From 988612418d9fab60350a86197b992b51a4f665ff Mon Sep 17 00:00:00 2001 From: dayjournal Date: Tue, 9 Mar 2021 19:34:03 +0900 Subject: [PATCH] :tada: v6.3.0 --- _resouce/css/style.css | 3 +- _resouce/js/script.js | 95 ++++++++++++++++++++--------------------- _resouce/main.js | 4 +- dist/app.js | 3 +- dist/app.js.LICENSE.txt | 60 ++++++++++++++++++++++++++ dist/index.html | 20 ++++----- docs/app.js | 3 +- docs/app.js.LICENSE.txt | 60 ++++++++++++++++++++++++++ docs/index.html | 20 ++++----- 9 files changed, 194 insertions(+), 74 deletions(-) create mode 100644 dist/app.js.LICENSE.txt create mode 100644 docs/app.js.LICENSE.txt diff --git a/_resouce/css/style.css b/_resouce/css/style.css index ac60da3..8eb6bbf 100644 --- a/_resouce/css/style.css +++ b/_resouce/css/style.css @@ -1,4 +1,5 @@ -html, body { +html, +body { height: 100%; padding: 0; margin: 0; diff --git a/_resouce/js/script.js b/_resouce/js/script.js index ad96539..3e2b3f5 100644 --- a/_resouce/js/script.js +++ b/_resouce/js/script.js @@ -1,84 +1,81 @@ - // MIERUNE MONO読み込み const map = new mapboxgl.Map({ - container: "map", + container: 'map', style: { version: 8, sources: { m_mono: { - type: "raster", - tiles: ["https://tile.mierune.co.jp/mierune_mono/{z}/{x}/{y}.png"], - tileSize: 256 - } + type: 'raster', + tiles: ['https://tile.mierune.co.jp/mierune_mono/{z}/{x}/{y}.png'], + tileSize: 256, + }, }, - layers: [{ - id: "m_mono", - type: "raster", - source: "m_mono", - minzoom: 0, - maxzoom: 18 - }] + layers: [ + { + id: 'm_mono', + type: 'raster', + source: 'm_mono', + minzoom: 0, + maxzoom: 18, + }, + ], }, - center: [139.770, 35.676], - zoom: 13 + center: [139.77, 35.676], + zoom: 13, }); - -map.on("load", function () { - +map.on('load', function () { // 元ポイントを取得 const features = turf.featureCollection([ turf.point([139.7594, 35.6865]), turf.point([139.7692, 35.6665]), - turf.point([139.7812, 35.6849]) + turf.point([139.7812, 35.6849]), ]); // 元ポイント表示 - map.addSource("FeaturesPoint", { - type: "geojson", - data: features + map.addSource('FeaturesPoint', { + type: 'geojson', + data: features, }); map.addLayer({ - id: "FeaturesPoint", - type: "circle", - source: "FeaturesPoint", + id: 'FeaturesPoint', + type: 'circle', + source: 'FeaturesPoint', layout: {}, paint: { - "circle-pitch-alignment": "map", - "circle-stroke-color": "#1253A4", - "circle-stroke-width": 5, - "circle-stroke-opacity": 0.8, - "circle-color": "#1253A4", - "circle-radius": 5, - "circle-opacity": 0.5 - } + 'circle-pitch-alignment': 'map', + 'circle-stroke-color': '#1253A4', + 'circle-stroke-width': 5, + 'circle-stroke-opacity': 0.8, + 'circle-color': '#1253A4', + 'circle-radius': 5, + 'circle-opacity': 0.5, + }, }); - // センターポイントを取得 const center = turf.center(features); // センターポイント表示 - map.addSource("CenterPoint", { - type: "geojson", - data: center + map.addSource('CenterPoint', { + type: 'geojson', + data: center, }); map.addLayer({ - id: "CenterPoint", - type: "circle", - source: "CenterPoint", + id: 'CenterPoint', + type: 'circle', + source: 'CenterPoint', layout: {}, paint: { - "circle-pitch-alignment": "map", - "circle-stroke-color": "#8DCF3F", - "circle-stroke-width": 10, - "circle-stroke-opacity": 0.8, - "circle-color": "#8DCF3F", - "circle-radius": 10, - "circle-opacity": 0.5 - } + 'circle-pitch-alignment': 'map', + 'circle-stroke-color': '#8DCF3F', + 'circle-stroke-width': 10, + 'circle-stroke-opacity': 0.8, + 'circle-color': '#8DCF3F', + 'circle-radius': 10, + 'circle-opacity': 0.5, + }, }); - }); // コントロール関係表示 diff --git a/_resouce/main.js b/_resouce/main.js index 82c0eca..868371d 100644 --- a/_resouce/main.js +++ b/_resouce/main.js @@ -1,6 +1,6 @@ // CSS一式を読み込んでパッケージ -import "mapbox-gl/dist/mapbox-gl.css"; -import "./css/style.css"; +import 'mapbox-gl/dist/mapbox-gl.css'; +import './css/style.css'; // JS一式を読み込んでパッケージ import './js/script.js'; diff --git a/dist/app.js b/dist/app.js index e667883..22be4c1 100644 --- a/dist/app.js +++ b/dist/app.js @@ -1 +1,2 @@ -(()=>{var t={631:(t,e,r)=>{var n=r(158),i=r(530);const o=new n.Map({container:"map",style:{version:8,sources:{m_mono:{type:"raster",tiles:["https://tile.mierune.co.jp/mierune_mono/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"m_mono",type:"raster",source:"m_mono",minzoom:0,maxzoom:18}]},center:[139.77,35.676],zoom:13});o.on("load",(function(){const t=i.featureCollection([i.point([139.7594,35.6865]),i.point([139.7692,35.6665]),i.point([139.7812,35.6849])]);o.addSource("FeaturesPoint",{type:"geojson",data:t}),o.addLayer({id:"FeaturesPoint",type:"circle",source:"FeaturesPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#1253A4","circle-stroke-width":5,"circle-stroke-opacity":.8,"circle-color":"#1253A4","circle-radius":5,"circle-opacity":.5}});const e=i.center(t);o.addSource("CenterPoint",{type:"geojson",data:e}),o.addLayer({id:"CenterPoint",type:"circle",source:"CenterPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#8DCF3F","circle-stroke-width":10,"circle-stroke-opacity":.8,"circle-color":"#8DCF3F","circle-radius":10,"circle-opacity":.5}})})),o.addControl(new n.NavigationControl)},530:function(t,e){!function(t){"use strict";function e(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.bbox,i=r.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");n&&S(n),i&&C(i);var o={type:"Feature"};return i&&(o.id=i),n&&(o.bbox=n),o.properties=e||{},o.geometry=t,o}function r(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var i,a=r.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");switch(a&&S(a),t){case"Point":i=n(e).geometry;break;case"LineString":i=s(e).geometry;break;case"Polygon":i=o(e).geometry;break;case"MultiPoint":i=h(e).geometry;break;case"MultiLineString":i=c(e).geometry;break;case"MultiPolygon":i=p(e).geometry;break;default:throw new Error(t+" is invalid")}return a&&(i.bbox=a),i}function n(t,r,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!E(t[0])||!E(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},r,n)}function i(t,e,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return l(t.map((function(t){return n(t,e)})),r)}function o(t,r,n){if(!t)throw new Error("coordinates is required");for(var i=0;i=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function g(t,e){if(null==t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var r=Ao[e||"kilometers"];if(!r)throw new Error(e+" units is invalid");return t*r}function m(t,e){if(null==t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var r=Ao[e||"kilometers"];if(!r)throw new Error(e+" units is invalid");return t/r}function y(t,e){return v(m(t,e))}function _(t){if(null==t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function v(t){if(null==t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function x(t){if(null==t)throw new Error("degrees is required");return t%360*Math.PI/180}function b(t,e,r){if(null==t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return g(m(t,e),r||"kilometers")}function w(t,e,r){if(null==t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var n=Do[e||"meters"];if(!n)throw new Error("invalid original units");var i=Do[r||"kilometers"];if(!i)throw new Error("invalid final units");return t/n*i}function E(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function I(t){return!!t&&t.constructor===Object}function S(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!E(t))throw new Error("bbox must only contain numbers")}))}function C(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function T(t,e,r){if(null!==t)for(var n,i,o,a,s,u,l,c,h=0,p=0,f=t.type,d="FeatureCollection"===f,g="Feature"===f,m=d?t.features.length:1,y=0;yt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]1&&E(e[0])&&E(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function G(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return X(e),e;throw new Error("No valid coordinates")}function X(t){if(t.length>1&&E(t[0])&&E(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return X(t[0]);throw new Error("coordinates must only contain numbers")}function Z(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)}function Y(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)}function W(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0;n=0&&g>=0&&g=0;c--)if(Math.abs(e[c][0][0]-u)<=1e-7&&Math.abs(e[c][0][1]-l)<=1e-7){for(var h=a.path.length-2;h>=0;--h)e[c].unshift(a.path[h]);s=!0;break}s||(e[r++]=a.path)}}))})),e}(function(t,e){for(var r=t.length-1,n=t[0].length-1,i={rows:r,cols:n,cells:[]},o=0;o=e?8:0,s|=l>=e?4:0,s|=c>=e?2:0;var p,f,d,g,m=!1;if(5==(s|=h>=e?1:0)||10===s){var y=(u+l+c+h)/4;5===s&&y=t.minX&&e.maxY>=t.minY}function dt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function gt(t,e,r,n,i){for(var o,a=[e,r];a.length;)(r=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((r-e)/n/2)*n,Fo(t,o,e,r,i),a.push(e,o,o,r))}function mt(t,e){return t(e={exports:{}},e.exports),e.exports}function yt(t,e){if(!(this instanceof yt))return new yt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||function(t,e){return te?1:0},this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}function _t(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;for(var n,i=function(t){for(var e=t[0],r=t[0],n=t[0],i=t[0],o=0;on[0]&&(n=a),a[1]i[1]&&(i=a)}var s=[e,r,n,i],u=s.slice();for(o=0;oo||s.push({node:c,dist:h})}for(;s.length&&!s.peek().node.children;){var p=s.pop(),f=p.node,d=St(f,e,r),g=St(f,n,i);if(p.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function bt(t,e,r){for(var n=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),a=Math.max(t[1],e[1]),s=r.search({minX:n,minY:i,maxX:o,maxY:a}),u=0;u0!=Qo(t,e,n)>0&&Qo(r,n,t)>0!=Qo(r,n,e)>0}(s[u].p,s[u].next.p,t,e))return!1;return!0}function wt(t){var e=t.p,r=t.next.p;return t.minX=Math.min(e[0],r[0]),t.minY=Math.min(e[1],r[1]),t.maxX=Math.max(e[0],r[0]),t.maxY=Math.max(e[1],r[1]),t}function Et(t,e){var r={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function It(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function St(t,e,r){var n=e[0],i=e[1],o=r[0]-n,a=r[1]-i;if(0!==o||0!==a){var s=((t[0]-n)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(n=r[0],i=r[1]):s>0&&(n+=o*s,i+=a*s)}return(o=t[0]-n)*o+(a=t[1]-i)*a}function Ct(t,e,r,n,i,o,a,s){var u,l,c,h,p=r-t,f=n-e,d=a-i,g=s-o,m=t-i,y=e-o,_=p*p+f*f,v=p*d+f*g,x=d*d+g*g,b=p*m+f*y,w=d*m+g*y,E=_*x-v*v,I=E,S=E;0===E?(l=0,I=1,h=w,S=x):(h=_*w-v*b,(l=v*w-x*b)<0?(l=0,h=w,S=x):l>I&&(l=I,h=w+v,S=x)),h<0?(h=0,-b<0?l=0:-b>_?l=I:(l=-b,I=_)):h>S&&(h=S,-b+v<0?l=0:-b+v>_?l=I:(l=-b+v,I=_));var C=(1-(c=0===h?0:h/S))*i+c*a-((1-(u=0===l?0:l/I))*t+u*r),T=(1-c)*o+c*s-((1-u)*e+u*n);return C*C+T*T}function Tt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.concavity||1/0,n=[];if(T(t,(function(t){n.push([t[0],t[1]])})),!n.length)return null;var i=$o(n,r);return i.length>3?o([i]):null}function Pt(t,e,r){if("object"!=typeof(r=r||{}))throw new Error("options is invalid");var n=r.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=j(t),o=G(e),a=e.geometry?e.geometry.type:e.type,s=e.bbox;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,s))return!1;"Polygon"===a&&(o=[o]);for(var u=0,l=!1;ut[1]!=l>t[1]&&t[0]<(u-a)*(t[1]-s)/(l-s)+a&&(n=!n)}return n}function At(t,e){var r=[];return z(e,(function(e){L(t,(function(t){Pt(t,e)&&r.push(t)}))})),l(r)}function Lt(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var r=!1;return l(function(t){if(t.length<3)return[];t.sort(Nt);for(var e,r,n,i,o,a,s=t.length-1,u=t[s].x,l=t[0].x,c=t[s].y,h=c;s--;)t[s].yh&&(h=t[s].y);var p,f=l-u,d=h-c,g=f>d?f:d,m=.5*(l+u),y=.5*(h+c),_=[new Dt({x:m-20*g,y:y-g,__sentinel:!0},{x:m,y:y+20*g,__sentinel:!0},{x:m+20*g,y:y-g,__sentinel:!0})],v=[],x=[];for(s=t.length;s--;){for(x.length=0,p=_.length;p--;)(f=t[s].x-_[p].x)>0&&f*f>_[p].r?(v.push(_[p]),_.splice(p,1)):f*f+(d=t[s].y-_[p].y)*d>_[p].r||(x.push(_[p].a,_[p].b,_[p].b,_[p].c,_[p].c,_[p].a),_.splice(p,1));for(zt(x),p=x.length;p;)r=x[--p],e=x[--p],n=t[s],i=r.x-e.x,o=r.y-e.y,a=2*(i*(n.y-r.y)-o*(n.x-r.x)),Math.abs(a)>1e-12&&_.push(new Dt(e,r,n))}for(Array.prototype.push.apply(v,_),s=v.length;s--;)(v[s].a.__sentinel||v[s].b.__sentinel||v[s].c.__sentinel)&&v.splice(s,1);return v}(t.features.map((function(t){var n={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?n.z=t.properties[e]:3===t.geometry.coordinates.length&&(r=!0,n.z=t.geometry.coordinates[2]),n}))).map((function(t){var e=[t.a.x,t.a.y],n=[t.b.x,t.b.y],i=[t.c.x,t.c.y],a={};return r?(e.push(t.a.z),n.push(t.b.z),i.push(t.c.z)):a={a:t.a.z,b:t.b.z,c:t.c.z},o([[e,n,i,e]],a)})))}function Dt(t,e,r){this.a=t,this.b=e,this.c=r;var n,i,o=e.x-t.x,a=e.y-t.y,s=r.x-t.x,u=r.y-t.y,l=o*(t.x+e.x)+a*(t.y+e.y),c=s*(t.x+r.x)+u*(t.y+r.y),h=2*(o*(r.y-e.y)-a*(r.x-e.x));this.x=(u*l-a*c)/h,this.y=(o*c-s*l)/h,n=this.x-t.x,i=this.y-t.y,this.r=n*n+i*i}function Nt(t,e){return e.x-t.x}function zt(t){var e,r,n,i,o,a=t.length;t:for(;a;)for(r=t[--a],e=t[--a],n=a;n;)if(o=t[--n],i=t[--n],e===i&&r===o||e===o&&r===i){t.splice(a,2),t.splice(n,2),a-=2;continue t}}function Rt(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.units,i=j(t),o=j(e),a=x(o[1]-i[1]),s=x(o[0]-i[0]),u=x(i[1]),l=x(o[1]),c=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(u)*Math.cos(l);return g(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),n)}function kt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Ot(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return Ot(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Bt(t);default:throw new Error("unknown GeoJSON type")}}function Ot(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=Ft(t.properties),e.geometry=Bt(t.geometry),e}function Ft(t){var e={};return t?(Object.keys(t).forEach((function(r){var n=t[r];"object"==typeof n?null===n?e[r]=null:n.length?e[r]=n.map((function(t){return t})):e[r]=Ft(n):e[r]=n})),e):e}function Bt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Bt(t)})),e):(e.coordinates=Ut(t.coordinates),e)}function Ut(t){return"object"!=typeof t[0]?t.slice():t.map((function(t){return Ut(t)}))}function Vt(t,e){function r(t,e){e.length&&e.pop();for(var r=u[t<0?~t:t],n=0,i=r.length;n1)for(var a,s,u=1,l=n(o[0]);ul&&(s=o[0],o[0]=o[u],o[u]=s,l=a);return o}))}}function jt(t,e,r){for(var n,i=e+(r---e>>1);e=Math.abs(c)?l>0?o<=n&&n<=s:s<=n&&n<=o:c>0?a<=i&&i<=u:u<=i&&i<=a)}(r,i=e[s+1],n)||o.push(n);return o.push(i),o}function $t(t,e){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n}function te(t,e,r){var n=e.x,i=e.y,o=r.x-n,a=r.y-i;if(0!==o||0!==a){var s=((t.x-n)*o+(t.y-i)*a)/(o*o+a*a);s>1?(n=r.x,i=r.y):s>0&&(n+=o*s,i+=a*s)}return(o=t.x-n)*o+(a=t.y-i)*a}function ee(t,e,r,n,i){for(var o,a=n,s=e+1;sa&&(o=s,a=u)}a>n&&(o-e>1&&ee(t,e,o,n,i),i.push(t[o]),r-o>1&&ee(t,o,r,n,i))}function re(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return function(t,e){var r=t.length-1,n=[t[0]];return ee(t,0,r,e,n),n.push(t[r]),n}(t=r?t:function(t,e){for(var r,n=t[0],i=[n],o=1,a=t.length;oe&&(i.push(r),n=r);return n!==r&&i.push(r),i}(t,n),n)}function ne(t,e,r){return re(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,r).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function ie(t,e,r){return t.map((function(t){var n=t.map((function(t){return{x:t[0],y:t[1]}}));if(n.length<4)throw new Error("invalid polygon");for(var i=re(n,e,r).map((function(t){return[t.x,t.y]}));!function(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}(i);)i=re(n,e-=.01*e,r).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function oe(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.resolution||1e4,n=e.sharpness||.85;if(!t)throw new Error("line is required");if(!E(r))throw new Error("resolution must be an number");if(!E(n))throw new Error("sharpness must be an number");for(var i=[],o=new da({points:H(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),duration:r,sharpness:n}),a=0;a=Rt(t.slice(0,2),[e,i])){var o=(r+i)/2;return[e,o-(n-e)/2,n,o+(n-e)/2]}var a=(e+n)/2;return[a-(i-r)/2,r,a+(i-r)/2,i]}function le(t,e,r,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,a=i.properties,s=j(t),u=x(s[0]),l=x(s[1]),c=x(r),h=m(e,o),p=Math.asin(Math.sin(l)*Math.cos(h)+Math.cos(l)*Math.sin(h)*Math.cos(c));return n([v(u+Math.atan2(Math.sin(c)*Math.sin(h)*Math.cos(l),Math.cos(h)-Math.sin(l)*Math.sin(p))),v(p)],a)}function ce(t,e,r){var n=(r=r||{}).steps||64,i=r.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof r)throw new Error("options must be an object");if("number"!=typeof n)throw new Error("steps must be a number");n=n||64,i=i||t.properties||{};for(var a=[],s=0;s=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&be(or.x)&&Se(n,t)&&(r=n,p=u),n=n.next;return r}(t,e)){var r=Ce(e,t);ye(r,r.next)}}(s[i],r),r=ye(r,r.next);return r}(t,e,p,r)),t.length>80*r){n=o=t[0],i=a=t[1];for(var d=r;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return _e(p,f,r,n,i,l),f}function me(t,e,r,n,i){var o,a;if(i===Ae(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Te(o,t[o],t[o+1],a);return a&&Ee(a,a.next)&&(Pe(a),a=a.next),a}function ye(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ee(n,n.next)&&0!==we(n.prev,n,n.next))n=n.next;else{if(Pe(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function _e(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=xe(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,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,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--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?function(t,e,r,n){var i=t.prev,o=t,a=t.next;if(we(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=xe(s,u,e,r,n),p=xe(l,c,e,r,n),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&be(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&we(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&be(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&we(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}(t,n,i,o):function(t){var e=t.prev,r=t,n=t.next;if(we(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(be(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&we(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Pe(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?_e(t=function(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ee(i,o)&&Ie(i,n,n.next,o)&&Se(i,o)&&Se(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Pe(n),Pe(n.next),n=t=o),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,o,2):2===a&&function(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&function(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&&Ie(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&Se(t,e)&&Se(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(a,s)){var u=Ce(a,s);return a=ye(a,a.next),u=ye(u,u.next),_e(a,e,r,n,i,o),void _e(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}(t,e,r,n,i,o):_e(ye(t),e,r,n,i,o,1);break}}}function ve(t,e){return t.x-e.x}function xe(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 be(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function we(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ee(t,e){return t.x===e.x&&t.y===e.y}function Ie(t,e,r,n){return!!(Ee(t,e)&&Ee(r,n)||Ee(t,n)&&Ee(r,e))||we(t,e,r)>0!=we(t,e,n)>0&&we(r,n,t)>0!=we(r,n,e)>0}function Se(t,e){return we(t.prev,t,t.next)<0?we(t,e,t.next)>=0&&we(t,t.prev,e)>=0:we(t,e,t.prev)<0||we(t,t.next,e)<0}function Ce(t,e){var r=new Me(t.i,t.x,t.y),n=new Me(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Te(t,e,r,n){var i=new Me(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 Pe(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 Me(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 Ae(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}(t),r=ga(e.vertices,e.holes,2),n=[],i=[];r.forEach((function(t,n){var o=r[n];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var a=0;ae?1:0})}function ze(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);ze(t,e,Math.max(r,Math.floor(e-a*u/o+l)),Math.min(n,Math.floor(e+(o-a)*u/o+l)),i)}var c=t[e],h=r,p=n;for(Re(t,r,e),i(t[n],c)>0&&Re(t,r,n);h0;)p--}0===i(t[r],c)?Re(t,r,p):Re(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function Re(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ke(t,e){if(!(this instanceof ke))return new ke(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function Oe(t,e){Fe(t,0,t.children.length,e,t)}function Fe(t,e,r,n,i){i||(i=Ze(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,a=e;a=t.minX&&e.maxY>=t.minY}function Ze(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ye(t,e,r,n,i){for(var o,a=[e,r];a.length;)(r=a.pop())-(e=a.pop())<=n||(Ne(t,o=e+Math.ceil((r-e)/n/2)*n,e,r,i),a.push(e,o,o,r))}function We(t){var e=ke(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=He(e)).bbox=e}else t.bbox=t.bbox?t.bbox:Ke(t);return ke.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){var r=He(t);r.bbox=t,e.push(r)})):L(t,(function(t){t.bbox=t.bbox?t.bbox:Ke(t),e.push(t)})),ke.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=He(e)).bbox=e}return ke.prototype.remove.call(this,t)},e.clear=function(){return ke.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:ke.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return ke.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:ke.prototype.all.call(this)}},e.toJSON=function(){return ke.prototype.toJSON.call(this)},e.fromJSON=function(t){return ke.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return{minX:(e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:Ke(t))[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function He(t){var e=[t[0],t[1]],r=[t[0],t[3]],n=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],n,r,e]]}}}function Ke(t){var e=[1/0,1/0,-1/0,-1/0];return T(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]i?r:i,n>o?n:o]}(t,n),r.push(i),n})),r})(r,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}(t,e)})),l(e)}function Qe(t,r){var n={},i=[];if("LineString"===t.type&&(t=e(t)),"LineString"===r.type&&(r=e(r)),"Feature"===t.type&&"Feature"===r.type&&"LineString"===t.geometry.type&&"LineString"===r.geometry.type&&2===t.geometry.coordinates.length&&2===r.geometry.coordinates.length){var o=$e(t,r);return o&&i.push(o),l(i)}var a=We();return a.load(Je(r)),L(Je(t),(function(t){L(a.search(t),(function(e){var r=$e(t,e);if(r){var o=G(r).join(",");n[o]||(n[o]=!0,i.push(r))}}))})),l(i)}function $e(t,e){var r=G(t),i=G(e);if(2!==r.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var o=r[0][0],a=r[0][1],s=r[1][0],u=r[1][1],l=i[0][0],c=i[0][1],h=i[1][0],p=i[1][1],f=(p-c)*(s-o)-(h-l)*(u-a);if(0===f)return null;var d=((h-l)*(a-c)-(p-c)*(o-l))/f,g=((s-o)*(a-c)-(u-a)*(o-l))/f;return d>=0&&d<=1&&g>=0&&g<=1?n([o+d*(s-o),a+d*(u-a)]):null}function tr(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var o=n([1/0,1/0],{dist:1/0}),a=0;return k(t,(function(t){for(var i=G(t),u=0;u0&&((y=m.features[0]).properties.dist=Rt(e,y,r),y.properties.location=a+Rt(l,y,r)),l.properties.dist180?-(360-n):n}function rr(t,e){var r=x(t[1]),n=x(e[1]),i=x(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(r/2+Math.PI/4));return(v(Math.atan2(i,o))+360)%360}function nr(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=j(t),o=j(e);return o[0]+=o[0]-i[0]>180?-360:i[0]-o[0]>180?360:0,b(function(t,e,r){var n=r=void 0===r?Mo:Number(r),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,a=o-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?a/u:Math.cos(i);return Math.sqrt(a*a+l*l*s*s)*n}(i,o),"meters",n)}function ir(t,e){return ar(t,"mercator",e)}function or(t,e){return ar(t,"wgs84",e)}function ar(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&E(t[0])?t="mercator"===e?sr(t):ur(t):(!0!==n&&(t=kt(t)),T(t,(function(t){var r="mercator"===e?sr(t):ur(t);t[0]=r[0],t[1]=r[1]}))),t}function sr(t){var e=Math.PI/180,r=20037508.342789244,n=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return n[0]>r&&(n[0]=r),n[0]<-r&&(n[0]=-r),n[1]>r&&(n[1]=r),n[1]<-r&&(n[1]=-r),n}function ur(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function lr(t,r,i){if(!I(i=i||{}))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=n(t):"Point"===t.type?t=e(t):Y(t,"Point","point"),!r)throw new Error("line is required");Array.isArray(r)?r=s(r):"LineString"===r.type?r=e(r):Y(r,"LineString","line");var o=1/0,a=t.geometry.coordinates;return F(r,(function(t){var e=t.geometry.coordinates[0],r=t.geometry.coordinates[1],s=function(t,e,r,i){var o=i.mercator,a=!0!==o?Rt(e,t,i):cr(e,t,i),s=_(!0!==o?he(e,t):er(e,t)),u=_(!0!==o?he(e,r):er(e,r)),l=Math.abs(s-u);if(l>90)return a;var c=(u+180)%360,h=_(!0!==o?he(r,t):er(r,t)),p=Math.abs(h-c);return p>180&&(p=Math.abs(p-360)),p>90?!0!==o?Rt(t,r,i):cr(t,r,i):!0!==o?a*Math.sin(x(l)):function(t,e,r,i){var o=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(r[0])>=180)&&(o=t[0]>0||e[0]>0||r[0]>0?-180:180);var a=n(r),s=or(function(t,e,r){var n=t[0],i=t[1],o=e[0]-n,a=e[1]-i,s=((r[0]-n)*o+(r[1]-i)*a)/(o*o+a*a);return[n+s*o,i+s*a]}(ir([t[0]+o,t[1]]),ir([e[0]+o,e[1]]),ir([r[0]+o,r[1]])));return 0!==o&&(s[0]-=o),nr(a,s,i)}(e,r,t,i)}(a,e,r,i);o>s&&(o=s)})),o}function cr(t,e,r){var n=r.units,i=0;Math.abs(t[0])>=180&&(i=t[0]>0?-180:180),Math.abs(e[0])>=180&&(i=e[0]>0?-180:180);var o=ir([t[0]+i,t[1]]),a=ir([e[0]+i,e[1]]),s=function(t){return t*t},u=s(o[0]-a[0])+s(o[1]-a[1]);return b(Math.sqrt(u),"meters",n)}function hr(t){for(var r=function(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?l([e(t)]):l([t]):t}(t),i=pe(r),o=!1,a=0;!o&&a0){e+=Math.abs(mr(t[0]));for(var r=1;r2){for(a=0;a=c&&h===i.length-1);h++){if(c>e&&0===o.length){if(!(a=e-c))return o.push(i[h]),s(o);u=he(i[h],i[h-1])-180,l=le(i[h],a,u,n),o.push(l.geometry.coordinates)}if(c>=r)return(a=r-c)?(u=he(i[h],i[h-1])-180,l=le(i[h],a,u,n),o.push(l.geometry.coordinates),s(o)):(o.push(i[h]),s(o));if(c>=e&&o.push(i[h]),h===i.length-1)return s(o);c+=Rt(i[h],i[h+1],n)}return s(i[i.length-1])}function xr(t,e,r){var n=(r=r||{}).ignoreEndVertices;if(!I(r))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var i=j(t),o=G(e),a=0;a=Math.abs(h)?c>0?a0?s=Math.abs(h)?c>0?a<=i&&i0?s<=o&&o=Math.abs(h)?c>0?a0?s=Math.abs(h)?c>0?a<=i&&i<=u:u<=i&&i<=a:h>0?s<=o&&o<=l:l<=o&&o<=s)}(o[a],o[a+1],i,s))return!0}return!1}function br(t,e){var r=J(t),n=J(e),i=H(t),o=H(e);switch(r){case"Point":switch(n){case"MultiPoint":return function(t,e){var r,n=!1;for(r=0;re[0]||t[2]e[1]||t[3] is required");if("number"!=typeof r)throw new Error(" must be a number");if("number"!=typeof n)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,r);return T(t,(function(t){!function(t,e,r){t.length>r&&t.splice(r,t.length);for(var n=0;n=0==e}function Pr(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var r=0,n=t.length;r1&&r.push(s(h)),l(r)}function Lr(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var r,n=1/0;return L(e,(function(e){var i=tr(e,t).properties.dist;ip&&d.push(le(t,e,p,a).geometry.coordinates),s(d,c)}function zr(t){var e=t%360;return e<0&&(e+=360),e}function Rr(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.properties,n=J(t),i=G(t);if(r=r||t.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(n){case"Polygon":return kr(i,r);case"MultiPolygon":var o=[];return i.forEach((function(t){o.push(kr(t,r))})),l(o);default:throw new Error("geom "+n+" not supported")}}function kr(t,e){return t.length>1?c(t,e):s(t[0],e)}function Or(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.properties,n=e.autoComplete,i=e.orderCoords;if(!t)throw new Error("lines is required");switch(n=void 0===n||n,i=void 0===i||i,J(t)){case"FeatureCollection":case"GeometryCollection":var o=[];return(t.features?t.features:t.geometries).forEach((function(t){o.push(G(Fr(t,{},n,i)))})),p(o,r)}return Fr(t,r,n,i)}function Fr(t,e,r,n){e=e||t.properties||{};var i=G(t),a=J(t);if(!i.length)throw new Error("line must contain coordinates");switch(a){case"LineString":return r&&(i=Br(i)),o([i],e);case"MultiLineString":var u=[],l=0;return i.forEach((function(t){if(r&&(t=Br(t)),n){var e=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.abs(e-n)*Math.abs(r-i)}(q(s(t)));e>l?(u.unshift(t),l=e):u.push(t)}else u.push(t)})),o(u,e);default:throw new Error("geometry type "+a+" is not supported")}}function Br(t){var e=t[0],r=e[0],n=e[1],i=t[t.length-1],o=i[0],a=i[1];return r===o&&n===a||t.push(e),t}function Ur(t,e,r){var n,i,o,a,s,u=t.length,l=qr(t[0],e),c=[];for(r||(r=[]),n=1;ne[2]&&(r|=2),t[1]e[3]&&(r|=8),r}function jr(t,e){for(var r=[],n=0;n0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&r.push(i))}return r}function Gr(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function Xr(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?(r.strict,t===e):function(t,e,r){var n,i;if(Zr(t)||Zr(e))return!1;if(t.prototype!==e.prototype)return!1;if(Gr(t))return!!Gr(e)&&Xr(t=Ma.call(t),e=Ma.call(e),r);if(Yr(t)){if(!Yr(e))return!1;if(t.length!==e.length)return!1;for(n=0;n=0;n--)if(o[n]!==a[n])return!1;for(n=o.length-1;n>=0;n--)if(!Xr(t[i=o[n]],e[i],r))return!1;return typeof t==typeof e}(t,e,r))}function Zr(t){return null==t}function Yr(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}function Wr(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n,i=r.tolerance||0,o=[],a=We();return a.load(Je(t)),F(e,(function(t){var e=!1;L(a.search(t),(function(r){if(!1===e){var o=G(t).sort(),a=G(r).sort();Xr(o,a)||(0===i?xr(o[0],r)&&xr(o[1],r):tr(r,o[0]).properties.dist<=i&&tr(r,o[1]).properties.dist<=i)?(e=!0,n=n?Hr(n,t):t):(0===i?xr(a[0],t)&&xr(a[1],t):tr(t,a[0]).properties.dist<=i&&tr(t,a[1]).properties.dist<=i)&&(n=n?Hr(n,r):r)}})),!1===e&&n&&(o.push(n),n=void 0)})),n&&o.push(n),l(o)}function Hr(t,e){var r=G(e),n=G(t),i=n[0],o=n[n.length-1],a=t.geometry.coordinates;return Xr(r[0],i)?a.unshift(r[1]):Xr(r[0],o)?a.push(r[1]):Xr(r[1],i)?a.unshift(r[0]):Xr(r[1],o)&&a.push(r[0]),t}function Kr(t){var e=t%360;return e<0&&(e+=360),e}function Jr(t,e,r,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,a=i.properties;if(!t)throw new Error("origin is required");if(null==e)throw new Error("distance is required");if(null==r)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var s=b(e,o,"meters"),u=j(t),l=function(t,e,r,n){var i=e/(n=void 0===n?Mo:Number(n)),o=t[0]*Math.PI/180,a=x(t[1]),s=x(r),u=i*Math.cos(s),l=a+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),h=Math.abs(c)>1e-11?u/c:Math.cos(a);return[(180*(o+i*Math.sin(s)/h)/Math.PI+540)%360-180,180*l/Math.PI]}(u,s,r);return l[0]+=l[0]-u[0]>180?-360:u[0]-l[0]>180?360:0,n(l,a)}function Qr(t,e,r,n,i,o){for(var a=0;a0?function(t,e,r){return $r(t,e,r)<0}(e,s,i)||(i=s):r>0&&n<=0&&(function(t,e,r){return $r(t,e,r)>0}(e,s,o)||(o=s)),r=n}return[i,o]}function $r(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(r[0]-t[0])*(e[1]-t[1])}function tn(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var r,n,i=G(t),o=0,a=1;a0}function en(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return z(t,(function(t){en(t,e)})),t;case"LineString":return rn(G(t),e),t;case"Polygon":return nn(G(t),e),t;case"MultiLineString":return G(t).forEach((function(t){rn(t,e)})),t;case"MultiPolygon":return G(t).forEach((function(t){nn(t,e)})),t;case"Point":case"MultiPoint":return t}}function rn(t,e){tn(t)===e&&t.reverse()}function nn(t,e){tn(t[0])!==e&&t[0].reverse();for(var r=1;ra?128:64,l|=ha?32:16,l|=pa?8:4;var d=+(l|=fa?2:1),g=0;if(17===l||18===l||33===l||34===l||38===l||68===l||72===l||98===l||102===l||132===l||136===l||137===l||152===l||153===l){var m=(c+h+p+f)/4;g=m>a?2:m0?(l=156,g=4):l=152:33===l?g>0?(l=139,g=4):l=137:72===l?g>0?(l=99,g=4):l=98:132===l&&(g>0?(l=39,g=4):l=38)}if(0!=l&&170!=l){var y,_,v,x,b,w,E,I;y=_=v=x=b=w=E=I=.5;var S=[];1===l?(v=1-an(e,p,f),I=1-an(e,c,f),S.push(ys[l])):169===l?(v=an(a,f,p),I=an(a,f,c),S.push(ys[l])):4===l?(w=1-an(e,h,p),x=an(e,f,p),S.push(gs[l])):166===l?(w=an(a,p,h),x=1-an(a,p,f),S.push(gs[l])):16===l?(b=an(e,p,h),_=an(e,c,h),S.push(ds[l])):154===l?(b=1-an(a,h,p),_=1-an(a,h,c),S.push(ds[l])):64===l?(E=an(e,f,c),y=1-an(e,h,c),S.push(vs[l])):106===l?(E=1-an(a,c,f),y=an(a,c,h),S.push(vs[l])):168===l?(x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),S.push(ms[l]),S.push(ys[l])):2===l?(x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),S.push(ms[l]),S.push(ys[l])):162===l?(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),S.push(ms[l]),S.push(ys[l])):8===l?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),S.push(ds[l]),S.push(gs[l])):138===l?(b=1-an(e,h,p),w=1-an(a,h,p),y=1-an(a,h,c),_=1-an(e,h,c),S.push(ds[l]),S.push(gs[l])):32===l?(b=an(a,p,h),w=an(e,p,h),y=an(e,c,h),_=an(a,c,h),S.push(ds[l]),S.push(gs[l])):42===l?(I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h),S.push(_s[l]),S.push(vs[l])):128===l&&(I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c),S.push(_s[l]),S.push(vs[l])),5===l?(w=1-an(e,h,p),I=1-an(e,c,f),S.push(gs[l])):165===l?(w=an(a,p,h),I=an(a,f,c),S.push(gs[l])):20===l?(x=an(e,f,p),_=an(e,c,h),S.push(ms[l])):150===l?(x=1-an(a,p,f),_=1-an(a,h,c),S.push(ms[l])):80===l?(b=an(e,p,h),E=an(e,f,c),S.push(ds[l])):90===l?(b=1-an(a,h,p),E=1-an(a,c,f),S.push(ds[l])):65===l?(v=1-an(e,p,f),y=1-an(e,h,c),S.push(ys[l])):105===l?(v=an(a,f,p),y=an(a,c,h),S.push(ys[l])):160===l?(b=an(a,p,h),w=an(e,p,h),I=an(e,f,c),E=an(a,f,c),S.push(ds[l]),S.push(gs[l])):10===l?(b=1-an(e,h,p),w=1-an(a,h,p),I=1-an(a,c,f),E=1-an(e,c,f),S.push(ds[l]),S.push(gs[l])):130===l?(x=1-an(e,p,f),v=1-an(a,p,f),y=1-an(a,h,c),_=1-an(e,h,c),S.push(ms[l]),S.push(ys[l])):40===l?(x=an(a,f,p),v=an(e,f,p),y=an(e,c,h),_=an(a,c,h),S.push(ms[l]),S.push(ys[l])):101===l?(w=an(a,p,h),y=an(a,c,h),S.push(gs[l])):69===l?(w=1-an(e,h,p),y=1-an(e,h,c),S.push(gs[l])):149===l?(I=an(a,f,c),_=1-an(a,h,c),S.push(_s[l])):21===l?(I=1-an(e,c,f),_=an(e,c,h),S.push(_s[l])):86===l?(x=1-an(a,p,f),E=1-an(a,c,f),S.push(ms[l])):84===l?(x=an(e,f,p),E=an(e,f,c),S.push(ms[l])):89===l?(b=1-an(a,h,p),v=an(a,f,p),S.push(ys[l])):81===l?(b=an(e,p,h),v=1-an(e,p,f),S.push(ys[l])):96===l?(b=an(a,p,h),w=an(e,p,h),E=an(e,f,c),y=an(a,c,h),S.push(ds[l]),S.push(gs[l])):74===l?(b=1-an(e,h,p),w=1-an(a,h,p),E=1-an(a,c,f),y=1-an(e,h,c),S.push(ds[l]),S.push(gs[l])):24===l?(b=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),_=an(e,c,h),S.push(ds[l]),S.push(ys[l])):146===l?(b=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),_=1-an(a,h,c),S.push(ds[l]),S.push(ys[l])):6===l?(w=1-an(e,h,p),x=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),S.push(gs[l]),S.push(ms[l])):164===l?(w=an(a,p,h),x=an(e,f,p),I=an(e,f,c),E=an(a,f,c),S.push(gs[l]),S.push(ms[l])):129===l?(v=1-an(e,p,f),I=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c),S.push(ys[l]),S.push(_s[l])):41===l?(v=an(a,f,p),I=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h),S.push(ys[l]),S.push(_s[l])):66===l?(x=1-an(e,p,f),v=1-an(a,p,f),E=1-an(a,c,f),y=1-an(e,h,c),S.push(ms[l]),S.push(ys[l])):104===l?(x=an(a,f,p),v=an(e,f,p),E=an(e,f,c),y=an(a,c,h),S.push(ys[l]),S.push(xs[l])):144===l?(b=an(e,p,h),I=an(e,f,c),E=an(a,f,c),_=1-an(a,h,c),S.push(ds[l]),S.push(vs[l])):26===l?(b=1-an(a,h,p),I=1-an(a,c,f),E=1-an(e,c,f),_=an(e,c,h),S.push(ds[l]),S.push(vs[l])):36===l?(w=an(a,p,h),x=an(e,f,p),y=an(e,c,h),_=an(a,c,h),S.push(gs[l]),S.push(ms[l])):134===l?(w=1-an(e,h,p),x=1-an(a,p,f),y=1-an(a,h,c),_=1-an(e,h,c),S.push(gs[l]),S.push(ms[l])):9===l?(b=1-an(e,h,p),w=1-an(a,h,p),v=an(a,f,p),I=1-an(e,c,f),S.push(ds[l]),S.push(gs[l])):161===l?(b=an(a,p,h),w=an(e,p,h),v=1-an(e,p,f),I=an(a,f,c),S.push(ds[l]),S.push(gs[l])):37===l?(w=an(a,p,h),I=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h),S.push(gs[l]),S.push(_s[l])):133===l?(w=1-an(e,h,p),I=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c),S.push(gs[l]),S.push(_s[l])):148===l?(x=an(e,f,p),I=an(e,f,c),E=an(a,f,c),_=1-an(a,h,c),S.push(ms[l]),S.push(vs[l])):22===l?(x=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),_=an(e,c,h),S.push(ms[l]),S.push(vs[l])):82===l?(b=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),E=1-an(a,c,f),S.push(ds[l]),S.push(ys[l])):88===l?(b=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),E=an(e,f,c),S.push(ds[l]),S.push(ys[l])):73===l?(b=1-an(e,h,p),w=1-an(a,h,p),v=an(a,f,p),y=1-an(e,h,c),S.push(ds[l]),S.push(gs[l])):97===l?(b=an(a,p,h),w=an(e,p,h),v=1-an(e,p,f),y=an(a,c,h),S.push(ds[l]),S.push(gs[l])):145===l?(b=an(e,p,h),v=1-an(e,p,f),I=an(a,f,c),_=1-an(a,h,c),S.push(ds[l]),S.push(_s[l])):25===l?(b=1-an(a,h,p),v=an(a,f,p),I=1-an(e,c,f),_=an(e,c,h),S.push(ds[l]),S.push(_s[l])):70===l?(w=1-an(e,h,p),x=1-an(a,p,f),E=1-an(a,c,f),y=1-an(e,h,c),S.push(gs[l]),S.push(ms[l])):100===l?(w=an(a,p,h),x=an(e,f,p),E=an(e,f,c),y=an(a,c,h),S.push(gs[l]),S.push(ms[l])):34===l?(0===g?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)):(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)),S.push(ds[l]),S.push(gs[l]),S.push(_s[l]),S.push(vs[l])):35===l?(4===g?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)):(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)),S.push(ds[l]),S.push(gs[l]),S.push(ys[l]),S.push(vs[l])):136===l?(0===g?(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)):(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)),S.push(ds[l]),S.push(gs[l]),S.push(_s[l]),S.push(vs[l])):153===l?(0===g?(b=an(e,p,h),v=1-an(e,p,f),I=1-an(e,c,f),_=an(e,c,h)):(b=1-an(a,h,p),v=an(a,f,p),I=an(a,f,c),_=1-an(a,h,c)),S.push(ds[l]),S.push(ys[l])):102===l?(0===g?(w=1-an(e,h,p),x=an(e,f,p),E=an(e,f,c),y=1-an(e,h,c)):(w=an(a,p,h),x=1-an(a,p,f),E=1-an(a,c,f),y=an(a,c,h)),S.push(gs[l]),S.push(vs[l])):155===l?(4===g?(b=an(e,p,h),v=1-an(e,p,f),I=1-an(e,c,f),_=an(e,c,h)):(b=1-an(a,h,p),v=an(a,f,p),I=an(a,f,c),_=1-an(a,h,c)),S.push(ds[l]),S.push(_s[l])):103===l?(4===g?(w=1-an(e,h,p),x=an(e,f,p),E=an(e,f,c),y=1-an(e,h,c)):(w=an(a,p,h),x=1-an(a,p,f),E=1-an(a,c,f),y=an(a,c,h)),S.push(gs[l]),S.push(ms[l])):152===l?(0===g?(b=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),_=an(e,c,h)):(b=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),_=1-an(a,h,c)),S.push(ds[l]),S.push(ms[l]),S.push(ys[l])):156===l?(4===g?(b=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),_=an(e,c,h)):(b=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),_=1-an(a,h,c)),S.push(ds[l]),S.push(ys[l]),S.push(vs[l])):137===l?(0===g?(b=an(a,p,h),w=an(e,p,h),v=1-an(e,p,f),I=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)):(b=1-an(e,h,p),w=1-an(a,h,p),v=an(a,f,p),I=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)),S.push(ds[l]),S.push(gs[l]),S.push(ys[l])):139===l?(4===g?(b=an(a,p,h),w=an(e,p,h),v=1-an(e,p,f),I=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)):(b=1-an(e,h,p),w=1-an(a,h,p),v=an(a,f,p),I=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)),S.push(ds[l]),S.push(gs[l]),S.push(_s[l])):98===l?(0===g?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),E=an(e,f,c),y=1-an(e,h,c)):(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),E=1-an(a,c,f),y=an(a,c,h)),S.push(ds[l]),S.push(gs[l]),S.push(vs[l])):99===l?(4===g?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),E=an(e,f,c),y=1-an(e,h,c)):(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),E=1-an(a,c,f),y=an(a,c,h)),S.push(ds[l]),S.push(gs[l]),S.push(ys[l])):38===l?(0===g?(w=1-an(e,h,p),x=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)):(w=an(a,p,h),x=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)),S.push(gs[l]),S.push(_s[l]),S.push(vs[l])):39===l?(4===g?(w=1-an(e,h,p),x=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)):(w=an(a,p,h),x=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)),S.push(gs[l]),S.push(ms[l]),S.push(vs[l])):85===l&&(b=1,w=0,x=1,v=0,I=0,E=1,y=0,_=1),(y<0||y>1||_<0||_>1||b<0||b>1||x<0||x>1||I<0||I>1||E<0||E>1)&&console.log("MarchingSquaresJS-isoBands: "+l+" "+d+" "+c+","+h+","+p+","+f+" "+g+" "+y+" "+_+" "+b+" "+w+" "+x+" "+v+" "+I+" "+E),o.cells[s][u]={cval:l,cval_real:d,flipped:g,topleft:y,topright:_,righttop:b,rightbottom:w,bottomright:x,bottomleft:v,leftbottom:I,lefttop:E,edges:S}}}}}return o}(t,e,r);return La.polygons?(La.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],r=0;return t.cells.forEach((function(t,n){t.forEach((function(t,i){if(void 0!==t){var o=ws[t.cval](t);"object"==typeof o&&sn(o)?"object"==typeof o[0]&&sn(o[0])?"object"==typeof o[0][0]&&sn(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=n})),e[r++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=n})),e[r++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),e}(l)):(La.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],r=t.rows,n=t.cols,i=[],o=0;o0){var s=function(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],r=t.cval_real;switch(e){case 0:return r&Na?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return r&za?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return r&Ra?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return r&Na?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return r&za?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return r&Ra?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return r&Ra?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return r&Ra?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return r&Da?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return r&Ra?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return r&Ra?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return r&Da?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return r&Da?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return r&Ra?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return r&Da?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return r&Da?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return r&Na?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return r&Da?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return r&Na?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}(t.cells[o][a]),u=null,l=a,c=o;null!==s&&i.push([s.p[0]+l,s.p[1]+c]);do{if(null===(u=function(t,e,r,n){var i,o,a,s,u,l=t.cval;switch(e){case-1:switch(n){case 0:i=gs[l],a=Xa[l],s=Za[l],u=Ya[l];break;default:i=ds[l],a=qa[l],s=ja[l],u=Ga[l]}break;case 1:switch(n){case 0:i=_s[l],a=ns[l],s=is[l],u=os[l];break;default:i=vs[l],a=ts[l],s=es[l],u=rs[l]}break;default:switch(r){case-1:switch(n){case 0:i=xs[l],a=ka[l],s=Oa[l],u=Fa[l];break;default:i=bs[l],a=Ba[l],s=Ua[l],u=Va[l]}break;case 1:switch(n){case 0:i=ys[l],a=Wa[l],s=Ha[l],u=Ka[l];break;default:i=ms[l],a=Ja[l],s=Qa[l],u=$a[l]}}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var r=e+1;r=r||l<0||l>=n||void 0===t.cells[c][l]){var h=function(t,e,r,n,i,o){for(var a=t.cells[r][e],s=a.cval_real,u=e+n,l=r+i,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=i,u-=n,s=(a=t.cells[l][u]).cval_real,-1===i)if(0===o)if(s&Ra)c.push([u,l]),n=-1,i=0,o=0;else{if(!(s&za)){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u+1,l]),n=1,i=0,o=0}else{if(!(s&Ra)){if(s&za){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u+a.bottomleft,l]),n=0,i=1,o=0,h=!0;break}c.push([u,l]),n=-1,i=0,o=0}else if(1===i)if(0===o){if(!(s&Na)){if(s&Da){c.push([u+a.topleft,l+1]),n=0,i=-1,o=0,h=!0;break}c.push([u+a.topright,l+1]),n=0,i=-1,o=1,h=!0;break}c.push([u+1,l+1]),n=1,i=0,o=1}else c.push([u+1,l+1]),n=1,i=0,o=1;else if(-1===n)if(0===o){if(!(s&Da)){if(s&Ra){c.push([u,l+a.leftbottom]),n=1,i=0,o=0,h=!0;break}c.push([u,l+a.lefttop]),n=1,i=0,o=1,h=!0;break}c.push([u,l+1]),n=0,i=1,o=0}else{if(!(s&Da)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),n=0,i=1,o=0}else{if(1!==n){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(s&za)){c.push([u+1,l+a.rightbottom]),n=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}else{if(!(s&za)){if(s&Na){c.push([u+1,l+a.righttop]),n=-1,i=0,o=1;break}c.push([u+1,l+a.rightbottom]),n=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}}else if(s=(a=t.cells[l][u]).cval_real,-1===n)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])n=0,i=-1,o=1;else{if(!(s&Ra)){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u,l])}else{if(!(s&Da)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===n){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])n=0,i=1,o=0;else{if(!(s&Na)){c.push([u+a.topleft,l+1]),n=0,i=-1,o=0,h=!0;break}c.push([u+1,l+1]),n=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])n=1,i=0,o=1;else{if(!(s&za)){c.push([u+1,l+a.righttop]),n=-1,i=0,o=1,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])n=-1,i=0,o=0;else{if(!(s&Da)){c.push([u,l+a.leftbottom]),n=1,i=0,o=0,h=!0;break}c.push([u,l+1]),n=0,i=1,o=0}}if(l+=i,(u+=n)===e&&l===r)break}return{path:c,i:u,j:l,x:n,y:i,o}}(t,l-=u.x,c-=u.y,u.x,u.y,u.o);if(null===h)break;h.path.forEach((function(t){i.push(t)})),l=h.i,c=h.j,s=h}}while(void 0!==t.cells[c][l]&&t.cells[c][l].edges.length>0);e.push(i),i=[],t.cells[o][a].edges.length>0&&a--}return e}(l)),"function"==typeof La.successCallback&&La.successCallback(u),u}function an(t,e,r){return(t-e)/(r-e)}function sn(t){return t.constructor.toString().indexOf("Array")>-1}function un(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.pivot,i=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");return 0===e||(n||(n=fe(t)),!1!==i&&void 0!==i||(t=kt(t)),T(t,(function(t){var r=er(n,t)+e,i=nr(n,t),o=G(Jr(n,i,r));t[0]=o[0],t[1]=o[1]}))),t}function ln(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.origin,i=r.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(n)||"object"==typeof n;return!0!==i&&(t=kt(t)),"FeatureCollection"!==t.type||o?cn(t,e,n):(L(t,(function(r,i){t.features[i]=cn(r,e,n)})),t)}function cn(t,e,r){var i="Point"===J(t);return r=function(t,e){if(null!=e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return j(e);var r=t.bbox?t.bbox:q(t),i=r[0],o=r[1],a=r[2],s=r[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return n([i,o]);case"se":case"southeast":case"eastsouth":case"bottomright":return n([a,o]);case"nw":case"northwest":case"westnorth":case"topleft":return n([i,s]);case"ne":case"northeast":case"eastnorth":case"topright":return n([a,s]);case"center":return pe(t);case void 0:case null:case"centroid":return fe(t);default:throw new Error("invalid origin")}}(t,r),1===e||i||T(t,(function(t){var n=nr(r,t),i=er(r,t),o=G(Jr(r,n*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)})),t}function hn(t){var e=t[0],r=t[1];return[r[0]-e[0],r[1]-e[1]]}function pn(t,e){return t[0]*e[1]-e[0]*t[1]}function fn(t,e,r){var n=[],i=y(e,r),o=G(t),a=[];return o.forEach((function(t,e){if(e!==o.length-1){var r=function(t,e,r){var n=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+r*(e[1]-t[1])/n,o=e[0]+r*(e[1]-t[1])/n;return[[i,t[1]+r*(t[0]-e[0])/n],[o,e[1]+r*(t[0]-e[0])/n]]}(t,o[e+1],i);if(n.push(r),e>0){var s=n[e-1],u=function(t,e){return!function(t,e){return 0===pn(hn(t),hn(e))}(t,e)&&function(t,e){var r=t[0],n=hn(t),i=e[0],o=hn(e),a=pn(n,o);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(r,function(t,e){return[t*e[0],t*e[1]]}(pn(function(t,e){return[t[0]-e[0],t[1]-e[1]]}(i,r),o)/a,n))}(t,e)}(r,s);!1!==u&&(s[1]=u,r[0]=u),a.push(s[0]),e===o.length-2&&(a.push(r[0]),a.push(r[1]))}2===o.length&&(a.push(r[0]),a.push(r[1]))}})),s(a,t.properties)}function dn(t,e,r){var n=e[0]-t[0],i=e[1]-t[1],o=r[0]-e[0],a=r[1]-e[1];return Math.sign(n*a-o*i)}function gn(t,e){return e.geometry.coordinates[0].every((function(e){return Pt(n(e),t)}))}function mn(t,e){for(var r=0;r=Math.abs(a)?o>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:a>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1])}(t.coordinates[r],t.coordinates[r+1],e.coordinates))return!0;return!1}function yn(t,e){return Qe(e,Rr(t)).features.length>0}function _n(t,e){return!(t[0]>e[0]||t[2]e[1]||t[3]0}function wn(t,e){for(var r=!1,i=!1,o=t.coordinates[0].length,a=0;a=Math.abs(s)?a>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:s>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1]:Math.abs(a)>=Math.abs(s)?a>0?t[0]0?t[1]0}function Pn(t,e,r){r=r||[];for(var n=0;n0)){if(o/=p,p<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=n-u,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o0)){if(o/=f,f<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=i-l,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o0||h<1)||(c>0&&(t[0]=[u+c*p,l+c*f]),h<1&&(t[1]=[u+h*p,l+h*f]),!0)}}}}}function Xn(t,e,r,n,i){var o=t[1];if(o)return!0;var a,s,u=t[0],l=t.left,c=t.right,h=l[0],p=l[1],f=c[0],d=c[1],g=(h+f)/2,m=(p+d)/2;if(d===p){if(g=n)return;if(h>f){if(u){if(u[1]>=i)return}else u=[g,r];o=[g,i]}else{if(u){if(u[1]1)if(h>f){if(u){if(u[1]>=i)return}else u=[(r-s)/a,r];o=[(i-s)/a,i]}else{if(u){if(u[1]=n)return}else u=[e,a*e+s];o=[n,a*n+s]}else{if(u){if(u[0]=-$s)){var f=u*u+l*l,d=c*c+h*h,g=(h*f-l*d)/p,m=(u*d-c*f)/p,y=Ks.pop()||new function(){On(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=t,y.site=i,y.x=g+a,y.y=(y.cy=m+s)+Math.sqrt(g*g+m*m),t.circle=y;for(var _=null,v=Ws._;v;)if(y.yQs)s=s.L;else{if(!((i=o-function(t,e){var r=t.N;if(r)return ei(r,e);var n=t.site;return n[1]===e?n[0]:1/0}(s,a))>Qs)){n>-Qs?(e=s.P,r=s):i>-Qs?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}!function(t){Ys[t.index]={site:t,halfedges:[]}}(t);var u=Jn(t);if(Zs.insert(e,u),e||r){if(e===r)return Kn(e),r=Jn(e.site),Zs.insert(u,r),u.edge=r.edge=Vn(e.site,u.site),Hn(e),void Hn(r);if(r){Kn(e),Kn(r);var l=e.site,c=l[0],h=l[1],p=t[0]-c,f=t[1]-h,d=r.site,g=d[0]-c,m=d[1]-h,y=2*(p*m-f*g),_=p*p+f*f,v=g*g+m*m,x=[(m*_-f*v)/y+c,(p*v-g*_)/y+h];jn(r.edge,l,d,x),u.edge=Vn(l,t,null,x),r.edge=Vn(t,d,null,x),Hn(e),Hn(r)}else u.edge=Vn(e.site,u.site)}}function ei(t,e){var r=t.site,n=r[0],i=r[1],o=i-e;if(!o)return n;var a=t.P;if(!a)return-1/0;var s=(r=a.site)[0],u=r[1],l=u-e;if(!l)return s;var c=s-n,h=1/o-1/l,p=c/l;return h?(-p+Math.sqrt(p*p-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+n:(n+s)/2}function ri(t,e,r){return(t[0]-r[0])*(e[1]-t[1])-(t[0]-e[0])*(r[1]-t[1])}function ni(t,e){return e[1]-t[1]||e[0]-t[0]}function ii(t,e){var r,n,i,o=t.sort(ni).pop();for(Hs=[],Ys=new Array(t.length),Zs=new kn,Ws=new kn;;)if(i=Xs,o&&(!i||o[1]Qs||Math.abs(i[0][1]-i[1][1])>Qs)||delete Hs[o]}(a,s,u,l),function(t,e,r,n){var i,o,a,s,u,l,c,h,p,f,d,g,m=Ys.length,y=!0;for(i=0;iQs||Math.abs(g-p)>Qs)&&(u.splice(s,0,Hs.push(qn(a,f,Math.abs(d-t)Qs?[t,Math.abs(h-t)Qs?[Math.abs(p-n)Qs?[r,Math.abs(h-r)Qs?[Math.abs(p-e)=-270&&(g=-g),d<-180&&d>=-360&&(m=-m),"degrees"===a){var y=g*Math.cos(h)+m*Math.sin(h),_=m*Math.cos(h)-g*Math.sin(h);g=y,m=_}p.push([g+c[0],m+c[1]])}return p.push(p[0]),"degrees"===a?o([p],l):un(o([p],l),s,{pivot:u})}function si(t){var e=t*Math.PI/180;return Math.tan(e)}function ui(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.properties,i=e.weight;if(!t)throw new Error("geojson is required");var o=0,a=0,s=0;return z(t,(function(t,e,r){var n=r[i];if(!E(n=null==n?1:n))throw new Error("weight value must be a number for feature index "+e);(n=Number(n))>0&&T(t,(function(t){o+=t[0]*n,a+=t[1]*n,s+=n}))})),n([o/s,a/s],r)}function li(t,e,r,i){var o=r.properties.tolerance||.001,a=0,s=0,u=0,l=0;if(L(r,(function(e){var r=e.properties.weight,n=null==r?1:r;if(!E(n=Number(n)))throw new Error("weight value must be a number");if(n>0){l+=1;var i=n*Rt(e,t);0===i&&(i=1);var o=n/i;a+=e.geometry.coordinates[0]*o,s+=e.geometry.coordinates[1]*o,u+=o}})),l<1)throw new Error("no features to measure");var c=a/u,h=s/u;return 1===l||0===i||Math.abs(c-e[0])0?t+r[e-1]:t})),c.forEach((function(t){t=2*t*Math.PI/c[c.length-1];var e=Math.random();u.push([e*i*Math.sin(t),e*i*Math.cos(t)])})),u[u.length-1]=u[0],u=u.map(function(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}(hi(r))),a.push(o([u]))}return l(a)}function di(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.bbox,n=e.num_vertices,i=e.max_length,o=e.max_rotation;null!=t||(t=1),(!E(n)||n<2)&&(n=10),E(i)||(i=1e-4),E(o)||(o=Math.PI/8);for(var a=[],u=0;u1?t:null;case"MultiPolygon":var e=[];if(k(t,(function(t){fr(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}function Bi(){this.reset()}function Ui(t,e,r){var n=t.s=e+r,i=n-e,o=n-i;t.t=e-o+(r-i)}function Vi(t){return t>1?Cf:t<-1?-Cf:Math.asin(t)}function qi(){}function ji(t,e){t&&Vf.hasOwnProperty(t.type)&&Vf[t.type](t,e)}function Gi(t,e,r){var n,i=-1,o=t.length-r;for(e.lineStart();++iSf?t-Pf:t<-Sf?t+Pf:t,e]}function to(t,e,r){return(t%=Pf)?e||r?jf(ro(t),no(e,r)):ro(t):e||r?no(e,r):$i}function eo(t){return function(e,r){return[(e+=t)>Sf?e-Pf:e<-Sf?e+Pf:e,r]}}function ro(t){var e=eo(t);return e.invert=eo(-t),e}function no(t,e){function r(t,e){var r=zf(e),s=zf(t)*r,u=Of(t)*r,l=Of(e),c=l*n+s*i;return[Nf(u*o-c*a,s*n-l*i),Vi(c*o+u*a)]}var n=zf(t),i=Of(t),o=zf(e),a=Of(e);return r.invert=function(t,e){var r=zf(e),s=zf(t)*r,u=Of(t)*r,l=Of(e),c=l*o-u*a;return[Nf(u*o+l*a,s*n+c*i),Vi(c*n-s*i)]},r}function io(t,e){(e=Yi(e))[0]-=t,Qi(e);var r=function(t){return t>1?0:t<-1?Sf:Math.acos(t)}(-e[1]);return((-e[2]<0?-r:r)+Pf-If)%Pf}function oo(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function ao(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0)do{l.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+s+4)%4)!==h);else l.point(o[0],o[1])}function a(n,i){return Lf(n[0]-t)0?0:3:Lf(n[0]-r)0?2:1:Lf(n[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(a){function u(t,e){i(t,e)&&b.point(t,e)}function l(o,a){var s=i(o,a);if(h&&p.push([o,a]),v)f=o,d=a,g=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&_)b.point(o,a);else{var u=[m=Math.max(Jf,Math.min(Kf,m)),y=Math.max(Jf,Math.min(Kf,y))],l=[o=Math.max(Jf,Math.min(Kf,o)),a=Math.max(Jf,Math.min(Kf,a))];Xf(u,l,t,e,r,n)?(_||(b.lineStart(),b.point(u[0],u[1])),b.point(l[0],l[1]),s||b.lineEnd(),x=!1):s&&(b.lineStart(),b.point(o,a),x=!1)}m=o,y=a,_=s}var c,h,p,f,d,g,m,y,_,v,x,b=a,w=Gf(),E={point:u,lineStart:function(){E.point=l,h&&h.push(p=[]),v=!0,_=!1,m=y=NaN},lineEnd:function(){c&&(l(f,d),g&&_&&w.rejoin(),c.push(w.result())),E.point=u,_&&b.lineEnd()},polygonStart:function(){b=w,c=[],h=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,r=0,i=h.length;rn&&(p-o)*(n-a)>(f-a)*(t-o)&&++e:f<=n&&(p-o)*(n-a)<(f-a)*(t-o)&&--e;return e}(),r=x&&e,i=(c=Hf(c)).length;(r||i)&&(a.polygonStart(),r&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Yf(c,s,e,o,a),a.polygonEnd()),b=a,c=h=p=null}};return E}}function uo(t){return t.length>1}function lo(t,e){return((t=t.x)[0]<0?t[1]-Cf-If:Cf-t[1])-((e=e.x)[0]<0?e[1]-Cf-If:Cf-e[1])}function co(t){return function(e){var r=new ho;for(var n in t)r[n]=t[n];return r.stream=e,r}}function ho(){}function po(t,e,r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),qf(r,t.stream(id));var a=id.result(),s=Math.min(n/(a[1][0]-a[0][0]),i/(a[1][1]-a[0][1])),u=+e[0][0]+(n-s*(a[1][0]+a[0][0]))/2,l=+e[0][1]+(i-s*(a[1][1]+a[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*s).translate([u,l])}function fo(t,e){return[t,kf(Bf((Cf+e)/2))]}function go(t,e){return[kf(Bf((Cf+e)/2)),-t]}function mo(t,r,n,i){var o=t.properties||{},a="Feature"===t.type?t.geometry:t;if("GeometryCollection"===a.type){var s=[];return z(t,(function(t){var e=mo(t,r,n,i);e&&s.push(e)})),l(s)}var u,c=q(t),h=c[1]>50&&c[3]>50;u=h?{type:a.type,coordinates:_o(a.coordinates,xo(a))}:ir(a);var p,f=(new lc).read(u),d=g(m(r,n),"meters"),y=tp.bufferOp(f,d);if(!yo((y=(new cc).write(y)).coordinates))return(p=h?{type:y.type,coordinates:vo(y.coordinates,xo(a))}:or(y)).geometry?p:e(p,o)}function yo(t){return Array.isArray(t[0])?yo(t[0]):isNaN(t[0])}function _o(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return _o(t,e)}))}function vo(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return vo(t,e)}))}function xo(t){var e=pe(t).geometry.coordinates.reverse(),r=e.map((function(t){return-t}));return hd().center(e).rotate(r).scale(Mo)}function bo(){for(var t=new lc,e=t.read(JSON.stringify(arguments[0].geometry)),r=1;r=0&&(void 0===i||o_/2;A&&(M-=_/4);for(var L=[],D=[],N=0;N<6;N++){var z=2*Math.PI/6*N;L.push(Math.cos(z)),D.push(Math.sin(z))}for(var R=[],k=0;k<=C;k++)for(var O=0;O<=P;O++){var F=k%2==1;if(!(0===O&&F||0===O&&A)){var B=k*b+s-T,U=O*w+u+M;if(F&&(U-=_/2),!0===i)(function(t,e,r,n,i,a){for(var s=[],u=0;u<6;u++){var l=[];l.push(t),l.push([t[0]+e*i[u],t[1]+r*a[u]]),l.push([t[0]+e*i[(u+1)%6],t[1]+r*a[(u+1)%6]]),l.push(t),s.push(o([l],n))}return s})([B,U],d/2,g/2,n,L,D).forEach((function(t){a?wo(a,t)&&R.push(t):R.push(t)}));else{var V=function(t,e,r,n,i,a){for(var s=[],u=0;u<6;u++){var l=t[0]+e*i[u],c=t[1]+r*a[u];s.push([l,c])}return s.push(s[0].slice()),o([s],n)}([B,U],d/2,g/2,n,L,D);a?wo(a,V)&&R.push(V):R.push(V)}}}return l(R)}function So(t){if(t.features.length<=1)return t;var e=function(t){var e=Bo(),r=[];return k(t,(function(t,e){var n=q(t);r.push({minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],geojson:t,index:e})})),e.load(r),e}(t),r=[],n={};return k(t,(function(t,i){if(n[i])return!0;for(e.remove({index:i},Co),n[i]=!0;;){var o=q(t),a=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(a.length>0){var s=a.map((function(t){return n[t.index]=!0,e.remove({index:t.index},Co),t.geojson}));s.push(t),t=bo.apply(this,s)}if(0===a.length)break}r.push(t)})),l(r)}function Co(t,e){return t.index===e.index}function To(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.properties,i=r.mask,a=[];if(null==e)throw new Error("cellSide is required");if(!E(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(J(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var s=t[0],u=t[1],c=t[2],h=t[3],p=e/Rt([s,u],[c,u],r)*(c-s),f=e/Rt([s,u],[s,h],r)*(h-u),d=c-s,g=h-u,m=Math.floor(d/p),y=Math.floor(g/f),_=(g-y*f)/2,v=s+(d-m*p)/2,x=0;xe?1:0};i>n;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+c)),Math.min(i,Math.floor(r+(a-s)*l/a+c)),o)}var h=e[r],p=n,f=i;for(nt(e,n,r),o(e[i],h)>0&&nt(e,n,i);p0;)f--}0===o(e[n],h)?nt(e,n,f):nt(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}},Bo=it;it.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!ft(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),a=dt(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,ot(r,this.toBBox),ot(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},_splitRoot:function(t,e){this.data=dt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ot(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,s,u,l,c;for(u=l=1/0,n=e;n<=r-e;n++)a=function(t,e){var r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}(i=at(t,0,n,this.toBBox),o=at(t,n,r,this.toBBox)),s=ct(i)+ct(o),a=e;i--)o=t.children[i],st(u,t.leaf?a(o):o),l+=ht(u);return l},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)st(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():ot(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Uo=function(t,e,r){var n=t*e,i=Vo*t,o=i-(i-t),a=t-o,s=Vo*e,u=s-(s-e),l=e-u,c=a*l-(n-o*u-a*u-o*l);return r?(r[0]=c,r[1]=n,r):[c,n]},Vo=+(Math.pow(2,27)+1),qo=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,i=t-(r-n)+(e-n);return i?[i,r]:[r]}(t[0],e[0]);var i,o,a=new Array(r+n),s=0,u=0,l=0,c=Math.abs,h=t[u],p=c(h),f=e[l],d=c(f);p=n?(i=h,(u+=1)=n?(i=h,(u+=1)>1;return["sum(",n(t.slice(0,e)),",",n(t.slice(e)),")"].join("")}function i(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var o=[],a=0;a0){if(o<=0)return s;n=i+o}else{if(!(i<0))return s;if(o>=0)return s;n=-(i+o)}var u=33306690738754716e-32*n;return s>=u||s<=-u?s:a(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],o=e[0]-n[0],a=r[0]-n[0],u=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],h=t[2]-n[2],p=e[2]-n[2],f=r[2]-n[2],d=o*c,g=a*l,m=a*u,y=i*c,_=i*l,v=o*u,x=h*(d-g)+p*(m-y)+f*(_-v),b=7771561172376103e-31*((Math.abs(d)+Math.abs(g))*Math.abs(h)+(Math.abs(m)+Math.abs(y))*Math.abs(p)+(Math.abs(_)+Math.abs(v))*Math.abs(f));return x>b||-x>b?x:s(t,e,r,n)}];!function(){for(;u.length<=5;)u.push(o(u.length));for(var e=[],r=["slow"],n=0;n<=5;++n)e.push("a"+n),r.push("o"+n);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)i.push("case ",n,":return o",n,"(",e.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i1&&Wo(t[o[l-2]],t[o[l-1]],u)<=0;)l-=1,o.pop();for(o.push(s),l=a.length;l>1&&Wo(t[a[l-2]],t[a[l-1]],u)>=0;)l-=1,a.pop();a.push(s)}r=new Array(a.length+o.length-2);for(var c=0,h=(n=0,o.length);n0;--p)r[c++]=a[p];return r},Wo=Zo[3],Ho=yt,Ko=yt;yt.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},_down:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=s,t=o}e[t]=i}},Ho.default=Ko;var Jo=function(t,e){for(var r=t[0],n=t[1],i=!1,o=0,a=e.length-1;on!=c>n&&r<(l-s)*(n-u)/(c-u)+s&&(i=!i)}return i},Qo=Zo[3],$o=_t,ta=_t;$o.default=ta;var ea=function(t){return t},ra=function(t){if(null==t)return ea;var e,r,n=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=r=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*n+o,c[1]=(r+=t[1])*i+a;u=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=n,s[l]=o,o},maybeSet:function(n,o){for(var l=e(n)&u,c=a[l],h=0;c!=i;){if(r(c,n))return s[l];if(++h>=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=n,s[l]=o,o},get:function(n,o){for(var l=e(n)&u,c=a[l],h=0;c!=i;){if(r(c,n))return s[l];if(++h>=t)break;c=a[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,r=a.length;e>7^ca[2]^ca[3])},pa=function(t){var e,r,n,i=function(t){function e(t,e,r,n){if(p[r]!==t){p[r]=t;var i=f[r];if(i>=0){var o=d[r];i===e&&o===n||i===n&&o===e||(++m,g[r]=1)}else f[r]=e,d[r]=n}}function r(t){return ha(u[t])}function n(t,e){return sa(u[t],u[e])}var i,o,a,s,u=t.coordinates,l=t.lines,c=t.rings,h=function(){for(var t=aa(1.4*u.length,r,n,Int32Array,-1,Int32Array),e=new Int32Array(u.length),i=0,o=u.length;i=t)throw new Error("full hashset");u=o[s=s+1&a]}return o[s]=n,!0},has:function(n){for(var s=e(n)&a,u=o[s],l=0;u!=i;){if(r(u,n))return!0;if(++l>=t)break;u=o[s=s+1&a]}return!1},values:function(){for(var t=[],e=0,r=o.length;es&&(s=e),ru&&(u=r)}function n(t){t.forEach(r)}function i(t){t.forEach(n)}var o=1/0,a=1/0,s=-1/0,u=-1/0,l={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){r(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(r)},LineString:function(t){n(t.arcs)},MultiLineString:function(t){t.arcs.forEach(n)},Polygon:function(t){t.arcs.forEach(n)},MultiPolygon:function(t){t.arcs.forEach(i)}};for(var c in t)e(t[c]);return s>=o&&u>=a?[o,a,s,u]:void 0}(t=function(t){var e,r={};for(e in t)r[e]=Gt(t[e]);return r}(t)),a=e>0&&o&&function(t,e,r){function n(t){return[Math.round((t[0]-l)*f),Math.round((t[1]-c)*d)]}function i(t,e){for(var r,n,i,o,a,s=-1,u=0,h=t.length,p=new Array(h);++st&&(e.push(n),r=i)}return e},da.prototype.vector=function(t){var e=this.pos(t+10),r=this.pos(t-10);return{angle:180*Math.atan2(e.y-r.y,e.x-r.x)/3.14,speed:Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y)+(r.z-e.z)*(r.z-e.z))}},da.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var r=e/this.duration;if(r>=1)return this.points[this.length-1];var n=Math.floor((this.points.length-1)*r);return function(t,e,r,n,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+n.x*o[1]+r.x*o[2]+e.x*o[3],y:i.y*o[0]+n.y*o[1]+r.y*o[2]+e.y*o[3],z:i.z*o[0]+n.z*o[1]+r.z*o[2]+e.z*o[3]}}((this.length-1)*r-n,this.points[n],this.controls[n][1],this.controls[n+1][0],this.points[n+1])};var ga=ge,ma=ge;ge.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(Ae(t,0,o,r));if(i)for(var s=0,u=e.length;s0&&(n+=t[i-1].length,r.holes.push(n))}return r},ga.default=ma,ke.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!Xe(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),a=Ze(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Oe(r,this.toBBox),Oe(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},_splitRoot:function(t,e){this.data=Ze([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Oe(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,s,u,l,c;for(u=l=1/0,n=e;n<=r-e;n++)a=function(t,e){var r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}(i=Fe(t,0,n,this.toBBox),o=Fe(t,n,r,this.toBBox)),s=qe(i)+qe(o),a=e;i--)o=t.children[i],Be(u,t.leaf?a(o):o),l+=je(u);return l},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)Be(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():Oe(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var ya=Object.freeze({toMercator:ir,toWgs84:or}),_a=6378137,va=function(t){function e(){for(var t=[],e=0;e1)for(e=0;e=1||u<=0||l>=1||l<=0))){var g=d,m=!s[g];m&&(s[g]=!0),e?a.push(e(d,t,r,c,h,u,n,i,p,f,l,m)):a.push(d)}}function i(t,e){var r,n,i,a,s=o[t][e],u=o[t][e+1];return s[0]m[e.isect].coord?-1:1})),f=[];S.length>0;){var A=S.pop(),L=A.isect,D=A.parent,N=A.winding,z=f.length,R=[m[L].coord],k=L;if(m[L].ringAndEdge1Walkable)var O=m[L].ringAndEdge1,F=m[L].nxtIsectAlongRingAndEdge1;else O=m[L].ringAndEdge2,F=m[L].nxtIsectAlongRingAndEdge2;for(;!Pr(m[L].coord,m[F].coord);){R.push(m[F].coord);var B=void 0;for(s=0;sp&&(g>c&&dc&&gu&&(u=m)}var y=[];if(s&&u0&&Math.abs(x-r[v-1][0])>p){var b=parseFloat(r[v-1][0]),w=parseFloat(r[v-1][1]),E=parseFloat(r[v][0]),I=parseFloat(r[v][1]);if(b>-180&&b-180&&r[v-1][0]c&&b<180&&-180===E&&v+1c&&r[v-1][0]<180){_.push([180,r[v][1]]),v++,_.push([r[v][0],r[v][1]]);continue}if(bc){var S=b;b=E,E=S;var C=w;w=I,I=C}if(b>c&&E=180&&bc?180:-180,P]),(_=[]).push([r[v-1][0]>c?-180:180,P]),y.push(_)}else _=[],y.push(_);_.push([x,r[v][1]])}else _.push([r[v][0],r[v][1]])}}else{var M=[];y.push(M);for(var A=0;A=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(n.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(n.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return n.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?n.coordinates[1]-i.coordinates[1]:i.coordinates[1]-n.coordinates[1];var o=dn(t.coordinates,n.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(n.coordinates[0]-t.coordinates[0],2)+Math.pow(n.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},Es.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},Es.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},Es.prototype.addInnerEdge=function(t){this.innerEdges.push(t)};var Is=function(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)};Is.prototype.getSymetric=function(){return this.symetric||(this.symetric=new Is(this.to,this.from),this.symetric.symetric=this),this.symetric},Is.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},Is.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},Is.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},Is.prototype.toLineString=function(){return s([this.from.coordinates,this.to.coordinates])},Is.prototype.compareTo=function(t){return dn(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var Ss=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},Cs={length:{configurable:!0}};Ss.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},Ss.prototype.get=function(t){return this.edges[t]},Cs.length.get=function(){return this.edges.length},Ss.prototype.forEach=function(t){this.edges.forEach(t)},Ss.prototype.map=function(t){return this.edges.map(t)},Ss.prototype.some=function(t){return this.edges.some(t)},Ss.prototype.isValid=function(){return!0},Ss.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,r,n){return r.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=n),e}),0),r=(0===e?this.length:e)-1,n=(e+1)%this.length,i=dn(this.edges[r].from.coordinates,this.edges[e].from.coordinates,this.edges[n].from.coordinates);return 0===i?this.edges[r].from.coordinates[0]>this.edges[n].from.coordinates[0]:i>0},Ss.prototype.toMultiPoint=function(){return h(this.edges.map((function(t){return t.from.coordinates})))},Ss.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=o([t])},Ss.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=se(this.toPolygon())},Ss.findEdgeRingContaining=function(t,e){var r,i,o=t.getEnvelope();return e.forEach((function(e){var a=e.getEnvelope();if(i&&(r=i.getEnvelope()),!function(t,e){var r=t.geometry.coordinates.map((function(t){return t[0]})),n=t.geometry.coordinates.map((function(t){return t[1]})),i=e.geometry.coordinates.map((function(t){return t[0]})),o=e.geometry.coordinates.map((function(t){return t[1]}));return Math.max(null,r)===Math.max(null,i)&&Math.max(null,n)===Math.max(null,o)&&Math.min(null,r)===Math.min(null,i)&&Math.min(null,n)===Math.min(null,o)}(a,o)&&gn(a,o)){var s=t.map((function(t){return t.from.coordinates})).find((function(t){return!e.some((function(e){return function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t,e.from.coordinates)}))}));s&&e.inside(n(s))&&(i&&!gn(r,a)||(i=e))}})),i},Ss.prototype.inside=function(t){return Pt(t,this.toPolygon())},Object.defineProperties(Ss.prototype,Cs);var Ts=function(){this.edges=[],this.nodes={}};Ts.fromGeoJson=function(t){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(t);var e=new Ts;return k(t,(function(t){Y(t,"LineString","Graph::fromGeoJson"),P(t,(function(t,r){if(t){var n=e.getNode(t),i=e.getNode(r);e.addEdge(n,i)}return r}))})),e},Ts.prototype.getNode=function(t){var e=Es.buildId(t),r=this.nodes[e];return r||(r=this.nodes[e]=new Es(t)),r},Ts.prototype.addEdge=function(t,e){var r=new Is(t,e),n=r.getSymetric();this.edges.push(r),this.edges.push(n)},Ts.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},Ts.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var r=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),r.forEach((function(t){return e._removeIfDangle(t)}))}},Ts.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},Ts.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,r){t.getOuterEdge((0===r?t.getOuterEdges().length:r)-1).symetric.next=e}))},Ts.prototype._computeNextCCWEdges=function(t,e){for(var r,n,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var a=i[o],s=a.symetric,u=void 0,l=void 0;a.label===e&&(u=a),s.label===e&&(l=s),u&&l&&(l&&(n=l),u&&(n&&(n.next=u,n=void 0),r||(r=u)))}n&&(n.next=r)},Ts.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(r){if(!(r.label>=0)){t.push(r);var n=r;do{n.label=e,n=n.next}while(!r.isEqual(n));e++}})),t},Ts.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(r){t._computeNextCCWEdges(r,e.label)}))}));var e=[];return this.edges.forEach((function(r){r.ring||e.push(t._findEdgeRing(r))})),e},Ts.prototype._findIntersectionNodes=function(t){var e=[],r=t,n=function(){var n=0;r.from.getOuterEdges().forEach((function(e){e.label===t.label&&++n})),n>1&&e.push(r.from),r=r.next};do{n()}while(!t.isEqual(r));return e},Ts.prototype._findEdgeRing=function(t){var e=t,r=new Ss;do{r.push(e),e.ring=r,e=e.next}while(!t.isEqual(e));return r},Ts.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},Ts.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()};var Ps=mt((function(t,e){function r(t){var e=[];for(var r in t)e.push(r);return e}(t.exports="function"==typeof Object.keys?Object.keys:r).shim=r})),Ms=(Ps.shim,mt((function(t,e){function r(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function n(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(e=t.exports=i?r:n).supported=r,e.unsupported=n}))),As=(Ms.supported,Ms.unsupported,mt((function(t){function e(t){return null==t}function r(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}var n=Array.prototype.slice,i=t.exports=function(t,o,a){return a||(a={}),t===o||(t instanceof Date&&o instanceof Date?t.getTime()===o.getTime():!t||!o||"object"!=typeof t&&"object"!=typeof o?a.strict?t===o:t==o:function(t,o,a){var s,u;if(e(t)||e(o))return!1;if(t.prototype!==o.prototype)return!1;if(Ms(t))return!!Ms(o)&&(t=n.call(t),o=n.call(o),i(t,o,a));if(r(t)){if(!r(o))return!1;if(t.length!==o.length)return!1;for(s=0;s=0;s--)if(l[s]!=c[s])return!1;for(s=l.length-1;s>=0;s--)if(u=l[s],!i(t[u],o[u],a))return!1;return typeof t==typeof o}(t,o,a))}}))),Ls=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:Cn};Ls.prototype.compare=function(t,e){if(t.type!==e.type||!Sn(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var r=this,n=In(t),i=In(e);return n.every((function(t){return this.some((function(e){return r.compare(t,e)}))}),i)}}return!1},Ls.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var r=0;r=0&&(r=[].concat(t.slice(n,t.length),t.slice(1,n+1))),r},Ls.prototype.comparePath=function(t,e){var r=this;return t.every((function(t,e){return r.compareCoord(t,this[e])}),e)},Ls.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length),i=this;return r.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),n)}return!1},Ls.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},Ls.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},Ls.prototype.removePseudo=function(t){return t};var Ds=Ls,Ns=mt((function(t){function e(t,e,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,r,n)}e.prototype.run=function(t,e,r,n){this._init(t,e,r,n);for(var i=0;i=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],r=0;r0){for(u=0;u=0);return t},e.prototype.assign=function(){for(var t,e=!1,r=this.dataset.length,n=0;ni&&(r=n):e=this.minPts)return r},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var r=[],n=0,i=this.dataset.length;n0,f=[];if(r)i="kmrand"==r?function(t,e){for(var r={},n=[],i=e<<2,o=t.length,a=t[0].length>0;n.length0;){var s=t[Math.floor(Math.random()*o)],u=a?s.join("_"):""+s;r[u]||(r[u]=!0,n.push(s))}if(n.length0,a=t[Math.floor(Math.random()*i)];for(o&&a.join("_"),n.push(a);n.length0;){var u=a.pop();if(u===r)return An(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),r=this.content.pop();e!==this.content.length-1&&(this.content[e]=r,this.scoreFunction(r)0;){var r=(t+1>>1)-1,n=this.content[r];if(!(this.scoreFunction(e)=s)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[n=a],a=null,i.halfedges.forEach((function(r){var n=o.edges[r],s=n.left;if(s!==i.site&&s||(s=n.right)){var u=t-s[0],l=e-s[1],h=u*u+l*l;he.x?1:this.ye.y?1:0},lu.prototype.clone=function(){},lu.prototype.copy=function(){return new lu(this)},lu.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},lu.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+r*r+n*n)},lu.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},lu.prototype.hashCode=function(){var t=17;return 37*(t=37*t+lu.hashCode(this.x))+lu.hashCode(this.y)},lu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},lu.prototype.interfaces_=function(){return[au,su,Ei]},lu.prototype.getClass=function(){return lu},lu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=iu.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},cu.DimensionalComparator.get=function(){return hu},cu.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},cu.NULL_ORDINATE.get=function(){return iu.NaN},cu.X.get=function(){return 0},cu.Y.get=function(){return 1},cu.Z.get=function(){return 2},Object.defineProperties(lu,cu);var hu=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new nu("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};hu.prototype.compare=function(t,e){var r=t,n=e,i=hu.compare(r.x,n.x);if(0!==i)return i;var o=hu.compare(r.y,n.y);return 0!==o?o:this._dimensionsToTest<=2?0:hu.compare(r.z,n.z)},hu.prototype.interfaces_=function(){return[uu]},hu.prototype.getClass=function(){return hu},hu.compare=function(t,e){return te?1:iu.isNaN(t)?iu.isNaN(e)?0:-1:iu.isNaN(e)?1:0};var pu=function(){};pu.prototype.create=function(){},pu.prototype.interfaces_=function(){return[]},pu.prototype.getClass=function(){return pu};var fu=function(){},du={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};fu.prototype.interfaces_=function(){return[]},fu.prototype.getClass=function(){return fu},fu.toLocationSymbol=function(t){switch(t){case fu.EXTERIOR:return"e";case fu.BOUNDARY:return"b";case fu.INTERIOR:return"i";case fu.NONE:return"-"}throw new nu("Unknown location value: "+t)},du.INTERIOR.get=function(){return 0},du.BOUNDARY.get=function(){return 1},du.EXTERIOR.get=function(){return 2},du.NONE.get=function(){return-1},Object.defineProperties(fu,du);var gu=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},mu=function(){},yu={LOG_10:{configurable:!0}};mu.prototype.interfaces_=function(){return[]},mu.prototype.getClass=function(){return mu},mu.log10=function(t){var e=Math.log(t);return iu.isInfinite(e)||iu.isNaN(e)?e:e/mu.LOG_10},mu.min=function(t,e,r,n){var i=t;return er?r:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var n=arguments[0],i=arguments[1],o=arguments[2];return no?o:n}},mu.wrap=function(t,e){return t<0?e- -t%e:t%e},mu.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],r=arguments[0];return t>r&&(r=t),e>r&&(r=e),r}if(4===arguments.length){var n=arguments[1],i=arguments[2],o=arguments[3],a=arguments[0];return n>a&&(a=n),i>a&&(a=i),o>a&&(a=o),a}},mu.average=function(t,e){return(t+e)/2},yu.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(mu,yu);var _u=function(t){this.str=t};_u.prototype.append=function(t){this.str+=t},_u.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},_u.prototype.toString=function(t){return this.str};var vu=function(t){this.value=t};vu.prototype.intValue=function(){return this.value},vu.prototype.compareTo=function(t){return this.valuet?1:0},vu.isNaN=function(t){return Number.isNaN(t)};var xu=function(){};xu.isWhitespace=function(t){return t<=32&&t>=0||127===t},xu.toUpperCase=function(t){return t.toUpperCase()};var bu=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var r=arguments[0];this.init(r)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n,i)}},wu={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};bu.prototype.le=function(t){return(this._hi9?(c=!0,h="9"):h="0"+l,a.append(h),r=r.subtract(bu.valueOf(l)).multiply(bu.TEN),c&&r.selfAdd(bu.TEN);var p=!0,f=bu.magnitude(r._hi);if(f<0&&Math.abs(f)>=s-u&&(p=!1),!p)break}return e[0]=n,a.toString()},bu.prototype.sqr=function(){return this.multiply(this)},bu.prototype.doubleValue=function(){return this._hi+this._lo},bu.prototype.subtract=function(){if(arguments[0]instanceof bu){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},bu.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},bu.prototype.isZero=function(){return 0===this._hi&&0===this._lo},bu.prototype.selfSubtract=function(){if(arguments[0]instanceof bu){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},bu.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},bu.prototype.min=function(t){return this.le(t)?this:t},bu.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,l=null,c=null,h=null;return u=this._hi/r,h=(i=(l=bu.SPLIT*u)-(i=l-u))*(a=(h=bu.SPLIT*r)-(a=h-r))-(c=u*r)+i*(s=r-a)+(o=u-i)*a+o*s,h=u+(l=(this._hi-c-h+this._lo-u*n)/r),this._hi=h,this._lo=u-h+l,this}},bu.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},bu.prototype.divide=function(){if(arguments[0]instanceof bu){var t=arguments[0],e=null,r=null,n=null,i=null,o=null,a=null,s=null,u=null;return r=(o=this._hi/t._hi)-(e=(a=bu.SPLIT*o)-(e=a-o)),u=e*(n=(u=bu.SPLIT*t._hi)-(n=u-t._hi))-(s=o*t._hi)+e*(i=t._hi-n)+r*n+r*i,a=(this._hi-s-u+this._lo-o*t._lo)/t._hi,new bu(u=o+a,o-u+a)}if("number"==typeof arguments[0]){var l=arguments[0];return iu.isNaN(l)?bu.createNaN():bu.copy(this).selfDivide(l,0)}},bu.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},bu.prototype.pow=function(t){if(0===t)return bu.valueOf(1);var e=new bu(this),r=bu.valueOf(1),n=Math.abs(t);if(n>1)for(;n>0;)n%2==1&&r.selfMultiply(e),(n/=2)>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},bu.prototype.ceil=function(){if(this.isNaN())return bu.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new bu(t,e)},bu.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},bu.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},bu.prototype.setValue=function(){if(arguments[0]instanceof bu){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},bu.prototype.max=function(t){return this.ge(t)?this:t},bu.prototype.sqrt=function(){if(this.isZero())return bu.valueOf(0);if(this.isNegative())return bu.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=bu.valueOf(e),n=this.subtract(r.sqr())._hi*(.5*t);return r.add(n)},bu.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],r=null,n=null,i=null,o=null,a=null,s=null;return o=(i=this._hi+e)-(a=i-this._hi),n=(s=(o=e-a+(this._hi-o))+this._lo)+(i-(r=i+s)),this._hi=r+n,this._lo=n+(r-this._hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],c=null,h=null,p=null,f=null,d=null,g=null,m=null;f=this._hi+u,h=this._lo+l,d=f-(g=f-this._hi),p=h-(m=h-this._lo);var y=(c=f+(g=(d=u-g+(this._hi-d))+h))+(g=(p=l-m+(this._lo-p))+(g+(f-c))),_=g+(c-y);return this._hi=y,this._lo=_,this}},bu.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,l=null;i=(u=bu.SPLIT*this._hi)-this._hi,l=bu.SPLIT*r,i=u-i,o=this._hi-i,a=l-r;var c=(u=this._hi*r)+(l=i*(a=l-a)-u+i*(s=r-a)+o*a+o*s+(this._hi*n+this._lo*r)),h=l+(i=u-c);return this._hi=c,this._lo=h,this}},bu.prototype.selfSqr=function(){return this.selfMultiply(this)},bu.prototype.floor=function(){if(this.isNaN())return bu.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new bu(t,e)},bu.prototype.negate=function(){return this.isNaN()?this:new bu(-this._hi,-this._lo)},bu.prototype.clone=function(){},bu.prototype.multiply=function(){if(arguments[0]instanceof bu){var t=arguments[0];return t.isNaN()?bu.createNaN():bu.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return iu.isNaN(e)?bu.createNaN():bu.copy(this).selfMultiply(e,0)}},bu.prototype.isNaN=function(){return iu.isNaN(this._hi)},bu.prototype.intValue=function(){return Math.trunc(this._hi)},bu.prototype.toString=function(){var t=bu.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},bu.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),n=e[0]+1,i=r;if("."===r.charAt(0))i="0"+r;else if(n<0)i="0."+bu.stringOfChar("0",-n)+r;else if(-1===r.indexOf(".")){var o=n-r.length;i=r+bu.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},bu.prototype.reciprocal=function(){var t,e,r,n,i=null,o=null,a=null,s=null;t=(r=1/this._hi)-(i=(a=bu.SPLIT*r)-(i=a-r)),o=(s=bu.SPLIT*this._hi)-this._hi;var u=r+(a=(1-(n=r*this._hi)-(s=i*(o=s-o)-n+i*(e=this._hi-o)+t*o+t*e)-r*this._lo)/this._hi);return new bu(u,r-u+a)},bu.prototype.toSciNotation=function(){if(this.isZero())return bu.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),n=bu.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===r.charAt(0))throw new Error("Found leading zero: "+r);var i="";r.length>1&&(i=r.substring(1));var o=r.charAt(0)+"."+i;return this.isNegative()?"-"+o+n:o+n},bu.prototype.abs=function(){return this.isNaN()?bu.NaN:this.isNegative()?this.negate():new bu(this)},bu.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},bu.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},bu.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},bu.prototype.trunc=function(){return this.isNaN()?bu.NaN:this.isPositive()?this.floor():this.ceil()},bu.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},bu.prototype.interfaces_=function(){return[Ei,au,su]},bu.prototype.getClass=function(){return bu},bu.sqr=function(t){return bu.valueOf(t).selfMultiply(t)},bu.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return bu.parse(t)}if("number"==typeof arguments[0])return new bu(arguments[0])},bu.sqrt=function(t){return bu.valueOf(t).sqrt()},bu.parse=function(t){for(var e=0,r=t.length;xu.isWhitespace(t.charAt(e));)e++;var n=!1;if(e=r);){var l=t.charAt(e);if(e++,xu.isDigit(l)){var c=l-"0";o.selfMultiply(bu.TEN),o.selfAdd(c),a++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=vu.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}s=a}}var p=o,f=a-s-u;if(0===f)p=o;else if(f>0){var d=bu.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=bu.TEN.pow(-f);p=o.multiply(g)}return n?p.negate():p},bu.createNaN=function(){return new bu(iu.NaN,iu.NaN)},bu.copy=function(t){return new bu(t)},bu.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),n=Math.trunc(Math.floor(r));return 10*Math.pow(10,n)<=e&&(n+=1),n},bu.stringOfChar=function(t,e){for(var r=new _u,n=0;n0){if(o<=0)return Eu.signum(a);n=i+o}else{if(!(i<0))return Eu.signum(a);if(o>=0)return Eu.signum(a);n=-i-o}var s=Eu.DP_SAFE_EPSILON*n;return a>=s||-a>=s?Eu.signum(a):2},Eu.signum=function(t){return t>0?1:t<0?-1:0},Iu.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Eu,Iu);var Su=function(){},Cu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Cu.X.get=function(){return 0},Cu.Y.get=function(){return 1},Cu.Z.get=function(){return 2},Cu.M.get=function(){return 3},Su.prototype.setOrdinate=function(t,e,r){},Su.prototype.size=function(){},Su.prototype.getOrdinate=function(t,e){},Su.prototype.getCoordinate=function(){},Su.prototype.getCoordinateCopy=function(t){},Su.prototype.getDimension=function(){},Su.prototype.getX=function(t){},Su.prototype.clone=function(){},Su.prototype.expandEnvelope=function(t){},Su.prototype.copy=function(){},Su.prototype.getY=function(t){},Su.prototype.toCoordinateArray=function(){},Su.prototype.interfaces_=function(){return[su]},Su.prototype.getClass=function(){return Su},Object.defineProperties(Su,Cu);var Tu=function(){},Pu=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Tu),Mu=function(){};Mu.arraycopy=function(t,e,r,n,i){for(var o=0,a=e;at._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,n=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&n>=this._miny&&n<=this._maxy}},Lu.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Lu){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||rthis._maxy||nthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=n,this._maxy=n):(rthis._maxx&&(this._maxx=r),nthis._maxy&&(this._maxy=n))}},Lu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Lu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Lu.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Lu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Lu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Lu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Lu.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Lu.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Lu){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof lu){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return this.covers(r,n)}},Lu.prototype.centre=function(){return this.isNull()?null:new lu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Lu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof lu){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Lu){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.init(r.x,n.x,r.y,n.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];it._maxx&&(e=this._minx-t._maxx);var r=0;return this._maxyt._maxy&&(r=this._miny-t._maxy),0===e?r:0===r?e:Math.sqrt(e*e+r*r)},Lu.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+lu.hashCode(this._minx))+lu.hashCode(this._maxx))+lu.hashCode(this._miny))+lu.hashCode(this._maxy)},Lu.prototype.interfaces_=function(){return[au,Ei]},Lu.prototype.getClass=function(){return Lu},Lu.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.xe.x?t.x:e.x)&&r.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),u=Math.max(o.x,a.x),l=Math.min(n.x,i.x),c=Math.max(n.x,i.x);return!(l>u||cu||cthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},Vu.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Vu.prototype.setPrecisionModel=function(t){this._precisionModel=t},Vu.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?n:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=n>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return Uu.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},Vu.nonRobustComputeEdgeDistance=function(t,e,r){var n=t.x-e.x,i=t.y-e.y,o=Math.sqrt(n*n+i*i);return Uu.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},qu.DONT_INTERSECT.get=function(){return 0},qu.DO_INTERSECT.get=function(){return 1},qu.COLLINEAR.get=function(){return 2},qu.NO_INTERSECTION.get=function(){return 0},qu.POINT_INTERSECTION.get=function(){return 1},qu.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Vu,qu);var ju=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Lu(this._inputLines[0][0],this._inputLines[0][1]),r=new Lu(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&r.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],r=arguments[1],n=arguments[2];if(this._isProper=!1,Lu.intersects(r,n,e)&&0===Zu.orientationIndex(r,n,e)&&0===Zu.orientationIndex(n,r,e))return this._isProper=!0,(e.equals(r)||e.equals(n))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,r,n,i){i.x=this.smallestInAbsValue(t.x,e.x,r.x,n.x),i.y=this.smallestInAbsValue(t.y,e.y,r.y,n.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,r.x-=i.x,r.y-=i.y,n.x-=i.x,n.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,r,n,i){var o=null;try{o=Au.intersection(t,r,n,i)}catch(a){if(!(a instanceof Pu))throw a;o=e.nearestEndpoint(t,r,n,i)}return o},e.prototype.intersection=function(t,r,n,i){var o=this.intersectionWithNormalization(t,r,n,i);return this.isInSegmentEnvelopes(o)||(o=new lu(e.nearestEndpoint(t,r,n,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,r,n){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&Mu.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,r,n){var i=new lu(t),o=new lu(e),a=new lu(r),s=new lu(n),u=new lu;this.normalizeToEnvCentre(i,o,a,s,u);var l=this.safeHCoordinateIntersection(i,o,a,s);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,r,n,i){var o=Lu.intersects(e,r,n),a=Lu.intersects(e,r,i),s=Lu.intersects(n,i,e),u=Lu.intersects(n,i,r);return o&&a?(this._intPt[0]=n,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=e,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||a||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=n,this._intPt[1]=r,!n.equals(r)||a||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&u?(this._intPt[0]=i,this._intPt[1]=r,!i.equals(r)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,r,n,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=r.xn.x?r.x:n.x,p=r.y>n.y?r.y:n.y,f=((o>l?o:l)+(sc?a:c)+(u0&&a>0||o<0&&a<0)return t.NO_INTERSECTION;var s=Zu.orientationIndex(n,i,e),u=Zu.orientationIndex(n,i,r);return s>0&&u>0||s<0&&u<0?t.NO_INTERSECTION:0===o&&0===a&&0===s&&0===u?this.computeCollinearIntersection(e,r,n,i):(0===o||0===a||0===s||0===u?(this._isProper=!1,e.equals2D(n)||e.equals2D(i)?this._intPt[0]=e:r.equals2D(n)||r.equals2D(i)?this._intPt[0]=r:0===o?this._intPt[0]=new lu(n):0===a?this._intPt[0]=new lu(i):0===s?this._intPt[0]=new lu(e):0===u&&(this._intPt[0]=new lu(r))):(this._isProper=!0,this._intPt[0]=this.intersection(e,r,n,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,r,n){var i=t,o=Zu.distancePointLine(t,r,n),a=Zu.distancePointLine(e,r,n);return a0?r>0?-i:i:r>0?i:-i;if(0===e||0===r)return n>0?t>0?i:-i:t>0?-i:i;if(e>0?n>0?e<=n||(i=-i,o=t,t=r,r=o,o=e,e=n,n=o):e<=-n?(i=-i,r=-r,n=-n):(o=t,t=-r,r=o,o=e,e=-n,n=o):n>0?-e<=n?(i=-i,t=-t,e=-e):(o=-t,t=r,r=o,o=-e,e=n,n=o):e>=n?(t=-t,e=-e,r=-r,n=-n):(i=-i,o=-t,t=-r,r=o,o=-e,e=-n,n=o),t>0){if(!(r>0))return i;if(!(t<=r))return i}else{if(r>0)return-i;if(!(t>=r))return-i;i=-i,t=-t,r=-r}for(;;){if((n-=(a=Math.floor(r/t))*e)<0)return-i;if(n>e)return i;if(t>(r-=a*t)+r){if(en+n)return-i;r=t-r,n=e-n,i=-i}if(0===n)return 0===r?0:-i;if(0===r)return i;if((e-=(a=Math.floor(t/r))*n)<0)return i;if(e>n)return-i;if(r>(t-=a*r)+t){if(ne+e)return i;t=r-t,e=n-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var Xu=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};Xu.prototype.countSegment=function(t,e){if(t.xn&&(r=e.x,n=t.x),this._p.x>=r&&this._p.x<=n&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,s=e.y-this._p.y,u=Gu.signOfDet2x2(i,o,a,s);if(0===u)return this._isPointOnSegment=!0,null;s0&&this._crossingCount++}},Xu.prototype.isPointInPolygon=function(){return this.getLocation()!==fu.EXTERIOR},Xu.prototype.getLocation=function(){return this._isPointOnSegment?fu.BOUNDARY:this._crossingCount%2==1?fu.INTERIOR:fu.EXTERIOR},Xu.prototype.isOnSegment=function(){return this._isPointOnSegment},Xu.prototype.interfaces_=function(){return[]},Xu.prototype.getClass=function(){return Xu},Xu.locatePointInRing=function(){if(arguments[0]instanceof lu&&gu(arguments[1],Su)){for(var t=arguments[1],e=new Xu(arguments[0]),r=new lu,n=new lu,i=1;i1||s<0||s>1)&&(i=!0)}}else i=!0;return i?mu.min(Zu.distancePointLine(t,r,n),Zu.distancePointLine(e,r,n),Zu.distancePointLine(r,t,e),Zu.distancePointLine(n,t,e)):0},Zu.isPointInRing=function(t,e){return Zu.locatePointInRing(t,e)!==fu.EXTERIOR},Zu.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,n=new lu;t.getCoordinate(0,n);for(var i=n.x,o=n.y,a=1;ar.y&&(r=o,n=i)}var a=n;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(r)&&a!==n);var s=n;do{s=(s+1)%e}while(t[s].equals2D(r)&&s!==n);var u=t[a],l=t[s];if(u.equals2D(r)||l.equals2D(r)||u.equals2D(l))return!1;var c=Zu.computeOrientation(u,r,l);return 0===c?u.x>l.x:c>0},Zu.locatePointInRing=function(t,e){return Xu.locatePointInRing(t,e)},Zu.distancePointLinePerpendicular=function(t,e,r){var n=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),i=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/n;return Math.abs(i)*Math.sqrt(n)},Zu.computeOrientation=function(t,e,r){return Zu.orientationIndex(t,e,r)},Zu.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new nu("Line array must contain at least one vertex");for(var r=t.distance(e[0]),n=0;n=1)return o.distance(s);var c=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/u;return Math.abs(c)*Math.sqrt(u)}},Zu.isOnLine=function(t,e){for(var r=new ju,n=1;n0},rl.prototype.interfaces_=function(){return[$u]},rl.prototype.getClass=function(){return rl};var nl=function(){};nl.prototype.isInBoundary=function(t){return t>1},nl.prototype.interfaces_=function(){return[$u]},nl.prototype.getClass=function(){return nl};var il=function(){};il.prototype.isInBoundary=function(t){return 1===t},il.prototype.interfaces_=function(){return[$u]},il.prototype.getClass=function(){return il};var ol=function(){};ol.prototype.add=function(){},ol.prototype.addAll=function(){},ol.prototype.isEmpty=function(){},ol.prototype.iterator=function(){},ol.prototype.size=function(){},ol.prototype.toArray=function(){},ol.prototype.remove=function(){};var al=function(t){function e(e){t.call(this),this.message=e||""}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={name:{configurable:!0}};return r.name.get=function(){return"IndexOutOfBoundsException"},Object.defineProperties(e,r),e}(Error),sl=function(){};sl.prototype.hasNext=function(){},sl.prototype.next=function(){},sl.prototype.remove=function(){};var ul=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(ol);(Ii.prototype=new Error).name="NoSuchElementException";var ll=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof ol&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,ol]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var r=this.array_[t];return this.array_[t]=e,r},e.prototype.iterator=function(){return new cl(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new al;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l=0;c--)this.add(s[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof lu){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(hy&&(_=-1);for(var v=m;v!==y;v+=_)this.add(d[v],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new lu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,r),e}(ll),pl=function(){},fl={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};fl.ForwardComparator.get=function(){return dl},fl.BidirectionalComparator.get=function(){return gl},fl.coordArrayType.get=function(){return new Array(0).fill(null)},pl.prototype.interfaces_=function(){return[]},pl.prototype.getClass=function(){return pl},pl.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},pl.ptNotInList=function(t,e){for(var r=0;r=t?e:[]},pl.indexOf=function(t,e){for(var r=0;r0)&&(e=t[r]);return e},pl.extract=function(t,e,r){e=mu.clamp(e,0,t.length);var n=(r=mu.clamp(r,-1,t.length))-e+1;r<0&&(n=0),e>=t.length&&(n=0),rn.length)return 1;if(0===r.length)return 0;var i=pl.compare(r,n);return pl.isEqualReversed(r,n)?0:i},gl.prototype.OLDcompare=function(t,e){var r=t,n=e;if(r.lengthn.length)return 1;if(0===r.length)return 0;for(var i=pl.increasingDirection(r),o=pl.increasingDirection(n),a=i>0?0:r.length-1,s=o>0?0:r.length-1,u=0;u0))return e.value;e=e.right}}return null},Di.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:xl,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var r,n,i=this.root_;do{if(r=i,(n=t.compareTo(i.key))<0)i=i.left;else{if(!(n>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:r,color:xl,getValue:function(){return this.value},getKey:function(){return this.key}};return n<0?r.left=a:r.right=a,this.fixAfterInsertion(a),this.size_++,null},Di.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(Pi(t)===Ai(Pi(Pi(t)))){var e=Li(Pi(Pi(t)));1===Ti(e)?(Mi(Pi(t),xl),Mi(e,xl),Mi(Pi(Pi(t)),1),t=Pi(Pi(t))):(t===Li(Pi(t))&&(t=Pi(t),this.rotateLeft(t)),Mi(Pi(t),xl),Mi(Pi(Pi(t)),1),this.rotateRight(Pi(Pi(t))))}else{var r=Ai(Pi(Pi(t)));1===Ti(r)?(Mi(Pi(t),xl),Mi(r,xl),Mi(Pi(Pi(t)),1),t=Pi(Pi(t))):(t===Ai(Pi(t))&&(t=Pi(t),this.rotateRight(t)),Mi(Pi(t),xl),Mi(Pi(Pi(t)),1),this.rotateLeft(Pi(Pi(t))))}this.root_.color=xl},Di.prototype.values=function(){var t=new ll,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Di.successor(e));)t.add(e.value);return t},Di.prototype.entrySet=function(){var t=new _l,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Di.successor(e));)t.add(e);return t},Di.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},Di.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},Di.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Di.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var r=t.parent,n=t;null!==r&&n===r.right;)n=r,r=r.parent;return r},Di.prototype.size=function(){return this.size_};var bl=function(){};bl.prototype.interfaces_=function(){return[]},bl.prototype.getClass=function(){return bl},Ni.prototype=new Ci,(zi.prototype=new Ni).contains=function(t){for(var e=0,r=this.array_.length;e=0;){var a=i.substring(0,o);n.add(a),o=(i=i.substring(o+r)).indexOf(e)}i.length>0&&n.add(i);for(var s=new Array(n.size()).fill(null),u=0;u0)for(var o=i;o0&&n.append(" ");for(var o=0;o0&&n.append(","),n.append(Dl.toString(t.getOrdinate(i,o)))}return n.append(")"),n.toString()}},zl.ensureValidRing=function(t,e){var r=e.size();return 0===r?e:r<=3?zl.createClosedRing(t,e,4):e.getOrdinate(0,Su.X)===e.getOrdinate(r-1,Su.X)&&e.getOrdinate(0,Su.Y)===e.getOrdinate(r-1,Su.Y)?e:zl.createClosedRing(t,e,r+1)},zl.createClosedRing=function(t,e,r){var n=t.create(r,e.getDimension()),i=e.size();zl.copy(e,0,n,0,i);for(var o=i;o0&&zl.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Il.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return Zu.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return zl.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,r=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.MINIMUM_VALID_SIZE.get=function(){return 4},r.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,r),e}(Rl),ql=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Hu.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],r=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,r)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),r=0;r0?e.createPoint(r[0]):e.createPoint():t},Zl.prototype.interfaces_=function(){return[jl.GeometryEditorOperation]},Zl.prototype.getClass=function(){return Zl};var Yl=function(){};Yl.prototype.edit=function(t,e){return t instanceof Vl?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Rl?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ol?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Yl.prototype.interfaces_=function(){return[jl.GeometryEditorOperation]},Yl.prototype.getClass=function(){return Yl};var Wl=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new _u(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(e=3),e<2?new Wl(t):new Wl(t,e)}},Kl.prototype.interfaces_=function(){return[pu,Ei]},Kl.prototype.getClass=function(){return Kl},Kl.instance=function(){return Kl.instanceObject},Jl.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Jl.instanceObject.get=function(){return new Kl},Object.defineProperties(Kl,Jl);var Ql=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new ll,e=this.map_.values(),r=e.next();!r.done;)t.add(r.value),r=e.next();return t},e.prototype.entrySet=function(){var t=new _l;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(ml),$l=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ec){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var r=arguments[0];this._modelType=t.FIXED,this.setScale(r)}else if(arguments[0]instanceof t){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}},tc={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};$l.prototype.equals=function(t){if(!(t instanceof $l))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},$l.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),n=e.getMaximumSignificantDigits();return new vu(r).compareTo(new vu(n))},$l.prototype.getScale=function(){return this._scale},$l.prototype.isFloating=function(){return this._modelType===$l.FLOATING||this._modelType===$l.FLOATING_SINGLE},$l.prototype.getType=function(){return this._modelType},$l.prototype.toString=function(){var t="UNKNOWN";return this._modelType===$l.FLOATING?t="Floating":this._modelType===$l.FLOATING_SINGLE?t="Floating-Single":this._modelType===$l.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},$l.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return iu.isNaN(t)||this._modelType===$l.FLOATING_SINGLE?t:this._modelType===$l.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof lu){var e=arguments[0];if(this._modelType===$l.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},$l.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===$l.FLOATING?t=16:this._modelType===$l.FLOATING_SINGLE?t=6:this._modelType===$l.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},$l.prototype.setScale=function(t){this._scale=Math.abs(t)},$l.prototype.interfaces_=function(){return[Ei,au]},$l.prototype.getClass=function(){return $l},$l.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},tc.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},tc.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties($l,tc);var ec=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},rc={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ec.prototype.readResolve=function(){return ec.nameToTypeMap.get(this._name)},ec.prototype.toString=function(){return this._name},ec.prototype.interfaces_=function(){return[Ei]},ec.prototype.getClass=function(){return ec},rc.serialVersionUID.get=function(){return-552860263173159e4},rc.nameToTypeMap.get=function(){return new Ql},Object.defineProperties(ec,rc),$l.Type=ec,$l.FIXED=new ec("FIXED"),$l.FLOATING=new ec("FLOATING"),$l.FLOATING_SINGLE=new ec("FLOATING SINGLE");var nc=function t(){this._precisionModel=new $l,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?gu(arguments[0],pu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof $l&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ic={serialVersionUID:{configurable:!0}};nc.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new lu(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new lu(t.getMinX(),t.getMinY()),new lu(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new lu(t.getMinX(),t.getMinY()),new lu(t.getMinX(),t.getMaxY()),new lu(t.getMaxX(),t.getMaxY()),new lu(t.getMaxX(),t.getMinY()),new lu(t.getMinX(),t.getMinY())]),null)},nc.prototype.createLineString=function(t){return t?t instanceof Array?new Rl(this.getCoordinateSequenceFactory().create(t),this):gu(t,Su)?new Rl(t,this):void 0:new Rl(this.getCoordinateSequenceFactory().create([]),this)},nc.prototype.createMultiLineString=function(){return 0===arguments.length?new Ml(null,this):1===arguments.length?new Ml(arguments[0],this):void 0},nc.prototype.buildGeometry=function(t){for(var e=null,r=!1,n=!1,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===e&&(e=a),a!==e&&(r=!0),o.isGeometryCollectionOrDerived()&&(n=!0)}if(null===e)return this.createGeometryCollection();if(r||n)return this.createGeometryCollection(nc.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Bl)return this.createMultiPolygon(nc.toPolygonArray(t));if(s instanceof Rl)return this.createMultiLineString(nc.toLineStringArray(t));if(s instanceof Ol)return this.createMultiPoint(nc.toPointArray(t));Uu.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},nc.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},nc.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof lu){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(gu(arguments[0],Su))return new Ol(arguments[0],this)}},nc.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},nc.prototype.createPolygon=function(){if(0===arguments.length)return new Bl(null,null,this);if(1===arguments.length){if(gu(arguments[0],Su)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Vl){var r=arguments[0];return this.createPolygon(r,null)}}else if(2===arguments.length)return new Bl(arguments[0],arguments[1],this)},nc.prototype.getSRID=function(){return this._SRID},nc.prototype.createGeometryCollection=function(){return 0===arguments.length?new Pl(null,this):1===arguments.length?new Pl(arguments[0],this):void 0},nc.prototype.createGeometry=function(t){return new jl(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},nc.prototype.getPrecisionModel=function(){return this._precisionModel},nc.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(gu(arguments[0],Su))return new Vl(arguments[0],this)}},nc.prototype.createMultiPolygon=function(){return 0===arguments.length?new ql(null,this):1===arguments.length?new ql(arguments[0],this):void 0},nc.prototype.createMultiPoint=function(){if(0===arguments.length)return new Ul(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new Ul(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(gu(arguments[0],Su)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(e.size()).fill(null),n=0;n=this.size())throw new Error;return this.array_[t]},Oi.prototype.push=function(t){return this.array_.push(t),t},Oi.prototype.pop=function(t){if(0===this.array_.length)throw new ki;return this.array_.pop()},Oi.prototype.peek=function(){if(0===this.array_.length)throw new ki;return this.array_[this.array_.length-1]},Oi.prototype.empty=function(){return 0===this.array_.length},Oi.prototype.isEmpty=function(){return this.empty()},Oi.prototype.search=function(t){return this.array_.indexOf(t)},Oi.prototype.size=function(){return this.array_.length},Oi.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e0&&this._minIndexthis._minCoord.y&&r.y>this._minCoord.y&&n===Zu.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},fc.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge().getCoordinates();if(e<0||e+1>=r.length)return-1;if(r[e].y===r[e+1].y)return-1;var n=hc.LEFT;return r[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=r,this._minCoord=e[r])},fc.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},fc.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.isForward()&&this.checkForRightmostCoordinate(r)}Uu.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===hc.LEFT&&(this._orientedDe=this._minDe.getSym())},fc.prototype.interfaces_=function(){return[]},fc.prototype.getClass=function(){return fc};var dc=function(t){function e(r,n){t.call(this,e.msgWithCoord(r,n)),this.pt=n?new lu(n):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Fu),gc=function(){this.array_=[]};gc.prototype.addLast=function(t){this.array_.push(t)},gc.prototype.removeFirst=function(){return this.array_.shift()},gc.prototype.isEmpty=function(){return 0===this.array_.length};var mc=function(){this._finder=null,this._dirEdgeList=new ll,this._nodes=new ll,this._rightMostCoord=null,this._env=null,this._finder=new fc};mc.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},mc.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},mc.prototype.computeNodeDepth=function(t){for(var e=null,r=t.getEdges().iterator();r.hasNext();){var n=r.next();if(n.isVisited()||n.getSym().isVisited()){e=n;break}}if(null===e)throw new dc("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},mc.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(hc.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},mc.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},mc.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(hc.RIGHT)>=1&&e.getDepth(hc.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},mc.prototype.computeDepths=function(t){var e=new _l,r=new gc,n=t.getNode();for(r.addLast(n),e.add(n),t.setVisited(!0);!r.isEmpty();){var i=r.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(r.addLast(s),e.add(s))}}}},mc.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},mc.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Lu,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next().getEdge().getCoordinates(),n=0;nthis.location.length){var e=new Array(3).fill(null);e[hc.ON]=this.location[hc.ON],e[hc.LEFT]=fu.NONE,e[hc.RIGHT]=fu.NONE,this.location=e}for(var r=0;r1&&t.append(fu.toLocationSymbol(this.location[hc.LEFT])),t.append(fu.toLocationSymbol(this.location[hc.ON])),this.location.length>1&&t.append(fu.toLocationSymbol(this.location[hc.RIGHT])),t.toString()},yc.prototype.setLocations=function(t,e,r){this.location[hc.ON]=t,this.location[hc.LEFT]=e,this.location[hc.RIGHT]=r},yc.prototype.get=function(t){return t1},yc.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},vc.prototype.addPoints=function(t,e,r){var n=t.getCoordinates();if(e){var i=1;r&&(i=0);for(var o=i;o=0;s--)this._pts.add(n[s])}},vc.prototype.isHole=function(){return this._isHole},vc.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},vc.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Zu.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();)if(r.next().containsPoint(t))return!1;return!0},vc.prototype.addHole=function(t){this._holes.add(t)},vc.prototype.isShell=function(){return null===this._shell},vc.prototype.getLabel=function(){return this._label},vc.prototype.getEdges=function(){return this._edges},vc.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},vc.prototype.getShell=function(){return this._shell},vc.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],r=arguments[0].getLocation(e,hc.RIGHT);if(r===fu.NONE)return null;if(this._label.getLocation(e)===fu.NONE)return this._label.setLocation(e,r),null}},vc.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},vc.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(t)},wc.prototype.isInResult=function(){return this._isInResult},wc.prototype.isVisited=function(){return this._isVisited},wc.prototype.interfaces_=function(){return[]},wc.prototype.getClass=function(){return wc};var Ec=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new _c(0,fu.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var r=fu.NONE;if(r=this._label.getLocation(e),!t.isNull(e)){var n=t.getLocation(e);r!==fu.BOUNDARY&&(r=n)}return r},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],r=arguments[1];null===this._label?this._label=new _c(e,r):this._label.setLocation(e,r)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof _c)for(var r=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(r,n);this._label.getLocation(n)===fu.NONE&&this._label.setLocation(n,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=fu.NONE;null!==this._label&&(e=this._label.getLocation(t));var r=null;switch(e){case fu.BOUNDARY:r=fu.INTERIOR;break;case fu.INTERIOR:default:r=fu.BOUNDARY}this._label.setLocation(t,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wc),Ic=function(){this.nodeMap=new Di,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Ic.prototype.find=function(t){return this.nodeMap.get(t)},Ic.prototype.addNode=function(){if(arguments[0]instanceof lu){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Ec){var r=arguments[0],n=this.nodeMap.get(r.getCoordinate());return null===n?(this.nodeMap.put(r.getCoordinate(),r),r):(n.mergeLabel(r),n)}},Ic.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Ic.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ic.prototype.values=function(){return this.nodeMap.values()},Ic.prototype.getBoundaryNodes=function(t){for(var e=new ll,r=this.iterator();r.hasNext();){var n=r.next();n.getLabel().getLocation(t)===fu.BOUNDARY&&e.add(n)}return e},Ic.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Ic.prototype.interfaces_=function(){return[]},Ic.prototype.getClass=function(){return Ic};var Sc=function(){},Cc={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Sc.prototype.interfaces_=function(){return[]},Sc.prototype.getClass=function(){return Sc},Sc.isNorthern=function(t){return t===Sc.NE||t===Sc.NW},Sc.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Sc.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var r=te?t:e)?3:r},Sc.isInHalfPlane=function(t,e){return e===Sc.SE?t===Sc.SE||t===Sc.SW:t===e||t===e+1},Sc.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new nu("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Sc.NE:Sc.SE:e>=0?Sc.NW:Sc.SW}if(arguments[0]instanceof lu&&arguments[1]instanceof lu){var r=arguments[0],n=arguments[1];if(n.x===r.x&&n.y===r.y)throw new nu("Cannot compute the quadrant for two identical points "+r);return n.x>=r.x?n.y>=r.y?Sc.NE:Sc.SE:n.y>=r.y?Sc.NW:Sc.SW}},Cc.NE.get=function(){return 0},Cc.NW.get=function(){return 1},Cc.SW.get=function(){return 2},Cc.SE.get=function(){return 3},Object.defineProperties(Sc,Cc);var Tc=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._edge=e,this.init(r,n),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}};Tc.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):r.addAll(a)}else n.add(o)}return n},Lc.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Lc.prototype.buildMaximalEdgeRings=function(t){for(var e=new ll,r=t.iterator();r.hasNext();){var n=r.next();if(n.isInResult()&&n.getLabel().isArea()&&null===n.getEdgeRing()){var i=new bc(n,this._geometryFactory);e.add(i),i.setInResult()}}return e},Lc.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next();n.isHole()&&n.setShell(t)}},Lc.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Lc.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),n=r.getEnvelopeInternal(),i=r.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var u=s.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(n)&&Zu.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||a.contains(c))&&(o=u)}return o},Lc.prototype.findShell=function(t){for(var e=0,r=null,n=t.iterator();n.hasNext();){var i=n.next();i.isHole()||(r=i,e++)}return Uu.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},Lc.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],r=arguments[1];Ac.linkResultDirectedEdges(r);var n=this.buildMaximalEdgeRings(e),i=new ll,o=this.buildMinimalEdgeRings(n,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Lc.prototype.interfaces_=function(){return[]},Lc.prototype.getClass=function(){return Lc};var Dc=function(){};Dc.prototype.getBounds=function(){},Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc};var Nc=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Nc.prototype.getItem=function(){return this._item},Nc.prototype.getBounds=function(){return this._bounds},Nc.prototype.interfaces_=function(){return[Dc,Ei]},Nc.prototype.getClass=function(){return Nc};var zc=function(){this._size=null,this._items=null,this._size=0,this._items=new ll,this._items.add(null)};zc.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},zc.prototype.size=function(){return this._size},zc.prototype.reorder=function(t){for(var e=null,r=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(r)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,r)},zc.prototype.clear=function(){this._size=0,this._items.clear()},zc.prototype.isEmpty=function(){return 0===this._size},zc.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},zc.prototype.interfaces_=function(){return[]},zc.prototype.getClass=function(){return zc};var Rc=function(){};Rc.prototype.visitItem=function(t){},Rc.prototype.interfaces_=function(){return[]},Rc.prototype.getClass=function(){return Rc};var kc=function(){};kc.prototype.insert=function(t,e){},kc.prototype.remove=function(t,e){},kc.prototype.query=function(){},kc.prototype.interfaces_=function(){return[]},kc.prototype.getClass=function(){return kc};var Oc=function(){if(this._childBoundables=new ll,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Fc={serialVersionUID:{configurable:!0}};Oc.prototype.getLevel=function(){return this._level},Oc.prototype.size=function(){return this._childBoundables.size()},Oc.prototype.getChildBoundables=function(){return this._childBoundables},Oc.prototype.addChildBoundable=function(t){Uu.isTrue(null===this._bounds),this._childBoundables.add(t)},Oc.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Oc.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Oc.prototype.interfaces_=function(){return[Dc,Ei]},Oc.prototype.getClass=function(){return Oc},Fc.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Oc,Fc);var Bc=function(){};Bc.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Bc.min=function(t){return Bc.sort(t),t.get(0)},Bc.sort=function(t,e){var r=t.toArray();e?El.sort(r,e):El.sort(r);for(var n=t.iterator(),i=0,o=r.length;iUc.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(n)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new nu("neither boundable is composite")},Uc.prototype.isLeaves=function(){return!(Uc.isComposite(this._boundable1)||Uc.isComposite(this._boundable2))},Uc.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},Uc.prototype.expand=function(t,e,r,n){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new Uc(o,e,this._itemDistance);a.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=r}},qc={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Vc.prototype.getNodeCapacity=function(){return this._nodeCapacity},Vc.prototype.lastNode=function(t){return t.get(t.size()-1)},Vc.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var r=e.next();r instanceof Oc?t+=this.size(r):r instanceof Nc&&(t+=1)}return t}},Vc.prototype.removeItem=function(t,e){for(var r=null,n=t.getChildBoundables().iterator();n.hasNext();){var i=n.next();i instanceof Nc&&i.getItem()===e&&(r=i)}return null!==r&&(t.getChildBoundables().remove(r),!0)},Vc.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new ll:t}if(1===arguments.length){for(var e=arguments[0],r=new ll,n=e.getChildBoundables().iterator();n.hasNext();){var i=n.next();if(i instanceof Oc){var o=this.itemsTree(i);null!==o&&r.add(o)}else i instanceof Nc?r.add(i.getItem()):Uu.shouldNeverReachHere()}return r.size()<=0?null:r}},Vc.prototype.insert=function(t,e){Uu.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Nc(t,e))},Vc.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new ll;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];if(Uu.isTrue(r>-2),n.getLevel()===r)return i.add(n),null;for(var o=n.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Oc?this.boundablesAtLevel(r,a,i):(Uu.isTrue(a instanceof Nc),-1===r&&i.add(a))}return null}},Vc.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new ll;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var r=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,n)}else if(3===arguments.length)if(gu(arguments[2],Rc)&&arguments[0]instanceof Object&&arguments[1]instanceof Oc)for(var i=arguments[0],o=arguments[2],a=arguments[1].getChildBoundables(),s=0;st&&(t=n)}}return t+1}},Vc.prototype.createParentBoundables=function(t,e){Uu.isTrue(!t.isEmpty());var r=new ll;r.add(this.createNode(e));var n=new ll(t);Bc.sort(n,this.getComparator());for(var i=n.iterator();i.hasNext();){var o=i.next();this.lastNode(r).getChildBoundables().size()===this.getNodeCapacity()&&r.add(this.createNode(e)),this.lastNode(r).addChildBoundable(o)}return r},Vc.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Vc.prototype.interfaces_=function(){return[Ei]},Vc.prototype.getClass=function(){return Vc},Vc.compareDoubles=function(t,e){return t>e?1:t0);for(var r=new ll,n=0;n0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],d=new Nc(arguments[0],arguments[1]),g=new Uc(this.getRoot(),d,f);return this.nearestNeighbour(g)[0]}},e.prototype.interfaces_=function(){return[kc,Ei]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return Zc},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[uu]},compare:function(r,n){return t.compareDoubles(e.centreX(r.getBounds()),e.centreX(n.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[uu]},compare:function(r,n){return t.compareDoubles(e.centreY(r.getBounds()),e.centreY(n.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,r),e}(Vc),Zc=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var r=e.next();null===t?t=new Lu(r.getBounds()):t.expandToInclude(r.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oc),Yc=function(){};Yc.prototype.interfaces_=function(){return[]},Yc.prototype.getClass=function(){return Yc},Yc.relativeSign=function(t,e){return te?1:0},Yc.compare=function(t,e,r){if(e.equals2D(r))return 0;var n=Yc.relativeSign(e.x,r.x),i=Yc.relativeSign(e.y,r.y);switch(t){case 0:return Yc.compareValue(n,i);case 1:return Yc.compareValue(i,n);case 2:return Yc.compareValue(i,-n);case 3:return Yc.compareValue(-n,i);case 4:return Yc.compareValue(-n,-i);case 5:return Yc.compareValue(-i,-n);case 6:return Yc.compareValue(-i,n);case 7:return Yc.compareValue(n,-i)}return Uu.shouldNeverReachHere("invalid octant value"),0},Yc.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Wc=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._segString=t,this.coord=new lu(e),this.segmentIndex=r,this._segmentOctant=n,this._isInterior=!e.equals2D(t.getCoordinate(r))};Wc.prototype.getCoordinate=function(){return this.coord},Wc.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Wc.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:Yc.compare(this._segmentOctant,this.coord,e.coord)},Wc.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},Wc.prototype.isInterior=function(){return this._isInterior},Wc.prototype.interfaces_=function(){return[au]},Wc.prototype.getClass=function(){return Wc};var Hc=function(){this._nodeMap=new Di,this._edge=null;var t=arguments[0];this._edge=t};Hc.prototype.getSplitCoordinates=function(){var t=new hl;this.addEndpoints();for(var e=this.iterator(),r=e.next();e.hasNext();){var n=e.next();this.addEdgeCoordinates(r,n,t),r=n}return t.toCoordinateArray()},Hc.prototype.addCollapsedNodes=function(){var t=new ll;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var r=e.next().intValue();this.add(this._edge.getCoordinate(r),r)}},Hc.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Hc.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?r>=n?0:1:r>=n?7:6:e>=0?r>=n?3:2:r>=n?4:5}if(arguments[0]instanceof lu&&arguments[1]instanceof lu){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new nu("Cannot compute the octant for two identical points "+i);return Kc.octant(a,s)}};var Jc=function(){};Jc.prototype.getCoordinates=function(){},Jc.prototype.size=function(){},Jc.prototype.getCoordinate=function(t){},Jc.prototype.isClosed=function(){},Jc.prototype.setData=function(t){},Jc.prototype.getData=function(){},Jc.prototype.interfaces_=function(){return[]},Jc.prototype.getClass=function(){return Jc};var Qc=function(){};Qc.prototype.addIntersection=function(t,e){},Qc.prototype.interfaces_=function(){return[Jc]},Qc.prototype.getClass=function(){return Qc};var $c=function(){this._nodeList=new Hc(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};$c.prototype.getCoordinates=function(){return this._pts},$c.prototype.size=function(){return this._pts.length},$c.prototype.getCoordinate=function(t){return this._pts[t]},$c.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},$c.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},$c.prototype.setData=function(t){this._data=t},$c.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Kc.octant(t,e)},$c.prototype.getData=function(){return this._data},$c.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var r=arguments[1],n=arguments[3],i=new lu(arguments[0].getIntersection(n));this.addIntersection(i,r)}},$c.prototype.toString=function(){return Ou.toLineString(new Wl(this._pts))},$c.prototype.getNodeList=function(){return this._nodeList},$c.prototype.addIntersectionNode=function(t,e){var r=e,n=r+1;if(n=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}if(arguments[0]instanceof lu){var n=arguments[0];return Zu.orientationIndex(this.p0,this.p1,n)}},th.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},th.prototype.isVertical=function(){return this.p0.x===this.p1.x},th.prototype.equals=function(t){if(!(t instanceof th))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},th.prototype.intersection=function(t){var e=new ju;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},th.prototype.project=function(){if(arguments[0]instanceof lu){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new lu(t);var e=this.projectionFactor(t),r=new lu;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof th){var n=arguments[0],i=this.projectionFactor(n.p0),o=this.projectionFactor(n.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(n.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(n.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new th(a,s)}},th.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},th.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},th.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},th.prototype.distancePerpendicular=function(t){return Zu.distancePointLinePerpendicular(t,this.p0,this.p1)},th.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},th.prototype.midPoint=function(){return th.midPoint(this.p0,this.p1)},th.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,n=e*e+r*r;return n<=0?iu.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/n},th.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var r=new Array(2).fill(null),n=iu.MAX_VALUE,i=null,o=this.closestPoint(t.p0);n=o.distance(t.p0),r[0]=o,r[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||iu.isNaN(e))&&(e=1),e},th.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},th.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},th.prototype.distance=function(){if(arguments[0]instanceof th){var t=arguments[0];return Zu.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof lu){var e=arguments[0];return Zu.distancePointLine(e,this.p0,this.p1)}},th.prototype.pointAlong=function(t){var e=new lu;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},th.prototype.hashCode=function(){var t=iu.doubleToLongBits(this.p0.x);t^=31*iu.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),r=iu.doubleToLongBits(this.p1.x);return r^=31*iu.doubleToLongBits(this.p1.y),e^Math.trunc(r)^Math.trunc(r>>32)},th.prototype.interfaces_=function(){return[au,Ei]},th.prototype.getClass=function(){return th},th.midPoint=function(t,e){return new lu((t.x+e.x)/2,(t.y+e.y)/2)},eh.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(th,eh);var rh=function(){this.tempEnv1=new Lu,this.tempEnv2=new Lu,this._overlapSeg1=new th,this._overlapSeg2=new th};rh.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],r=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},rh.prototype.interfaces_=function(){return[]},rh.prototype.getClass=function(){return rh};var nh=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=n};nh.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},nh.prototype.computeSelect=function(t,e,r,n){var i=this._pts[e],o=this._pts[r];if(n.tempEnv1.init(i,o),r-e==1)return n.select(this,e),null;if(!t.intersects(n.tempEnv1))return null;var a=Math.trunc((e+r)/2);e=t.length-1)return t.length-1;for(var n=Sc.quadrant(t[r],t[r+1]),i=e+1;ir.getId()&&(r.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.SegmentOverlapAction.get=function(){return uh},Object.defineProperties(e,r),e}(ah),uh=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],r=arguments[2],n=arguments[3],i=arguments[0].getContext(),o=r.getContext();this._si.processIntersections(i,e,o,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(rh),lh=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.setQuadrantSegments(r),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},ch={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};lh.prototype.getEndCapStyle=function(){return this._endCapStyle},lh.prototype.isSingleSided=function(){return this._isSingleSided},lh.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=lh.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=lh.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==lh.JOIN_ROUND&&(this._quadrantSegments=lh.DEFAULT_QUADRANT_SEGMENTS)},lh.prototype.getJoinStyle=function(){return this._joinStyle},lh.prototype.setJoinStyle=function(t){this._joinStyle=t},lh.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},lh.prototype.getSimplifyFactor=function(){return this._simplifyFactor},lh.prototype.getQuadrantSegments=function(){return this._quadrantSegments},lh.prototype.setEndCapStyle=function(t){this._endCapStyle=t},lh.prototype.getMitreLimit=function(){return this._mitreLimit},lh.prototype.setMitreLimit=function(t){this._mitreLimit=t},lh.prototype.setSingleSided=function(t){this._isSingleSided=t},lh.prototype.interfaces_=function(){return[]},lh.prototype.getClass=function(){return lh},lh.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},ch.CAP_ROUND.get=function(){return 1},ch.CAP_FLAT.get=function(){return 2},ch.CAP_SQUARE.get=function(){return 3},ch.JOIN_ROUND.get=function(){return 1},ch.JOIN_MITRE.get=function(){return 2},ch.JOIN_BEVEL.get=function(){return 3},ch.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},ch.DEFAULT_MITRE_LIMIT.get=function(){return 5},ch.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(lh,ch);var hh=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Zu.COUNTERCLOCKWISE,this._inputLine=t||null},ph={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};hh.prototype.isDeletable=function(t,e,r,n){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[r];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,n)&&this.isShallowSampled(i,o,t,r,n)},hh.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(e),n=!1;r=0;n--)this.addPt(t[n])},fh.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=gh.PI_TIMES_2;for(;t<=-Math.PI;)t+=gh.PI_TIMES_2;return t},gh.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],r=arguments[1],n=r.x-e.x,i=r.y-e.y;return Math.atan2(i,n)}},gh.isAcute=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)>0},gh.isObtuse=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)<0},gh.interiorAngle=function(t,e,r){var n=gh.angle(e,t),i=gh.angle(e,r);return Math.abs(i-n)},gh.normalizePositive=function(t){if(t<0){for(;t<0;)t+=gh.PI_TIMES_2;t>=gh.PI_TIMES_2&&(t=0)}else{for(;t>=gh.PI_TIMES_2;)t-=gh.PI_TIMES_2;t<0&&(t=0)}return t},gh.angleBetween=function(t,e,r){var n=gh.angle(e,t),i=gh.angle(e,r);return gh.diff(n,i)},gh.diff=function(t,e){var r=null;return(r=tMath.PI&&(r=2*Math.PI-r),r},gh.toRadians=function(t){return t*Math.PI/180},gh.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?gh.COUNTERCLOCKWISE:r<0?gh.CLOCKWISE:gh.NONE},gh.angleBetweenOriented=function(t,e,r){var n=gh.angle(e,t),i=gh.angle(e,r)-n;return i<=-Math.PI?i+gh.PI_TIMES_2:i>Math.PI?i-gh.PI_TIMES_2:i},mh.PI_TIMES_2.get=function(){return 2*Math.PI},mh.PI_OVER_2.get=function(){return Math.PI/2},mh.PI_OVER_4.get=function(){return Math.PI/4},mh.COUNTERCLOCKWISE.get=function(){return Zu.COUNTERCLOCKWISE},mh.CLOCKWISE.get=function(){return Zu.CLOCKWISE},mh.NONE.get=function(){return Zu.COLLINEAR},Object.defineProperties(gh,mh);var yh=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new th,this._seg1=new th,this._offset0=new th,this._offset1=new th,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=r,this._li=new ju,this._filletAngleQuantum=Math.PI/2/r.getQuadrantSegments(),r.getQuadrantSegments()>=8&&r.getJoinStyle()===lh.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},_h={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};yh.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=Zu.computeOrientation(this._s0,this._s1,this._s2),n=r===Zu.CLOCKWISE&&this._side===hc.LEFT||r===Zu.COUNTERCLOCKWISE&&this._side===hc.RIGHT;0===r?this.addCollinear(e):n?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},yh.prototype.addLineEndCap=function(t,e){var r=new th(t,e),n=new th;this.computeOffsetSegment(r,hc.LEFT,this._distance,n);var i=new th;this.computeOffsetSegment(r,hc.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case lh.CAP_ROUND:this._segList.addPt(n.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,Zu.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case lh.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(i.p1);break;case lh.CAP_SQUARE:var u=new lu;u.x=Math.abs(this._distance)*Math.cos(s),u.y=Math.abs(this._distance)*Math.sin(s);var l=new lu(n.p1.x+u.x,n.p1.y+u.y),c=new lu(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},yh.prototype.getCoordinates=function(){return this._segList.getCoordinates()},yh.prototype.addMitreJoin=function(t,e,r,n){var i=!0,o=null;try{o=Au.intersection(e.p0,e.p1,r.p0,r.p1),(n<=0?1:o.distance(t)/Math.abs(n))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof Pu))throw t;o=new lu(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,r,n,this._bufParams.getMitreLimit())},yh.prototype.addFilletCorner=function(t,e,r,n,i){var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o),u=r.x-t.x,l=r.y-t.y,c=Math.atan2(l,u);n===Zu.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,n,i),this._segList.addPt(r)},yh.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var r=new lu((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var n=new lu((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},yh.prototype.createCircle=function(t){var e=new lu(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},yh.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},yh.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new fh,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*yh.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},yh.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===lh.JOIN_BEVEL||this._bufParams.getJoinStyle()===lh.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Zu.CLOCKWISE,this._distance))},yh.prototype.closeRing=function(){this._segList.closeRing()},yh.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},yh.prototype.interfaces_=function(){return[]},yh.prototype.getClass=function(){return yh},_h.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},_h.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},_h.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},_h.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(yh,_h);var vh=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};vh.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var r=e<0,n=Math.abs(e),i=this.getSegGen(n);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,r,i);var o=i.getCoordinates();return r&&pl.reverse(o),o},vh.prototype.computeSingleSidedBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var i=hh.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],hc.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{r.addSegments(t,!1);var s=hh.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],hc.LEFT),r.addFirstSegment();for(var l=2;l<=u;l++)r.addNextSegment(s[l],!0)}r.addLastSegment(),r.closeRing()},vh.prototype.computeRingBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);e===hc.RIGHT&&(n=-n);var i=hh.simplify(t,n),o=i.length-1;r.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;r.addNextSegment(i[a],s)}r.closeRing()},vh.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),n=hh.simplify(t,r),i=n.length-1;e.initSideSegments(n[0],n[1],hc.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(n[o],!0);e.addLastSegment(),e.addLineEndCap(n[i-1],n[i]);var a=hh.simplify(t,-r),s=a.length-1;e.initSideSegments(a[s],a[s-1],hc.LEFT);for(var u=s-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},vh.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case lh.CAP_ROUND:e.createCircle(t);break;case lh.CAP_SQUARE:e.createSquare(t)}},vh.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var r=Math.abs(e),n=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],n);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,n)}else this.computeLineBufferCurve(t,n);return n.getCoordinates()},vh.prototype.getBufferParameters=function(){return this._bufParams},vh.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},vh.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return vh.copyCoordinates(t);var n=this.getSegGen(r);return this.computeRingBufferCurve(t,e,n),n.getCoordinates()},vh.prototype.computeOffsetCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){var i=hh.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],hc.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{var s=hh.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],hc.LEFT),r.addFirstSegment();for(var l=2;l<=u;l++)r.addNextSegment(s[l],!0)}r.addLastSegment()},vh.prototype.getSegGen=function(t){return new yh(this._precisionModel,this._bufParams,t)},vh.prototype.interfaces_=function(){return[]},vh.prototype.getClass=function(){return vh},vh.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;ri.getMaxY()||this.findStabbedSegments(t,n.getDirectedEdges(),e)}return e}if(3===arguments.length)if(gu(arguments[2],ul)&&arguments[0]instanceof lu&&arguments[1]instanceof Pc){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=a.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||Zu.computeOrientation(this._seg.p0,this._seg.p1,o)===Zu.RIGHT)){var c=a.getDepth(hc.LEFT);this._seg.p0.equals(u[l])||(c=a.getDepth(hc.RIGHT));var h=new wh(this._seg,c);s.add(h)}}else if(gu(arguments[2],ul)&&arguments[0]instanceof lu&&gu(arguments[1],ul))for(var p=arguments[0],f=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(p,g,f)}},xh.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Bc.min(e)._leftDepth},xh.prototype.interfaces_=function(){return[]},xh.prototype.getClass=function(){return xh},bh.DepthSegment.get=function(){return wh},Object.defineProperties(xh,bh);var wh=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new th(t),this._leftDepth=e};wh.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==r||0!=(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?r:this._upwardSeg.compareTo(e._upwardSeg)},wh.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return 0!==r?r:t.p1.compareTo(e.p1)},wh.prototype.toString=function(){return this._upwardSeg.toString()},wh.prototype.interfaces_=function(){return[au]},wh.prototype.getClass=function(){return wh};var Eh=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};Eh.prototype.area=function(){return Eh.area(this.p0,this.p1,this.p2)},Eh.prototype.signedArea=function(){return Eh.signedArea(this.p0,this.p1,this.p2)},Eh.prototype.interpolateZ=function(t){if(null===t)throw new nu("Supplied point is null.");return Eh.interpolateZ(t,this.p0,this.p1,this.p2)},Eh.prototype.longestSideLength=function(){return Eh.longestSideLength(this.p0,this.p1,this.p2)},Eh.prototype.isAcute=function(){return Eh.isAcute(this.p0,this.p1,this.p2)},Eh.prototype.circumcentre=function(){return Eh.circumcentre(this.p0,this.p1,this.p2)},Eh.prototype.area3D=function(){return Eh.area3D(this.p0,this.p1,this.p2)},Eh.prototype.centroid=function(){return Eh.centroid(this.p0,this.p1,this.p2)},Eh.prototype.inCentre=function(){return Eh.inCentre(this.p0,this.p1,this.p2)},Eh.prototype.interfaces_=function(){return[]},Eh.prototype.getClass=function(){return Eh},Eh.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},Eh.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},Eh.det=function(t,e,r,n){return t*n-e*r},Eh.interpolateZ=function(t,e,r,n){var i=e.x,o=e.y,a=r.x-i,s=n.x-i,u=r.y-o,l=n.y-o,c=a*l-s*u,h=t.x-i,p=t.y-o,f=(l*h-s*p)/c,d=(-u*h+a*p)/c;return e.z+f*(r.z-e.z)+d*(n.z-e.z)},Eh.longestSideLength=function(t,e,r){var n=t.distance(e),i=e.distance(r),o=r.distance(t),a=n;return i>a&&(a=i),o>a&&(a=o),a},Eh.isAcute=function(t,e,r){return!!gh.isAcute(t,e,r)&&!!gh.isAcute(e,r,t)&&!!gh.isAcute(r,t,e)},Eh.circumcentre=function(t,e,r){var n=r.x,i=r.y,o=t.x-n,a=t.y-i,s=e.x-n,u=e.y-i,l=2*Eh.det(o,a,s,u),c=Eh.det(a,o*o+a*a,u,s*s+u*u),h=Eh.det(o,o*o+a*a,s,s*s+u*u);return new lu(n-c/l,i+h/l)},Eh.perpendicularBisector=function(t,e){var r=e.x-t.x,n=e.y-t.y,i=new Au(t.x+r/2,t.y+n/2,1),o=new Au(t.x-n+r/2,t.y+r+n/2,1);return new Au(i,o)},Eh.angleBisector=function(t,e,r){var n=e.distance(t),i=n/(n+e.distance(r)),o=r.x-t.x,a=r.y-t.y;return new lu(t.x+i*o,t.y+i*a)},Eh.area3D=function(t,e,r){var n=e.x-t.x,i=e.y-t.y,o=e.z-t.z,a=r.x-t.x,s=r.y-t.y,u=r.z-t.z,l=i*u-o*s,c=o*a-n*u,h=n*s-i*a,p=l*l+c*c+h*h;return Math.sqrt(p)/2},Eh.centroid=function(t,e,r){var n=(t.x+e.x+r.x)/3,i=(t.y+e.y+r.y)/3;return new lu(n,i)},Eh.inCentre=function(t,e,r){var n=e.distance(r),i=t.distance(r),o=t.distance(e),a=n+i+o,s=(n*t.x+i*e.x+o*r.x)/a,u=(n*t.y+i*e.y+o*r.y)/a;return new lu(s,u)};var Ih=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ll;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};Ih.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,fu.EXTERIOR,fu.INTERIOR)},Ih.prototype.addPolygon=function(t){var e=this._distance,r=hc.LEFT;this._distance<0&&(e=-this._distance,r=hc.RIGHT);var n=t.getExteriorRing(),i=pl.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,r,fu.EXTERIOR,fu.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,e,hc.opposite(r),fu.INTERIOR,fu.EXTERIOR)}},Ih.prototype.isTriangleErodedCompletely=function(t,e){var r=new Eh(t[0],t[1],t[2]),n=r.inCentre();return Zu.distancePointLine(n,r.p0,r.p1)=Vl.MINIMUM_VALID_SIZE&&Zu.isCCW(t)&&(o=i,a=n,r=hc.opposite(r));var s=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(s,o,a)},Ih.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Bl?this.addPolygon(t):t instanceof Rl?this.addLineString(t):t instanceof Ol?this.addPoint(t):(t instanceof Ul||t instanceof Ml||t instanceof ql||t instanceof Pl)&&this.addCollection(t)},Ih.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(4===r.length)return this.isTriangleErodedCompletely(r,e);var n=t.getEnvelopeInternal(),i=Math.min(n.getHeight(),n.getWidth());return e<0&&2*Math.abs(e)>i},Ih.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new Ii;var t=this._parent.getGeometryN(this._index++);return t instanceof Pl?(this._subcollectionIterator=new Ch(t),this._subcollectionIterator.next()):t},Ch.prototype.remove=function(){throw new Error(this.getClass().getName())},Ch.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Ch.prototype.interfaces_=function(){return[sl]},Ch.prototype.getClass=function(){return Ch},Ch.isAtomic=function(t){return!(t instanceof Pl)};var Th=function(){this._geom=null;var t=arguments[0];this._geom=t};Th.prototype.locate=function(t){return Th.locate(t,this._geom)},Th.prototype.interfaces_=function(){return[Sh]},Th.prototype.getClass=function(){return Th},Th.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Zu.isPointInRing(t,e.getCoordinates())},Th.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Th.isPointInRing(t,r))return!1;for(var n=0;n=0;r--){var n=this._edgeList.get(r),i=n.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=n}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),r=t.getDepth(hc.LEFT),n=t.getDepth(hc.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),r);if(this.computeDepths(0,e,i)!==n)throw new dc("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],a=arguments[2],s=arguments[0];s=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),n){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;r=a,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;r.setNextMin(o),n=this._SCANNING_FOR_INCOMING}}n===this._LINKING_TO_OUTGOING&&(Uu.isTrue(null!==e,"found null for first outgoing dirEdge"),Uu.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),r.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var r=arguments[0],n=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===r&&n++;return n}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=fu.NONE,e=this.iterator();e.hasNext();){var r=e.next(),n=r.getSym();if(!r.isLineEdge()){if(r.isInResult()){t=fu.INTERIOR;break}if(n.isInResult()){t=fu.EXTERIOR;break}}}if(t===fu.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===fu.INTERIOR):(a.isInResult()&&(i=fu.EXTERIOR),s.isInResult()&&(i=fu.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new _c(fu.NONE);for(var r=this.iterator();r.hasNext();)for(var n=r.next().getEdge().getLabel(),i=0;i<2;i++){var o=n.getLocation(i);o!==fu.INTERIOR&&o!==fu.BOUNDARY||this._label.setLocation(i,fu.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ph),Ah=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Ec(t,new Mh)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Mc),Lh=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Lh.prototype.compareTo=function(t){var e=t;return Lh.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Lh.prototype.interfaces_=function(){return[au]},Lh.prototype.getClass=function(){return Lh},Lh.orientation=function(t){return 1===pl.increasingDirection(t)},Lh.compareOriented=function(t,e,r,n){for(var i=e?1:-1,o=n?1:-1,a=e?t.length:-1,s=n?r.length:-1,u=e?0:t.length-1,l=n?0:r.length-1;;){var c=t[u].compareTo(r[l]);if(0!==c)return c;var h=(u+=i)===a,p=(l+=o)===s;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Dh=function(){this._edges=new ll,this._ocaMap=new Di};Dh.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var n=r.getCoordinates(),i=0;i0&&t.print(","),t.print(n[i].x+" "+n[i].y);t.println(")")}t.print(") ")},Dh.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Dh.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(n);i||r--;var o=new Array(r).fill(null),a=0;o[a++]=new lu(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new Vh(o,new _c(this.edge._label))},kh.prototype.add=function(t,e,r){var n=new Rh(t,e,r),i=this._nodeMap.get(n);return null!==i?i:(this._nodeMap.put(n,n),n)},kh.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},kh.prototype.interfaces_=function(){return[]},kh.prototype.getClass=function(){return kh};var Oh=function(){};Oh.prototype.getChainStartIndices=function(t){var e=0,r=new ll;r.add(new vu(e));do{var n=this.findChainEnd(t,e);r.add(new vu(n)),e=n}while(er?e:r},Fh.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return ee&&(n=1),this._depth[t][r]=n}}},Bh.prototype.getDelta=function(t){return this._depth[t][hc.RIGHT]-this._depth[t][hc.LEFT]},Bh.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?fu.EXTERIOR:fu.INTERIOR},Bh.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Bh.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var r=1;r<3;r++){var n=t.getLocation(e,r);n!==fu.EXTERIOR&&n!==fu.INTERIOR||(this.isNull(e,r)?this._depth[e][r]=Bh.depthAtLocation(n):this._depth[e][r]+=Bh.depthAtLocation(n))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===fu.INTERIOR&&this._depth[i][o]++}},Bh.prototype.interfaces_=function(){return[]},Bh.prototype.getClass=function(){return Bh},Bh.depthAtLocation=function(t){return t===fu.EXTERIOR?0:t===fu.INTERIOR?1:Bh.NULL_VALUE},Uh.NULL_VALUE.get=function(){return-1},Object.defineProperties(Bh,Uh);var Vh=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new kh(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Bh,this._depthDelta=0,1===arguments.length){var r=arguments[0];e.call(this,r,null)}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,_c.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;if(this.pts.length!==r.pts.length)return!1;for(var n=!0,i=!0,o=this.pts.length,a=0;a0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Fh(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Lu;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;en||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return Uu.isTrue(!(a&&s),"Found bad envelope test"),s},Zh.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new lu(this._maxx,this._maxy),this._corner[1]=new lu(this._minx,this._maxy),this._corner[2]=new lu(this._minx,this._miny),this._corner[3]=new lu(this._maxx,this._miny)},Zh.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Zh.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Zh.prototype.getCoordinate=function(){return this._originalPt},Zh.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Zh.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=Zh.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Lu(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Zh.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},Zh.prototype.intersectsToleranceSquare=function(t,e){var r=!1,n=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||r&&n||t.equals(this._pt)||e.equals(this._pt)))))},Zh.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),n=t.getCoordinate(e+1);return!!this.intersects(r,n)&&(t.addIntersection(this.getCoordinate(),e),!0)},Zh.prototype.interfaces_=function(){return[]},Zh.prototype.getClass=function(){return Zh},Yh.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(Zh,Yh);var Wh=function(){this.tempEnv1=new Lu,this.selectedSegment=new th};Wh.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},Wh.prototype.interfaces_=function(){return[]},Wh.prototype.getClass=function(){return Wh};var Hh=function(){this._index=null;var t=arguments[0];this._index=t},Kh={HotPixelSnapAction:{configurable:!0}};Hh.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2],i=e.getSafeEnvelope(),o=new Jh(e,r,n);return this._index.query(i,{interfaces_:function(){return[Rc]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},Hh.prototype.interfaces_=function(){return[]},Hh.prototype.getClass=function(){return Hh},Kh.HotPixelSnapAction.get=function(){return Jh},Object.defineProperties(Hh,Kh);var Jh=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],r=arguments[0].getContext();if(null!==this._parentEdge&&r===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wh),Qh=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new ll};Qh.prototype.processIntersections=function(t,e,r,n){if(t===r&&e===n)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof dc))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var r=arguments[0],n=tp.precisionScaleFactor(this._argGeom,this._distance,r),i=new $l(n);this.bufferFixedPrecision(i)}},tp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===$l.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},tp.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},tp.prototype.bufferOriginalPrecision=function(){try{var t=new qh(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Fu))throw t;this._saveException=t}},tp.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},tp.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},tp.prototype.interfaces_=function(){return[]},tp.prototype.getClass=function(){return tp},tp.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new tp(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Hu&&"number"==typeof arguments[1]){var e=arguments[1],r=arguments[2],n=new tp(arguments[0]);return n.setQuadrantSegments(r),n.getResultGeometry(e)}if(arguments[2]instanceof lh&&arguments[0]instanceof Hu&&"number"==typeof arguments[1]){var i=arguments[1];return new tp(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],a=arguments[2],s=arguments[3],u=new tp(arguments[0]);return u.setQuadrantSegments(a),u.setEndCapStyle(s),u.getResultGeometry(o)}},tp.precisionScaleFactor=function(t,e,r){var n=t.getEnvelopeInternal(),i=mu.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY()))+2*(e>0?e:0),o=r-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},ep.CAP_ROUND.get=function(){return lh.CAP_ROUND},ep.CAP_BUTT.get=function(){return lh.CAP_FLAT},ep.CAP_FLAT.get=function(){return lh.CAP_FLAT},ep.CAP_SQUARE.get=function(){return lh.CAP_SQUARE},ep.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(tp,ep);var rp=function(){this._pt=[new lu,new lu],this._distance=iu.NaN,this._isNull=!0};rp.prototype.getCoordinates=function(){return this._pt},rp.prototype.getCoordinate=function(t){return this._pt[t]},rp.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var n=e.distance(r);nthis._distance&&this.initialize(e,r,n)}},rp.prototype.interfaces_=function(){return[]},rp.prototype.getClass=function(){return rp};var np=function(){};np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np},np.computeDistance=function(){if(arguments[2]instanceof rp&&arguments[0]instanceof Rl&&arguments[1]instanceof lu)for(var t=arguments[1],e=arguments[2],r=arguments[0].getCoordinates(),n=new th,i=0;i0||this._isIn?fu.INTERIOR:fu.EXTERIOR)},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp};var hp=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._component=e,this._segIndex=r,this._pt=n}},pp={INSIDE_AREA:{configurable:!0}};hp.prototype.isInsideArea=function(){return this._segIndex===hp.INSIDE_AREA},hp.prototype.getCoordinate=function(){return this._pt},hp.prototype.getGeometryComponent=function(){return this._component},hp.prototype.getSegmentIndex=function(){return this._segIndex},hp.prototype.interfaces_=function(){return[]},hp.prototype.getClass=function(){return hp},pp.INSIDE_AREA.get=function(){return-1},Object.defineProperties(hp,pp);var fp=function(t){this._pts=t||null};fp.prototype.filter=function(t){t instanceof Ol&&this._pts.add(t)},fp.prototype.interfaces_=function(){return[Cl]},fp.prototype.getClass=function(){return fp},fp.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Ol?Bc.singletonList(t):fp.getPoints(t,new ll)}if(2===arguments.length){var e=arguments[0],r=arguments[1];return e instanceof Ol?r.add(e):e instanceof Pl&&e.apply(new fp(r)),r}};var dp=function(){this._locations=null;var t=arguments[0];this._locations=t};dp.prototype.filter=function(t){(t instanceof Ol||t instanceof Rl||t instanceof Bl)&&this._locations.add(new hp(t,0,t.getCoordinate()))},dp.prototype.interfaces_=function(){return[Cl]},dp.prototype.getClass=function(){return dp},dp.getLocations=function(t){var e=new ll;return t.apply(new dp(e)),e};var gp=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new cp,this._minDistanceLocation=null,this._minDistance=iu.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=n,this._terminateDistance=i}};gp.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=1-e,i=up.getPolygons(this._geom[e]);if(i.size()>0){var o=dp.getLocations(this._geom[n]);if(this.computeContainmentDistance(o,i,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=r[0],this._minDistanceLocation[e]=r[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&gu(arguments[0],ul)&&gu(arguments[1],ul)){for(var a=arguments[0],s=arguments[1],u=arguments[2],l=0;lthis._minDistance)return null;for(var n=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var h=u.getCoordinates(),p=l.getCoordinates(),f=0;fthis._distance&&this.initialize(e,r,n)}},mp.prototype.interfaces_=function(){return[]},mp.prototype.getClass=function(){return mp};var yp=function(){};yp.prototype.interfaces_=function(){return[]},yp.prototype.getClass=function(){return yp},yp.computeDistance=function(){if(arguments[2]instanceof mp&&arguments[0]instanceof Rl&&arguments[1]instanceof lu)for(var t=arguments[0],e=arguments[1],r=arguments[2],n=new th,i=t.getCoordinates(),o=0;o1||t<=0)throw new nu("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},_p.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},_p.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},_p.prototype.computeOrientedDistance=function(t,e,r){var n=new xp(e);if(t.apply(n),r.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var i=new bp(e,this._densifyFrac);t.apply(i),r.setMaximum(i.getMaxPointDistance())}},_p.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},_p.prototype.interfaces_=function(){return[]},_p.prototype.getClass=function(){return _p},_p.distance=function(){if(2===arguments.length)return new _p(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new _p(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},vp.MaxPointDistanceFilter.get=function(){return xp},vp.MaxDensifiedByFractionDistanceFilter.get=function(){return bp},Object.defineProperties(_p,vp);var xp=function(){this._maxPtDist=new mp,this._minPtDist=new mp,this._euclideanDist=new yp,this._geom=null;var t=arguments[0];this._geom=t};xp.prototype.filter=function(t){this._minPtDist.initialize(),yp.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xp.prototype.getMaxPointDistance=function(){return this._maxPtDist},xp.prototype.interfaces_=function(){return[Qu]},xp.prototype.getClass=function(){return xp};var bp=function(){this._maxPtDist=new mp,this._minPtDist=new mp,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};bp.prototype.filter=function(t,e){if(0===e)return null;for(var r=t.getCoordinate(e-1),n=t.getCoordinate(e),i=(n.x-r.x)/this._numSubSegs,o=(n.y-r.y)/this._numSubSegs,a=0;ar){this._isValid=!1;var i=n.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ou.toLineString(i[0],i[1])+")"}},wp.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=wp.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),wp.VERBOSE&&Mu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},wp.prototype.checkNegativeValid=function(){if(!(this._input instanceof Bl||this._input instanceof ql||this._input instanceof Pl))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},wp.prototype.getErrorIndicator=function(){return this._errorIndicator},wp.prototype.checkMinimumDistance=function(t,e,r){var n=new gp(t,e,r);if(this._minDistanceFound=n.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Ip.prototype.report=function(t){if(!Ip.VERBOSE)return null;Mu.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ip.prototype.getErrorMessage=function(){return this._errorMsg},Ip.prototype.interfaces_=function(){return[]},Ip.prototype.getClass=function(){return Ip},Ip.isValidMsg=function(t,e,r){var n=new Ip(t,e,r);return n.isValid()?null:n.getErrorMessage()},Ip.isValid=function(t,e,r){return!!new Ip(t,e,r).isValid()},Sp.VERBOSE.get=function(){return!1},Sp.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Ip,Sp);var Cp=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Cp.prototype.getCoordinates=function(){return this._pts},Cp.prototype.size=function(){return this._pts.length},Cp.prototype.getCoordinate=function(t){return this._pts[t]},Cp.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Cp.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Kc.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Cp.prototype.setData=function(t){this._data=t},Cp.prototype.getData=function(){return this._data},Cp.prototype.toString=function(){return Ou.toLineString(new Wl(this._pts))},Cp.prototype.interfaces_=function(){return[Jc]},Cp.prototype.getClass=function(){return Cp};var Tp=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new ll,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Tp.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Tp.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Tp.prototype.getIntersectionSegments=function(){return this._intSegments},Tp.prototype.count=function(){return this._intersectionCount},Tp.prototype.getIntersections=function(){return this._intersections},Tp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Tp.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Tp.prototype.processIntersections=function(t,e,r,n){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===r&&e===n)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(r,n))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Tp.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Tp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Tp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Tp.prototype.interfaces_=function(){return[Nh]},Tp.prototype.getClass=function(){return Tp},Tp.createAllIntersectionsFinder=function(t){var e=new Tp(t);return e.setFindAllIntersections(!0),e},Tp.createAnyIntersectionFinder=function(t){return new Tp(t)},Tp.createIntersectionCounter=function(t){var e=new Tp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Pp=function(){this._li=new ju,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Pp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Pp.prototype.getIntersections=function(){return this._segInt.getIntersections()},Pp.prototype.isValid=function(){return this.execute(),this._isValid},Pp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Pp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Tp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new sh;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Pp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new dc(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Pp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ou.toLineString(t[0],t[1])+" and "+Ou.toLineString(t[2],t[3])},Pp.prototype.interfaces_=function(){return[]},Pp.prototype.getClass=function(){return Pp},Pp.computeIntersections=function(t){var e=new Pp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Mp=function t(){this._nv=null;var e=arguments[0];this._nv=new Pp(t.toSegmentStrings(e))};Mp.prototype.checkValid=function(){this._nv.checkValid()},Mp.prototype.interfaces_=function(){return[]},Mp.prototype.getClass=function(){return Mp},Mp.toSegmentStrings=function(t){for(var e=new ll,r=t.iterator();r.hasNext();){var n=r.next();e.add(new Cp(n.getCoordinates(),n))}return e},Mp.checkValid=function(t){new Mp(t).checkValid()};var Ap=function(t){this._mapOp=t};Ap.prototype.map=function(t){for(var e=new ll,r=0;r0&&n<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},Np.prototype.interfaces_=function(){return[]},Np.prototype.getClass=function(){return Np};var zp=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new th,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Rl&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],n=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=n}};zp.prototype.snapVertices=function(t,e){for(var r=this._isClosed?t.size()-1:t.size(),n=0;n=0&&t.add(o+1,new lu(i),!1)}},zp.prototype.findSegmentIndexToSnap=function(t,e){for(var r=iu.MAX_VALUE,n=-1,i=0;ie&&(e=n)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Rp.computeOverlaySnapTolerance(i),Rp.computeOverlaySnapTolerance(o))}},Rp.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Rp.SNAP_PRECISION_FACTOR},Rp.snapToSelf=function(t,e,r){return new Rp(t).snapToSelf(e,r)},kp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Rp,kp);var Op=function(t){function e(e,r,n){t.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=void 0!==n&&n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var r=new zp(t,this._snapTolerance);return r.setAllowSnappingToSourceVertices(this._isSelfSnap),r.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var r=t.toCoordinateArray(),n=this.snapLine(r,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Np),Fp=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Fp.prototype.getCommon=function(){return iu.longBitsToDouble(this._commonBits)},Fp.prototype.add=function(t){var e=iu.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Fp.signExpBits(this._commonBits),this._isFirst=!1,null):Fp.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Fp.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Fp.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Fp.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=iu.longBitsToDouble(t),r="0000000000000000000000000000000000000000000000000000000000000000"+iu.toBinaryString(t),n=r.substring(r.length-64);return n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]"}},Fp.prototype.interfaces_=function(){return[]},Fp.prototype.getClass=function(){return Fp},Fp.getBit=function(t,e){return 0!=(t&1<>52},Fp.zeroLowerBits=function(t,e){return t&~((1<=0;n--){if(Fp.getBit(t,n)!==Fp.getBit(e,n))return r;r++}return 52};var Bp=function(){this._commonCoord=null,this._ccFilter=new Vp},Up={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Bp.prototype.addCommonBits=function(t){var e=new qp(this._commonCoord);t.apply(e),t.geometryChanged()},Bp.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new lu(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new qp(e);return t.apply(r),t.geometryChanged(),t},Bp.prototype.getCommonCoordinate=function(){return this._commonCoord},Bp.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Bp.prototype.interfaces_=function(){return[]},Bp.prototype.getClass=function(){return Bp},Up.CommonCoordinateFilter.get=function(){return Vp},Up.Translater.get=function(){return qp},Object.defineProperties(Bp,Up);var Vp=function(){this._commonBitsX=new Fp,this._commonBitsY=new Fp};Vp.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Vp.prototype.getCommonCoordinate=function(){return new lu(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Vp.prototype.interfaces_=function(){return[Qu]},Vp.prototype.getClass=function(){return Vp};var qp=function(){this.trans=null;var t=arguments[0];this.trans=t};qp.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,n=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,n)},qp.prototype.isDone=function(){return!1},qp.prototype.isGeometryChanged=function(){return!0},qp.prototype.interfaces_=function(){return[Tl]},qp.prototype.getClass=function(){return qp};var jp=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};jp.prototype.selfSnap=function(t){return new Rp(t).snapTo(t,this._snapTolerance)},jp.prototype.removeCommonBits=function(t){this._cbr=new Bp,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},jp.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},jp.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=pf.overlayOp(e[0],e[1],t);return this.prepareResult(r)},jp.prototype.checkValid=function(t){t.isValid()||Mu.out.println("Snapped geometry is invalid")},jp.prototype.computeSnapTolerance=function(){this._snapTolerance=Rp.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},jp.prototype.snap=function(t){var e=this.removeCommonBits(t);return Rp.snap(e[0],e[1],this._snapTolerance)},jp.prototype.interfaces_=function(){return[]},jp.prototype.getClass=function(){return jp},jp.overlayOp=function(t,e,r){return new jp(t,e).getResultGeometry(r)},jp.union=function(t,e){return jp.overlayOp(t,e,pf.UNION)},jp.intersection=function(t,e){return jp.overlayOp(t,e,pf.INTERSECTION)},jp.symDifference=function(t,e){return jp.overlayOp(t,e,pf.SYMDIFFERENCE)},jp.difference=function(t,e){return jp.overlayOp(t,e,pf.DIFFERENCE)};var Gp=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Gp.prototype.getResultGeometry=function(t){var e=null,r=!1,n=null;try{e=pf.overlayOp(this._geom[0],this._geom[1],t),r=!0}catch(t){if(!(t instanceof Fu))throw t;n=t}if(!r)try{e=jp.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Fu?n:t}return e},Gp.prototype.interfaces_=function(){return[]},Gp.prototype.getClass=function(){return Gp},Gp.overlayOp=function(t,e,r){return new Gp(t,e).getResultGeometry(r)},Gp.union=function(t,e){return Gp.overlayOp(t,e,pf.UNION)},Gp.intersection=function(t,e){return Gp.overlayOp(t,e,pf.INTERSECTION)},Gp.symDifference=function(t,e){return Gp.overlayOp(t,e,pf.SYMDIFFERENCE)},Gp.difference=function(t,e){return Gp.overlayOp(t,e,pf.DIFFERENCE)};var Xp=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Xp.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Xp.prototype.interfaces_=function(){return[]},Xp.prototype.getClass=function(){return Xp};var Zp=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],r=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=r}else if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=n,this._xValue=i,this._obj=o}},Yp={INSERT:{configurable:!0},DELETE:{configurable:!0}};Zp.prototype.isDelete=function(){return this._eventType===Zp.DELETE},Zp.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Zp.prototype.getObject=function(){return this._obj},Zp.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},Zp.prototype.getInsertEvent=function(){return this._insertEvent},Zp.prototype.isInsert=function(){return this._eventType===Zp.INSERT},Zp.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},Zp.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Zp.prototype.interfaces_=function(){return[au]},Zp.prototype.getClass=function(){return Zp},Yp.INSERT.get=function(){return 1},Yp.DELETE.get=function(){return 2},Object.defineProperties(Zp,Yp);var Wp=function(){};Wp.prototype.interfaces_=function(){return[]},Wp.prototype.getClass=function(){return Wp};var Hp=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};Hp.prototype.isTrivialIntersection=function(t,e,r,n){if(t===r&&1===this._li.getIntersectionNum()){if(Hp.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&n===i||0===n&&e===i)return!0}}return!1},Hp.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Hp.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Hp.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Hp.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next().getCoordinate();if(t.isIntersection(n))return!0}return!1},Hp.prototype.hasProperIntersection=function(){return this._hasProper},Hp.prototype.hasIntersection=function(){return this._hasIntersection},Hp.prototype.isDone=function(){return this._isDone},Hp.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},Hp.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Hp.prototype.addIntersections=function(t,e,r,n){if(t===r&&e===n)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,n)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),r.addIntersections(this._li,n,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Hp.prototype.interfaces_=function(){return[]},Hp.prototype.getClass=function(){return Hp},Hp.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Kp=function(t){function e(){t.call(this),this.events=new ll,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Bc.sort(this.events);for(var t=0;te||this._maxo?1:0},$p.prototype.interfaces_=function(){return[uu]},$p.prototype.getClass=function(){return $p};var tf=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],r=arguments[1],n=arguments[2];this._min=e,this._max=r,this._item=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;r.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Jp),ef=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,r),null!==this._node2&&this._node2.query(t,e,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Jp),rf=function(){this._leaves=new ll,this._root=null,this._level=0};rf.prototype.buildTree=function(){Bc.sort(this._leaves,new Jp.NodeComparator);for(var t=this._leaves,e=null,r=new ll;;){if(this.buildLevel(t,r),1===r.size())return r.get(0);e=t,t=r,r=e}},rf.prototype.insert=function(t,e,r){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new tf(t,e,r))},rf.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},rf.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},rf.prototype.printNode=function(t){Mu.out.println(Ou.toLineString(new lu(t._min,this._level),new lu(t._max,this._level)))},rf.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},rf.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),r=0,n=t.iterator();n.hasNext();){var i=n.next();e[r++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,r){if(this.isBoundaryNode(t,e))return null;r===fu.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,r)},e.prototype.addPolygonRing=function(t,e,r){if(t.isEmpty())return null;var n=pl.removeRepeatedPoints(t.getCoordinates());if(n.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var i=e,o=r;Zu.isCCW(n)&&(i=r,o=e);var a=new Vh(n,new _c(this._argIndex,fu.BOUNDARY,i,o));this._lineEdgeMap.put(t,a),this.insertEdge(a),this.insertPoint(this._argIndex,n[0],fu.BOUNDARY)},e.prototype.insertPoint=function(t,e,r){var n=this._nodes.addNode(e),i=n.getLabel();null===i?n._label=new _c(t,r):i.setLocation(t,r)},e.prototype.createEdgeSetIntersector=function(){return new Kp},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var r=e.next(),n=r.getLabel().getLocation(t),i=r.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,n)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ql&&(this._useBoundaryDeterminationRule=!1),e instanceof Bl)this.addPolygon(e);else if(e instanceof Rl)this.addLineString(e);else if(e instanceof Ol)this.addPoint(e);else if(e instanceof Ul)this.addCollection(e);else if(e instanceof Ml)this.addCollection(e);else if(e instanceof ql)this.addCollection(e);else{if(!(e instanceof Pl))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new of(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?fu.BOUNDARY:fu.INTERIOR},e}(Ac),cf=function(){if(this._li=new ju,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new lf(0,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=$u.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new lf(0,e,n),this._arg[1]=new lf(1,r,n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new lf(0,i,a),this._arg[1]=new lf(1,o,a)}};cf.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},cf.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},cf.prototype.interfaces_=function(){return[]},cf.prototype.getClass=function(){return cf};var hf=function(){};hf.prototype.interfaces_=function(){return[]},hf.prototype.getClass=function(){return hf},hf.map=function(){if(arguments[0]instanceof Hu&&gu(arguments[1],hf.MapOp)){for(var t=arguments[0],e=arguments[1],r=new ll,n=0;n=t.size()?null:t.get(e)},vf.union=function(t){return new vf(t).union()},xf.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(vf,xf);var bf=function(){};bf.prototype.interfaces_=function(){return[]},bf.prototype.getClass=function(){return bf},bf.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return pf.createEmptyResult(pf.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Gp.overlayOp(t,e,pf.UNION)};var wf=function(){return new Bi};Bi.prototype={constructor:Bi,reset:function(){this.s=this.t=0},add:function(t){Ui(Ef,t,this.t),Ui(this,Ef.s,this.s),this.s?this.t+=Ef.t:this.s=Ef.t},valueOf:function(){return this.s}};var Ef=new Bi,If=1e-6,Sf=Math.PI,Cf=Sf/2,Tf=Sf/4,Pf=2*Sf,Mf=180/Sf,Af=Sf/180,Lf=Math.abs,Df=Math.atan,Nf=Math.atan2,zf=Math.cos,Rf=Math.exp,kf=Math.log,Of=Math.sin,Ff=Math.sqrt,Bf=Math.tan,Uf={Feature:function(t,e){ji(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}},Xf=function(t,e,r,n,i,o){var a,s=t[0],u=t[1],l=0,c=1,h=e[0]-s,p=e[1]-u;if(a=r-s,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=p,p<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,p||!(a<0)){if(a/=p,p<0){if(a>c)return;a>l&&(l=a)}else if(p>0){if(a0&&(t[0]=s+l*h,t[1]=u+l*p),c<1&&(e[0]=s+c*h,e[1]=u+c*p),!0}}}}},Zf=function(t,e){return Lf(t[0]-e[0])=0;--o)i.point((c=l[o])[0],c[1]);else n(p.x,p.p.x,-1,i);p=p.p}l=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}},Wf=function(t,e){return te?1:t>=e?0:NaN},Hf=(function(t){1===t.length&&(t=function(t){return function(e,r){return Wf(t(e),r)}}(t))}(Wf),function(t){for(var e,r,n,i=t.length,o=-1,a=0;++o=0;)for(e=(n=t[i]).length;--e>=0;)r[--a]=n[e];return r}),Kf=1e9,Jf=-Kf,Qf=wf(),$f=(wf(),function(t){return t}),td=(wf(),wf(),1/0),ed=td,rd=-td,nd=rd,id={point:function(t,e){trd&&(rd=t),end&&(nd=e)},lineStart:qi,lineEnd:qi,polygonStart:qi,polygonEnd:qi,result:function(){var t=[[td,ed],[rd,nd]];return rd=nd=-(ed=td=1/0),t}},od=(wf(),function(t,e,r,n){return function(i,o){function a(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function s(t,e){var r=i(t,e);m.point(r[0],r[1])}function u(){b.point=s,m.lineStart()}function l(){b.point=a,m.lineEnd()}function c(t,e){g.push([t,e]);var r=i(t,e);v.point(r[0],r[1])}function h(){v.lineStart(),g=[]}function p(){c(g[0][0],g[0][1]),v.lineEnd();var t,e,r,n,i=v.clean(),a=_.result(),s=a.length;if(g.pop(),f.push(g),g=null,s)if(1&i){if((e=(r=a[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t1&&2&i&&a.push(a.pop().concat(a.shift())),d.push(a.filter(uo))}var f,d,g,m=e(o),y=i.invert(n[0],n[1]),_=Gf(),v=e(_),x=!1,b={point:a,lineStart:u,lineEnd:l,polygonStart:function(){b.point=c,b.lineStart=h,b.lineEnd=p,d=[],f=[]},polygonEnd:function(){b.point=a,b.lineStart=u,b.lineEnd=l,d=Hf(d);var t=function(t,e){var r=e[0],n=e[1],i=[Of(r),-zf(r),0],o=0,a=0;Qf.reset();for(var s=0,u=t.length;s=0?1:-1,I=E*w,S=I>Sf,C=d*x;if(Qf.add(Nf(C*E*Of(I),g*b+C*zf(I))),o+=S?w+E*Pf:w,S^p>=r^_>=r){var T=Hi(Yi(h),Yi(y));Qi(T);var P=Hi(i,T);Qi(P);var M=(S^w>=0?-1:1)*Vi(P[2]);(n>M||n===M&&(T[0]||T[1]))&&(a+=S^w>=0?1:-1)}}return(o<-If||o0?Sf:-Sf,u=Lf(o-r);Lf(u-Sf)0?Cf:-Cf),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),e=0):i!==s&&u>=Sf&&(Lf(r-i)If?Df((Of(e)*(o=zf(n))*Of(r)-Of(n)*(i=zf(e))*Of(t))/(i*o*a)):(e+n)/2}(r,n,o,a),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=o,n=a),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*Cf,n.point(-Sf,i),n.point(0,i),n.point(Sf,i),n.point(Sf,0),n.point(Sf,-i),n.point(0,-i),n.point(-Sf,-i),n.point(-Sf,0),n.point(-Sf,i);else if(Lf(t[0]-e[0])>If){var o=t[0]o}function n(t,e,r){var n=[1,0,0],i=Hi(Yi(t),Yi(e)),a=Wi(i,i),s=i[0],u=a-s*s;if(!u)return!r&&t;var l=o*a/u,c=-o*s/u,h=Hi(n,i),p=Ji(n,l);Ki(p,Ji(i,c));var f=h,d=Wi(p,f),g=Wi(f,f),m=d*d-g*(Wi(p,p)-1);if(!(m<0)){var y=Ff(m),_=Ji(f,(-d-y)/g);if(Ki(_,p),_=Zi(_),!r)return _;var v,x=t[0],b=e[0],w=t[1],E=e[1];b0^_[1]<(Lf(_[0]-x)Sf^(x<=_[0]&&_[0]<=b)){var C=Ji(f,(-d+y)/g);return Ki(C,p),[_,Zi(C)]}}}function i(e,r){var n=a?t:Sf-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var o=zf(t),a=o>0,s=Lf(o)>If;return od(r,(function(t){var e,o,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,p){var f,d=[h,p],g=r(h,p),m=a?g?0:i(h,p):g?i(h+(h<0?Sf:-Sf),p):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(f=n(e,d))||Zf(e,f)||Zf(d,f))&&(d[0]+=If,d[1]+=If,g=r(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),f=n(d,e),t.point(f[0],f[1])):(f=n(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(s&&e&&a^g){var y;m&o||!(y=n(d,e,!0))||(c=0,a?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Zf(e,d)||t.point(d[0],d[1]),e=d,u=g,o=m},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(r,n,i,o){!function(t,e,r,n,i,o){if(r){var a=zf(e),s=Of(e),u=n*r;null==i?(i=e+n*Pf,o=e-u/2):(i=io(a,i),o=io(a,o),(n>0?io)&&(i+=n*Pf));for(var l,c=i;n>0?c>o:c4*e&&g--){var x=a+p,b=s+f,w=u+d,E=Ff(x*x+b*b+w*w),I=Vi(w/=E),S=Lf(Lf(w)-1)e||Lf((y*M+_*A)/v-.5)>.3||a*p+s*f+u*d2?t[2]*Af:0),e.invert=function(e){return(e=t.invert(e[0]*Af,e[1]*Af))[0]*=Mf,e[1]*=Mf,e},e}(o.rotate()).invert([0,0]));return l(null==c?[[a[0]-e,a[1]-e],[a[0]+e,a[1]+e]]:t===fo?[[Math.max(a[0]-e,c),r],[Math.min(a[0]+e,n),i]]:[[c,Math.max(a[1]-e,r)],[n,Math.min(a[1]+e,i)]])}var r,n,i,o=function(t){return function(t){function e(t){return[(t=l(t[0]*Af,t[1]*Af))[0]*g+a,s-t[1]*g]}function r(t,e){return[(t=o(t,e))[0]*g+a,s-t[1]*g]}function n(){l=jf(u=to(x,b,w),o);var t=o(_,v);return a=m-t[0]*g,s=y+t[1]*g,i()}function i(){return f=d=null,e}var o,a,s,u,l,c,h,p,f,d,g=150,m=480,y=250,_=0,v=0,x=0,b=0,w=0,E=null,I=ad,S=null,C=$f,T=.5,P=ld(r,T);return e.stream=function(t){return f&&d===t?f:f=cd(I(u,P(C(d=t))))},e.clipAngle=function(t){return arguments.length?(I=+t?sd(E=t*Af,6*Af):(E=null,ad),i()):E*Mf},e.clipExtent=function(t){return arguments.length?(C=null==t?(S=c=h=p=null,$f):so(S=+t[0][0],c=+t[0][1],h=+t[1][0],p=+t[1][1]),i()):null==S?null:[[S,c],[h,p]]},e.scale=function(t){return arguments.length?(g=+t,n()):g},e.translate=function(t){return arguments.length?(m=+t[0],y=+t[1],n()):[m,y]},e.center=function(t){return arguments.length?(_=t[0]%360*Af,v=t[1]%360*Af,n()):[_*Mf,v*Mf]},e.rotate=function(t){return arguments.length?(x=t[0]%360*Af,b=t[1]%360*Af,w=t.length>2?t[2]%360*Af:0,n()):[x*Mf,b*Mf,w*Mf]},e.precision=function(t){return arguments.length?(P=ld(r,T=t*t),i()):Ff(T)},e.fitExtent=function(t,r){return po(e,t,r)},e.fitSize=function(t,r){return function(t,e,r){return po(t,[[0,0],e],r)}(e,t,r)},function(){return o=t.apply(this,arguments),e.invert=o.invert&&function(t){return(t=l.invert((t[0]-a)/g,(s-t[1])/g))&&[t[0]*Mf,t[1]*Mf]},n()}}((function(){return t}))()}(t),a=o.center,s=o.scale,u=o.translate,l=o.clipExtent,c=null;return o.scale=function(t){return arguments.length?(s(t),e()):s()},o.translate=function(t){return arguments.length?(u(t),e()):u()},o.center=function(t){return arguments.length?(a(t),e()):a()},o.clipExtent=function(t){return arguments.length?(null==t?c=r=n=i=null:(c=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),e()):null==c?null:[[c,r],[n,i]]},e()}(go),e=t.center,r=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)};t.projection=ya,t.random=tu,t.clusters=eu,t.helpers=No,t.invariant=Ro,t.meta=zo,t.isolines=function(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.zProperty||"elevation",i=r.commonProperties||{},o=r.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!I(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var a=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.zProperty||"elevation",n=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var r={};return L(t,(function(t){var e=G(t)[1];r[e]||(r[e]=[]),r[e].push(t)})),Object.keys(r).map((function(t){return r[t].sort((function(t,e){return G(t)[0]-G(e)[0]}))})).sort((function(t,r){return e?G(t[0])[1]-G(r[0])[1]:G(r[0])[1]-G(t[0])[1]}))}(t,n),a=[],s=0;sa;)r=i[n=Math.floor((o+1)*Math.random())],i[n]=i[o],i[o]=r;return i.slice(a)}(t.features,e))},t.envelope=se,t.square=ue,t.circle=ce,t.midpoint=function(t,e){return le(t,Rt(t,e)/2,he(t,e))},t.center=pe,t.centerOfMass=function t(e,r){switch(J(e)){case"Point":return e;case"Polygon":var i=[];T(e,(function(t){i.push(t)}));var o,a,s,u,l,c,h,p,f=fe(e,r),d=f.geometry.coordinates,g=0,m=0,y=0,_=i.map((function(t){return[t[0]-d[0],t[1]-d[1]]}));for(o=0;o=0&&l<=1&&(p.onLine1=!0),c>=0&&c<=1&&(p.onLine2=!0),!(!p.onLine1||!p.onLine2)&&[p.x,p.y])}(t[r][0],t[r][1],t[r+1][0],t[r+1][1],e[o][0],e[o][1],e[o+1][0],e[o+1][1]);a&&i.features.push(n([a[0],a[1]]))}}))})),i},t.pointOnFeature=hr,t.area=fr,t.along=function(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var i;if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}if(!E(e))throw new Error("distance must be a number");for(var o=0,a=0;a=o&&a===i.length-1);a++){if(o>=e){var s=e-o;if(s){var u=he(i[a],i[a-1])-180;return le(i[a],s,u,r)}return n(i[a])}o+=Rt(i[a],i[a+1],r)}return n(i[i.length-1])},t.length=_r,t.lineSlice=function(t,e,r){var n=G(r);if("LineString"!==J(r))throw new Error("line must be a LineString");for(var i,o=tr(r,t),a=tr(r,e),u=[(i=o.properties.index<=a.properties.index?[o,a]:[a,o])[0].geometry.coordinates],l=i[0].properties.index+1;l is required");if("boolean"!=typeof r)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=kt(t));var i=[];switch(t.type){case"GeometryCollection":return z(t,(function(t){en(t,r)})),t;case"FeatureCollection":return L(t,(function(t){L(en(t,r),(function(t){i.push(t)}))})),l(i)}return en(t,r)},t.isobands=function(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.zProperty||"elevation",i=r.commonProperties||{},a=r.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!I(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(a))throw new Error("breaksProperties is not an Array");var s=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.zProperty||"elevation",n=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var r={};return L(t,(function(t){var e=G(t)[1];r[e]||(r[e]=[]),r[e].push(t)})),Object.keys(r).map((function(t){return r[t].sort((function(t,e){return G(t)[0]-G(e)[0]}))})).sort((function(t,r){return e?G(t[0])[1]-G(r[0])[1]:G(r[0])[1]-G(t[0])[1]}))}(t,n),a=[],s=0;s0}(t,e);case"Polygon":return!yn(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Pt(e,t);case"LineString":return!yn(t,e);case"Polygon":return!function(t,e){for(var r=0;r0)for(var r=0;r0))throw new Error("Invalid maxDistance");if(!(null==n||Math.sign(n)>0))throw new Error("Invalid minPoints");t=kt(t),n=n||3;var o=new Os.DBSCAN,a=-1;return o.run(N(t),b(e,i),n,Rt).forEach((function(e){a++,e.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster=a,r.properties.dbscan="core"}))})),o.noise.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster?r.properties.dbscan="edge":r.properties.dbscan="noise"})),t},t.clustersKmeans=function(t,e){if("object"!=typeof(e=e||{}))throw new Error("options is invalid");var r=e.numberOfClusters,n=e.mutate;W(t,"Point","Input must contain Points");var i=t.features.length;(r=r||Math.round(Math.sqrt(i/2)))>i&&(r=i),!1!==n&&void 0!==n||(t=kt(t));var o=N(t),a=o.slice(0,r),s=qs(o,r,a),u={};return s.centroids.forEach((function(t,e){u[e]=t})),L(t,(function(t,e){var r=s.idxs[e];t.properties.cluster=r,t.properties.centroid=u[r]})),t},t.pointToLineDistance=lr,t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Mn(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Mn(e,"line2"))throw new Error("line2 must be a LineString");for(var r=Je(Jt(t)).features,n=Je(Jt(e)).features,i=0;i=g;){for(var N=[],z=[],R=d+w,k=0;R<=m;){var O=n([R,L]),F=function(t,e){for(var r=0;r0&&0!==e)if(e>o[o.length-1])e-=o.length;else{var n=Eo(e,o);0!==n&&(e-=n)}if(e!==+u){var h=i[e];h&&l&&(void 0!==r&&h.properties[r]!==l.properties[r]||Tn(l,h)&&function(t,e){return Qe(s(N(t)),s(N(e))).features.length>0}(l,h)&&(i[u]=bo(l,h),o.push(t.properties.origIndexPosition),o.sort((function(t,e){return t-e})),a.remove(t),i.splice(e,1),l.properties.origIndexPosition=u,a.remove(l,(function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition})),c=!0))}})),c){if(!l)continue;l.properties.origIndexPosition=u,a.insert(l),u--}}return i.forEach((function(t){delete t.properties.origIndexPosition,delete t.bbox})),n},t.hexGrid=Io,t.mask=function(t,e){var r=function(t){return o(t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(e),n=function(t){var e=[],r=[];return k(t,(function(t){var n=t.geometry.coordinates,i=n[0],a=n.slice(1);e.push(o([i])),a.forEach((function(t){r.push(o([t]))}))})),[l(e),l(r)]}(t),i=n[0],a=n[1];return function(t,e,r){var n=[];return n.push(t.geometry.coordinates[0]),k(e,(function(t){n.push(t.geometry.coordinates[0])})),k(r,(function(t){n.push(t.geometry.coordinates[0])})),o(n)}(r,i=So(i),a=So(a))},t.squareGrid=To,t.triangleGrid=Po,t.interpolate=function(t,e,r){if("object"!=typeof(r=r||{}))throw new Error("options is invalid");var n=r.gridType,i=r.property,o=r.weight;if(!t)throw new Error("points is required");if(W(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",n=n||"square",o=o||1;var a,s=q(t);switch(n){case"point":case"points":a=Ir(s,e,r);break;case"square":case"squares":a=To(s,e,r);break;case"hex":case"hexes":a=Io(s,e,r);break;case"triangle":case"triangles":a=Po(s,e,r);break;default:throw new Error("invalid gridType")}var u=[];return L(a,(function(e){var a=0,s=0;L(t,(function(t){var u,l=Rt("point"===n?e:fe(e),t,r);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===l&&(a=u);var c=1/Math.pow(l,o);s+=c,a+=c*u}));var l=kt(e);l.properties[i]=a/s,u.push(l)})),l(u)},t.pointOnSurface=hr,t.polygonToLineString=Rr,t.lineStringToPolygon=Or,t.inside=Pt,t.within=At,t.bezier=oe,t.nearest=De,t.pointOnLine=tr,t.lineDistance=_r,t.radians2degrees=v,t.degrees2radians=x,t.distanceToDegrees=y,t.distanceToRadians=m,t.radiansToDistance=g,t.bearingToAngle=_,t.convertDistance=b,t.toMercator=ir,t.toWgs84=or,t.randomPosition=hi,t.randomPoint=pi,t.randomPolygon=fi,t.randomLineString=di,t.getCluster=mi,t.clusterEach=yi,t.clusterReduce=_i,t.createBins=vi,t.applyFilter=xi,t.propertiesContainsFilter=bi,t.filterProperties=wi,t.earthRadius=Mo,t.factors=Ao,t.unitsFactors=Lo,t.areaFactors=Do,t.feature=e,t.geometry=r,t.point=n,t.points=i,t.polygon=o,t.polygons=a,t.lineString=s,t.lineStrings=u,t.featureCollection=l,t.multiLineString=c,t.multiPoint=h,t.multiPolygon=p,t.geometryCollection=f,t.round=d,t.radiansToLength=g,t.lengthToRadians=m,t.lengthToDegrees=y,t.bearingToAzimuth=_,t.radiansToDegrees=v,t.degreesToRadians=x,t.convertLength=b,t.convertArea=w,t.isNumber=E,t.isObject=I,t.validateBBox=S,t.validateId=C,t.getCoord=j,t.getCoords=G,t.containsNumber=X,t.geojsonType=Z,t.featureOf=Y,t.collectionOf=W,t.getGeom=H,t.getGeomType=K,t.getType=J,t.coordEach=T,t.coordReduce=P,t.propEach=M,t.propReduce=A,t.featureEach=L,t.featureReduce=D,t.coordAll=N,t.geomEach=z,t.geomReduce=R,t.flattenEach=k,t.flattenReduce=O,t.segmentEach=F,t.segmentReduce=B,t.lineEach=U,t.lineReduce=V,Object.defineProperty(t,"__esModule",{value:!0})}(e)},754:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,"html, body {\n height: 100%;\n padding: 0;\n margin: 0;\n}\n\n#map {\n z-index: 0;\n height: 100%;\n}\n",""]);const o=i},113:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}",""]);const o=i},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,n){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(n)for(var o=0;o(n=1))return n;for(;ro?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=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(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}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}var l=u(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function h(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(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 y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function _(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(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 b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var w={};function E(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function S(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.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 M(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 A(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,D,N,z,R=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),k=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,O=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,F={now:R,frame:function(t){var e=k(t);return{cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.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 L||(L=a.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==D&&(D=a.matchMedia("(prefers-reduced-motion: reduce)")),D.matches)}},B={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!V&&z&&(q?j(t):N=t)}},V=!1,q=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,z),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),V=!0}a.document&&((z=a.document.createElement("img")).onload=function(){N&&j(N),N=null,q=!0},z.onerror=function(){V=!0,N=null},z.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",X=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}X.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},X.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},X.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},X.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return Z(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},X.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var r=K(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(F.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!B.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||B.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function W(t){return Y.test(t)}var H=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(H);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Q(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,r=Q(B.ACCESS_TOKEN);return e=r&&r.u?a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):B.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},$.prototype.fetchEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=a.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=a.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){E("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){E("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,r,n){var i=this;if(B.EVENTS_URL){var o=K(B.EVENTS_URL);o.params.push("access_token="+(n||B.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.0",skuId:G,userId:this.anonId},s=e?p(a,e):a,u={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(B.EVENTS_URL&&n||B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||W(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=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}($),nt=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){B.EVENTS_URL&&B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||W(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Q(B.ACCESS_TOKEN),n=r?r.u:B.ACCESS_TOKEN,i=n!==this.eventData.tokenU;m(this.anonId)||(this.anonId=g(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}($)),it=nt.postTurnstileEvent.bind(nt),ot=new rt,at=ot.postMapLoadEvent.bind(ot),st=500,ut=50;function lt(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,pt=1/0;function ft(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var gt,mt,yt=function(t){function e(e,r,n){401===r&&W(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=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),_t=C()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},vt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(_t())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:_t(),signal:n.signal}),o=!1,s=!1,u=(r=i.url).indexOf("sku=")>0&&W(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,o){if(!s){if(r&&"SecurityError"!==r.message&&E(r),n&&o)return c(n);var l=Date.now();a.fetch(i).then((function(r){if(r.ok){var n=u?r.clone():null;return c(r,n,l)}return e(new yt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(lt(),tt){var n={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=T(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===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,n);lt(),tt&&tt.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return E(t.message)}))})))}}(i,n,u),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(lt(),!tt)return e(null);var r=ct(t.url);tt.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=T(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,l):l(null,null),{cancel:function(){s=!0,o||n.abort()}}}(t,e);if(C()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new a.XMLHttpRequest;for(var n in r.open(t.method||"GET",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 yt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return vt(p(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return vt(p(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";gt=[],mt=0;var Et=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),mt>=B.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}mt++;var n=!1,i=function(){if(!n)for(n=!0,mt--;gt.length&&mt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Pt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Mt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},At=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Lt(t){var e=t.value;return e?[new At(t.key,e,"constants have been deprecated as of v8")]:[]}function Dt(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 Ht=[Ot,Ft,Bt,Ut,Vt,Xt,qt,Yt(jt),Zt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Ht;r255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var c=s.substr(0,u),h=s.substr(u+1,l-(u+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),g=o(h[2]),m=g<=.5?g*(d+1):g+d-g*d,y=2*g-m;return[n(255*a(y,m,f+1/3)),n(255*a(y,m,f)),n(255*a(y,m,f-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.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+")"},te.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]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=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"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.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}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.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 ae(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 te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],n++}else o=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Yt(o,a)}else r=he[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Xt,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Ft)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Yt(Bt))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Vt)))return null;var c=n[n.length-1];c.scale=s,c.font=u,c.textColor=l}else{var h=e.parse(t[o],1,jt);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)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 fe(n)},fe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Zt?new re("",r,null,null,null):new re(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var ge={"to-boolean":Ut,"to-color":Vt,"to-number":Ft,"to-string":Bt},me=function(t,e){this.type=t,this.args=e};me.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=ge[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ee(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 Ie(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 Se(t,e){for(var r,n,i,o,a,s,u,l=!1,c=0,h=e.length;c0&&s<0||a<0&&s>0}function Pe(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}be(e,t)}function ze(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Be(t,e)&&(r=!1)})),r}ke.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ce("Input is not a number.");o=a-1}return 0}Ve.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)},Ve.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new pe(e,[t]):"coerce"===r?new me(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 o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof le)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ue)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof xe)return!1;if(e instanceof ke)return!1;var r=e instanceof me||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof le})),!!n&&Oe(e)&&Be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new _e;try{o=new le(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}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.")},Ve.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 Ve(this.registry,n,e||null,i,this.errors)},Ve.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 Rt(n,t))},Ve.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var je=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=e.parse(s,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new je(i,r,n)},je.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[qe(e,n)].evaluate(t)},je.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 Xe=Object.freeze({__proto__:null,number:Ge,color:function(t,e,r){return new te(Ge(t.r,e.r,r),Ge(t.g,e.g,r),Ge(t.b,e.b,r),Ge(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ge(t,e[n],r)}))}}),Ze=6/29*3*(6/29),Ye=Math.PI/180,We=180/Math.PI;function He(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ze+4/29}function Ke(t){return t>6/29?t*t*t:Ze*(t-4/29)}function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Qe(t.r),r=Qe(t.g),n=Qe(t.b),i=He((.4124564*e+.3575761*r+.1804375*n)/.95047),o=He((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-He((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function tr(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*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Je(3.2404542*r-1.5371385*e-.4985314*n),Je(-.969266*r+1.8760108*e+.041556*n),Je(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function er(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var rr={forward:$e,reverse:tr,interpolate:function(t,e,r){return{l:Ge(t.l,e.l,r),a:Ge(t.a,e.a,r),b:Ge(t.b,e.b,r),alpha:Ge(t.alpha,e.alpha,r)}}},nr={forward:function(t){var e=$e(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*We;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Ye,r=t.c;return tr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:er(t.h,e.h,r),c:Ge(t.c,e.c,r),l:Ge(t.l,e.l,r),alpha:Ge(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:rr,hcl:nr}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))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,Ft)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=Vt:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var g=e.parse(p,d,l);if(!g)return null;l=l||g.type,u.push([h,g])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new or(l,r,n,i,u):e.error("Type "+Wt(l)+" is not interpolatable.")},or.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 o=qe(e,n),a=or.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Xe[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?nr.reverse(nr.interpolate(nr.forward(s),nr.forward(u),a)):rr.reverse(rr.interpolate(rr.forward(s),rr.forward(u),a))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},lr.prototype.eachChild=function(t){t(this.index),t(this.input)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cr=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);return r&&n?Jt(r.type,[Ut,Bt,Ft,Ot,jt])?new cr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");return r.indexOf(e)>=0},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Ft,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);if(!r||!n)return null;if(!Jt(r.type,[Ut,Bt,Ft,Ot,jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new hr(r,n,i):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};pr.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={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,se(p)))return null}else r=se(p);if(void 0!==i[String(p)])return l.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,jt);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,o,g):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=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,jt),n=e.parse(t[2],2,Ft);if(!r||!n)return null;if(!Jt(r.type,[Yt(jt),Bt,jt]))return e.error("Expected first argument to be of type array or string, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new dr(r.type,r,n,i):null}return new dr(r.type,r,n)},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Wt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},dr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},dr.prototype.outputDefined=function(){return!1},dr.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 _r=yr("==",(function(t,e,r){return e===r}),mr),vr=yr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!mr(0,e,r,n)})),xr=yr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),wr=yr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Er=yr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Ir=function(t,e,r,n,i){this.type=Bt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Ir.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ft);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,Bt)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Bt)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Ft)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ft))?null:new Ir(r,i,o,a,s)},Ir.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))},Ir.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)},Ir.prototype.outputDefined=function(){return!1},Ir.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 Sr=function(t){this.type=Ft,this.input=t};Sr.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 "+Wt(r.type)+" instead."):new Sr(r):null},Sr.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 ce("Expected value to be of type string or array, but found "+Wt(se(e))+" instead.")},Sr.prototype.eachChild=function(t){t(this.input)},Sr.prototype.outputDefined=function(){return!1},Sr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Cr={"==":_r,"!=":vr,">":br,"<":xr,">=":Er,"<=":wr,array:pe,at:lr,boolean:pe,case:fr,coalesce:sr,collator:xe,format:fe,image:de,in:cr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Sr,let:ur,literal:le,match:pr,number:pe,"number-format":Ir,object:pe,slice:dr,step:je,string:pe,"to-boolean":me,"to-color":me,"to-number":me,"to-string":me,var:Ue,within:ke};function Tr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(r,n,i,a);if(s)throw new ce(s);return new te(r/255*a,n/255*a,i/255*a,a)}function Pr(t,e){return t in e}function Mr(t,e){var r=e[t];return void 0===r?null:r}function Ar(t){return{type:t}}function Lr(t){return{result:"success",value:t}}function Dr(t){return{result:"error",value:t}}function Nr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function zr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function kr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Or(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Fr(t){return t}function Br(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,i){return Br(typeof r===i?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==kr(r))return Br(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=qe(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==kr(r))return Br(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=qe(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=Xe[e.type]||Fr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ir[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function jr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):kr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Br(r,t.default,e.default)}ve.register(Cr,{error:[{kind:"error"},[Bt],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[Bt,[jt],function(t,e){return Wt(se(e[0].evaluate(t)))}],"to-rgba":[Yt(Ft,4),[Vt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Vt,[Ft,Ft,Ft],Tr],rgba:[Vt,[Ft,Ft,Ft,Ft],Tr],has:{type:Ut,overloads:[[[Bt],function(t,e){return Pr(e[0].evaluate(t),t.properties())}],[[Bt,qt],function(t,e){var r=e[1];return Pr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:jt,overloads:[[[Bt],function(t,e){return Mr(e[0].evaluate(t),t.properties())}],[[Bt,qt],function(t,e){var r=e[1];return Mr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[jt,[Bt],function(t,e){return Mr(e[0].evaluate(t),t.featureState||{})}],properties:[qt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[Ft,[],function(t){return t.globals.zoom}],"heatmap-density":[Ft,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ft,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ft,Ar(Ft),function(t,e){for(var r=0,n=0,i=e;n":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ut,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Yt(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Yt(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[Bt,Yt(jt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ut,[Bt,Yt(jt)],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:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Ar(Ut),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Cr}function Zr(t,e){var r=new Ve(Cr,[],e?function(t){var e={color:Vt,string:Bt,number:Ft,enum:Bt,boolean:Ut,formatted:Xt,resolvedImage:Zt};return"array"===t.type?Yt(e[t.value]||jt,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?Lr(new Gr(n,e)):Dr(r.errors)}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){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=o,this.expression.evaluate(this._evaluator)},Gr.prototype.evaluate=function(t,e,r,n,i,o){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=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Yr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Fe(e.expression)};Yr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Yr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Wr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Fe(e.expression),this.interpolationType=n};function Hr(t,e){if("error"===(t=Zr(t,e)).result)return t;var r=t.value.expression,n=Oe(r);if(!n&&!Nr(e))return Dr([new Rt("","data expressions not supported")]);var i=Be(r,["zoom"]);if(!i&&!zr(e))return Dr([new Rt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof sr)for(var n=0,i=e.args;nn.maximum?[new At(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function tn(t){var e,r,n,i=t.valueSpec,o=Nt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===kr(t.value.stops)&&"array"===kr(t.value.stops[0])&&"object"===kr(t.value.stops[0][0]),c=Jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Qr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===kr(r)&&0===r.length&&e.push(new At(t.key,r,"array must have at least one stop")),e},default:function(t){return En({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new At(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Rr(t.valueSpec)&&c.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Nr(t.valueSpec)?c.push(new At(t.key,t.value,"property functions not supported")):s&&!zr(t.valueSpec)&&c.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new At(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==kr(o))return[new At(s,o,"array expected, "+kr(o)+" found")];if(2!==o.length)return[new At(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==kr(o[0]))return[new At(s,o,"object expected, "+kr(o[0])+" found")];if(void 0===o[0].zoom)return[new At(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new At(s,o,"object stop key must have value")];if(n&&n>Nt(o[0].zoom))return[new At(s,o[0].zoom,"stop zoom values must appear in ascending order")];Nt(o[0].zoom)!==n&&(n=Nt(o[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:$r,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Xr(zt(o[1]))?e.concat([new At(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(En({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=kr(t.value),u=Nt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new At(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 At(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Nr(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"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 un(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?ln(t[1],t[2],"=="):"!="===r?pn(ln(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?ln(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(un))):"all"===r?["all"].concat(t.slice(1).map(un)):"none"===r?["all"].concat(t.slice(1).map(un).map(pn)):"in"===r?cn(t[1],t.slice(2)):"!in"===r?pn(cn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?pn(hn(t[1])):"within"!==r||t}function ln(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 cn(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(sn)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function fn(t){return nn(zt(t.value))?en(Dt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==kr(r))return[new At(n,r,"array expected, "+kr(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new At(n,r,"filter array must have at least 1 element")];switch(a=a.concat(rn({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Nt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Nt(r[1])&&a.push(new At(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new At(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=kr(r[1]))&&a.push(new At(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=c[f+0]&&n>=c[f+1])?(a[p]=!0,o.push(l[p])):a[p]=!1}}},zn.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=u;p<=c;p++)for(var f=l;f<=h;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,o,a,s))return}},zn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},zn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},zn.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 c=t[l];u[l]=On[s].shallow.indexOf(l)>=0?c:qn(c,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 jn(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||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(jn);if("object"==typeof t){var e=t.$name||"Object",r=On[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,o=Object.keys(t);i=0?s:jn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Gn=function(){this.first=!0};Gn.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=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Zn(t){for(var e=0,r=t;e=65097&&t<=65103)||Xn["CJK Compatibility Ideographs"](t)||Xn["CJK Compatibility"](t)||Xn["CJK Radicals Supplement"](t)||Xn["CJK Strokes"](t)||!(!Xn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Xn["CJK Unified Ideographs Extension A"](t)||Xn["CJK Unified Ideographs"](t)||Xn["Enclosed CJK Letters and Months"](t)||Xn["Hangul Compatibility Jamo"](t)||Xn["Hangul Jamo Extended-A"](t)||Xn["Hangul Jamo Extended-B"](t)||Xn["Hangul Jamo"](t)||Xn["Hangul Syllables"](t)||Xn.Hiragana(t)||Xn["Ideographic Description Characters"](t)||Xn.Kanbun(t)||Xn["Kangxi Radicals"](t)||Xn["Katakana Phonetic Extensions"](t)||Xn.Katakana(t)&&12540!==t||!(!Xn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Xn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Xn["Unified Canadian Aboriginal Syllabics"](t)||Xn["Unified Canadian Aboriginal Syllabics Extended"](t)||Xn["Vertical Forms"](t)||Xn["Yijing Hexagram Symbols"](t)||Xn["Yi Syllables"](t)||Xn["Yi Radicals"](t))))}function Wn(t){return!(Yn(t)||function(t){return!!(Xn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Xn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Xn["Letterlike Symbols"](t)||Xn["Number Forms"](t)||Xn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Xn["Control Pictures"](t)&&9251!==t||Xn["Optical Character Recognition"](t)||Xn["Enclosed Alphanumerics"](t)||Xn["Geometric Shapes"](t)||Xn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Xn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Xn["CJK Symbols and Punctuation"](t)||Xn.Katakana(t)||Xn["Private Use Area"](t)||Xn["CJK Compatibility Forms"](t)||Xn["Small Form Variants"](t)||Xn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Hn(t){return t>=1424&&t<=2303||Xn["Arabic Presentation Forms-A"](t)||Xn["Arabic Presentation Forms-B"](t)}function Kn(t,e){return!(!e&&Hn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Xn.Khmer(t))}function Jn(t){for(var e=0,r=t;e-1&&($n="error"),Qn&&Qn(t)};function ri(){ni.fire(new Ct("pluginStateChange",{pluginStatus:$n,pluginURL:ti}))}var ni=new Pt,ii=function(){return $n},oi=function(){if("deferred"!==$n||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$n="loading",ri(),ti&&xt({url:ti},(function(t){t?ei(t):($n="loaded",ri())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$n||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===$n},setState:function(t){$n=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=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 Gn,this.transition={})};si.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 ui=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Or(t))return new Kr(t,e);if(Xr(t)){var r=Hr(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=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ui.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var li=function(t){this.property=t,this.value=new ui(t,void 0)};li.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},li.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ci.prototype.getValue=function(t){return b(this._values[t].value.value)},ci.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].value=new ui(this._values[t].property,null===e?void 0:b(e))},ci.prototype.getTransition=function(t){return b(this._values[t].transition)},ci.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].transition=b(e)||void 0},ci.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)}(a))}return i};var pi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};pi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new gi(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(yi),vi=function(t){this.specification=t};vi.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 si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},vi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},vi.prototype.interpolate=function(t){return t};var xi=function(t){this.specification=t};xi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},xi.prototype.interpolate=function(){return!1};var bi=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 ui(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new li(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Fn("DataDrivenProperty",yi),Fn("DataConstantProperty",mi),Fn("CrossFadedDataDrivenProperty",_i),Fn("CrossFadedProperty",vi),Fn("ColorRampProperty",xi);var wi=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),r.layout&&(this._unevaluatedLayout=new fi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ci(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 gi(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(Ln,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return _(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(An,"layers."+this.id+".paint."+t,t,e,r))return!1;if(_(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"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Dn(this,t.call(Pn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Mt,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 di&&Nr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Pt),Ei={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ii=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},Si=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ci(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=Ei[t.type].BYTES_PER_ELEMENT,o=r=Ti(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ti(r,Math.max(n,e)),alignment:e}}function Ti(t,e){return Math.ceil(t/e)*e}Si.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Si.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},Si.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Si.prototype.clear=function(){this.length=0},Si.prototype.resize=function(t){this.reserve(t),this.length=t},Si.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)}},Si.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Pi=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}(Si);Pi.prototype.bytesPerElement=4,Fn("StructArrayLayout2i4",Pi);var Mi=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 o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Si);Mi.prototype.bytesPerElement=8,Fn("StructArrayLayout4i8",Mi);var Ai=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.int16[s+5]=a,t},e}(Si);Ai.prototype.bytesPerElement=12,Fn("StructArrayLayout2i4i12",Ai);var Li=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.uint8[u+7]=a,t},e}(Si);Li.prototype.bytesPerElement=8,Fn("StructArrayLayout2i4ub8",Li);var Di=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}(Si);Di.prototype.bytesPerElement=8,Fn("StructArrayLayout2f8",Di);var Ni=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,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c){var h=10*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]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=l,this.uint16[h+9]=c,t},e}(Si);Ni.prototype.bytesPerElement=20,Fn("StructArrayLayout10ui20",Ni);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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,o,a,s,u,l,c,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,l,c,h)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p){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]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,t},e}(Si);zi.prototype.bytesPerElement=24,Fn("StructArrayLayout4i4ui4i24",zi);var Ri=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}(Si);Ri.prototype.bytesPerElement=12,Fn("StructArrayLayout3f12",Ri);var ki=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}(Si);ki.prototype.bytesPerElement=4,Fn("StructArrayLayout1ul4",ki);var Oi=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,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[h+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Si);Oi.prototype.bytesPerElement=20,Fn("StructArrayLayout6i1ul2ui20",Oi);var Fi=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.int16[s+5]=a,t},e}(Si);Fi.prototype.bytesPerElement=12,Fn("StructArrayLayout2i2i2i12",Fi);var Bi=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 o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Si);Bi.prototype.bytesPerElement=16,Fn("StructArrayLayout2f1f2i16",Bi);var Ui=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 o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Si);Ui.prototype.bytesPerElement=12,Fn("StructArrayLayout2ub2f12",Ui);var Vi=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}(Si);Vi.prototype.bytesPerElement=6,Fn("StructArrayLayout3ui6",Vi);var qi=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,o,a,s,u,l,c,h,p,f,d,g,m){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m,y){var _=24*t,v=12*t,x=48*t;return this.int16[_+0]=e,this.int16[_+1]=r,this.uint16[_+2]=n,this.uint16[_+3]=i,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[_+10]=u,this.uint16[_+11]=l,this.uint16[_+12]=c,this.float32[v+7]=h,this.float32[v+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=g,this.uint32[v+10]=m,this.int16[_+22]=y,t},e}(Si);qi.prototype.bytesPerElement=48,Fn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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,o,a,s,u,l,c,h,p,f,d,g,m,y,_,v,x,b,w,E,I,S,C,T){var P=this.length;return this.resize(P+1),this.emplace(P,t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m,y,_,v,x,b,w,E,I,S,C,T)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m,y,_,v,x,b,w,E,I,S,C,T,P){var M=34*t,A=17*t;return this.int16[M+0]=e,this.int16[M+1]=r,this.int16[M+2]=n,this.int16[M+3]=i,this.int16[M+4]=o,this.int16[M+5]=a,this.int16[M+6]=s,this.int16[M+7]=u,this.uint16[M+8]=l,this.uint16[M+9]=c,this.uint16[M+10]=h,this.uint16[M+11]=p,this.uint16[M+12]=f,this.uint16[M+13]=d,this.uint16[M+14]=g,this.uint16[M+15]=m,this.uint16[M+16]=y,this.uint16[M+17]=_,this.uint16[M+18]=v,this.uint16[M+19]=x,this.uint16[M+20]=b,this.uint16[M+21]=w,this.uint16[M+22]=E,this.uint32[A+12]=I,this.float32[A+13]=S,this.float32[A+14]=C,this.float32[A+15]=T,this.float32[A+16]=P,t},e}(Si);ji.prototype.bytesPerElement=68,Fn("StructArrayLayout8i15ui1ul4f68",ji);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Si);Gi.prototype.bytesPerElement=4,Fn("StructArrayLayout1f4",Gi);var Xi=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}(Si);Xi.prototype.bytesPerElement=6,Fn("StructArrayLayout3i6",Xi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Si);Zi.prototype.bytesPerElement=8,Fn("StructArrayLayout1ul2ui8",Zi);var Yi=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}(Si);Yi.prototype.bytesPerElement=4,Fn("StructArrayLayout2ui4",Yi);var Wi=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}(Si);Wi.prototype.bytesPerElement=2,Fn("StructArrayLayout1ui2",Wi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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 o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Si);Hi.prototype.bytesPerElement=16,Fn("StructArrayLayout4f16",Hi);var Ki=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}(Ii);Ki.prototype.size=20;var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ki(this,t)},e}(Oi);Fn("CollisionBoxArray",Ji);var Qi=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}(Ii);Qi.prototype.size=48;var $i=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 Qi(this,t)},e}(qi);Fn("PlacedSymbolArray",$i);var to=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}(Ii);to.prototype.size=68;var eo=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 to(this,t)},e}(ji);Fn("SymbolInstanceArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Gi);Fn("GlyphOffsetArray",ro);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.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}(Xi);Fn("SymbolLineVertexArray",no);var io=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}(Ii);io.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(Zi);Fn("FeatureIndexArray",oo);var ao=Ci([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function uo(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&E("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.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},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>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)))*a+(((u>>>16)*a&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}})),ho=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<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,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),po=co,fo=ho;po.murmur3=co,po.murmur2=fo;var go=function(){this.ids=[],this.positions=[],this.indexed=!1};go.prototype.add=function(t,e,r,n){this.ids.push(yo(t)),this.positions.push(e,r,n)},go.prototype.getPositions=function(t){for(var e=yo(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},go.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],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;_o(e,a,s),_o(r,3*a,3*s),_o(r,3*a+1,3*s+1),_o(r,3*a+2,3*s+2)}s-na.x+1||ua.y+1)&&E("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Vo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Uo(t):[]}}function qo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var jo=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 Pi,this.indexArray=new Vi,this.segments=new so,this.programConfigurations=new Ro(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Go(t,e){for(var r=0;r1){if(Wo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Qo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function $o(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ta(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 o=I(t,e,r[0]);return o!==I(t,e,r[1])||o!==I(t,e,r[2])||o!==I(t,e,r[3])}function ea(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ra(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function na(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u=8192||c<0||c>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;qo(this.layoutVertexArray,l,c,-1,-1),qo(this.layoutVertexArray,l,c,1,-1),qo(this.layoutVertexArray,l,c,1,1),qo(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Fn("CircleBucket",jo,{omit:["layers"]});var ia=new bi({"circle-sort-key":new yi(Mt.layout_circle["circle-sort-key"])}),oa={paint:new bi({"circle-radius":new yi(Mt.paint_circle["circle-radius"]),"circle-color":new yi(Mt.paint_circle["circle-color"]),"circle-blur":new yi(Mt.paint_circle["circle-blur"]),"circle-opacity":new yi(Mt.paint_circle["circle-opacity"]),"circle-translate":new mi(Mt.paint_circle["circle-translate"]),"circle-translate-anchor":new mi(Mt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new mi(Mt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new mi(Mt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yi(Mt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yi(Mt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yi(Mt.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(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 ua(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],g=e[12],m=e[13],y=e[14],_=e[15],v=r[0],x=r[1],b=r[2],w=r[3];return t[0]=v*n+x*s+b*h+w*g,t[1]=v*i+x*u+b*p+w*m,t[2]=v*o+x*l+b*f+w*y,t[3]=v*a+x*c+b*d+w*_,t[4]=(v=r[4])*n+(x=r[5])*s+(b=r[6])*h+(w=r[7])*g,t[5]=v*i+x*u+b*p+w*m,t[6]=v*o+x*l+b*f+w*y,t[7]=v*a+x*c+b*d+w*_,t[8]=(v=r[8])*n+(x=r[9])*s+(b=r[10])*h+(w=r[11])*g,t[9]=v*i+x*u+b*p+w*m,t[10]=v*o+x*l+b*f+w*y,t[11]=v*a+x*c+b*d+w*_,t[12]=(v=r[12])*n+(x=r[13])*s+(b=r[14])*h+(w=r[15])*g,t[13]=v*i+x*u+b*p+w*m,t[14]=v*o+x*l+b*f+w*y,t[15]=v*a+x*c+b*d+w*_,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 la,ca=ua;function ha(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}la=new aa(3),aa!=Float32Array&&(la[0]=0,la[1]=0,la[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var pa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype.queryRadius=function(t){var e=t;return ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+ra(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=na(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?u:function(t,e){return t.map((function(t){return fa(t,e)}))}(u,s),p=c?l*a:l,f=0,d=n;ft.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 a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var d=r;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return La(p,f,r,n,i,l),f}function Ma(t,e,r,n,i){var o,a;if(i===$a(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Ka(o,t[o],t[o+1],a);return a&&Ga(a,a.next)&&(Ja(a),a=a.next),a}function Aa(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ga(n,n.next)&&0!==ja(n.prev,n,n.next))n=n.next;else{if(Ja(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function La(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ba(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,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,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--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Na(t,n,i,o):Da(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ja(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?La(t=za(Aa(t),e,r),e,r,n,i,o,2):2===a&&Ra(t,e,r,n,i,o):La(Aa(t),e,r,n,i,o,1);break}}}function Da(t){var e=t.prev,r=t,n=t.next;if(ja(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Va(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ja(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Na(t,e,r,n){var i=t.prev,o=t,a=t.next;if(ja(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=Ba(i.x=l&&p&&p.z<=c;){if(h!==t.prev&&h!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=l;){if(h!==t.prev&&h!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function za(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ga(i,o)&&Xa(i,n,n.next,o)&&Wa(i,o)&&Wa(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ja(n),Ja(n.next),n=t=o),n=n.next}while(n!==t);return Aa(n)}function Ra(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&qa(a,s)){var u=Ha(a,s);return a=Aa(a,a.next),u=Aa(u,u.next),La(a,e,r,n,i,o),void La(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function ka(t,e){return t.x-e.x}function Oa(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&Va(or.x||n.x===r.x&&Fa(r,n)))&&(r=n,p=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ha(e,t);Aa(e,e.next),Aa(r,r.next)}}function Fa(t,e){return ja(t.prev,t,e.prev)<0&&ja(e.next,t,t.next)<0}function Ba(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 Ua(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function qa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Xa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Wa(t,e)&&Wa(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ja(t.prev,t,e.prev)||ja(t,e.prev,e))||Ga(t,e)&&ja(t.prev,t,t.next)>0&&ja(e.prev,e,e.next)>0)}function ja(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ga(t,e){return t.x===e.x&&t.y===e.y}function Xa(t,e,r,n){var i=Ya(ja(t,e,r)),o=Ya(ja(t,e,n)),a=Ya(ja(r,n,t)),s=Ya(ja(r,n,e));return i!==o&&a!==s||!(0!==i||!Za(t,r,e))||!(0!==o||!Za(t,n,e))||!(0!==a||!Za(r,t,n))||!(0!==s||!Za(r,e,n))}function Za(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 Ya(t){return t>0?1:t<0?-1:0}function Wa(t,e){return ja(t.prev,t,t.next)<0?ja(t,e,t.next)>=0&&ja(t,t.prev,e)>=0:ja(t,e,t.prev)<0||ja(t,t.next,e)<0}function Ha(t,e){var r=new Qa(t.i,t.x,t.y),n=new Qa(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ka(t,e,r,n){var i=new Qa(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 Ja(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Qa(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 $a(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+c)),Math.min(i,Math.floor(r+(a-s)*l/a+c)),o)}var h=e[r],p=n,f=i;for(es(e,n,r),o(e[i],h)>0&&es(e,n,i);p0;)f--}0===o(e[n],h)?es(e,n,f):es(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||rs)}function es(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function rs(t,e){return te?1:0}function ns(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},Ca.default=Ta;var ss=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Pi,this.indexArray=new Vi,this.indexArray2=new Yi,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,r){this.hasPattern=os("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},fs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=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),(o+=t.readSVarint())l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},fs.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=fs.types[this.type];function c(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 vs(t,e,r){if(3===t){var n=new ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ys.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 ps(this._pbf,e,this.extent,this._keys,this._values)};var xs={VectorTile:function(t,e){this.layers=t.readFields(vs,{},e)},VectorTileFeature:ps,VectorTileLayer:ms},bs=xs.VectorTileFeature.types,ws=Math.pow(2,13);function Es(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*ws)+a,i*ws*2,o*ws*2,Math.round(s))}var Is=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 Ai,this.indexArray=new Vi,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ss(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Is.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||D.every((function(t){return t.y<0}))||D.every((function(t){return t.y>8192}))))for(var g=0,m=0;m=1){var _=d[m-1];if(!Ss(y,_)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=y.sub(_)._perp()._unit(),x=_.dist(y);g+x>32768&&(g=0),Es(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,g),Es(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,g),Es(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,0,g+=x),Es(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,1,g);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+u>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===bs[t.type]){for(var w=[],E=[],I=h.vertexLength,S=0,C=s;S=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(E&&y>l){var S=c.dist(f);if(S>2*h){var C=c.sub(c.sub(f)._mult(h/S)._round());this.updateDistance(f,C),this.addCurrentVertex(C,g,0,0,p),f=C}}var T=f&&d,P=T?r:s?"butt":n;if(T&&"round"===P&&(bi&&(P="bevel"),"bevel"===P&&(b>2&&(P="flipbevel"),b100)_=m.mult(-1);else{var M=b*g.add(m).mag()/g.sub(m).mag();_._perp()._mult(M*(I?-1:1))}this.addCurrentVertex(c,_,0,0,p),this.addCurrentVertex(c,_.mult(-1),0,0,p)}else if("bevel"===P||"fakeround"===P){var A=-Math.sqrt(b*b-1),L=I?A:0,D=I?0:A;if(f&&this.addCurrentVertex(c,g,L,D,p),"fakeround"===P)for(var N=Math.round(180*w/Math.PI/20),z=1;z2*h){var U=c.add(d.sub(c)._mult(h/B)._round());this.updateDistance(c,U),this.addCurrentVertex(U,m,0,0,p),c=U}}}}},Rs.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>zs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Rs.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(zs-1):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===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Rs.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Rs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Fn("LineBucket",Rs,{omit:["layers","patternFeatures"]});var ks=new bi({"line-cap":new mi(Mt.layout_line["line-cap"]),"line-join":new yi(Mt.layout_line["line-join"]),"line-miter-limit":new mi(Mt.layout_line["line-miter-limit"]),"line-round-limit":new mi(Mt.layout_line["line-round-limit"]),"line-sort-key":new yi(Mt.layout_line["line-sort-key"])}),Os={paint:new bi({"line-opacity":new yi(Mt.paint_line["line-opacity"]),"line-color":new yi(Mt.paint_line["line-color"]),"line-translate":new mi(Mt.paint_line["line-translate"]),"line-translate-anchor":new mi(Mt.paint_line["line-translate-anchor"]),"line-width":new yi(Mt.paint_line["line-width"]),"line-gap-width":new yi(Mt.paint_line["line-gap-width"]),"line-offset":new yi(Mt.paint_line["line-offset"]),"line-blur":new yi(Mt.paint_line["line-blur"]),"line-dasharray":new vi(Mt.paint_line["line-dasharray"]),"line-pattern":new _i(Mt.paint_line["line-pattern"]),"line-gradient":new xi(Mt.paint_line["line-gradient"])}),layout:ks},Fs=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 si(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=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(yi))(Os.paint.properties["line-width"].specification);Fs.useIntegerZoom=!0;var Bs=function(t){function e(e){t.call(this,e,Os),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof je,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Fs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Rs(t)},e.prototype.queryRadius=function(t){var e=t,r=Us(ea("line-width",this,e),ea("line-gap-width",this,e)),n=ea("line-offset",this,e);return r/2+Math.abs(n)+ra(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var u=na(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Us(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var Vs=Ci([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=Ci([{name:"a_projected_pos",components:3,type:"Float32"}],4),js=(Ci([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ci([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Gs=(Ci([{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"}]),Ci([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Xs=Ci([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Zs(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()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ci([{name:"triangle",components:3,type:"Uint16"}]),Ci([{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"}]),Ci([{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"}]),Ci([{type:"Float32",name:"offsetX"}]),Ci([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ys={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ws=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},Hs=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*g},Ks=Js;function Js(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Js.Varint=0,Js.Fixed64=1,Js.Bytes=2,Js.Fixed32=5;var Qs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $s(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function tu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function eu(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 ru(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function fu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function du(t,e,r){1===t&&r.readMessage(gu,e)}function gu(t,e,r){if(3===t){var n=r.readMessage(mu,{}),i=n.width,o=n.height,a=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new _a({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function mu(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 yu(t){for(var e=0,r=0,n=0,i=t;n=0;p--){var f=a[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=a.pop();p>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*fu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ws(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ws(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,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return tu(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return tu(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&&Qs?function(t,e,r){return Qs.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+c>r)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=c}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!==Js.Bytes)return t.push(this.readVarint(e));var r=$s(this);for(t=t||[];this.pos127;);else if(e===Js.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Js.Fixed32)this.pos+=4;else{if(e!==Js.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;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,o=0;o55295&&n<57344){if(!i){n>56319||o+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&&eu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Hs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Hs(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&&eu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cu,e)},writeBytesField:function(t,e){this.writeTag(t,Js.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Js.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Js.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var _u=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},vu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};vu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},vu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},vu.tlbr.get=function(){return this.tl.concat(this.br)},vu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(_u.prototype,vu);var xu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=yu(i),a=new va({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;va.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var h=e[c],p=n[c].paddedRect,f=p.x+1,d=p.y+1,g=h.data.width,m=h.data.height;va.copy(h.data,a,{x:0,y:0},{x:f,y:d},h.data),va.copy(h.data,a,{x:0,y:m-1},{x:f,y:d-1},{width:g,height:1}),va.copy(h.data,a,{x:0,y:0},{x:f,y:d+m},{width:g,height:1}),va.copy(h.data,a,{x:g-1,y:0},{x:f-1,y:d},{width:1,height:m}),va.copy(h.data,a,{x:0,y:0},{x:f+g,y:d},{width:1,height:m})}this.image=a,this.iconPositions=r,this.patternPositions=n};xu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new _u(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},xu.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)},xu.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]})}},Fn("ImagePosition",_u),Fn("ImageAtlas",xu);var bu={horizontal:1,vertical:2,horizontalOnly:3},wu=function(){this.scale=1,this.fontStack="",this.imageName=null};wu.forText=function(t,e){var r=new wu;return r.scale=t||1,r.fontStack=e,r},wu.forImage=function(t){var e=new wu;return e.imageName=t,e};var Eu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Iu(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g){var m,y=Eu.fromFeature(t,i);h===bu.vertical&&y.verticalizePunctuation();var _=ai.processBidirectionalText,v=ai.processStyledBidirectionalText;if(_&&1===y.sections.length){m=[];for(var x=0,b=_(y.toString(),Lu(y,l,o,e,n,f,d));x0&&F>S&&(S=F)}else{var B=r[T.fontStack],U=B&&B[M];if(U&&U.rect)D=U.rect,L=U.metrics;else{var V=e[T.fontStack],q=V&&V[M];if(!q)continue;L=q.metrics}A=24*(b-T.scale)}R?(t.verticalizable=!0,I.push({glyph:M,imageName:N,x:p,y:f+A,vertical:R,scale:T.scale,fontStack:T.fontStack,sectionIndex:P,metrics:L,rect:D}),p+=z*T.scale+l):(I.push({glyph:M,imageName:N,x:p,y:f+A,vertical:R,scale:T.scale,fontStack:T.fontStack,sectionIndex:P,metrics:L,rect:D}),p+=L.advance*T.scale+l)}0!==I.length&&(d=Math.max(p-l,d),Nu(I,0,I.length-1,m,S)),p=0;var j=o*b+S;E.lineOffset=Math.max(S,w),f+=j,g=Math.max(j,g),++y}else f+=o,++y}var G,X=f- -17,Z=Du(a),Y=Z.horizontalAlign,W=Z.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,c=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var h=0,p=t;h=0&&n>=t&&Su[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Eu.prototype.substring=function(t,e){var r=new Eu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Eu.prototype.toString=function(){return this.text},Eu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Eu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(wu.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 Su={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Cu={};function Tu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Pu(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,p=0;p-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function Vu(t){for(var e=0,r=0;rl){var d=(l-u)/f,g=Ge(h.x,p.x,d),m=Ge(h.y,p.y,d),y=new Ru(g,m,p.angleTo(h),c);return y._round(),!a||Uu(t,y,s,a,e)?y:void 0}u+=f}}function Xu(t,e,r,n,i,o,a,s,u){var l=qu(n,o,a),c=ju(n,i),h=c*a,p=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h=0&&b=0&&w=0&&f+c<=h){var E=new Ru(b,w,v,g);E._round(),i&&!Uu(e,E,a,i,o)||d.push(E)}}p+=_}return u||d.length||s||(d=t(e,p/2,n,i,o,a,s,!0,l)),d}(t,p?e/2*s%e:(c/2+2*o)*a*s%e,e,l,r,h,p,!1,u)}function Zu(t,e,r,n,o){for(var a=[],s=0;s=n&&p.x>=n||(h.x>=n?h=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=n&&(p=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round():p.y>=o&&(p=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round()),l&&h.equals(l[l.length-1])||a.push(l=[h]),l.push(p)))))}return a}function Yu(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},g=p.reduce(d,0),m=f.reduce(d,0),y=u-g,_=l-m,v=0,x=g,b=0,w=m,E=0,I=y,S=0,C=_;if(a.content&&n){var T=a.content;v=Wu(p,0,T[0]),b=Wu(f,0,T[1]),x=Wu(p,T[0],T[2]),w=Wu(f,T[1],T[3]),E=T[0]-v,S=T[1]-b,I=T[2]-T[0]-x,C=T[3]-T[1]-w}var P=function(n,o,u,l){var p=Ku(n.stretch-v,x,c,t.left),f=Ju(n.fixed-E,I,n.stretch,g),d=Ku(o.stretch-b,w,h,t.top),y=Ju(o.fixed-S,C,o.stretch,m),_=Ku(u.stretch-v,x,c,t.left),T=Ju(u.fixed-E,I,u.stretch,g),P=Ku(l.stretch-b,w,h,t.top),M=Ju(l.fixed-S,C,l.stretch,m),A=new i(p,d),L=new i(_,d),D=new i(_,P),N=new i(p,P),z=new i(f/s,y/s),R=new i(T/s,M/s),k=e*Math.PI/180;if(k){var O=Math.sin(k),F=Math.cos(k),B=[F,-O,O,F];A._matMult(B),L._matMult(B),N._matMult(B),D._matMult(B)}var U=n.stretch+n.fixed,V=o.stretch+o.fixed;return{tl:A,tr:L,bl:N,br:D,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+V,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:R,minFontScaleX:I/s/c,minFontScaleY:C/s/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var M=Hu(p,y,g),A=Hu(f,_,m),L=0;L0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var g=a.top*s-u,m=a.bottom*s+u,y=a.left*s-u,_=a.right*s+u,v=a.collisionPadding;if(v&&(y-=v[0]*s,g-=v[1]*s,_+=v[2]*s,m+=v[3]*s),c){var x=new i(y,g),b=new i(_,g),w=new i(y,m),E=new i(_,m),I=c*Math.PI/180;x._rotate(I),b._rotate(I),w._rotate(I),E._rotate(I),y=Math.min(x.x,b.x,w.x,E.x),_=Math.max(x.x,b.x,w.x,E.x),g=Math.min(x.y,b.y,w.y,E.y),m=Math.max(x.y,b.y,w.y,E.y)}t.emplaceBack(e.x,e.y,y,g,_,m,r,n,o)}this.boxEndIndex=t.length},$u=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tl),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 tl(t,e){return te?1:0}function el(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;la)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var h=Math.min(a-n,s-o),p=h/2,f=new $u([],rl);if(0===h)return new i(n,o);for(var d=n;dm.d||!m.d)&&(m=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,y)),_.max-m.d<=e||(f.push(new nl(_.p.x-(p=_.h/2),_.p.y-p,p,t)),f.push(new nl(_.p.x+p,_.p.y-p,p,t)),f.push(new nl(_.p.x-p,_.p.y+p,p,t)),f.push(new nl(_.p.x+p,_.p.y+p,p,t)),y+=4)}return r&&(console.log("num probes: "+y),console.log("best distance: "+m.d)),m.p}function rl(t,e){return e.max-t.max}function nl(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!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(r=!r),n=Math.min(n,Jo(t,l,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}$u.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$u.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}},$u.prototype.peek=function(){return this.data[0]},$u.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},$u.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var il=Number.POSITIVE_INFINITY;function ol(t,e){return e[1]!==il?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 al(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sl(t,e,r,n,o,a,s,u,l,c,h,p,f,d,g){var m=function(t,e,r,n,o,a,s,u){for(var l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=0,p=e.positionedLines;h32640&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((_=[128*d.compositeTextSizes[0].evaluate(s,{},g),128*d.compositeTextSizes[1].evaluate(s,{},g)])[0]>32640||_[1]>32640)&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,_,u,a,s,c,e,l.lineStartIndex,l.lineLength,f,g);for(var v=0,x=h;v=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],u||l){for(var h=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new si(this.zoom),g=0,m=t;g=0;for(var D=0,N=I.sections;D=0;s--)o[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},yl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},yl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},yl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},yl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},yl.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)}},Fn("SymbolBucket",yl,{omit:["layers","collisionBoxArray","features","compareText"]}),yl.MAX_GLYPHS=65535,yl.addDynamicAttributes=fl;var _l=new bi({"symbol-placement":new mi(Mt.layout_symbol["symbol-placement"]),"symbol-spacing":new mi(Mt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new mi(Mt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yi(Mt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new mi(Mt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new mi(Mt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new mi(Mt.layout_symbol["icon-ignore-placement"]),"icon-optional":new mi(Mt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new mi(Mt.layout_symbol["icon-rotation-alignment"]),"icon-size":new yi(Mt.layout_symbol["icon-size"]),"icon-text-fit":new mi(Mt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new mi(Mt.layout_symbol["icon-text-fit-padding"]),"icon-image":new yi(Mt.layout_symbol["icon-image"]),"icon-rotate":new yi(Mt.layout_symbol["icon-rotate"]),"icon-padding":new mi(Mt.layout_symbol["icon-padding"]),"icon-keep-upright":new mi(Mt.layout_symbol["icon-keep-upright"]),"icon-offset":new yi(Mt.layout_symbol["icon-offset"]),"icon-anchor":new yi(Mt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new mi(Mt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new mi(Mt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new mi(Mt.layout_symbol["text-rotation-alignment"]),"text-field":new yi(Mt.layout_symbol["text-field"]),"text-font":new yi(Mt.layout_symbol["text-font"]),"text-size":new yi(Mt.layout_symbol["text-size"]),"text-max-width":new yi(Mt.layout_symbol["text-max-width"]),"text-line-height":new mi(Mt.layout_symbol["text-line-height"]),"text-letter-spacing":new yi(Mt.layout_symbol["text-letter-spacing"]),"text-justify":new yi(Mt.layout_symbol["text-justify"]),"text-radial-offset":new yi(Mt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new mi(Mt.layout_symbol["text-variable-anchor"]),"text-anchor":new yi(Mt.layout_symbol["text-anchor"]),"text-max-angle":new mi(Mt.layout_symbol["text-max-angle"]),"text-writing-mode":new mi(Mt.layout_symbol["text-writing-mode"]),"text-rotate":new yi(Mt.layout_symbol["text-rotate"]),"text-padding":new mi(Mt.layout_symbol["text-padding"]),"text-keep-upright":new mi(Mt.layout_symbol["text-keep-upright"]),"text-transform":new yi(Mt.layout_symbol["text-transform"]),"text-offset":new yi(Mt.layout_symbol["text-offset"]),"text-allow-overlap":new mi(Mt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new mi(Mt.layout_symbol["text-ignore-placement"]),"text-optional":new mi(Mt.layout_symbol["text-optional"])}),vl={paint:new bi({"icon-opacity":new yi(Mt.paint_symbol["icon-opacity"]),"icon-color":new yi(Mt.paint_symbol["icon-color"]),"icon-halo-color":new yi(Mt.paint_symbol["icon-halo-color"]),"icon-halo-width":new yi(Mt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yi(Mt.paint_symbol["icon-halo-blur"]),"icon-translate":new mi(Mt.paint_symbol["icon-translate"]),"icon-translate-anchor":new mi(Mt.paint_symbol["icon-translate-anchor"]),"text-opacity":new yi(Mt.paint_symbol["text-opacity"]),"text-color":new yi(Mt.paint_symbol["text-color"],{runtimeType:Vt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new yi(Mt.paint_symbol["text-halo-color"]),"text-halo-width":new yi(Mt.paint_symbol["text-halo-width"]),"text-halo-blur":new yi(Mt.paint_symbol["text-halo-blur"]),"text-translate":new mi(Mt.paint_symbol["text-translate"]),"text-translate-anchor":new mi(Mt.paint_symbol["text-translate-anchor"])}),layout:_l},xl=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ot,this.defaultValue=t};xl.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},xl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},xl.prototype.outputDefined=function(){return!1},xl.prototype.serialize=function(){return null},Fn("FormatSectionOverride",xl,{omit:["defaultValue"]});var bl=function(t){function e(e){t.call(this,e,vl)}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=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},Rl.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else C()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Rl.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Rl.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(jn(e.error)):n(null,jn(e.data)))}else{var i=!1,o=M(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,o)},o)}:function(t){i=!0},s=null,u=jn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Rl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Ol=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]))};Ol.prototype.setNorthEast=function(t){return this._ne=t instanceof Fl?new Fl(t.lng,t.lat):Fl.convert(t),this},Ol.prototype.setSouthWest=function(t){return this._sw=t instanceof Fl?new Fl(t.lng,t.lat):Fl.convert(t),this},Ol.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Fl)e=t,r=t;else{if(!(t instanceof Ol))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Ol.convert(t)):this.extend(Fl.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 Fl(e.lng,e.lat),this._ne=new Fl(r.lng,r.lat)),this},Ol.prototype.getCenter=function(){return new Fl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Ol.prototype.getSouthWest=function(){return this._sw},Ol.prototype.getNorthEast=function(){return this._ne},Ol.prototype.getNorthWest=function(){return new Fl(this.getWest(),this.getNorth())},Ol.prototype.getSouthEast=function(){return new Fl(this.getEast(),this.getSouth())},Ol.prototype.getWest=function(){return this._sw.lng},Ol.prototype.getSouth=function(){return this._sw.lat},Ol.prototype.getEast=function(){return this._ne.lng},Ol.prototype.getNorth=function(){return this._ne.lat},Ol.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Ol.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Ol.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Ol.prototype.contains=function(t){var e=Fl.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},Ol.convert=function(t){return!t||t instanceof Ol?t:new Ol(t)};var Fl=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Fl.prototype.wrap=function(){return new Fl(h(this.lng,-180,180),this.lat)},Fl.prototype.toArray=function(){return[this.lng,this.lat]},Fl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Fl.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))},Fl.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 Ol(new Fl(this.lng-r,this.lat-e),new Fl(this.lng+r,this.lat+e))},Fl.convert=function(t){if(t instanceof Fl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Fl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Fl(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 Bl=2*Math.PI*6371008.8;function Ul(t){return Bl*Math.cos(t*Math.PI/180)}function Vl(t){return(180+t)/360}function ql(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jl(t,e){return t/Ul(e)}function Gl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Xl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Xl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Fl.convert(t);return new Xl(Vl(r.lng),ql(r.lat),jl(e,r.lat))},Xl.prototype.toLngLat=function(){return new Fl(360*this.x-180,Gl(this.y))},Xl.prototype.toAltitude=function(){return this.z*Ul(Gl(this.y))},Xl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Bl*(t=Gl(this.y),1/Math.cos(t*Math.PI/180));var t};var Zl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Hl(0,t,t,e,r)};Zl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Zl.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=kl(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=kl(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new Wl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Wl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Hl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Hl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Wl.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},Wl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Wl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Wl(e,this.wrap,e,r,n),new Wl(e,this.wrap,e,r+1,n),new Wl(e,this.wrap,e,r,n+1),new Wl(e,this.wrap,e,r+1,n+1)]},Wl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=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)},Kl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Kl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Kl.prototype.getPixels=function(){return new va({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kl.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,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},ec.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new xs.VectorTile(new Ks(this.rawTileData)).layers,this.sourceLayerCoder=new Jl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ec.prototype.query=function(t,e,r,n){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=an(a.filter),l=t.queryGeometry,c=t.queryPadding*s,h=nc(l),p=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),f=nc(t.cameraQueryGeometry),d=0,g=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var c=0,h=l;c=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var g=Vo(d,!0);if(!i.filter(new si(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),d))return;for(var m=this.getId(d,f),y=0;yn)i=!1;else if(e)if(this.expirationTimeut&&(t.getActor().send("enforceCacheSizeLimit",st),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Zu,t.clone=function(t){var e=new aa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Xs,t.config=B,t.create=function(){var t=new aa(16);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new aa(9);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Zr,t.createLayout=Ci,t.createStyleLayer=function(t){return"custom"===t.type?new Cl(t):new Tl[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ge,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ks(t).readFields(du,[])},t.pbf=Ks,t.performSymbolLayout=function(t,e,r,n,i,o,a){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 c=t.textSizeData,h=c.maxZoom;l.compositeTextSizes=[u["text-size"].possiblyEvaluate(new si(c.minZoom),a),u["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,f=p.maxZoom;l.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new si(p.minZoom),a),u["icon-size"].possiblyEvaluate(new si(f),a)]}l.layoutTextSize=u["text-size"].possiblyEvaluate(new si(t.zoom+1),a),l.layoutIconSize=u["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),l.textMaxSize=u["text-size"].possiblyEvaluate(new si(18));for(var d=24*s.get("text-line-height"),g="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),m=s.get("text-keep-upright"),y=s.get("text-size"),_=function(){var o=x[v],u=s.get("text-font").evaluate(o,{},a).join(","),c=y.evaluate(o,{},a),h=l.layoutTextSize.evaluate(o,{},a),p=l.layoutIconSize.evaluate(o,{},a),f={horizontal:{},vertical:void 0},_=o.text,b=[0,0];if(_){var w=_.toString(),I=24*s.get("text-letter-spacing").evaluate(o,{},a),S=function(t){for(var e=0,r=t;e=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m,y,_,v,x,b,w,I,S){var C,T,P,M,A,L=t.addToLineVertexArray(e,r),D=0,N=0,z=0,R=0,k=-1,O=-1,F={},B=po(""),U=0,V=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(C=s.layout.get("text-offset").evaluate(x,{},I).map((function(t){return 24*t})))[0],V=C[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},I),V=il),t.allowVerticalPlacement&&n.vertical){var q=s.layout.get("text-rotate").evaluate(x,{},I)+90;M=new Qu(u,e,l,c,h,n.vertical,p,f,d,q),a&&(A=new Qu(u,e,l,c,h,a,m,y,d,q))}if(i){var j=s.layout.get("icon-rotate").evaluate(x,{}),G="none"!==s.layout.get("icon-text-fit"),X=Yu(i,j,w,G),Z=a?Yu(a,j,w,G):void 0;P=new Qu(u,e,l,c,h,i,m,y,!1,j),D=4*X.length;var Y=t.iconSizeData,W=null;"source"===Y.kind?(W=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((W=[128*b.compositeIconSizes[0].evaluate(x,{},I),128*b.compositeIconSizes[1].evaluate(x,{},I)])[0]>32640||W[1]>32640)&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,X,W,v,_,x,!1,e,L.lineStartIndex,L.lineLength,-1,I),k=t.icon.placedSymbolArray.length-1,Z&&(N=4*Z.length,t.addSymbols(t.icon,Z,W,v,_,x,bu.vertical,e,L.lineStartIndex,L.lineLength,-1,I),O=t.icon.placedSymbolArray.length-1)}for(var H in n.horizontal){var K=n.horizontal[H];if(!T){B=po(K.text);var J=s.layout.get("text-rotate").evaluate(x,{},I);T=new Qu(u,e,l,c,h,K,p,f,d,J)}var Q=1===K.positionedLines.length;if(z+=sl(t,e,K,o,s,d,x,g,L,n.vertical?bu.horizontal:bu.horizontalOnly,Q?Object.keys(n.horizontal):[H],F,k,b,I),Q)break}n.vertical&&(R+=sl(t,e,n.vertical,o,s,d,x,g,L,bu.vertical,["vertical"],F,O,b,I));var $=T?T.boxStartIndex:t.collisionBoxArray.length,tt=T?T.boxEndIndex:t.collisionBoxArray.length,et=M?M.boxStartIndex:t.collisionBoxArray.length,rt=M?M.boxEndIndex:t.collisionBoxArray.length,nt=P?P.boxStartIndex:t.collisionBoxArray.length,it=P?P.boxEndIndex:t.collisionBoxArray.length,ot=A?A.boxStartIndex:t.collisionBoxArray.length,at=A?A.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(T,st),st=ut(M,st),st=ut(P,st);var lt=(st=ut(A,st))>-1?1:0;lt&&(st*=S/24),t.glyphOffsetArray.length>=yl.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,k,O,B,$,tt,et,rt,nt,it,ot,at,l,z,R,D,N,lt,0,p,U,V,st)}(t,h,s,r,n,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,b,S,u,v,w,C,d,e,o,l,c,a)};if("line"===T)for(var L=0,D=Zu(e.geometry,0,0,8192,8192);L1){var U=Gu(B,I,r.vertical||g,n,24,_);U&&A(B,U)}}else if("Polygon"===e.type)for(var V=0,q=ns(e.geometry,0);V=P.maxzoom||"none"!==P.visibility&&(a(T,this.zoom,n),(g[P.id]=P.createBucket({index:c.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,m,this.tileID.canonical),c.bucketLayerIDs.push(T.map((function(t){return t.id}))))}}}var M=t.mapObject(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(M).length?o.send("getGlyphs",{uid:this.uid,stacks:M},(function(t,e){h||(h=t,p=e,D.call(u))})):p={};var A=Object.keys(m.iconDependencies);A.length?o.send("getImages",{icons:A,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,f=e,D.call(u))})):f={};var L=Object.keys(m.patternDependencies);function D(){if(h)return s(h);if(p&&f&&d){var e=new i(p),r=new t.ImageAtlas(f,d);for(var o in g){var u=g[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,n),t.performSymbolLayout(u,p,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,n),u.addFeatures(m,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(g).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}L.length?o.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,D.call(u))})):d={},D.call(this)};var u=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var u=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);var c={};if(a){var h=a.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,l,c))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},u.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var l=t.window.ImageBitmap,c=function(){this.loaded={}};function h(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=l&&o instanceof l?this.getImageData(o):o,s=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var p=r[2*n+a],f=i,d=o;for(A(e,r,i,n),r[2*o+a]>p&&A(e,r,i,o);fp;)d--}r[2*i+a]===p?A(e,r,i,d):A(e,r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};R.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var h=l.pop(),p=l.pop(),f=l.pop();if(p-f<=a)for(var d=f;d<=p;d++)u=e[2*d+1],(s=e[2*d])>=r&&s<=i&&u>=n&&u<=o&&c.push(t[d]);else{var g=Math.floor((f+p)/2);u=e[2*g+1],(s=e[2*g])>=r&&s<=i&&u>=n&&u<=o&&c.push(t[g]);var m=(h+1)%2;(0===h?r<=s:n<=u)&&(l.push(f),l.push(g-1),l.push(m)),(0===h?i>=s:o>=u)&&(l.push(g+1),l.push(p),l.push(m))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},R.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)D(e[2*p],e[2*p+1],r,n)<=u&&s.push(t[p]);else{var f=Math.floor((h+c)/2),d=e[2*f],g=e[2*f+1];D(d,g,r,n)<=u&&s.push(t[f]);var m=(l+1)%2;(0===l?r-i<=d:n-i<=g)&&(a.push(h),a.push(f-1),a.push(m)),(0===l?r+i>=d:n+i>=g)&&(a.push(f+1),a.push(c),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var k={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},O=function(t){this.options=G(Object.create(k),t),this.trees=new Array(this.options.maxZoom+1)};function F(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function B(t,e){var r=t.geometry.coordinates,n=r[1];return{x:q(r[0]),y:j(n),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:V(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function V(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function q(t){return t/360+.5}function j(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function G(t,e){for(var r in e)t[r]=e[r];return t}function X(t){return t.x}function Z(t){return t.y}function Y(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function W(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)H(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],c=e[r+1],h=e[n],p=e[n+1],f=r+3;fa)o=f,a=d;else if(d===a){var g=Math.abs(f-s);gi&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function $(t,e,r,n){for(var i=0;i1?1:r}function rt(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],l=0;l=r&&d=n)){var g=[];if("Point"===p||"MultiPoint"===p)nt(h,g,r,n,i);else if("LineString"===p)it(h,g,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)at(h,g,r,n,i,!1);else if("Polygon"===p)at(h,g,r,n,i,!0);else if("MultiPolygon"===p)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,r,n,i,o,a){for(var s,u,l=ot(t),c=0===i?ut:lt,h=t.start,p=0;pr&&(u=c(l,f,d,m,y,r),a&&(l.start=h+s*u)):_>n?v=r&&(u=c(l,f,d,m,y,r),x=!0),v>n&&_<=n&&(u=c(l,f,d,m,y,n),x=!0),!o&&x&&(a&&(l.end=h+s*u),e.push(l),l=ot(t)),a&&(h+=s)}var b=t.length-3;f=t[b],d=t[b+1],g=t[b+2],(_=0===i?f:d)>=r&&_<=n&&st(l,f,d,g),b=l.length-3,o&&b>=3&&(l[b]!==l[0]||l[b+1]!==l[1])&&st(l,l[0],l[1],l[2]),l.length&&e.push(l)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function gt(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(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,o=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;n=n;l--){var c=+Date.now();s=this._cluster(s,l),this.trees[l]=new R(s,X,Z,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},O.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],c=0,h=u.range(q(r),j(o),q(i),j(n));ce&&(p+=g.numPoints||1)}if(p>=o){for(var m=u.x*h,y=u.y*h,_=i&&h>1?this._map(u,!0):null,v=(s<<5)+(e+1)+this.points.length,x=0,b=c;x1)for(var I=0,S=c;I>5},O.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},O.prototype._map=function(t,e){if(t.numPoints)return e?G({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?G({},n):n},yt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},yt.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<1&&console.time("creation"),p=this.tiles[h]=dt(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,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var g,m,y,_,v,x,b=.5*u.buffer/u.extent,w=.5-b,E=.5+b,I=1+b;g=m=y=_=null,v=rt(t,c,r-b,r+E,0,p.minX,p.maxX,u),x=rt(t,c,r+w,r+I,0,p.minX,p.maxX,u),t=null,v&&(g=rt(v,c,n-b,n+E,1,p.minY,p.maxY,u),m=rt(v,c,n+w,n+I,1,p.minY,p.maxY,u),v=null),x&&(y=rt(x,c,n-b,n+E,1,p.minY,p.maxY,u),_=rt(x,c,n+w,n+I,1,p.minY,p.maxY,u),x=null),l>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(_||[],e+1,2*r+1,2*n+1)}}},yt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,c=e,h=r;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[_t(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?pt(this.tiles[s],i):null):null};var xt=function(e){function r(t,r,n,i){e.call(this,t,r,n,vt),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function y(t,e,r,n,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],v.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,a=u;i1&&(s=t[++a]);var l=Math.abs(u-s.left),c=Math.abs(u-s.right),h=Math.min(l,c),p=void 0,f=i/r*(n+1);if(s.isDash){var d=n-Math.abs(f);p=Math.sqrt(h*h+d*d)}else p=n-Math.sqrt(h*h+f*f);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},E.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l1&&(u=t[++s]);var c=Math.abs(l-u.left),h=Math.abs(l-u.right),p=Math.min(c,h);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},E.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=n&&e.x=i&&e.y0&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{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,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),D=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=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(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;ar.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(D),z=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},B.prototype.has=function(t){return t.wrapped().key in this.data},B.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},B.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},B.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},B.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},B.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},B.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},B.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=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)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(Dt(this._source.type)){for(var l={},c={},h=0,p=Object.keys(u);hthis._source.maxzoom){var m=d.children(this._source.maxzoom)[0],y=this.getTile(m);if(y&&y.hasData()){n[m.key]=m;continue}}else{var _=d.children(this._source.maxzoom);if(n[_[0].key]&&n[_[1].key]&&n[_[2].key]&&n[_[3].key])continue}for(var v=g.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(i[b.key])break;if(i[b.key]=!0,!(g=this.getTile(b))&&v&&(g=this._addTile(b)),g&&(n[b.key]=b,v=g.wasRequested(),g.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var o=0,a=e;o0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),l=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,g=0,m=l;g=0&&y[1].y+m>=0){var _=u.map((function(t){return s.getTilePoint(t)})),v=l.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:_,cameraQueryGeometry:v,scale:g})}}},v=0;v=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Lt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Dt(t){return"raster"===t||"image"===t||"video"===t}function Nt(){return new t.window.Worker(Hi.workerUrl)}At.maxOverzooming=10,At.maxUnderzooming=3;var zt="mapboxgl_preloaded_worker_pool",Rt=function(){this.active={}};Rt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[r].mult(u))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function re(e,r,n,i,o,a,s,u){var l=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,m=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,o,a,s,u,l,c,h,p,f,d){var g,m=r/24,y=e.lineOffsetX*m,_=e.lineOffsetY*m;if(e.numGlyphs>1){var v=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ne(m,u,y,_,n,h,p,e,l,a,f);if(!w)return{notEnoughRoom:!0};var E=$t(w.first.point,s).point,I=$t(w.last.point,s).point;if(i&&!n){var S=ie(e.writingMode,E,I,d);if(S)return S}g=[w.first];for(var C=e.glyphStartIndex+1;C0?A.point:ae(p,M,T,1,o),D=ie(e.writingMode,T,L,d);if(D)return D}var N=se(m*u.getoffsetX(e.glyphStartIndex),y,_,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f);if(!N)return{notEnoughRoom:!0};g=[N]}for(var z=0,R=g;z0?1:-1,g=0;i&&(d*=-1,g=Math.PI),d<0&&(g+=Math.PI);for(var m=d>0?u+s:u+s+1,y=o,_=o,v=0,x=0,b=Math.abs(f),w=[];v+x<=b;){if((m+=d)=l)return null;if(_=y,w.push(y),void 0===(y=p[m])){var E=new t.Point(c.getx(m),c.gety(m)),I=$t(E,h);if(I.signedDistanceFromCamera>0)y=p[m]=I.point;else{var S=m-d;y=ae(0===v?a:new t.Point(c.getx(S),c.gety(S)),E,_,b-v+1,h)}}v+=x,x=_.dist(y)}var C=(b-v)/x,T=y.sub(_),P=T.mult(C)._add(_);P._add(T._unit()._perp()._mult(n*d));var M=g+Math.atan2(y.y-_.y,y.x-_.x);return w.push(P),{point:P,angle:M,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},Kt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:a},Kt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!n&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?l.length>0:l},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=a.seenUids,l=this.boxCells[i];if(null!==l)for(var c=this.bboxes,h=0,p=l;h=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var g=this.circleCells[i];if(null!==g)for(var m=this.circles,y=0,_=g;y<_.length;y+=1){var v=_[y];if(!u.circle[v]){u.circle[v]=!0;var x=3*v;if(this._circleAndRectCollide(m[x],m[x+1],m[x+2],t,e,r,n)&&(!s||s(this.circleKeys[v]))){if(a.hitTest)return o.push(!0),!0;var b=m[x],w=m[x+1],E=m[x+2];o.push({key:this.circleKeys[v],x1:b-E,y1:w-E,x2:b+E,y2:w+E})}}}},Kt.prototype._queryCellCircle=function(t,e,r,n,i,o,a,s){var u=a.circle,l=a.seenUids,c=this.boxCells[i];if(null!==c)for(var h=this.bboxes,p=0,f=c;pa*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,u=Math.abs(t-(n+s));if(u>s+r)return!1;var l=(a-i)/2,c=Math.abs(e-(i+l));if(c>l+r)return!1;if(u<=s||c<=l)return!0;var h=u-s,p=c-l;return h*h+p*p<=r*r};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(t,e){for(var r=0;r=1;L--)A.push(P.path[L]);for(var D=1;D0){for(var k=A[0].clone(),O=A[0].clone(),F=1;F=S.x&&O.x<=C.x&&k.y>=S.y&&O.y<=C.y?[A]:O.xC.x||O.yC.y?[]:t.clipLine([A],S.x,S.y,C.x,C.y)}for(var B=0,U=R;B=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(g=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:m,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:g},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:y,placedGlyphBoxes:_}):void 0},be.prototype.placeLayerBucketPart=function(e,r,n){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,l=o.textLabelPlaneMatrix,c=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,f=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,g=o.collisionGroup,m=s.get("text-optional"),y=s.get("icon-optional"),_=s.get("text-allow-overlap"),v=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order"),I=_&&(v||!a.hasIconData()||y),S=v&&(_||!a.hasTextData()||m);!a.collisionArrays&&f&&a.deserializeCollisionBoxes(f);var C=function(e,o){if(!r[e.crossTileID])if(p)i.placements[e.crossTileID]=new ge(!1,!1,!1);else{var f,E=!1,C=!1,T=!0,P=null,M={box:null,offscreen:null},A={box:null,offscreen:null},L=null,D=null,N=0,z=0,R=0;o.textFeatureIndex?N=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(N=e.featureIndex),o.verticalTextFeatureIndex&&(z=o.verticalTextFeatureIndex);var k=o.textBox;if(k){var O=function(r){var n=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,n=o,e))}return n},F=function(r,n){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i0&&(B=B.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var V=function(t,r,n){for(var o=t.x2-t.x1,s=t.y2-t.y1,l=e.textBoxScale,c=w&&!v?r:null,p={box:[],offscreen:!1},f=_?2*B.length:B.length,d=0;d=B.length,e,a,n,c);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){E=!0,P=m.shift;break}}return p};F((function(){return V(k,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(M&&M.box&&M.box.length)&&e.numVerticalGlyphVertices>0&&r?V(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(E=M.box,T=M.offscreen);var q=O(M&&M.box);if(!E&&i.prevPlacement){var j=i.prevPlacement.variableOffsets[e.crossTileID];j&&(i.variableOffsets[e.crossTileID]=j,i.markUsedJustification(a,j.anchor,e,q))}}else{var G=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,_,h,u,g.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(a,r,e),i.placedOrientations[e.crossTileID]=r),n};F((function(){return G(k,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?G(r,t.WritingMode.vertical):{box:null,offscreen:null}})),O(M&&M.box&&M.box.length)}}if(E=(f=M)&&f.box&&f.box.length>0,T=f&&f.offscreen,e.useRuntimeCollisionCircles){var X=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(a.textSizeData,d,X),Y=s.get("text-padding");L=i.collisionIndex.placeCollisionCircles(_,X,a.lineVertexArray,a.glyphOffsetArray,Z,u,l,c,n,b,g.predicate,e.collisionCircleDiameter,Y),E=_||L.circles.length>0&&!L.collisionDetected,T=T&&L.offscreen}if(o.iconFeatureIndex&&(R=o.iconFeatureIndex),o.iconBox){var W=function(t){var e=w&&P?xe(t,P.x,P.y,x,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,v,h,u,g.predicate)};C=A&&A.box&&A.box.length&&o.verticalIconBox?(D=W(o.verticalIconBox)).box.length>0:(D=W(o.iconBox)).box.length>0,T=T&&D.offscreen}var H=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=y||0===e.numIconVertices;if(H||K?K?H||(C=C&&E):E=C&&E:C=E=C&&E,E&&f&&f.box&&i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),a.bucketInstanceId,A&&A.box&&z?z:N,g.ID),C&&D&&i.collisionIndex.insertCollisionBox(D.box,s.get("icon-ignore-placement"),a.bucketInstanceId,R,g.ID),L&&(E&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),a.bucketInstanceId,N,g.ID),n)){var J=a.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new me);for(var $=0;$=0;--P){var M=T[P];C(a.symbolInstances.get(M),a.collisionArrays[M])}else for(var A=e.symbolInstanceStart;A=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:n.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a0,_=i.placedOrientations[o.crossTileID],v=_===t.WritingMode.vertical,x=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(s>0||u>0){var b=Ae(m.text);d(e.text,s,v?Le:b),d(e.text,u,x?Le:b);var w=m.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||v?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var E=i.variableOffsets[o.crossTileID];E&&i.markUsedJustification(e,E.anchor,o,_);var I=i.placedOrientations[o.crossTileID];I&&(i.markUsedJustification(e,"left",o,I),i.markUsedOrientation(e,I,o))}if(y){var S=Ae(m.icon),C=!(p&&o.verticalPlacedIconSymbolIndex&&v);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,C?S:Le),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=m.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,C?Le:S),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var T=e.collisionArrays[n];if(T){var P=new t.Point(0,0);if(T.textBox||T.verticalTextBox){var M=!0;if(l){var A=i.variableOffsets[g];A?(P=ve(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),c&&P._rotate(h?i.transform.angle:-i.transform.angle)):M=!1}T.textBox&&we(e.textCollisionBox.collisionVertexArray,m.text.placed,!M||v,P.x,P.y),T.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,m.text.placed,!M||x,P.x,P.y)}var L=Boolean(!x&&T.verticalIconBox);T.iconBox&&we(e.iconCollisionBox.collisionVertexArray,m.icon.placed,L,p?P.x:0,p?P.y:0),T.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!L,p?P.x:0,p?P.y:0)}}},m=0;mt},be.prototype.setStale=function(){this.stale=!0};var Ee=Math.pow(2,25),Ie=Math.pow(2,24),Se=Math.pow(2,17),Ce=Math.pow(2,16),Te=Math.pow(2,9),Pe=Math.pow(2,8),Me=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,r=Math.floor(127*t.opacity);return r*Ee+e*Ie+r*Se+e*Ce+r*Te+e*Pe+r*Me+e}var Le=0,De=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=[]};De.prototype.continuePlacement=function(t,e,r,n,i){for(var o=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new De(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ne.prototype.commit=function(t){return this.placement.commit(t),this.placement};var ze=512/t.EXTENT/2,Re=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,i)}}for(var c=0;c1?"@2x":"",u=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,c())})),l=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,a||(a=t,o=e,c())}));function c(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var u=i[s],l=u.width,c=u.height,h=u.x,p=u.y,f=u.sdf,d=u.pixelRatio,g=u.stretchX,m=u.stretchY,y=u.content,_=new t.RGBAImage({width:l,height:c});t.RGBAImage.copy(e,_,{x:h,y:p},{x:0,y:0},{width:l,height:c}),r[s]={data:_,pixelRatio:d,sdf:f,stretchX:g,stretchY:m,content:y}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new At(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Be(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,u=t;s=0;f--){var d=this._order[f];if(r(d))for(var g=i.length-1;g>=0;g--){var m=i[g].feature;if(n[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;}"),$e=yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=yr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=yr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=yr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=yr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=yr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=yr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),lr=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=yr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),fr=yr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),dr=yr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),mr=yr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var o="float"===n?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:a}}var _r=Object.freeze({__proto__:null,prelude:Xe,background:Ze,backgroundPattern:Ye,circle:We,clippingMask:He,heatmap:Ke,heatmapTexture:Je,collisionBox:Qe,collisionCircle:$e,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:ur,line:lr,lineGradient:cr,linePattern:hr,lineSDF:pr,raster:fr,symbolIcon:dr,symbolSDF:gr,symbolTextAndIcon:mr}),vr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function xr(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}br.prototype.draw=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g){var m,y=t.gl;if(!this.failedToCreate){for(var _ in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[_].set(a[_]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var v=(m={},m[y.LINES]=2,m[y.TRIANGLES]=3,m[y.LINE_STRIP]=1,m)[e],x=0,b=c.get();x0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:qr(i.paint.get("raster-hue-rotate"))};var o,a};function qr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var jr,Gr=function(t,e,r,n,i,o,a,s,u,l){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+n,u_texsize:l,u_texture:0}},Xr=function(e,r,n,i,o,a,s,u,l,c,h){var p=o.transform;return t.extend(Gr(e,r,n,i,o,a,s,u,l,c),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Zr=function(e,r,n,i,o,a,s,u,l,c){return t.extend(Xr(e,r,n,i,o,a,s,u,!0,l,!0),{u_texsize_icon:c,u_texture_icon:1})},Yr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Wr=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,h=c*(n.tileID.canonical.x+n.tileID.wrap*l),p=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Hr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,o,a,s){for(var u=e.context,l=u.gl,c=e.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d0){var b=t.create(),w=_;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),h.push({circleArray:x,circleOffset:f,transform:w,invTransform:b}),f=p+=x.length/4}v&&c.draw(u,l.LINES,St.disabled,Ct.disabled,e.colorModeForRenderPass(),Pt.disabled,Ar(_,e.transform,m),n.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,e.transform.zoom,null,null,v.collisionVertexBuffer)}}if(s&&h.length){var E=e.useProgram("collisionCircle"),I=new t.StructArrayLayout2f1f2i16;I.resize(4*p),I._trim();for(var S=0,C=0,T=h;C=0&&(g[y.associatedIconIndex]={shiftedAnchor:I,angle:S})}else le(y.numGlyphs,f)}if(h){d.clear();for(var T=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),u=(s-e.timeAdded)/a,l=r?(s-r.timeAdded)/a:-1,c=n.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-l,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var ln=new t.Color(1,0,0,1),cn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),fn=new t.Color(0,1,1,1);function dn(t,e,r,n){mn(t,0,e+r/2,t.transform.width,r,n)}function gn(t,e,r,n){mn(t,e-r/2,0,r,t.transform.height,n)}function mn(e,r,n,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function yn(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),u=St.disabled,l=Ct.disabled,c=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,l,c,Pt.disabled,Dr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),f=r.getTile(n).tileSize,d=512/Math.min(f,512)*(n.overscaledZ/e.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,g+" "+p+"kb"),s.draw(i,o.TRIANGLES,u,l,Tt.alphaBlended,Pt.disabled,Dr(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var _n={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=Ct.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var u=r.transform,l="map"===o,c="map"===a,h=0,p=e;h256&&this.clearStencil(),r.setColorMode(Tt.disabled),r.setDepthMode(St.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Ct({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},vn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Ct({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},vn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var x=this.style._layers[i[this.currentLayer]],b=o[x.source],w=c[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},vn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},vn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,t,_r[t],e,Hr[t],this._showOverdrawInspector)),this.cache[r]},vn.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()},vn.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)},vn.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))},vn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var xn=function(t,e){this.points=t,this.planes=e};xn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],r,n)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new xn(o,a)};var bn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o=0;if(0===a)return 0;a!==r.length&&(n=!1)}if(n)return 2;for(var u=0;u<3;u++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;hthis.max[u]-this.min[u])return 0}return 1};var wn=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};wn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},wn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},wn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var En=function(e,r,n,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},In={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}};En.prototype.clone=function(){var t=new En(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},In.minZoom.get=function(){return this._minZoom},In.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},In.maxZoom.get=function(){return this._maxZoom},In.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},In.minPitch.get=function(){return this._minPitch},In.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},In.maxPitch.get=function(){return this._maxPitch},In.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},In.renderWorldCopies.get=function(){return this._renderWorldCopies},In.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},In.worldSize.get=function(){return this.tileSize*this.scale},In.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},In.size.get=function(){return new t.Point(this.width,this.height)},In.bearing.get=function(){return-this.angle/Math.PI*180},In.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},In.pitch.get=function(){return this._pitch/Math.PI*180},In.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},In.fov.get=function(){return this._fov/Math.PI*180},In.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())},In.zoom.get=function(){return this._zoom},In.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())},In.center.get=function(){return this._center},In.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},In.padding.get=function(){return this._edgeInsets.toJSON()},In.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},In.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},En.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},En.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},En.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)},En.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),u=Math.floor(Math.max(n.x,i.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&r.push(new t.UnwrappedTileID(l,e));return r},En.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*i.x,o*i.y,0],s=xn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var l=function(t){return{aabb:new bn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],p=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(l(-d)),c.push(l(d));for(c.push(l(0));c.length>0;){var g=c.pop(),m=g.x,y=g.y,_=g.fullyVisible;if(!_){var v=g.aabb.intersects(s);if(0===v)continue;_=2===v}var x=g.aabb.distanceX(a),b=g.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(g.zoom===p||w>3+(1<=u)h.push({tileID:new t.OverscaledTileID(g.zoom===p?f:g.zoom,g.wrap,g.zoom,m,y),distanceSq:t.sqrLen([a[0]-.5-m,a[1]-.5-y])});else for(var E=0;E<4;E++){var I=(m<<1)+E%2,S=(y<<1)+(E>>1);c.push({aabb:g.aabb.quadrant(E),zoom:g.zoom+1,x:I,y:S,wrap:g.wrap,fullyVisible:_})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},En.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},In.unmodified.get=function(){return this._unmodified},En.prototype.zoomScale=function(t){return Math.pow(2,t)},En.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},En.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},En.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},In.point.get=function(){return this.project(this.center)},En.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},En.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},En.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},En.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},En.prototype.coordinateLocation=function(t){return t.toLngLat()},En.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[1]/i,s=n[1]/o,u=r[2]/i,l=n[2]/o,c=u===l?0:(0-u)/(l-u);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/o,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},En.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},En.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},En.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},En.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])},En.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,r?this.alignedProjMatrix:this.projMatrix,u),i[n]=new Float32Array(u),i[n]},En.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},En.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-oa&&(i=a-m)}if(this.lngRange){var y=f.x,_=l.x/2;y-_u&&(n=u-_)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},En.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,l,u),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),g=a-Math.round(a)+f*h+d*p,m=s-Math.round(s)+f*p+d*h,y=new Float64Array(c);if(t.translate(y,y,[g>.5?g-1:g,m>.5?m-1:m,0]),this.alignedProjMatrix=y,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},En.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},En.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},En.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,u=e;s=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},Sn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Cn={linearity:.3,easing:t.bezier(0,0,.3,1)},Tn=t.extend({deceleration:2500,maxSpeed:1400},Cn),Pn=t.extend({deceleration:20,maxSpeed:1400},Cn),Mn=t.extend({deceleration:1e3,maxSpeed:360},Cn),An=t.extend({deceleration:1e3,maxSpeed:90},Cn),Ln=function(t){this._map=t,this.clear()};function Dn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Ln.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new zn(t.type,this._map,t))},On.prototype.dblclick=function(t){return this._firePreventable(new zn(t.type,this._map,t))},On.prototype.mouseover=function(t){this._map.fire(new zn(t.type,this._map,t))},On.prototype.mouseout=function(t){this._map.fire(new zn(t.type,this._map,t))},On.prototype.touchstart=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},On.prototype.touchmove=function(t){this._map.fire(new Rn(t.type,this._map,t))},On.prototype.touchend=function(t){this._map.fire(new Rn(t.type,this._map,t))},On.prototype.touchcancel=function(t){this._map.fire(new Rn(t.type,this._map,t))},On.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},On.prototype.isEnabled=function(){return!0},On.prototype.isActive=function(){return!1},On.prototype.enable=function(){},On.prototype.disable=function(){};var Fn=function(t){this._map=t};Fn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Fn.prototype.mousemove=function(t){this._map.fire(new zn(t.type,this._map,t))},Fn.prototype.mousedown=function(){this._delayContextMenu=!0},Fn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Fn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new zn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var Bn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Un(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Vn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var qn=function(t){this.singleTap=new Vn(t),this.numTaps=t.numTaps,this.reset()};qn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},qn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},qn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},qn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var jn=function(){this._zoomIn=new qn({numTouches:1,numTaps:2}),this._zoomOut=new qn({numTouches:2,numTaps:1}),this.reset()};jn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},jn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},jn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},jn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},jn.prototype.touchcancel=function(){this.reset()},jn.prototype.enable=function(){this._enabled=!0},jn.prototype.disable=function(){this._enabled=!1,this.reset()},jn.prototype.isEnabled=function(){return this._enabled},jn.prototype.isActive=function(){return this._active};var Gn={0:1,2:2},Xn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Xn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Xn.prototype._correctButton=function(t,e){return!1},Xn.prototype._move=function(t,e){return{}},Xn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Xn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Gn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Un(n,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var l=i[u],c=this._touches[u];c&&(o._add(l),a._add(l.sub(c)),s++,i[u]=l)}if(this._touches=i,!(sMath.abs(t.x)}var ni=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,ri(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ri(t)&&ri(e)&&o}},e}(Kn),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function ai(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active},oi.prototype.disableRotation=function(){this._rotationDisabled=!0},oi.prototype.enableRotation=function(){this._rotationDisabled=!1};var si=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.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 n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,u=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&u&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=l(h);a=t.number(u,s,p),h<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},si.prototype.reset=function(){this._active=!1};var ui=function(t,e){this._clickZoom=t,this._tapZoom=e};ui.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ui.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ui.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ui.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var li=function(){this.reset()};li.prototype.reset=function(){this._active=!1},li.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var ci=function(){this._tap=new qn({numTouches:1,numTaps:1}),this.reset()};ci.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ci.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},ci.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},ci.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},ci.prototype.touchcancel=function(){this.reset()},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var hi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};fi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},gi=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 mi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var yi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ln(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;oo?Math.min(2,b):Math.max(.5,b),w=Math.pow(m,1-e),E=i.unproject(v.add(x.mult(e*w)).mult(g));i.setLocationAtPoint(i.renderWorldCopies?E.wrap():E,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:u,f="padding"in e?e.padding:o.padding,d=o.zoomScale(c-a),g=t.Point.convert(e.offset),m=o.centerPoint.add(g),y=o.pointLocation(m),_=t.LngLat.convert(e.center||y);this._normalizeCenter(_);var v=o.project(y),x=o.project(_).sub(v),b=e.curve,w=Math.max(o.width,o.height),E=w/d,I=x.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),C=w/o.zoomScale(S-a);b=Math.sqrt(C/I*2)}var T=b*b;function P(t){var e=(E*E-w*w+(t?-1:1)*T*T*I*I)/(2*(t?E:w)*T*I);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}var L=P(0),D=function(t){return A(L)/A(L+b*t)},N=function(t){return w*((A(L)*(M(e=L+b*t)/A(e))-M(L))/T)/I;var e},z=(P(1)-L)/b;if(Math.abs(I)<1e-6||!isFinite(z)){if(Math.abs(w-E)<1e-6)return this.easeTo(e,r);var R=Ee.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==u,this._padding=!o.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var i=e*z,d=1/D(i);o.zoom=1===e?c:a+o.scaleZoom(d),n._rotating&&(o.bearing=t.number(s,h,e)),n._pitching&&(o.pitch=t.number(u,p,e)),n._padding&&(o.interpolatePadding(l,f,e),m=o.centerPoint.add(g));var y=1===e?_:o.unproject(v.add(x.mult(N(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?y.wrap():y,m),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),vi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};vi.prototype.getDefaultPosition=function(){return"bottom-right"},vi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},vi.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},vi.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},vi.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},vi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},vi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var xi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xi.prototype.getDefaultPosition=function(){return"bottom-left"},xi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},xi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var bi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.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 i=new En(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new bi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wi,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ii))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new yi(this,e),this._hash=e.hash&&new Sn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new vi({customAttribution:e.customAttribution})),this.addControl(new xi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&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")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.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")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new zn(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new zn(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new zn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var o=n[t],a=0;a180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Li.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Li.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Li.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()},Li.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Li.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)},Li.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Li.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Li.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))},Li.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))},Li.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Oi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Fi=0,Bi=!1,Ui=function(e){function n(r){e.call(this),this.options=t.extend({},Oi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Ri?n(Ri):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){n(Ri="denied"!==t.state)})):n(Ri=!!t.window.navigator.geolocation),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fi=0,Bi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Bi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new ki(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ki({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"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.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":Fi--,Bi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Fi>1?(e={maximumAge:6e5,timeout:0},Bi=!0):(e=this.options.positionOptions,Bi=!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},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Vi={maxWidth:100,unit:"metric"},qi=function(e){this.options=t.extend({},Vi,e),t.bindAll(["_onMove","setUnit"],this)};function ji(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([n,i]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var u=3.2808*s;u>5280?Gi(e,n,u/5280,t._getUIString("ScaleControl.Miles")):Gi(e,n,u,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Gi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Gi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Gi(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+n}qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._onMove=function(){ji(this._map,this._container,this.options)},qi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qi.prototype.setUnit=function(t){this.options.unit=t,ji(this._map,this._container,this.options)};var Xi=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")};Xi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Xi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Xi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Xi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Xi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Xi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Xi.prototype._isFullscreen=function(){return this._fullscreen},Xi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Xi.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 Zi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Yi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Wi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Zi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.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},n.prototype.getLngLat=function(){return this._lngLat},n.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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Di(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,l=this._container.offsetHeight;s=i.y+a.bottom.ythis._map.transform.height-l?["bottom"]:[],i.xthis._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var c=i.add(a[o]).round();r.setTransform(this._container,Ni[o]+" translate("+c.x+"px,"+c.y+"px)"),zi(this._container,o,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Yi);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),Hi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ti,NavigationControl:Ai,GeolocateControl:Ui,AttributionControl:vi,ScaleControl:qi,FullscreenControl:Xi,Popup:Wi,Marker:ki,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Ft().acquire(zt)},clearPrewarmedResources:function(){var t=kt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),kt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Rt.workerCount},set workerCount(t){Rt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Hi})),r}()},379:(t,e,r)=>{"use strict";var n,i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),o=[];function a(t){for(var e=-1,r=0;r{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(379),e=r.n(t),n=r(113);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var i=r(754);e()(i.Z,{insert:"head",singleton:!1}),i.Z.locals,r(631)})()})(); \ No newline at end of file +/*! For license information please see app.js.LICENSE.txt */ +(()=>{var t={9631:(t,e,r)=>{var n=r(6158),i=r(7331);const o=new n.Map({container:"map",style:{version:8,sources:{m_mono:{type:"raster",tiles:["https://tile.mierune.co.jp/mierune_mono/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"m_mono",type:"raster",source:"m_mono",minzoom:0,maxzoom:18}]},center:[139.77,35.676],zoom:13});o.on("load",(function(){const t=i.featureCollection([i.point([139.7594,35.6865]),i.point([139.7692,35.6665]),i.point([139.7812,35.6849])]);o.addSource("FeaturesPoint",{type:"geojson",data:t}),o.addLayer({id:"FeaturesPoint",type:"circle",source:"FeaturesPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#1253A4","circle-stroke-width":5,"circle-stroke-opacity":.8,"circle-color":"#1253A4","circle-radius":5,"circle-opacity":.5}});const e=i.center(t);o.addSource("CenterPoint",{type:"geojson",data:e}),o.addLayer({id:"CenterPoint",type:"circle",source:"CenterPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#8DCF3F","circle-stroke-width":10,"circle-stroke-opacity":.8,"circle-color":"#8DCF3F","circle-radius":10,"circle-opacity":.5}})})),o.addControl(new n.NavigationControl)},9705:(t,e,r)=>{"use strict";var n=r(1540);function i(t){var e=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]{"use strict";function r(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function n(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(t[0])||!f(t[1]))throw new Error("coordinates must contain numbers");return r({type:"Point",coordinates:t},e,n)}function i(t,e,n){void 0===n&&(n={});for(var i=0,o=t;i=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return p(h(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=p,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),r)},e.convertArea=function(t,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[r];if(!i)throw new Error("invalid original units");var o=e.areaFactors[n];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=f,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!f(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},1540:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4102);function i(t,e,r){if(null!==t)for(var n,o,a,s,u,l,c,h,p=0,f=0,d=t.type,g="FeatureCollection"===d,y="Feature"===d,m=g?t.features.length:1,v=0;vl||f>c||d>h)return u=i,l=r,c=f,h=d,void(a=0);var g=n.lineString([u,i],t.properties);if(!1===e(g,r,o,d,a))return!1;a++,u=i}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,r,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s{"use strict";r.r(e),r.d(e,{along:()=>rr,angle:()=>Qo,applyFilter:()=>ba,area:()=>Qe,areaFactors:()=>p,bbox:()=>ht,bboxClip:()=>Zr,bboxPolygon:()=>be,bearing:()=>Ce,bearingToAngle:()=>A,bearingToAzimuth:()=>A,bezier:()=>ve,bezierSpline:()=>ve,booleanClockwise:()=>an,booleanContains:()=>ki,booleanCrosses:()=>Bi,booleanDisjoint:()=>Li,booleanEqual:()=>qi,booleanIntersects:()=>ji,booleanOverlap:()=>Vi,booleanParallel:()=>Ki,booleanPointInPolygon:()=>Et,booleanPointOnLine:()=>sr,booleanWithin:()=>cr,buffer:()=>Js,center:()=>Me,centerMean:()=>Yo,centerMedian:()=>Ho,centerOfMass:()=>Ae,centroid:()=>Te,circle:()=>Se,cleanCoords:()=>ue,clone:()=>Dt,clusterEach:()=>va,clusterReduce:()=>_a,clusters:()=>u,clustersDbscan:()=>Xi,clustersKmeans:()=>Yi,collect:()=>ne,collectionOf:()=>G,combine:()=>Le,concave:()=>ee,containsNumber:()=>V,convertArea:()=>N,convertDistance:()=>R,convertLength:()=>R,convex:()=>wt,coordAll:()=>$,coordEach:()=>Y,coordReduce:()=>W,createBins:()=>xa,degrees2radians:()=>k,degreesToRadians:()=>k,destination:()=>Ie,difference:()=>Sa,dissolve:()=>eu,distance:()=>Ct,distanceToDegrees:()=>T,distanceToRadians:()=>M,distanceWeight:()=>na,earthRadius:()=>l,ellipse:()=>Zo,envelope:()=>we,explode:()=>ke,factors:()=>c,feature:()=>f,featureCollection:()=>b,featureEach:()=>J,featureOf:()=>j,featureReduce:()=>Q,filterProperties:()=>Ea,findPoint:()=>lt,findSegment:()=>ut,flatten:()=>fr,flattenEach:()=>rt,flattenReduce:()=>nt,flip:()=>ie,geojsonType:()=>q,geomEach:()=>tt,geomReduce:()=>et,geometry:()=>d,geometryCollection:()=>S,getCluster:()=>ma,getCoord:()=>B,getCoords:()=>U,getGeom:()=>X,getType:()=>Z,greatCircle:()=>Tr,helpers:()=>n,hexGrid:()=>iu,inside:()=>Et,interpolate:()=>cu,intersect:()=>$s,invariant:()=>i,isNumber:()=>D,isObject:()=>O,isobands:()=>pi,isolines:()=>xt,kinks:()=>We,length:()=>nr,lengthToDegrees:()=>T,lengthToRadians:()=>M,lineArc:()=>Dr,lineChunk:()=>dr,lineDistance:()=>nr,lineEach:()=>at,lineIntersect:()=>Ue,lineOffset:()=>xi,lineOverlap:()=>Kr,lineReduce:()=>st,lineSegment:()=>ze,lineSlice:()=>ir,lineSliceAlong:()=>or,lineSplit:()=>Nr,lineString:()=>_,lineStringToPolygon:()=>qr,lineStrings:()=>x,lineToPolygon:()=>qr,mask:()=>su,meta:()=>o,midpoint:()=>Pe,moranIndex:()=>ia,multiLineString:()=>w,multiPoint:()=>E,multiPolygon:()=>I,nearest:()=>Oe,nearestPoint:()=>Oe,nearestPointOnLine:()=>Ve,nearestPointToLine:()=>Ze,planepoint:()=>Ye,point:()=>g,pointGrid:()=>hr,pointOnFeature:()=>Ke,pointOnLine:()=>Ve,pointOnSurface:()=>Ke,pointToLineDistance:()=>Xe,points:()=>y,pointsWithinPolygon:()=>St,polygon:()=>m,polygonSmooth:()=>ea,polygonTangents:()=>on,polygonToLine:()=>zr,polygonToLineString:()=>zr,polygonize:()=>Pi,polygons:()=>v,projection:()=>a,propEach:()=>H,propReduce:()=>K,propertiesContainsFilter:()=>wa,radians2degrees:()=>L,radiansToDegrees:()=>L,radiansToDistance:()=>P,radiansToLength:()=>P,random:()=>s,randomLineString:()=>da,randomPoint:()=>pa,randomPolygon:()=>fa,randomPosition:()=>ha,rewind:()=>cn,rhumbBearing:()=>tn,rhumbDestination:()=>en,rhumbDistance:()=>qe,round:()=>C,sample:()=>xe,sector:()=>Qr,segmentEach:()=>it,segmentReduce:()=>ot,shortestPath:()=>no,simplify:()=>ye,square:()=>Ee,squareGrid:()=>uu,standardDeviationalEllipse:()=>Jo,tag:()=>_e,tesselate:()=>De,tin:()=>Pt,toMercator:()=>aa,toWgs84:()=>sa,transformRotate:()=>fi,transformScale:()=>gi,transformTranslate:()=>yi,triangleGrid:()=>lu,truncate:()=>pr,union:()=>Qs,unitsFactors:()=>h,unkinkPolygon:()=>wr,validateBBox:()=>z,validateId:()=>F,voronoi:()=>Go,within:()=>St});var n={};r.r(n),r.d(n,{areaFactors:()=>p,bearingToAzimuth:()=>A,convertArea:()=>N,convertLength:()=>R,degreesToRadians:()=>k,earthRadius:()=>l,factors:()=>c,feature:()=>f,featureCollection:()=>b,geometry:()=>d,geometryCollection:()=>S,isNumber:()=>D,isObject:()=>O,lengthToDegrees:()=>T,lengthToRadians:()=>M,lineString:()=>_,lineStrings:()=>x,multiLineString:()=>w,multiPoint:()=>E,multiPolygon:()=>I,point:()=>g,points:()=>y,polygon:()=>m,polygons:()=>v,radiansToDegrees:()=>L,radiansToLength:()=>P,round:()=>C,unitsFactors:()=>h,validateBBox:()=>z,validateId:()=>F});var i={};r.r(i),r.d(i,{collectionOf:()=>G,containsNumber:()=>V,featureOf:()=>j,geojsonType:()=>q,getCoord:()=>B,getCoords:()=>U,getGeom:()=>X,getType:()=>Z});var o={};r.r(o),r.d(o,{coordAll:()=>$,coordEach:()=>Y,coordReduce:()=>W,featureEach:()=>J,featureReduce:()=>Q,findPoint:()=>lt,findSegment:()=>ut,flattenEach:()=>rt,flattenReduce:()=>nt,geomEach:()=>tt,geomReduce:()=>et,lineEach:()=>at,lineReduce:()=>st,propEach:()=>H,propReduce:()=>K,segmentEach:()=>it,segmentReduce:()=>ot});var a={};r.r(a),r.d(a,{toMercator:()=>aa,toWgs84:()=>sa});var s={};r.r(s),r.d(s,{randomLineString:()=>da,randomPoint:()=>pa,randomPolygon:()=>fa,randomPosition:()=>ha});var u={};r.r(u),r.d(u,{applyFilter:()=>ba,clusterEach:()=>va,clusterReduce:()=>_a,createBins:()=>xa,filterProperties:()=>Ea,getCluster:()=>ma,propertiesContainsFilter:()=>wa});var l=6371008.8,c={centimeters:100*l,centimetres:100*l,degrees:l/111325,feet:3.28084*l,inches:39.37*l,kilometers:l/1e3,kilometres:l/1e3,meters:l,metres:l,miles:l/1609.344,millimeters:1e3*l,millimetres:1e3*l,nauticalmiles:l/1852,radians:1,yards:l/1.0936},h={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/l,yards:1/1.0936},p={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function f(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function d(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return g(e).geometry;case"LineString":return _(e).geometry;case"Polygon":return m(e).geometry;case"MultiPoint":return E(e).geometry;case"MultiLineString":return w(e).geometry;case"MultiPolygon":return I(e).geometry;default:throw new Error(t+" is invalid")}}function g(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!D(t[0])||!D(t[1]))throw new Error("coordinates must contain numbers");return f({type:"Point",coordinates:t},e,r)}function y(t,e,r){return void 0===r&&(r={}),b(t.map((function(t){return g(t,e)})),r)}function m(t,e,r){void 0===r&&(r={});for(var n=0,i=t;n=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function P(t,e){void 0===e&&(e="kilometers");var r=c[e];if(!r)throw new Error(e+" units is invalid");return t*r}function M(t,e){void 0===e&&(e="kilometers");var r=c[e];if(!r)throw new Error(e+" units is invalid");return t/r}function T(t,e){return L(M(t,e))}function A(t){var e=t%360;return e<0&&(e+=360),e}function L(t){return t%(2*Math.PI)*180/Math.PI}function k(t){return t%360*Math.PI/180}function R(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return P(M(t,e),r)}function N(t,e,r){if(void 0===e&&(e="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=p[e];if(!n)throw new Error("invalid original units");var i=p[r];if(!i)throw new Error("invalid final units");return t/n*i}function D(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function O(t){return!!t&&t.constructor===Object}function z(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!D(t))throw new Error("bbox must only contain numbers")}))}function F(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function B(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function U(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function V(t){if(t.length>1&&D(t[0])&&D(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return V(t[0]);throw new Error("coordinates must only contain numbers")}function q(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)}function j(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)}function G(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0,i=t.features;ns||p>u||f>l)return a=o,s=r,u=p,l=f,void(i=0);var d=_([a,o],t.properties);if(!1===e(d,r,n,f,i))return!1;i++,a=o}))&&void 0}}}))}function ot(t,e,r){var n=r,i=!1;return it(t,(function(t,o,a,s,u){n=!1===i&&void 0===r?t:e(n,t,o,a,s,u),i=!0})),n}function at(t,e){if(!t)throw new Error("geojson is required");rt(t,(function(t,r,n){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,n,0,0))return!1;break;case"Polygon":for(var a=0;at[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=e?8:0,s|=l>=e?4:0,s|=c>=e?2:0;var p,f,d,g,y=!1;if(5==(s|=h>=e?1:0)||10===s){var m=(u+l+c+h)/4;5===s&&m=0&&g>=0&&g=0;c--)if(Math.abs(u[c][0][0]-o)<=1e-7&&Math.abs(u[c][0][1]-a)<=1e-7){for(var h=n.path.length-2;h>=0;--h)u[c].unshift(n.path[h]);i=!0;break}i||(u[l++]=n.path)}var p}))})),u);return"function"==typeof dt.successCallback&&dt.successCallback(c),c}function yt(t,e,r){return(t-e)/(r-e)}function mt(t){return 0===t.cval||15===t.cval}function vt(t){mt(t)||5===t.cval||10===t.cval||(t.cval=15)}function _t(t,e){return"top"===e?[t.top,1]:"bottom"===e?[t.bottom,0]:"right"===e?[1,t.right]:"left"===e?[0,t.left]:void 0}const xt=function(t,e,r){if(!O(r=r||{}))throw new Error("options is invalid");var n=r.zProperty||"elevation",i=r.commonProperties||{},o=r.breaksProperties||[];if(G(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!O(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var a=function(t,e){if(!O(e=e||{}))throw new Error("options is invalid");var r=e.zProperty||"elevation",n=e.flip,i=e.flags;G(t,"Point","input must contain Points");for(var o=function(t,e){var r={};return J(t,(function(t){var e=U(t)[1];r[e]||(r[e]=[]),r[e].push(t)})),Object.keys(r).map((function(t){return r[t].sort((function(t,e){return U(t)[0]-U(e)[0]}))})).sort((function(t,r){return e?U(t[0])[1]-U(r[0])[1]:U(r[0])[1]-U(t[0])[1]}))}(t,n),a=[],s=0;s3?m([n]):null}function Et(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=B(t),i=X(e),o=i.type,a=e.bbox,s=i.coordinates;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(n,a))return!1;"Polygon"===o&&(s=[s]);for(var u=!1,l=0;lt[1]!=l>t[1]&&t[0]<(u-a)*(t[1]-s)/(l-s)+a&&(n=!n)}return n}const St=function(t,e){var r=[];return J(t,(function(t){var n=!1;tt(e,(function(e){Et(t,e)&&(n=!0)})),n&&r.push(t)})),b(r)},Ct=function(t,e,r){void 0===r&&(r={});var n=B(t),i=B(e),o=k(i[1]-n[1]),a=k(i[0]-n[0]),s=k(n[1]),u=k(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(u);return P(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),r.units)};function Pt(t,e){var r=!1;return b(function(t){if(t.length<3)return[];t.sort(Tt);for(var e,r,n,i,o,a,s=t.length-1,u=t[s].x,l=t[0].x,c=t[s].y,h=c;s--;)t[s].yh&&(h=t[s].y);var p,f=l-u,d=h-c,g=f>d?f:d,y=.5*(l+u),m=.5*(h+c),v=[new Mt({__sentinel:!0,x:y-20*g,y:m-g},{__sentinel:!0,x:y,y:m+20*g},{__sentinel:!0,x:y+20*g,y:m-g})],_=[],x=[];for(s=t.length;s--;){for(x.length=0,p=v.length;p--;)(f=t[s].x-v[p].x)>0&&f*f>v[p].r?(_.push(v[p]),v.splice(p,1)):f*f+(d=t[s].y-v[p].y)*d>v[p].r||(x.push(v[p].a,v[p].b,v[p].b,v[p].c,v[p].c,v[p].a),v.splice(p,1));for(At(x),p=x.length;p;)r=x[--p],e=x[--p],n=t[s],i=r.x-e.x,o=r.y-e.y,a=2*(i*(n.y-r.y)-o*(n.x-r.x)),Math.abs(a)>1e-12&&v.push(new Mt(e,r,n))}for(Array.prototype.push.apply(_,v),s=_.length;s--;)(_[s].a.__sentinel||_[s].b.__sentinel||_[s].c.__sentinel)&&_.splice(s,1);return _}(t.features.map((function(t){var n={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?n.z=t.properties[e]:3===t.geometry.coordinates.length&&(r=!0,n.z=t.geometry.coordinates[2]),n}))).map((function(t){var e=[t.a.x,t.a.y],n=[t.b.x,t.b.y],i=[t.c.x,t.c.y],o={};return r?(e.push(t.a.z),n.push(t.b.z),i.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},m([[e,n,i,e]],o)})))}var Mt=function(t,e,r){this.a=t,this.b=e,this.c=r;var n,i,o=e.x-t.x,a=e.y-t.y,s=r.x-t.x,u=r.y-t.y,l=o*(t.x+e.x)+a*(t.y+e.y),c=s*(t.x+r.x)+u*(t.y+r.y),h=2*(o*(r.y-e.y)-a*(r.x-e.x));this.x=(u*l-a*c)/h,this.y=(o*c-s*l)/h,n=this.x-t.x,i=this.y-t.y,this.r=n*n+i*i};function Tt(t,e){return e.x-t.x}function At(t){var e,r,n,i,o,a=t.length;t:for(;a;)for(r=t[--a],e=t[--a],n=a;n;)if(o=t[--n],e===(i=t[--n])&&r===o||e===o&&r===i){t.splice(a,2),t.splice(n,2),a-=2;continue t}}function Lt(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=kt(t.properties),e.geometry=Rt(t.geometry),e}function kt(t){var e={};return t?(Object.keys(t).forEach((function(r){var n=t[r];"object"==typeof n?null===n?e[r]=null:Array.isArray(n)?e[r]=n.map((function(t){return t})):e[r]=kt(n):e[r]=n})),e):e}function Rt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Rt(t)})),e):(e.coordinates=Nt(t.coordinates),e)}function Nt(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return Nt(t)}))}const Dt=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Lt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return Lt(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Rt(t);default:throw new Error("unknown GeoJSON type")}};function Ot(t){return t[0].toString()+","+t[1].toString()}function zt(t){return t}function Ft(t,e){var r=function(t){if(null==t)return zt;var e,r,n=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=r=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*n+o,c[1]=(r+=t[1])*i+a;u1)for(var o,s,u=1,l=a(i[0]);ul&&(s=i[0],i[0]=i[u],i[u]=s,l=o);return i}))}}function Ut(t,e,r,n,i,o){3===arguments.length&&(n=o=Array,i=null);for(var a=new n(t=1<=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=n,s[l]=o,o}function h(n,o){for(var l=e(n)&u,c=a[l],h=0;c!=i;){if(r(c,n))return s[l];if(++h>=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=n,s[l]=o,o}function p(n,o){for(var l=e(n)&u,c=a[l],h=0;c!=i;){if(r(c,n))return s[l];if(++h>=t)break;c=a[l=l+1&u]}return o}function f(){for(var t=[],e=0,r=a.length;e>7^Gt[2]^Gt[3])}function Zt(t,e,r,n){Yt(t,e,r),Yt(t,e,e+n),Yt(t,e+n,r)}function Yt(t,e,r){for(var n,i=e+(r---e>>1);en&&(n=o),ai&&(i=a)}function u(t){t.forEach(s)}function l(t){t.forEach(u)}for(var c in t)o(t[c]);return n>=e&&i>=r?[e,r,n,i]:void 0}(t=function(t){var e,r,n={};for(e in t)n[e]=null==(r=t[e])?{type:null}:("FeatureCollection"===r.type?Wt:"Feature"===r.type?Ht:Kt)(r);return n}(t)),n=e>0&&r&&function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=o-n?(r-1)/(o-n):1,u=a-i?(r-1)/(a-i):1;function l(t){return[Math.round((t[0]-n)*s),Math.round((t[1]-i)*u)]}function c(t,e){for(var r,o,a,l,c,h=-1,p=0,f=t.length,d=new Array(f);++h=0){var o=h[r];i===e&&o===n||i===n&&o===e||(++f,p[r]=1)}else c[r]=e,h[r]=n}}function b(t){return Xt(o[t])}function w(t,e){return Vt(o[t],o[e])}l=c=h=null;var E,I=function(t,e,r,n,i){3===arguments.length&&(n=Array,i=null);for(var o=new n(t=1<=t)throw new Error("full hashset");u=o[s=s+1&a]}return o[s]=n,!0}function l(n){for(var s=e(n)&a,u=o[s],l=0;u!=i;){if(r(u,n))return!0;if(++l>=t)break;u=o[s=s+1&a]}return!1}function c(){for(var t=[],e=0,r=o.length;e2&&se(r[i-3],r[i-1],r[i-2])&&r.splice(r.length-2,1))}if(r.push(e[e.length-1]),i=r.length,ae(e[0],e[e.length-1])&&i<4)throw new Error("invalid polygon");return se(r[i-3],r[i-1],r[i-2])&&r.splice(r.length-2,1),r}function ae(t,e){return t[0]===e[0]&&t[1]===e[1]}function se(t,e,r){var n=r[0],i=r[1],o=t[0],a=t[1],s=e[0],u=e[1],l=s-o,c=u-a;return 0==(n-o)*c-(i-a)*l&&(Math.abs(l)>=Math.abs(c)?l>0?o<=n&&n<=s:s<=n&&n<=o:c>0?a<=i&&i<=u:u<=i&&i<=a)}const ue=function(t,e){void 0===e&&(e={});var r="object"==typeof e?e.mutate:e;if(!t)throw new Error("geojson is required");var n=Z(t),i=[];switch(n){case"LineString":i=oe(t);break;case"MultiLineString":case"Polygon":U(t).forEach((function(t){i.push(oe(t))}));break;case"MultiPolygon":U(t).forEach((function(t){var e=[];t.forEach((function(t){e.push(oe(t))})),i.push(e)}));break;case"Point":return t;case"MultiPoint":var o={};U(t).forEach((function(t){var e=t.join("-");o.hasOwnProperty(e)||(i.push(t),o[e]=!0)}));break;default:throw new Error(n+" geometry not supported")}return t.coordinates?!0===r?(t.coordinates=i,t):{type:n,coordinates:i}:!0===r?(t.geometry.coordinates=i,t):f({type:n,coordinates:i},t.properties,{bbox:t.bbox,id:t.id})};function le(t,e,r){var n=e.x,i=e.y,o=r.x-n,a=r.y-i;if(0!==o||0!==a){var s=((t.x-n)*o+(t.y-i)*a)/(o*o+a*a);s>1?(n=r.x,i=r.y):s>0&&(n+=o*s,i+=a*s)}return(o=t.x-n)*o+(a=t.y-i)*a}function ce(t,e,r,n,i){for(var o,a=n,s=e+1;sa&&(o=s,a=u)}a>n&&(o-e>1&&ce(t,e,o,n,i),i.push(t[o]),r-o>1&&ce(t,o,r,n,i))}function he(t,e){var r=t.length-1,n=[t[0]];return ce(t,0,r,e,n),n.push(t[r]),n}function pe(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return he(t=r?t:function(t,e){for(var r,n,i,o,a,s=t[0],u=[s],l=1,c=t.length;le&&(u.push(r),s=r);return s!==r&&u.push(r),u}(t,n),n)}function fe(t,e,r){return pe(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,r).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function de(t,e,r){return t.map((function(t){var n=t.map((function(t){return{x:t[0],y:t[1]}}));if(n.length<4)throw new Error("invalid polygon");for(var i=pe(n,e,r).map((function(t){return[t.x,t.y]}));!ge(i);)i=pe(n,e-=.01*e,r).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function ge(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}const ye=function(t,e){if(!O(e=e||{}))throw new Error("options is invalid");var r=void 0!==e.tolerance?e.tolerance:1,n=e.highQuality||!1,i=e.mutate||!1;if(!t)throw new Error("geojson is required");if(r&&r<0)throw new Error("invalid tolerance");return!0!==i&&(t=Dt(t)),tt(t,(function(t){!function(t,e,r){var n=t.type;if("Point"===n||"MultiPoint"===n)return t;ue(t,!0);var i=t.coordinates;switch(n){case"LineString":t.coordinates=fe(i,e,r);break;case"MultiLineString":t.coordinates=i.map((function(t){return fe(t,e,r)}));break;case"Polygon":t.coordinates=de(i,e,r);break;case"MultiPolygon":t.coordinates=i.map((function(t){return de(t,e,r)}))}}(t,r,n)})),t},me=function(){function t(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;et&&(e.push(n),r=i)}return e},t.prototype.vector=function(t){var e=this.pos(t+10),r=this.pos(t-10);return{angle:180*Math.atan2(e.y-r.y,e.x-r.x)/3.14,speed:Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y)+(r.z-e.z)*(r.z-e.z))}},t.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var r=e/this.duration;if(r>=1)return this.points[this.length-1];var n=Math.floor((this.points.length-1)*r);return function(t,e,r,n,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+n.x*o[1]+r.x*o[2]+e.x*o[3],y:i.y*o[0]+n.y*o[1]+r.y*o[2]+e.y*o[3],z:i.z*o[0]+n.z*o[1]+r.z*o[2]+e.z*o[3]}}((this.length-1)*r-n,this.points[n],this.controls[n][1],this.controls[n+1][0],this.points[n+1])},t}(),ve=function(t,e){void 0===e&&(e={});for(var r=e.resolution||1e4,n=e.sharpness||.85,i=[],o=X(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),a=new me({duration:r,points:o,sharpness:n}),s=0;sa;)r=i[n=Math.floor((o+1)*Math.random())],i[n]=i[o],i[o]=r;return i.slice(a)}(t.features,e))};function be(t,e){void 0===e&&(e={});var r=Number(t[0]),n=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[r,n];return m([[a,[i,n],[i,o],[r,o],a]],e.properties,{bbox:t,id:e.id})}const we=function(t){return be(ht(t))},Ee=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];if(Ct(t.slice(0,2),[n,r])>=Ct(t.slice(0,2),[e,i])){var o=(r+i)/2;return[e,o-(n-e)/2,n,o+(n-e)/2]}var a=(e+n)/2;return[a-(i-r)/2,r,a+(i-r)/2,i]};function Ie(t,e,r,n){void 0===n&&(n={});var i=B(t),o=k(i[0]),a=k(i[1]),s=k(r),u=M(e,n.units),l=Math.asin(Math.sin(a)*Math.cos(u)+Math.cos(a)*Math.sin(u)*Math.cos(s));return g([L(o+Math.atan2(Math.sin(s)*Math.sin(u)*Math.cos(a),Math.cos(u)-Math.sin(a)*Math.sin(l))),L(l)],n.properties)}const Se=function(t,e,r){void 0===r&&(r={});for(var n=r.steps||64,i=r.properties?r.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],a=0;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}(t),r=Re(e.vertices,e.holes,2),n=[],i=[];r.forEach((function(t,n){var o=r[n];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var o=0;oi?r:i,n>o?n:o]}(t,n),r.push(i),n})),r})(r,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),b(e)};var Fe=r(1787);function Be(t,e){var r=U(t),n=U(e);if(2!==r.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==n.length)throw new Error(" line2 must only contain 2 coordinates");var i=r[0][0],o=r[0][1],a=r[1][0],s=r[1][1],u=n[0][0],l=n[0][1],c=n[1][0],h=n[1][1],p=(h-l)*(a-i)-(c-u)*(s-o);if(0===p)return null;var f=((c-u)*(o-l)-(h-l)*(i-u))/p,d=((a-i)*(o-l)-(s-o)*(i-u))/p;return f>=0&&f<=1&&d>=0&&d<=1?g([i+f*(a-i),o+f*(s-o)]):null}const Ue=function(t,e){var r={},n=[];if("LineString"===t.type&&(t=f(t)),"LineString"===e.type&&(e=f(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var i=Be(t,e);return i&&n.push(i),b(n)}var o=Fe();return o.load(ze(e)),J(ze(t),(function(t){J(o.search(t),(function(e){var i=Be(t,e);if(i){var o=U(i).join(",");r[o]||(r[o]=!0,n.push(i))}}))})),b(n)},Ve=function(t,e,r){void 0===r&&(r={});var n=g([1/0,1/0],{dist:1/0}),i=0;return rt(t,(function(t){for(var o=U(t),a=0;a0&&((y=d.features[0]).properties.dist=Ct(e,y,r),y.properties.location=i+Ct(s,y,r)),s.properties.dist180?-360:n[0]-i[0]>180?360:0,R(function(t,e,r){var n=r=void 0===r?l:Number(r),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,a=o-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?a/u:Math.cos(i);return Math.sqrt(a*a+c*c*s*s)*n}(n,i),"meters",r.units)};function je(t,e){return t[0]*e[0]+t[1]*e[1]}function Ge(t,e,r){return"planar"===r.method?qe(t,e,r):Ct(t,e,r)}const Xe=function(t,e,r){if(void 0===r&&(r={}),r.method||(r.method="geodesic"),r.units||(r.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=g(t):"Point"===t.type?t=f(t):j(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=_(e):"LineString"===e.type?e=f(e):j(e,"LineString","line");var n=1/0,i=t.geometry.coordinates;return it(e,(function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],a=function(t,e,r,n){var i=[r[0]-e[0],r[1]-e[1]],o=je([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return Ge(t,e,{method:n.method,units:"degrees"});var a=je(i,i);if(a<=o)return Ge(t,r,{method:n.method,units:"degrees"});var s=o/a;return Ge(t,[e[0]+s*i[0],e[1]+s*i[1]],{method:n.method,units:"degrees"})}(i,e,o,r);a=0&&y<=1&&(_.onLine1=!0),m>=0&&m<=1&&(_.onLine2=!0),!(!_.onLine1||!_.onLine2)&&[_.x,_.y]));o&&n.features.push(g([o[0],o[1]]))}var a,s,u,l,c,h,p,f,d,y,m,v,_}))})),n}function He(t,e,r,n,i,o){return Math.sqrt((i-r)*(i-r)+(o-n)*(o-n))===Math.sqrt((t-r)*(t-r)+(e-n)*(e-n))+Math.sqrt((i-t)*(i-t)+(o-e)*(o-e))}const Ke=function(t){for(var e=function(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?b([f(t)]):b([t]):t}(t),r=Me(e),n=!1,i=0;!n&&i0){e+=Math.abs(tr(t[0]));for(var r=1;r2){for(a=0;a=i&&o===n.length-1);o++){if(i>=e){var a=e-i;if(a){var s=Ce(n[o],n[o-1])-180;return Ie(n[o],a,s,r)}return g(n[o])}i+=Ct(n[o],n[o+1],r)}return g(n[n.length-1])}function nr(t,e){return void 0===e&&(e={}),ot(t,(function(t,r){var n=r.geometry.coordinates;return t+Ct(n[0],n[1],e)}),0)}const ir=function(t,e,r){var n=U(r);if("LineString"!==Z(r))throw new Error("line must be a LineString");for(var i,o=Ve(r,t),a=Ve(r,e),s=[(i=o.properties.index<=a.properties.index?[o,a]:[a,o])[0].geometry.coordinates],u=i[0].properties.index+1;u=c&&h===i.length-1);h++){if(c>e&&0===o.length){if(!(a=e-c))return o.push(i[h]),_(o);s=Ce(i[h],i[h-1])-180,u=Ie(i[h],a,s,n),o.push(u.geometry.coordinates)}if(c>=r)return(a=r-c)?(s=Ce(i[h],i[h-1])-180,u=Ie(i[h],a,s,n),o.push(u.geometry.coordinates),_(o)):(o.push(i[h]),_(o));if(c>=e&&o.push(i[h]),h===i.length-1)return _(o);c+=Ct(i[h],i[h+1],n)}if(c=Math.abs(h)?c>0?a0?s=Math.abs(h)?c>0?a<=i&&i0?s<=o&&o=Math.abs(h)?c>0?a0?s=Math.abs(h)?c>0?a<=i&&i<=u:u<=i&&i<=a:h>0?s<=o&&o<=l:l<=o&&o<=s)}const sr=function(t,e,r){void 0===r&&(r={});for(var n=B(t),i=U(e),o=0;oe[0]||t[2]e[1]||t[3] is required");if("number"!=typeof r)throw new Error(" must be a number");if("number"!=typeof n)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,r);return Y(t,(function(t){!function(t,e,r){t.length>r&&t.splice(r,t.length);for(var n=0;n=0==e}function _r(t){for(var e=0,r=0;r=1||u<=0||l>=1||l<=0))){var g=d,y=!o[g];y&&(o[g]=!0),e?i.push(e(d,t,r,c,h,u,a,s,p,f,l,y)):i.push(d)}}function g(t,e){var r,i,o,a,s=n[t][e],u=n[t][e+1];return s[0]h[e.isect].coord?-1:1})),u=[];w.length>0;){var P=w.pop(),M=P.isect,T=P.parent,A=P.winding,L=u.length,k=[h[M].coord],R=M;if(h[M].ringAndEdge1Walkable)var N=h[M].ringAndEdge1,D=h[M].nxtIsectAlongRingAndEdge1;else N=h[M].ringAndEdge2,D=h[M].nxtIsectAlongRingAndEdge2;for(;!xr(h[M].coord,h[D].coord);){k.push(h[D].coord);var O=void 0;for(n=0;n1)for(e=0;ep&&(g>c&&dc&&gu&&(u=y)}var m=[];if(s&&u0&&Math.abs(x-r[_-1][0])>p){var b=parseFloat(r[_-1][0]),w=parseFloat(r[_-1][1]),E=parseFloat(r[_][0]),I=parseFloat(r[_][1]);if(b>-180&&b-180&&r[_-1][0]c&&b<180&&-180===E&&_+1c&&r[_-1][0]<180){v.push([180,r[_][1]]),_++,v.push([r[_][0],r[_][1]]);continue}if(bc){var S=b;b=E,E=S;var C=w;w=I,I=C}if(b>c&&E=180&&bc?180:-180,M]),(v=[]).push([r[_-1][0]>c?-180:180,M]),m.push(v)}else v=[],m.push(v);v.push([x,r[_][1]])}else v.push([r[_][0],r[_][1]])}}else{var T=[];m.push(T);for(var A=0;A1&&r.push(_(l)),b(r)}function kr(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var r,n=1/0;return J(e,(function(e){var i=Ve(e,t).properties.dist;ic&&p.push(Ie(t,e,c,i).geometry.coordinates),_(p,u)}function Or(t){var e=t%360;return e<0&&(e+=360),e}function zr(t,e){void 0===e&&(e={});var r=X(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),r.type){case"Polygon":return Fr(r,e);case"MultiPolygon":return function(t,e){void 0===e&&(e={});var r=X(t).coordinates,n=e.properties?e.properties:"Feature"===t.type?t.properties:{},i=[];return r.forEach((function(t){i.push(Br(t,n))})),b(i)}(r,e);default:throw new Error("invalid poly")}}function Fr(t,e){return void 0===e&&(e={}),Br(X(t).coordinates,e.properties?e.properties:"Feature"===t.type?t.properties:{})}function Br(t,e){return t.length>1?w(t,e):_(t[0],e)}function Ur(t,e,r,n){e=e||("Feature"===t.type?t.properties:{});var i=X(t),o=i.coordinates,a=i.type;if(!o.length)throw new Error("line must contain coordinates");switch(a){case"LineString":return r&&(o=Vr(o)),m([o],e);case"MultiLineString":var s=[],u=0;return o.forEach((function(t){if(r&&(t=Vr(t)),n){var e=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.abs(e-n)*Math.abs(r-i)}(ht(_(t)));e>u?(s.unshift(t),u=e):s.push(t)}else s.push(t)})),m(s,e);default:throw new Error("geometry type "+a+" is not supported")}}function Vr(t){var e=t[0],r=e[0],n=e[1],i=t[t.length-1],o=i[0],a=i[1];return r===o&&n===a||t.push(e),t}const qr=function(t,e){void 0===e&&(e={});var r=e.properties,n=e.autoComplete,i=e.orderCoords,o=e.mutate;switch(n=void 0===n||n,i=void 0===i||i,(o=void 0!==o&&o)||(t=Dt(t)),t.type){case"FeatureCollection":var a=[];return t.features.forEach((function(t){a.push(U(Ur(t,{},n,i)))})),I(a,r);default:return Ur(t,r,n,i)}};function jr(t,e){var r,n,i,o,a,s,u;for(n=1;n<=8;n*=2){for(r=[],o=!(Xr(i=t[t.length-1],e)&n),a=0;ae[2]&&(r|=2),t[1]e[3]&&(r|=8),r}function Zr(t,e){var r=X(t),n=r.type,i="Feature"===t.type?t.properties:{},o=r.coordinates;switch(n){case"LineString":case"MultiLineString":var a=[];return"LineString"===n&&(o=[o]),o.forEach((function(t){!function(t,e,r){var n,i,o,a,s,u=t.length,l=Xr(t[0],e),c=[];for(r||(r=[]),n=1;n0&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),o.length>=4&&r.push(o))}return r}var Wr=r(251);function Hr(t,e){var r=U(e),n=U(t),i=n[0],o=n[n.length-1],a=t.geometry.coordinates;return Wr(r[0],i)?a.unshift(r[1]):Wr(r[0],o)?a.push(r[1]):Wr(r[1],i)?a.unshift(r[0]):Wr(r[1],o)&&a.push(r[0]),t}const Kr=function(t,e,r){if(void 0===r&&(r={}),!O(r=r||{}))throw new Error("options is invalid");var n,i=r.tolerance||0,o=[],a=Fe(),s=ze(t);return a.load(s),it(e,(function(t){var e=!1;J(a.search(t),(function(r){if(!1===e){var o=U(t).sort(),a=U(r).sort();Wr(o,a)||(0===i?sr(o[0],r)&&sr(o[1],r):Ve(r,o[0]).properties.dist<=i&&Ve(r,o[1]).properties.dist<=i)?(e=!0,n=n?Hr(n,t):t):(0===i?sr(a[0],t)&&sr(a[1],t):Ve(t,a[0]).properties.dist<=i&&Ve(t,a[1]).properties.dist<=i)&&(n=n?Hr(n,r):r)}})),!1===e&&n&&(o.push(n),n=void 0)})),n&&o.push(n),b(o)};function Jr(t){var e=t%360;return e<0&&(e+=360),e}const Qr=function(t,e,r,n,i){if(!O(i=i||{}))throw new Error("options is invalid");var o=i.properties;if(!t)throw new Error("center is required");if(null==r)throw new Error("bearing1 is required");if(null==n)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");if(Jr(r)===Jr(n))return Se(t,e,i);var a=U(t),s=Dr(t,e,r,n,i),u=[[a]];return Y(s,(function(t){u[0].push(t)})),u[0].push(a),m(u,o)};function $r(t,e){var r=k(t[1]),n=k(e[1]),i=k(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(r/2+Math.PI/4));return(L(Math.atan2(i,o))+360)%360}const tn=function(t,e,r){var n;return void 0===r&&(r={}),(n=r.final?$r(B(e),B(t)):$r(B(t),B(e)))>180?-(360-n):n},en=function(t,e,r,n){void 0===n&&(n={});var i=e<0,o=R(Math.abs(e),n.units,"meters");i&&(o=-Math.abs(o));var a=B(t),s=function(t,e,r,n){var i=e/(n=void 0===n?l:Number(n)),o=t[0]*Math.PI/180,a=k(t[1]),s=k(r),u=i*Math.cos(s),c=a+u;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var h=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),p=Math.abs(h)>1e-11?u/h:Math.cos(a);return[(180*(o+i*Math.sin(s)/p)/Math.PI+540)%360-180,180*c/Math.PI]}(a,o,r);return s[0]+=s[0]-a[0]>180?-360:a[0]-s[0]>180?360:0,g(s,n.properties)};function rn(t,e,r,n,i,o){for(var a=0;a0?nn(e,s,i)<0||(i=s):r>0&&n<=0&&(nn(e,s,o)>0||(o=s)),r=n}return[i,o]}function nn(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(r[0]-t[0])*(e[1]-t[1])}const on=function(t,e){var r,n,i,o,a=U(t),s=U(e),u=ht(e),l=0,c=null;switch(a[0]>u[0]&&a[0]u[1]&&a[1]0}function sn(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return tt(t,(function(t){sn(t,e)})),t;case"LineString":return un(U(t),e),t;case"Polygon":return ln(U(t),e),t;case"MultiLineString":return U(t).forEach((function(t){un(t,e)})),t;case"MultiPolygon":return U(t).forEach((function(t){ln(t,e)})),t;case"Point":case"MultiPoint":return t}}function un(t,e){an(t)===e&&t.reverse()}function ln(t,e){an(t[0])!==e&&t[0].reverse();for(var r=1;r is required");if("boolean"!=typeof r)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=Dt(t));var i=[];switch(t.type){case"GeometryCollection":return tt(t,(function(t){sn(t,r)})),t;case"FeatureCollection":return J(t,(function(t){J(sn(t,r),(function(t){i.push(t)}))})),b(i)}return sn(t,r)};var hn={successCallback:null,verbose:!1,polygons:!1},pn={};function fn(t,e,r,n){n=n||{};for(var i=Object.keys(hn),o=0;oa?128:64,l|=ha?32:16,l|=pa?8:4;var d=+(l|=fa?2:1),g=0;if(17===l||18===l||33===l||34===l||38===l||68===l||72===l||98===l||102===l||132===l||136===l||137===l||152===l||153===l){var y=(c+h+p+f)/4;g=y>a?2:y0?(l=156,g=4):l=152:33===l?g>0?(l=139,g=4):l=137:72===l?g>0?(l=99,g=4):l=98:132===l&&(g>0?(l=39,g=4):l=38)}if(0!=l&&170!=l){var m,v,_,x,b,w,E,I;m=v=_=x=b=w=E=I=.5;var S=[];1===l?(_=1-ni(e,p,f),I=1-ni(e,c,f),S.push(Jn[l])):169===l?(_=ni(a,f,p),I=ni(a,f,c),S.push(Jn[l])):4===l?(w=1-ni(e,h,p),x=ni(e,f,p),S.push(Hn[l])):166===l?(w=ni(a,p,h),x=1-ni(a,p,f),S.push(Hn[l])):16===l?(b=ni(e,p,h),v=ni(e,c,h),S.push(Wn[l])):154===l?(b=1-ni(a,h,p),v=1-ni(a,h,c),S.push(Wn[l])):64===l?(E=ni(e,f,c),m=1-ni(e,h,c),S.push($n[l])):106===l?(E=1-ni(a,c,f),m=ni(a,c,h),S.push($n[l])):168===l?(x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),S.push(Kn[l]),S.push(Jn[l])):2===l?(x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),S.push(Kn[l]),S.push(Jn[l])):162===l?(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),S.push(Kn[l]),S.push(Jn[l])):8===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),S.push(Wn[l]),S.push(Hn[l])):138===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Wn[l]),S.push(Hn[l])):32===l?(b=ni(a,p,h),w=ni(e,p,h),m=ni(e,c,h),v=ni(a,c,h),S.push(Wn[l]),S.push(Hn[l])):42===l?(I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h),S.push(Qn[l]),S.push($n[l])):128===l&&(I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Qn[l]),S.push($n[l])),5===l?(w=1-ni(e,h,p),I=1-ni(e,c,f),S.push(Hn[l])):165===l?(w=ni(a,p,h),I=ni(a,f,c),S.push(Hn[l])):20===l?(x=ni(e,f,p),v=ni(e,c,h),S.push(Kn[l])):150===l?(x=1-ni(a,p,f),v=1-ni(a,h,c),S.push(Kn[l])):80===l?(b=ni(e,p,h),E=ni(e,f,c),S.push(Wn[l])):90===l?(b=1-ni(a,h,p),E=1-ni(a,c,f),S.push(Wn[l])):65===l?(_=1-ni(e,p,f),m=1-ni(e,h,c),S.push(Jn[l])):105===l?(_=ni(a,f,p),m=ni(a,c,h),S.push(Jn[l])):160===l?(b=ni(a,p,h),w=ni(e,p,h),I=ni(e,f,c),E=ni(a,f,c),S.push(Wn[l]),S.push(Hn[l])):10===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),I=1-ni(a,c,f),E=1-ni(e,c,f),S.push(Wn[l]),S.push(Hn[l])):130===l?(x=1-ni(e,p,f),_=1-ni(a,p,f),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Kn[l]),S.push(Jn[l])):40===l?(x=ni(a,f,p),_=ni(e,f,p),m=ni(e,c,h),v=ni(a,c,h),S.push(Kn[l]),S.push(Jn[l])):101===l?(w=ni(a,p,h),m=ni(a,c,h),S.push(Hn[l])):69===l?(w=1-ni(e,h,p),m=1-ni(e,h,c),S.push(Hn[l])):149===l?(I=ni(a,f,c),v=1-ni(a,h,c),S.push(Qn[l])):21===l?(I=1-ni(e,c,f),v=ni(e,c,h),S.push(Qn[l])):86===l?(x=1-ni(a,p,f),E=1-ni(a,c,f),S.push(Kn[l])):84===l?(x=ni(e,f,p),E=ni(e,f,c),S.push(Kn[l])):89===l?(b=1-ni(a,h,p),_=ni(a,f,p),S.push(Jn[l])):81===l?(b=ni(e,p,h),_=1-ni(e,p,f),S.push(Jn[l])):96===l?(b=ni(a,p,h),w=ni(e,p,h),E=ni(e,f,c),m=ni(a,c,h),S.push(Wn[l]),S.push(Hn[l])):74===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),E=1-ni(a,c,f),m=1-ni(e,h,c),S.push(Wn[l]),S.push(Hn[l])):24===l?(b=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),v=ni(e,c,h),S.push(Wn[l]),S.push(Jn[l])):146===l?(b=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),v=1-ni(a,h,c),S.push(Wn[l]),S.push(Jn[l])):6===l?(w=1-ni(e,h,p),x=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),S.push(Hn[l]),S.push(Kn[l])):164===l?(w=ni(a,p,h),x=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),S.push(Hn[l]),S.push(Kn[l])):129===l?(_=1-ni(e,p,f),I=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Jn[l]),S.push(Qn[l])):41===l?(_=ni(a,f,p),I=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h),S.push(Jn[l]),S.push(Qn[l])):66===l?(x=1-ni(e,p,f),_=1-ni(a,p,f),E=1-ni(a,c,f),m=1-ni(e,h,c),S.push(Kn[l]),S.push(Jn[l])):104===l?(x=ni(a,f,p),_=ni(e,f,p),E=ni(e,f,c),m=ni(a,c,h),S.push(Jn[l]),S.push(ti[l])):144===l?(b=ni(e,p,h),I=ni(e,f,c),E=ni(a,f,c),v=1-ni(a,h,c),S.push(Wn[l]),S.push($n[l])):26===l?(b=1-ni(a,h,p),I=1-ni(a,c,f),E=1-ni(e,c,f),v=ni(e,c,h),S.push(Wn[l]),S.push($n[l])):36===l?(w=ni(a,p,h),x=ni(e,f,p),m=ni(e,c,h),v=ni(a,c,h),S.push(Hn[l]),S.push(Kn[l])):134===l?(w=1-ni(e,h,p),x=1-ni(a,p,f),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Hn[l]),S.push(Kn[l])):9===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),_=ni(a,f,p),I=1-ni(e,c,f),S.push(Wn[l]),S.push(Hn[l])):161===l?(b=ni(a,p,h),w=ni(e,p,h),_=1-ni(e,p,f),I=ni(a,f,c),S.push(Wn[l]),S.push(Hn[l])):37===l?(w=ni(a,p,h),I=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h),S.push(Hn[l]),S.push(Qn[l])):133===l?(w=1-ni(e,h,p),I=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Hn[l]),S.push(Qn[l])):148===l?(x=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),v=1-ni(a,h,c),S.push(Kn[l]),S.push($n[l])):22===l?(x=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),v=ni(e,c,h),S.push(Kn[l]),S.push($n[l])):82===l?(b=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),E=1-ni(a,c,f),S.push(Wn[l]),S.push(Jn[l])):88===l?(b=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),E=ni(e,f,c),S.push(Wn[l]),S.push(Jn[l])):73===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),_=ni(a,f,p),m=1-ni(e,h,c),S.push(Wn[l]),S.push(Hn[l])):97===l?(b=ni(a,p,h),w=ni(e,p,h),_=1-ni(e,p,f),m=ni(a,c,h),S.push(Wn[l]),S.push(Hn[l])):145===l?(b=ni(e,p,h),_=1-ni(e,p,f),I=ni(a,f,c),v=1-ni(a,h,c),S.push(Wn[l]),S.push(Qn[l])):25===l?(b=1-ni(a,h,p),_=ni(a,f,p),I=1-ni(e,c,f),v=ni(e,c,h),S.push(Wn[l]),S.push(Qn[l])):70===l?(w=1-ni(e,h,p),x=1-ni(a,p,f),E=1-ni(a,c,f),m=1-ni(e,h,c),S.push(Hn[l]),S.push(Kn[l])):100===l?(w=ni(a,p,h),x=ni(e,f,p),E=ni(e,f,c),m=ni(a,c,h),S.push(Hn[l]),S.push(Kn[l])):34===l?(0===g?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)):(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)),S.push(Wn[l]),S.push(Hn[l]),S.push(Qn[l]),S.push($n[l])):35===l?(4===g?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)):(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)),S.push(Wn[l]),S.push(Hn[l]),S.push(Jn[l]),S.push($n[l])):136===l?(0===g?(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)):(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)),S.push(Wn[l]),S.push(Hn[l]),S.push(Qn[l]),S.push($n[l])):153===l?(0===g?(b=ni(e,p,h),_=1-ni(e,p,f),I=1-ni(e,c,f),v=ni(e,c,h)):(b=1-ni(a,h,p),_=ni(a,f,p),I=ni(a,f,c),v=1-ni(a,h,c)),S.push(Wn[l]),S.push(Jn[l])):102===l?(0===g?(w=1-ni(e,h,p),x=ni(e,f,p),E=ni(e,f,c),m=1-ni(e,h,c)):(w=ni(a,p,h),x=1-ni(a,p,f),E=1-ni(a,c,f),m=ni(a,c,h)),S.push(Hn[l]),S.push($n[l])):155===l?(4===g?(b=ni(e,p,h),_=1-ni(e,p,f),I=1-ni(e,c,f),v=ni(e,c,h)):(b=1-ni(a,h,p),_=ni(a,f,p),I=ni(a,f,c),v=1-ni(a,h,c)),S.push(Wn[l]),S.push(Qn[l])):103===l?(4===g?(w=1-ni(e,h,p),x=ni(e,f,p),E=ni(e,f,c),m=1-ni(e,h,c)):(w=ni(a,p,h),x=1-ni(a,p,f),E=1-ni(a,c,f),m=ni(a,c,h)),S.push(Hn[l]),S.push(Kn[l])):152===l?(0===g?(b=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),v=ni(e,c,h)):(b=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),v=1-ni(a,h,c)),S.push(Wn[l]),S.push(Kn[l]),S.push(Jn[l])):156===l?(4===g?(b=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),v=ni(e,c,h)):(b=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),v=1-ni(a,h,c)),S.push(Wn[l]),S.push(Jn[l]),S.push($n[l])):137===l?(0===g?(b=ni(a,p,h),w=ni(e,p,h),_=1-ni(e,p,f),I=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)):(b=1-ni(e,h,p),w=1-ni(a,h,p),_=ni(a,f,p),I=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)),S.push(Wn[l]),S.push(Hn[l]),S.push(Jn[l])):139===l?(4===g?(b=ni(a,p,h),w=ni(e,p,h),_=1-ni(e,p,f),I=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)):(b=1-ni(e,h,p),w=1-ni(a,h,p),_=ni(a,f,p),I=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)),S.push(Wn[l]),S.push(Hn[l]),S.push(Qn[l])):98===l?(0===g?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),E=ni(e,f,c),m=1-ni(e,h,c)):(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),E=1-ni(a,c,f),m=ni(a,c,h)),S.push(Wn[l]),S.push(Hn[l]),S.push($n[l])):99===l?(4===g?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),E=ni(e,f,c),m=1-ni(e,h,c)):(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),E=1-ni(a,c,f),m=ni(a,c,h)),S.push(Wn[l]),S.push(Hn[l]),S.push(Jn[l])):38===l?(0===g?(w=1-ni(e,h,p),x=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)):(w=ni(a,p,h),x=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)),S.push(Hn[l]),S.push(Qn[l]),S.push($n[l])):39===l?(4===g?(w=1-ni(e,h,p),x=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)):(w=ni(a,p,h),x=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)),S.push(Hn[l]),S.push(Kn[l]),S.push($n[l])):85===l&&(b=1,w=0,x=1,_=0,I=0,E=1,m=0,v=1),(m<0||m>1||v<0||v>1||b<0||b>1||x<0||x>1||I<0||I>1||E<0||E>1)&&console.log("MarchingSquaresJS-isoBands: "+l+" "+d+" "+c+","+h+","+p+","+f+" "+g+" "+m+" "+v+" "+b+" "+w+" "+x+" "+_+" "+I+" "+E),o.cells[s][u]={cval:l,cval_real:d,flipped:g,topleft:m,topright:v,righttop:b,rightbottom:w,bottomright:x,bottomleft:_,leftbottom:I,lefttop:E,edges:S}}}}}return o}(t,e,r);return pn.polygons?(pn.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],r=0;return t.cells.forEach((function(t,n){t.forEach((function(t,i){if(void 0!==t){var o=ri[t.cval](t);"object"==typeof o&&ii(o)?"object"==typeof o[0]&&ii(o[0])?"object"==typeof o[0][0]&&ii(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=n})),e[r++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=n})),e[r++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),e}(l)):(pn.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],r=t.rows,n=t.cols,i=[],o=0;o0){var s=ai(t.cells[o][a]),u=null,l=a,c=o;null!==s&&i.push([s.p[0]+l,s.p[1]+c]);do{if(null===(u=si(t.cells[c][l],s.x,s.y,s.o)))break;if(i.push([u.p[0]+l,u.p[1]+c]),l+=u.x,s=u,(c+=u.y)<0||c>=r||l<0||l>=n||void 0===t.cells[c][l]){var h=oi(t,l-=u.x,c-=u.y,u.x,u.y,u.o);if(null===h)break;h.path.forEach((function(t){i.push(t)})),l=h.i,c=h.j,s=h}}while(void 0!==t.cells[c][l]&&t.cells[c][l].edges.length>0);e.push(i),i=[],t.cells[o][a].edges.length>0&&a--}return e}(l)),"function"==typeof pn.successCallback&&pn.successCallback(u),u}var dn=64,gn=16,yn=[],mn=[],vn=[],_n=[],xn=[],bn=[],wn=[],En=[],In=[],Sn=[],Cn=[],Pn=[],Mn=[],Tn=[],An=[],Ln=[],kn=[],Rn=[],Nn=[],Dn=[],On=[],zn=[],Fn=[],Bn=[];wn[85]=Sn[85]=-1,En[85]=Cn[85]=0,In[85]=Pn[85]=1,Nn[85]=zn[85]=1,Dn[85]=Fn[85]=0,On[85]=Bn[85]=1,yn[85]=_n[85]=0,mn[85]=xn[85]=-1,vn[85]=An[85]=0,Ln[85]=Mn[85]=0,kn[85]=Tn[85]=1,bn[85]=Rn[85]=1,zn[1]=zn[169]=0,Fn[1]=Fn[169]=-1,Bn[1]=Bn[169]=0,Mn[1]=Mn[169]=-1,Tn[1]=Tn[169]=0,An[1]=An[169]=0,Sn[4]=Sn[166]=0,Cn[4]=Cn[166]=-1,Pn[4]=Pn[166]=1,Ln[4]=Ln[166]=1,kn[4]=kn[166]=0,Rn[4]=Rn[166]=0,wn[16]=wn[154]=0,En[16]=En[154]=1,In[16]=In[154]=1,_n[16]=_n[154]=1,xn[16]=xn[154]=0,bn[16]=bn[154]=1,Nn[64]=Nn[106]=0,Dn[64]=Dn[106]=1,On[64]=On[106]=0,yn[64]=yn[106]=-1,mn[64]=mn[106]=0,vn[64]=vn[106]=1,Nn[2]=Nn[168]=0,Dn[2]=Dn[168]=-1,On[2]=On[168]=1,zn[2]=zn[168]=0,Fn[2]=Fn[168]=-1,Bn[2]=Bn[168]=0,Mn[2]=Mn[168]=-1,Tn[2]=Tn[168]=0,An[2]=An[168]=0,Ln[2]=Ln[168]=-1,kn[2]=kn[168]=0,Rn[2]=Rn[168]=1,wn[8]=wn[162]=0,En[8]=En[162]=-1,In[8]=In[162]=0,Sn[8]=Sn[162]=0,Cn[8]=Cn[162]=-1,Pn[8]=Pn[162]=1,Mn[8]=Mn[162]=1,Tn[8]=Tn[162]=0,An[8]=An[162]=1,Ln[8]=Ln[162]=1,kn[8]=kn[162]=0,Rn[8]=Rn[162]=0,wn[32]=wn[138]=0,En[32]=En[138]=1,In[32]=In[138]=1,Sn[32]=Sn[138]=0,Cn[32]=Cn[138]=1,Pn[32]=Pn[138]=0,yn[32]=yn[138]=1,mn[32]=mn[138]=0,vn[32]=vn[138]=0,_n[32]=_n[138]=1,xn[32]=xn[138]=0,bn[32]=bn[138]=1,zn[128]=zn[42]=0,Fn[128]=Fn[42]=1,Bn[128]=Bn[42]=1,Nn[128]=Nn[42]=0,Dn[128]=Dn[42]=1,On[128]=On[42]=0,yn[128]=yn[42]=-1,mn[128]=mn[42]=0,vn[128]=vn[42]=1,_n[128]=_n[42]=-1,xn[128]=xn[42]=0,bn[128]=bn[42]=0,Sn[5]=Sn[165]=-1,Cn[5]=Cn[165]=0,Pn[5]=Pn[165]=0,zn[5]=zn[165]=1,Fn[5]=Fn[165]=0,Bn[5]=Bn[165]=0,Ln[20]=Ln[150]=0,kn[20]=kn[150]=1,Rn[20]=Rn[150]=1,_n[20]=_n[150]=0,xn[20]=xn[150]=-1,bn[20]=bn[150]=1,wn[80]=wn[90]=-1,En[80]=En[90]=0,In[80]=In[90]=1,Nn[80]=Nn[90]=1,Dn[80]=Dn[90]=0,On[80]=On[90]=1,Mn[65]=Mn[105]=0,Tn[65]=Tn[105]=1,An[65]=An[105]=0,yn[65]=yn[105]=0,mn[65]=mn[105]=-1,vn[65]=vn[105]=0,wn[160]=wn[10]=-1,En[160]=En[10]=0,In[160]=In[10]=1,Sn[160]=Sn[10]=-1,Cn[160]=Cn[10]=0,Pn[160]=Pn[10]=0,zn[160]=zn[10]=1,Fn[160]=Fn[10]=0,Bn[160]=Bn[10]=0,Nn[160]=Nn[10]=1,Dn[160]=Dn[10]=0,On[160]=On[10]=1,Ln[130]=Ln[40]=0,kn[130]=kn[40]=1,Rn[130]=Rn[40]=1,Mn[130]=Mn[40]=0,Tn[130]=Tn[40]=1,An[130]=An[40]=0,yn[130]=yn[40]=0,mn[130]=mn[40]=-1,vn[130]=vn[40]=0,_n[130]=_n[40]=0,xn[130]=xn[40]=-1,bn[130]=bn[40]=1,Sn[37]=Sn[133]=0,Cn[37]=Cn[133]=1,Pn[37]=Pn[133]=1,zn[37]=zn[133]=0,Fn[37]=Fn[133]=1,Bn[37]=Bn[133]=0,yn[37]=yn[133]=-1,mn[37]=mn[133]=0,vn[37]=vn[133]=0,_n[37]=_n[133]=1,xn[37]=xn[133]=0,bn[37]=bn[133]=0,Ln[148]=Ln[22]=-1,kn[148]=kn[22]=0,Rn[148]=Rn[22]=0,zn[148]=zn[22]=0,Fn[148]=Fn[22]=-1,Bn[148]=Bn[22]=1,Nn[148]=Nn[22]=0,Dn[148]=Dn[22]=1,On[148]=On[22]=1,_n[148]=_n[22]=-1,xn[148]=xn[22]=0,bn[148]=bn[22]=1,wn[82]=wn[88]=0,En[82]=En[88]=-1,In[82]=In[88]=1,Ln[82]=Ln[88]=1,kn[82]=kn[88]=0,Rn[82]=Rn[88]=1,Mn[82]=Mn[88]=-1,Tn[82]=Tn[88]=0,An[82]=An[88]=1,Nn[82]=Nn[88]=0,Dn[82]=Dn[88]=-1,On[82]=On[88]=0,wn[73]=wn[97]=0,En[73]=En[97]=1,In[73]=In[97]=0,Sn[73]=Sn[97]=0,Cn[73]=Cn[97]=-1,Pn[73]=Pn[97]=0,Mn[73]=Mn[97]=1,Tn[73]=Tn[97]=0,An[73]=An[97]=0,yn[73]=yn[97]=1,mn[73]=mn[97]=0,vn[73]=vn[97]=1,wn[145]=wn[25]=0,En[145]=En[25]=-1,In[145]=In[25]=0,Mn[145]=Mn[25]=1,Tn[145]=Tn[25]=0,An[145]=An[25]=1,zn[145]=zn[25]=0,Fn[145]=Fn[25]=1,Bn[145]=Bn[25]=1,_n[145]=_n[25]=-1,xn[145]=xn[25]=0,bn[145]=bn[25]=0,Sn[70]=Sn[100]=0,Cn[70]=Cn[100]=1,Pn[70]=Pn[100]=0,Ln[70]=Ln[100]=-1,kn[70]=kn[100]=0,Rn[70]=Rn[100]=1,Nn[70]=Nn[100]=0,Dn[70]=Dn[100]=-1,On[70]=On[100]=1,yn[70]=yn[100]=1,mn[70]=mn[100]=0,vn[70]=vn[100]=0,Sn[101]=Sn[69]=0,Cn[101]=Cn[69]=1,Pn[101]=Pn[69]=0,yn[101]=yn[69]=1,mn[101]=mn[69]=0,vn[101]=vn[69]=0,zn[149]=zn[21]=0,Fn[149]=Fn[21]=1,Bn[149]=Bn[21]=1,_n[149]=_n[21]=-1,xn[149]=xn[21]=0,bn[149]=bn[21]=0,Ln[86]=Ln[84]=-1,kn[86]=kn[84]=0,Rn[86]=Rn[84]=1,Nn[86]=Nn[84]=0,Dn[86]=Dn[84]=-1,On[86]=On[84]=1,wn[89]=wn[81]=0,En[89]=En[81]=-1,In[89]=In[81]=0,Mn[89]=Mn[81]=1,Tn[89]=Tn[81]=0,An[89]=An[81]=1,wn[96]=wn[74]=0,En[96]=En[74]=1,In[96]=In[74]=0,Sn[96]=Sn[74]=-1,Cn[96]=Cn[74]=0,Pn[96]=Pn[74]=1,Nn[96]=Nn[74]=1,Dn[96]=Dn[74]=0,On[96]=On[74]=0,yn[96]=yn[74]=1,mn[96]=mn[74]=0,vn[96]=vn[74]=1,wn[24]=wn[146]=0,En[24]=En[146]=-1,In[24]=In[146]=1,Ln[24]=Ln[146]=1,kn[24]=kn[146]=0,Rn[24]=Rn[146]=1,Mn[24]=Mn[146]=0,Tn[24]=Tn[146]=1,An[24]=An[146]=1,_n[24]=_n[146]=0,xn[24]=xn[146]=-1,bn[24]=bn[146]=0,Sn[6]=Sn[164]=-1,Cn[6]=Cn[164]=0,Pn[6]=Pn[164]=1,Ln[6]=Ln[164]=-1,kn[6]=kn[164]=0,Rn[6]=Rn[164]=0,zn[6]=zn[164]=0,Fn[6]=Fn[164]=-1,Bn[6]=Bn[164]=1,Nn[6]=Nn[164]=1,Dn[6]=Dn[164]=0,On[6]=On[164]=0,Mn[129]=Mn[41]=0,Tn[129]=Tn[41]=1,An[129]=An[41]=1,zn[129]=zn[41]=0,Fn[129]=Fn[41]=1,Bn[129]=Bn[41]=0,yn[129]=yn[41]=-1,mn[129]=mn[41]=0,vn[129]=vn[41]=0,_n[129]=_n[41]=0,xn[129]=xn[41]=-1,bn[129]=bn[41]=0,Ln[66]=Ln[104]=0,kn[66]=kn[104]=1,Rn[66]=Rn[104]=0,Mn[66]=Mn[104]=-1,Tn[66]=Tn[104]=0,An[66]=An[104]=1,Nn[66]=Nn[104]=0,Dn[66]=Dn[104]=-1,On[66]=On[104]=0,yn[66]=yn[104]=0,mn[66]=mn[104]=-1,vn[66]=vn[104]=1,wn[144]=wn[26]=-1,En[144]=En[26]=0,In[144]=In[26]=0,zn[144]=zn[26]=1,Fn[144]=Fn[26]=0,Bn[144]=Bn[26]=1,Nn[144]=Nn[26]=0,Dn[144]=Dn[26]=1,On[144]=On[26]=1,_n[144]=_n[26]=-1,xn[144]=xn[26]=0,bn[144]=bn[26]=1,Sn[36]=Sn[134]=0,Cn[36]=Cn[134]=1,Pn[36]=Pn[134]=1,Ln[36]=Ln[134]=0,kn[36]=kn[134]=1,Rn[36]=Rn[134]=0,yn[36]=yn[134]=0,mn[36]=mn[134]=-1,vn[36]=vn[134]=1,_n[36]=_n[134]=1,xn[36]=xn[134]=0,bn[36]=bn[134]=0,wn[9]=wn[161]=-1,En[9]=En[161]=0,In[9]=In[161]=0,Sn[9]=Sn[161]=0,Cn[9]=Cn[161]=-1,Pn[9]=Pn[161]=0,Mn[9]=Mn[161]=1,Tn[9]=Tn[161]=0,An[9]=An[161]=0,zn[9]=zn[161]=1,Fn[9]=Fn[161]=0,Bn[9]=Bn[161]=1,wn[136]=0,En[136]=1,In[136]=1,Sn[136]=0,Cn[136]=1,Pn[136]=0,Ln[136]=-1,kn[136]=0,Rn[136]=1,Mn[136]=-1,Tn[136]=0,An[136]=0,zn[136]=0,Fn[136]=-1,Bn[136]=0,Nn[136]=0,Dn[136]=-1,On[136]=1,yn[136]=1,mn[136]=0,vn[136]=0,_n[136]=1,xn[136]=0,bn[136]=1,wn[34]=0,En[34]=-1,In[34]=0,Sn[34]=0,Cn[34]=-1,Pn[34]=1,Ln[34]=1,kn[34]=0,Rn[34]=0,Mn[34]=1,Tn[34]=0,An[34]=1,zn[34]=0,Fn[34]=1,Bn[34]=1,Nn[34]=0,Dn[34]=1,On[34]=0,yn[34]=-1,mn[34]=0,vn[34]=1,_n[34]=-1,xn[34]=0,bn[34]=0,wn[35]=0,En[35]=1,In[35]=1,Sn[35]=0,Cn[35]=-1,Pn[35]=1,Ln[35]=1,kn[35]=0,Rn[35]=0,Mn[35]=-1,Tn[35]=0,An[35]=0,zn[35]=0,Fn[35]=-1,Bn[35]=0,Nn[35]=0,Dn[35]=1,On[35]=0,yn[35]=-1,mn[35]=0,vn[35]=1,_n[35]=1,xn[35]=0,bn[35]=1,wn[153]=0,En[153]=1,In[153]=1,Mn[153]=-1,Tn[153]=0,An[153]=0,zn[153]=0,Fn[153]=-1,Bn[153]=0,_n[153]=1,xn[153]=0,bn[153]=1,Sn[102]=0,Cn[102]=-1,Pn[102]=1,Ln[102]=1,kn[102]=0,Rn[102]=0,Nn[102]=0,Dn[102]=1,On[102]=0,yn[102]=-1,mn[102]=0,vn[102]=1,wn[155]=0,En[155]=-1,In[155]=0,Mn[155]=1,Tn[155]=0,An[155]=1,zn[155]=0,Fn[155]=1,Bn[155]=1,_n[155]=-1,xn[155]=0,bn[155]=0,Sn[103]=0,Cn[103]=1,Pn[103]=0,Ln[103]=-1,kn[103]=0,Rn[103]=1,Nn[103]=0,Dn[103]=-1,On[103]=1,yn[103]=1,mn[103]=0,vn[103]=0,wn[152]=0,En[152]=1,In[152]=1,Ln[152]=-1,kn[152]=0,Rn[152]=1,Mn[152]=-1,Tn[152]=0,An[152]=0,zn[152]=0,Fn[152]=-1,Bn[152]=0,Nn[152]=0,Dn[152]=-1,On[152]=1,_n[152]=1,xn[152]=0,bn[152]=1,wn[156]=0,En[156]=-1,In[156]=1,Ln[156]=1,kn[156]=0,Rn[156]=1,Mn[156]=-1,Tn[156]=0,An[156]=0,zn[156]=0,Fn[156]=-1,Bn[156]=0,Nn[156]=0,Dn[156]=1,On[156]=1,_n[156]=-1,xn[156]=0,bn[156]=1,wn[137]=0,En[137]=1,In[137]=1,Sn[137]=0,Cn[137]=1,Pn[137]=0,Mn[137]=-1,Tn[137]=0,An[137]=0,zn[137]=0,Fn[137]=-1,Bn[137]=0,yn[137]=1,mn[137]=0,vn[137]=0,_n[137]=1,xn[137]=0,bn[137]=1,wn[139]=0,En[139]=1,In[139]=1,Sn[139]=0,Cn[139]=-1,Pn[139]=0,Mn[139]=1,Tn[139]=0,An[139]=0,zn[139]=0,Fn[139]=1,Bn[139]=0,yn[139]=-1,mn[139]=0,vn[139]=0,_n[139]=1,xn[139]=0,bn[139]=1,wn[98]=0,En[98]=-1,In[98]=0,Sn[98]=0,Cn[98]=-1,Pn[98]=1,Ln[98]=1,kn[98]=0,Rn[98]=0,Mn[98]=1,Tn[98]=0,An[98]=1,Nn[98]=0,Dn[98]=1,On[98]=0,yn[98]=-1,mn[98]=0,vn[98]=1,wn[99]=0,En[99]=1,In[99]=0,Sn[99]=0,Cn[99]=-1,Pn[99]=1,Ln[99]=1,kn[99]=0,Rn[99]=0,Mn[99]=-1,Tn[99]=0,An[99]=1,Nn[99]=0,Dn[99]=-1,On[99]=0,yn[99]=1,mn[99]=0,vn[99]=1,Sn[38]=0,Cn[38]=-1,Pn[38]=1,Ln[38]=1,kn[38]=0,Rn[38]=0,zn[38]=0,Fn[38]=1,Bn[38]=1,Nn[38]=0,Dn[38]=1,On[38]=0,yn[38]=-1,mn[38]=0,vn[38]=1,_n[38]=-1,xn[38]=0,bn[38]=0,Sn[39]=0,Cn[39]=1,Pn[39]=1,Ln[39]=-1,kn[39]=0,Rn[39]=0,zn[39]=0,Fn[39]=-1,Bn[39]=1,Nn[39]=0,Dn[39]=1,On[39]=0,yn[39]=-1,mn[39]=0,vn[39]=1,_n[39]=1,xn[39]=0,bn[39]=0;var Un=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Vn=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},qn=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},jn=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},Gn=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},Xn=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},Zn=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},Yn=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Wn=[],Hn=[],Kn=[],Jn=[],Qn=[],$n=[],ti=[],ei=[];Jn[1]=Qn[1]=18,Jn[169]=Qn[169]=18,Kn[4]=Hn[4]=12,Kn[166]=Hn[166]=12,Wn[16]=ei[16]=4,Wn[154]=ei[154]=4,$n[64]=ti[64]=22,$n[106]=ti[106]=22,Kn[2]=$n[2]=17,Jn[2]=Qn[2]=18,Kn[168]=$n[168]=17,Jn[168]=Qn[168]=18,Wn[8]=Jn[8]=9,Hn[8]=Kn[8]=12,Wn[162]=Jn[162]=9,Hn[162]=Kn[162]=12,Wn[32]=ei[32]=4,Hn[32]=ti[32]=1,Wn[138]=ei[138]=4,Hn[138]=ti[138]=1,Qn[128]=ei[128]=21,$n[128]=ti[128]=22,Qn[42]=ei[42]=21,$n[42]=ti[42]=22,Hn[5]=Qn[5]=14,Hn[165]=Qn[165]=14,Kn[20]=ei[20]=6,Kn[150]=ei[150]=6,Wn[80]=$n[80]=11,Wn[90]=$n[90]=11,Jn[65]=ti[65]=3,Jn[105]=ti[105]=3,Wn[160]=$n[160]=11,Hn[160]=Qn[160]=14,Wn[10]=$n[10]=11,Hn[10]=Qn[10]=14,Kn[130]=ei[130]=6,Jn[130]=ti[130]=3,Kn[40]=ei[40]=6,Jn[40]=ti[40]=3,Hn[101]=ti[101]=1,Hn[69]=ti[69]=1,Qn[149]=ei[149]=21,Qn[21]=ei[21]=21,Kn[86]=$n[86]=17,Kn[84]=$n[84]=17,Wn[89]=Jn[89]=9,Wn[81]=Jn[81]=9,Wn[96]=ti[96]=0,Hn[96]=$n[96]=15,Wn[74]=ti[74]=0,Hn[74]=$n[74]=15,Wn[24]=Kn[24]=8,Jn[24]=ei[24]=7,Wn[146]=Kn[146]=8,Jn[146]=ei[146]=7,Hn[6]=$n[6]=15,Kn[6]=Qn[6]=16,Hn[164]=$n[164]=15,Kn[164]=Qn[164]=16,Jn[129]=ei[129]=7,Qn[129]=ti[129]=20,Jn[41]=ei[41]=7,Qn[41]=ti[41]=20,Kn[66]=ti[66]=2,Jn[66]=$n[66]=19,Kn[104]=ti[104]=2,Jn[104]=$n[104]=19,Wn[144]=Qn[144]=10,$n[144]=ei[144]=23,Wn[26]=Qn[26]=10,$n[26]=ei[26]=23,Hn[36]=ei[36]=5,Kn[36]=ti[36]=2,Hn[134]=ei[134]=5,Kn[134]=ti[134]=2,Wn[9]=Qn[9]=10,Hn[9]=Jn[9]=13,Wn[161]=Qn[161]=10,Hn[161]=Jn[161]=13,Hn[37]=ei[37]=5,Qn[37]=ti[37]=20,Hn[133]=ei[133]=5,Qn[133]=ti[133]=20,Kn[148]=Qn[148]=16,$n[148]=ei[148]=23,Kn[22]=Qn[22]=16,$n[22]=ei[22]=23,Wn[82]=Kn[82]=8,Jn[82]=$n[82]=19,Wn[88]=Kn[88]=8,Jn[88]=$n[88]=19,Wn[73]=ti[73]=0,Hn[73]=Jn[73]=13,Wn[97]=ti[97]=0,Hn[97]=Jn[97]=13,Wn[145]=Jn[145]=9,Qn[145]=ei[145]=21,Wn[25]=Jn[25]=9,Qn[25]=ei[25]=21,Hn[70]=ti[70]=1,Kn[70]=$n[70]=17,Hn[100]=ti[100]=1,Kn[100]=$n[100]=17,Wn[34]=Jn[34]=9,Hn[34]=Kn[34]=12,Qn[34]=ei[34]=21,$n[34]=ti[34]=22,Wn[136]=ei[136]=4,Hn[136]=ti[136]=1,Kn[136]=$n[136]=17,Jn[136]=Qn[136]=18,Wn[35]=ei[35]=4,Hn[35]=Kn[35]=12,Jn[35]=Qn[35]=18,$n[35]=ti[35]=22,Wn[153]=ei[153]=4,Jn[153]=Qn[153]=18,Hn[102]=Kn[102]=12,$n[102]=ti[102]=22,Wn[155]=Jn[155]=9,Qn[155]=ei[155]=23,Hn[103]=ti[103]=1,Kn[103]=$n[103]=17,Wn[152]=ei[152]=4,Kn[152]=$n[152]=17,Jn[152]=Qn[152]=18,Wn[156]=Kn[156]=8,Jn[156]=Qn[156]=18,$n[156]=ei[156]=23,Wn[137]=ei[137]=4,Hn[137]=ti[137]=1,Jn[137]=Qn[137]=18,Wn[139]=ei[139]=4,Hn[139]=Jn[139]=13,Qn[139]=ti[139]=20,Wn[98]=Jn[98]=9,Hn[98]=Kn[98]=12,$n[98]=ti[98]=22,Wn[99]=ti[99]=0,Hn[99]=Kn[99]=12,Jn[99]=$n[99]=19,Hn[38]=Kn[38]=12,Qn[38]=ei[38]=21,$n[38]=ti[38]=22,Hn[39]=ei[39]=5,Kn[39]=Qn[39]=16,$n[39]=ti[39]=22;var ri=[];function ni(t,e,r){return(t-e)/(r-e)}function ii(t){return t.constructor.toString().indexOf("Array")>-1}function oi(t,e,r,n,i,o){for(var a=t.cells[r][e],s=a.cval_real,u=e+n,l=r+i,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=i,u-=n,s=(a=t.cells[l][u]).cval_real,-1===i)if(0===o)if(1&s)c.push([u,l]),n=-1,i=0,o=0;else{if(!(4&s)){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u+1,l]),n=1,i=0,o=0}else{if(!(1&s)){if(4&s){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u+a.bottomleft,l]),n=0,i=1,o=0,h=!0;break}c.push([u,l]),n=-1,i=0,o=0}else if(1===i)if(0===o){if(!(s&gn)){if(s&dn){c.push([u+a.topleft,l+1]),n=0,i=-1,o=0,h=!0;break}c.push([u+a.topright,l+1]),n=0,i=-1,o=1,h=!0;break}c.push([u+1,l+1]),n=1,i=0,o=1}else c.push([u+1,l+1]),n=1,i=0,o=1;else if(-1===n)if(0===o){if(!(s&dn)){if(1&s){c.push([u,l+a.leftbottom]),n=1,i=0,o=0,h=!0;break}c.push([u,l+a.lefttop]),n=1,i=0,o=1,h=!0;break}c.push([u,l+1]),n=0,i=1,o=0}else{if(!(s&dn)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),n=0,i=1,o=0}else{if(1!==n){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(4&s)){c.push([u+1,l+a.rightbottom]),n=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}else{if(!(4&s)){if(s&gn){c.push([u+1,l+a.righttop]),n=-1,i=0,o=1;break}c.push([u+1,l+a.rightbottom]),n=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}}else if(s=(a=t.cells[l][u]).cval_real,-1===n)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])n=0,i=-1,o=1;else{if(!(1&s)){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u,l])}else{if(!(s&dn)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===n){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])n=0,i=1,o=0;else{if(!(s&gn)){c.push([u+a.topleft,l+1]),n=0,i=-1,o=0,h=!0;break}c.push([u+1,l+1]),n=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])n=1,i=0,o=1;else{if(!(4&s)){c.push([u+1,l+a.righttop]),n=-1,i=0,o=1,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])n=-1,i=0,o=0;else{if(!(s&dn)){c.push([u,l+a.leftbottom]),n=1,i=0,o=0,h=!0;break}c.push([u,l+1]),n=0,i=1,o=0}}if(l+=i,(u+=n)===e&&l===r)break}return{path:c,i:u,j:l,x:n,y:i,o}}function ai(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],r=t.cval_real;switch(e){case 0:return r&gn?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return 4&r?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return 1&r?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return r&gn?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return 4&r?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return 1&r?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return 1&r?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return 1&r?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return r&dn?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return 1&r?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return 1&r?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return r&dn?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return r&dn?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return 1&r?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return r&dn?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return r&dn?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return r&gn?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return r&dn?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return r&gn?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function si(t,e,r,n){var i,o,a,s,u,l=t.cval;switch(e){case-1:switch(n){case 0:i=Hn[l],a=Sn[l],s=Cn[l],u=Pn[l];break;default:i=Wn[l],a=wn[l],s=En[l],u=In[l]}break;case 1:switch(n){case 0:i=Qn[l],a=zn[l],s=Fn[l],u=Bn[l];break;default:i=$n[l],a=Nn[l],s=Dn[l],u=On[l]}break;default:switch(r){case-1:switch(n){case 0:i=ti[l],a=yn[l],s=mn[l],u=vn[l];break;default:i=ei[l],a=_n[l],s=xn[l],u=bn[l]}break;case 1:switch(n){case 0:i=Jn[l],a=Mn[l],s=Tn[l],u=An[l];break;default:i=Kn[l],a=Ln[l],s=kn[l],u=Rn[l]}}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var r=e+1;r0){var s=n[e-1],u=!function(t,e){return 0===vi(mi(t),mi(e))}(l=r,c=s)&&function(t,e){var r,n,i=t[0],o=mi(t),a=e[0],s=mi(e),u=vi(o,s);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}(vi((n=i,[(r=a)[0]-n[0],r[1]-n[1]]),s)/u,o))}(l,c);!1!==u&&(s[1]=u,r[0]=u),a.push(s[0]),e===o.length-2&&(a.push(r[0]),a.push(r[1]))}2===o.length&&(a.push(r[0]),a.push(r[1]))}var l,c,h,p,f,d,g,y})),_(a,t.properties)}const xi=function(t,e,r){if(!O(r=r||{}))throw new Error("options is invalid");var n=r.units;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");var i=Z(t),o=t.properties;switch(i){case"LineString":return _i(t,e,n);case"MultiLineString":var a=[];return rt(t,(function(t){a.push(_i(t,e,n).geometry.coordinates)})),w(a,o);default:throw new Error("geometry "+i+" is not supported")}};function bi(t,e,r){var n,i=e[0]-t[0],o=e[1]-t[1],a=r[0]-e[0];return((n=i*(r[1]-e[1])-a*o)>0)-(n<0)||+n}function wi(t,e){return e.geometry.coordinates[0].every((function(e){return Et(g(e),t)}))}const Ei=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,r){var n=e.to,i=r.to;if(n.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(n.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(n.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return n.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?n.coordinates[1]-i.coordinates[1]:i.coordinates[1]-n.coordinates[1];var o=bi(t.coordinates,n.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(n.coordinates[0]-t.coordinates[0],2)+Math.pow(n.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),Ii=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return _([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return bi(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),Si=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return t.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,r,n){return r.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=n),e}),0),r=(0===e?this.length:e)-1,n=(e+1)%this.length,i=bi(this.edges[r].from.coordinates,this.edges[e].from.coordinates,this.edges[n].from.coordinates);return 0===i?this.edges[r].from.coordinates[0]>this.edges[n].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return E(this.edges.map((function(t){return t.from.coordinates})))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=m([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=we(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var r,n,i=t.getEnvelope();return e.forEach((function(e){var o,a,s,u,l,c,h=e.getEnvelope();if(n&&(r=n.getEnvelope()),a=i,s=(o=h).geometry.coordinates.map((function(t){return t[0]})),u=o.geometry.coordinates.map((function(t){return t[1]})),l=a.geometry.coordinates.map((function(t){return t[0]})),c=a.geometry.coordinates.map((function(t){return t[1]})),(Math.max(null,s)!==Math.max(null,l)||Math.max(null,u)!==Math.max(null,c)||Math.min(null,s)!==Math.min(null,l)||Math.min(null,u)!==Math.min(null,c))&&wi(h,i)){var p=t.map((function(t){return t.from.coordinates})).find((function(t){return!e.some((function(e){return r=t,n=e.from.coordinates,r[0]===n[0]&&r[1]===n[1];var r,n}))}));p&&e.inside(g(p))&&(n&&!wi(r,h)||(n=e))}})),n},t.prototype.inside=function(t){return Et(t,this.toPolygon())},t}(),Ci=function(){function t(){this.edges=[],this.nodes={}}return t.fromGeoJson=function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(e);var r=new t;return rt(e,(function(t){j(t,"LineString","Graph::fromGeoJson"),W(t,(function(t,e){if(t){var n=r.getNode(t),i=r.getNode(e);r.addEdge(n,i)}return e}))})),r},t.prototype.getNode=function(t){var e=Ei.buildId(t),r=this.nodes[e];return r||(r=this.nodes[e]=new Ei(t)),r},t.prototype.addEdge=function(t,e){var r=new Ii(t,e),n=r.getSymetric();this.edges.push(r),this.edges.push(n)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var r=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),r.forEach((function(t){return e._removeIfDangle(t)}))}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},t.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,r){t.getOuterEdge((0===r?t.getOuterEdges().length:r)-1).symetric.next=e}))},t.prototype._computeNextCCWEdges=function(t,e){for(var r,n,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var a=i[o],s=a.symetric,u=void 0,l=void 0;a.label===e&&(u=a),s.label===e&&(l=s),u&&l&&(l&&(n=l),u&&(n&&(n.next=u,n=void 0),r||(r=u)))}n&&(n.next=r)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(r){if(!(r.label>=0)){t.push(r);var n=r;do{n.label=e,n=n.next}while(!r.isEqual(n));e++}})),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(r){t._computeNextCCWEdges(r,e.label)}))}));var e=[];return this.edges.forEach((function(r){r.ring||e.push(t._findEdgeRing(r))})),e},t.prototype._findIntersectionNodes=function(t){var e=[],r=t,n=function(){var n=0;r.from.getOuterEdges().forEach((function(e){e.label===t.label&&++n})),n>1&&e.push(r.from),r=r.next};do{n()}while(!t.isEqual(r));return e},t.prototype._findEdgeRing=function(t){var e=t,r=new Si;do{r.push(e),e.ring=r,e=e.next}while(!t.isEqual(e));return r},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()},t}();function Pi(t){var e=Ci.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var r=[],n=[];return e.getEdgeRings().filter((function(t){return t.isValid()})).forEach((function(t){t.isHole()?r.push(t):n.push(t)})),r.forEach((function(t){Si.findEdgeRingContaining(t,n)&&n.push(t)})),b(n.map((function(t){return t.toPolygon()})))}function Mi(t,e){for(var r=0;r0}function Ai(t,e,r){var n=r[0]-t[0],i=r[1]-t[1],o=e[0]-t[0],a=e[1]-t[1];return 0==n*a-i*o&&(Math.abs(o)>=Math.abs(a)?o>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:a>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1])}const Li=function(t,e){var r=!0;return rt(t,(function(t){rt(e,(function(e){if(!1===r)return!1;r=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return r=t.coordinates,n=e.coordinates,!(r[0]===n[0]&&r[1]===n[1]);case"LineString":return!Mi(e,t);case"Polygon":return!Et(t,e)}break;case"LineString":switch(e.type){case"Point":return!Mi(t,e);case"LineString":return!(Ue(t,e).features.length>0);case"Polygon":return!Ti(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Et(e,t);case"LineString":return!Ti(t,e);case"Polygon":return!function(t,e){for(var r=0,n=t.coordinates[0];r0}(e,t)}}var r,n;return!1}(t.geometry,e.geometry)}))})),r};function ki(t,e){var r=X(t),n=X(e),i=r.type,o=n.type,a=r.coordinates,s=n.coordinates;switch(i){case"Point":switch(o){case"Point":return Ni(a,s);default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"Point":return function(t,e){var r,n=!1;for(r=0;re[0]||t[2]e[1]||t[3]0}function zi(t,e){for(var r=!1,n=!1,i=t.coordinates[0].length,o=0;o=Math.abs(s)?a>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:s>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1]:Math.abs(a)>=Math.abs(s)?a>0?t[0]0?t[1]0)for(var r=0;r0}const qi=function(t,e){return X(t).type===X(e).type&&new Ui({precision:6}).compare(ue(t),ue(e))};function ji(t,e){var r=!1;return rt(t,(function(t){rt(e,(function(e){if(!0===r)return!0;r=!Li(t.geometry,e.geometry)}))})),r}var Gi=r(2606);const Xi=function(t,e,r){void 0===r&&(r={}),!0!==r.mutate&&(t=Dt(t)),r.minPoints=r.minPoints||3;var n=new Gi.DBSCAN,i=n.run($(t),R(e,r.units),r.minPoints,Ct),o=-1;return i.forEach((function(e){o++,e.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster=o,r.properties.dbscan="core"}))})),n.noise.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster?r.properties.dbscan="edge":r.properties.dbscan="noise"})),t};var Zi=r(1160);const Yi=function(t,e){void 0===e&&(e={});var r=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(r/2)),e.numberOfClusters>r&&(e.numberOfClusters=r),!0!==e.mutate&&(t=Dt(t));var n=$(t),i=n.slice(0,e.numberOfClusters),o=Zi(n,e.numberOfClusters,i),a={};return o.centroids.forEach((function(t,e){a[e]=t})),J(t,(function(t,e){var r=o.idxs[e];t.properties.cluster=r,t.properties.centroid=a[r]})),t};function Wi(t,e){return A(tn(t[0],t[1]))===A(tn(e[0],e[1]))}function Hi(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}const Ki=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Hi(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Hi(e,"line2"))throw new Error("line2 must be a LineString");for(var r=ze(ue(t)).features,n=ze(ue(e)).features,i=0;i0;){var u=a.pop();if(u===r)return Ji(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),r=this.content.pop();e!==this.content.length-1&&(this.content[e]=r,this.scoreFunction(r)0;){var r=(t+1>>1)-1,n=this.content[r];if(!(this.scoreFunction(e)=h;){for(var R=[],N=[],z=c+I,F=0;z<=p;){var U=g([z,L]),V=ro(U,o);R.push(V?0:1),N.push(z+"|"+L);var q=Ct(U,t);!V&&q0)){if(o/=p,p<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=n-u,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o0)){if(o/=f,f<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=i-l,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o0||h<1)||(c>0&&(t[0]=[u+c*p,l+c*f]),h<1&&(t[1]=[u+h*p,l+h*f]),!0)}}}}}function vo(t,e,r,n,i){var o=t[1];if(o)return!0;var a,s,u=t[0],l=t.left,c=t.right,h=l[0],p=l[1],f=c[0],d=c[1],g=(h+f)/2,y=(p+d)/2;if(d===p){if(g=n)return;if(h>f){if(u){if(u[1]>=i)return}else u=[g,r];o=[g,i]}else{if(u){if(u[1]1)if(h>f){if(u){if(u[1]>=i)return}else u=[(r-s)/a,r];o=[(i-s)/a,i]}else{if(u){if(u[1]=n)return}else u=[e,a*e+s];o=[n,a*n+s]}else{if(u){if(u[0]=-Uo)){var f=u*u+l*l,d=c*c+h*h,g=(h*f-l*d)/p,y=(u*d-c*f)/p,m=Eo.pop()||new Io;m.arc=t,m.site=i,m.x=g+a,m.y=(m.cy=y+s)+Math.sqrt(g*g+y*y),t.circle=m;for(var v=null,_=zo._;_;)if(m.y<_.y||m.y===_.y&&m.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}zo.insert(v,m),v||(wo=m)}}}}function Co(t){var e=t.circle;e&&(e.P||(wo=e.N),zo.remove(e),Eo.push(e),uo(e),t.circle=null)}var Po=[];function Mo(){uo(this),this.edge=this.site=this.circle=null}function To(t){var e=Po.pop()||new Mo;return e.site=t,e}function Ao(t){Co(t),Do.remove(t),Po.push(t),uo(t)}function Lo(t){var e=t.circle,r=e.x,n=e.cy,i=[r,n],o=t.P,a=t.N,s=[t];Ao(t);for(var u=o;u.circle&&Math.abs(r-u.circle.x)Bo)s=s.L;else{if(!((i=o-No(s,a))>Bo)){n>-Bo?(e=s.P,r=s):i>-Bo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}!function(t){Oo[t.index]={site:t,halfedges:[]}}(t);var u=To(t);if(Do.insert(e,u),e||r){if(e===r)return Co(e),r=To(e.site),Do.insert(u,r),u.edge=r.edge=fo(e.site,u.site),So(e),void So(r);if(r){Co(e),Co(r);var l=e.site,c=l[0],h=l[1],p=t[0]-c,f=t[1]-h,d=r.site,g=d[0]-c,y=d[1]-h,m=2*(p*y-f*g),v=p*p+f*f,_=g*g+y*y,x=[(y*v-f*_)/m+c,(p*_-g*v)/m+h];yo(r.edge,l,d,x),u.edge=fo(l,t,null,x),r.edge=fo(t,d,null,x),So(e),So(r)}else u.edge=fo(e.site,u.site)}}function Ro(t,e){var r=t.site,n=r[0],i=r[1],o=i-e;if(!o)return n;var a=t.P;if(!a)return-1/0;var s=(r=a.site)[0],u=r[1],l=u-e;if(!l)return s;var c=s-n,h=1/o-1/l,p=c/l;return h?(-p+Math.sqrt(p*p-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+n:(n+s)/2}function No(t,e){var r=t.N;if(r)return Ro(r,e);var n=t.site;return n[1]===e?n[0]:1/0}var Do,Oo,zo,Fo,Bo=1e-6,Uo=1e-12;function Vo(t,e){return e[1]-t[1]||e[0]-t[0]}function qo(t,e){var r,n,i,o=t.sort(Vo).pop();for(Fo=[],Oo=new Array(t.length),Do=new po,zo=new po;;)if(i=wo,o&&(!i||o[1]Bo||Math.abs(i[0][1]-i[1][1])>Bo)||delete Fo[o]}(a,s,u,l),function(t,e,r,n){var i,o,a,s,u,l,c,h,p,f,d,g,y=Oo.length,m=!0;for(i=0;iBo||Math.abs(g-p)>Bo)&&(u.splice(s,0,Fo.push(go(a,f,Math.abs(d-t)Bo?[t,Math.abs(h-t)Bo?[Math.abs(p-n)Bo?[r,Math.abs(h-r)Bo?[Math.abs(p-e)=s)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[n=a],a=null,i.halfedges.forEach((function(r){var n=o.edges[r],s=n.left;if(s!==i.site&&s||(s=n.right)){var u=t-s[0],l=e-s[1],h=u*u+l*l;h=-270&&(d=-d),f<-180&&f>=-360&&(g=-g),"degrees"===o){var y=d*Math.cos(c)+g*Math.sin(c),v=g*Math.cos(c)-d*Math.sin(c);d=y,g=v}h.push([d+l[0],g+l[1]])}return h.push(h[0]),"degrees"===o?m([h],u):fi(m([h],u),a,{pivot:s})},Yo=function(t,e){void 0===e&&(e={});var r=0,n=0,i=0;return tt(t,(function(t,o,a){var s=a[e.weight];if(!D(s=null==s?1:s))throw new Error("weight value must be a number for feature index "+o);(s=Number(s))>0&&Y(t,(function(t){r+=t[0]*s,n+=t[1]*s,i+=s}))})),g([r/i,n/i],e.properties,e)};function Wo(t,e,r,n){var i=r.properties.tolerance||.001,o=0,a=0,s=0,u=0;if(J(r,(function(e){var r=e.properties.weight,n=null==r?1:r;if(!D(n=Number(n)))throw new Error("weight value must be a number");if(n>0){u+=1;var i=n*Ct(e,t);0===i&&(i=1);var l=n/i;o+=e.geometry.coordinates[0]*l,a+=e.geometry.coordinates[1]*l,s+=l}})),u<1)throw new Error("no features to measure");var l=o/s,c=a/s;return 1===u||0===n||Math.abs(l-e[0])r&&(r=u,n=o,e.push([]));var l=o-n,c=t.coordinates[u][l+1],h=i[0],p=i[1],f=c[0],d=c[1];e[u].push([.75*h+.25*f,.75*p+.25*d]),e[u].push([.25*h+.75*f,.25*p+.75*d])}),!0),e.forEach((function(t){t.push(t[0])}))}function ta(t,e){var r=0,n=0,i=0;Y(t,(function(o,a,s,u,l){u>i&&(i=u,n=a,e.push([[]])),l>r&&(r=l,n=a,e[u].push([]));var c=a-n,h=t.coordinates[u][l][c+1],p=o[0],f=o[1],d=h[0],g=h[1];e[u][l].push([.75*p+.25*d,.75*f+.25*g]),e[u][l].push([.25*p+.75*d,.25*f+.75*g])}),!0),e.forEach((function(t){t.forEach((function(t){t.push(t[0])}))}))}const ea=function(t,e){var r=[],n=e.iterations||1;if(!t)throw new Error("inputPolys is required");return tt(t,(function(t,e,i){var o,a,s;switch(t.type){case"Polygon":o=[[]];for(var u=0;u0&&(a=m(o).geometry),$o(a,s),o=s.slice(0);r.push(m(o,i));break;case"MultiPolygon":o=[[[]]];for(var l=0;l0&&(a=I(o).geometry),ta(a,s),o=s.slice(0);r.push(I(o,i));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}})),b(r)};function ra(t,e,r){void 0===r&&(r=2);var n=B(t),i=B(e),o=n[0]-i[0],a=n[1]-i[1];return 1===r?Math.abs(o)+Math.abs(a):Math.pow(Math.pow(o,r)+Math.pow(a,r),1/r)}function na(t,e){var r=(e=e||{}).threshold||1e4,n=e.p||2,i=e.binary||!1,o=e.alpha||-1,a=e.standardization||!1,s=[];J(t,(function(t){s.push(Te(t))}));for(var u=[],l=0;l0?1:0))*r,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*r))];return o[0]>i&&(o[0]=i),o[0]<-i&&(o[0]=-i),o[1]>i&&(o[1]=i),o[1]<-i&&(o[1]=-i),o}function ca(t){var e=180/Math.PI,r=6378137;return[t[0]*e/r,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/r)))*e]}function ha(t){return Array.isArray(t)?ya(t):t&&t.bbox?ya(t.bbox):[360*ga(),180*ga()]}function pa(t,e){void 0===e&&(e={}),null==t&&(t=1);for(var r=[],n=0;n0?t+r[e-1]:t})),o.forEach((function(t){t=2*t*Math.PI/o[o.length-1];var r=Math.random();i.push([r*(e.max_radial_length||10)*Math.sin(t),r*(e.max_radial_length||10)*Math.cos(t)])})),i[i.length-1]=i[0],i=i.map((n=ha(e.bbox),function(t){return[t[0]+n[0],t[1]+n[1]]})),r.push(m([i]))},i=0;i1?0:t<-1?ka:Math.acos(t)}function Xa(t){return t>1?Ra:t<-1?-Ra:Math.asin(t)}function Za(){}function Ya(t,e){t&&Ja.hasOwnProperty(t.type)&&Ja[t.type](t,e)}var Wa,Ha,Ka={Feature:function(t,e){Ya(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nka?t-Da:t<-ka?t+Da:t,e]}function ls(t){return function(e,r){return[(e+=t)>ka?e-Da:e<-ka?e+Da:e,r]}}function cs(t){var e=ls(t);return e.invert=ls(-t),e}function hs(t,e){var r=Va(t),n=qa(t),i=Va(e),o=qa(e);function a(t,e){var a=Va(e),s=Va(t)*a,u=qa(t)*a,l=qa(e),c=l*r+s*n;return[Ua(u*i-c*o,s*r-l*n),Xa(c*i+u*o)]}return a.invert=function(t,e){var a=Va(e),s=Va(t)*a,u=qa(t)*a,l=qa(e),c=l*i-u*o;return[Ua(u*i+l*o,s*r+c*n),Xa(c*r-s*n)]},a}function ps(t,e){(e=es(e))[0]-=t,as(e);var r=Ga(-e[1]);return((-e[2]<0?-r:r)+Da-La)%Da}function fs(){var t,e=[];return{point:function(e,r){t.push([e,r])},lineStart:function(){e.push(t=[])},lineEnd:Za,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function ds(t,e){return Fa(t[0]-e[0])=0;--o)i.point((c=l[o])[0],c[1]);else n(p.x,p.p.x,-1,i);p=p.p}l=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}}function ms(t){if(e=t.length){for(var e,r,n=0,i=t[0];++ne?1:t>=e?0:NaN}Pa(),Pa(),Pa(),us.invert=us,1===(Wa=vs).length&&(Ha=Wa,Wa=function(t,e){return vs(Ha(t),e)});var _s=Array.prototype;function xs(t){for(var e,r,n,i=t.length,o=-1,a=0;++o=0;)for(e=(n=t[i]).length;--e>=0;)r[--a]=n[e];return r}_s.slice,_s.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var bs=1e9,ws=-bs;function Es(t,e,r,n){function i(i,o){return t<=i&&i<=r&&e<=o&&o<=n}function o(i,o,s,l){var c=0,h=0;if(null==i||(c=a(i,s))!==(h=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+s+4)%4)!==h);else l.point(o[0],o[1])}function a(n,i){return Fa(n[0]-t)0?0:3:Fa(n[0]-r)0?2:1:Fa(n[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(a){var u,l,c,h,p,f,d,g,y,m,v,_=a,x=fs(),b={point:w,lineStart:function(){b.point=E,l&&l.push(c=[]),m=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(E(h,p),f&&y&&x.rejoin(),u.push(x.result())),b.point=w,y&&_.lineEnd()},polygonStart:function(){_=x,u=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,r=0,i=l.length;rn&&(p-o)*(n-a)>(f-a)*(t-o)&&++e:f<=n&&(p-o)*(n-a)<(f-a)*(t-o)&&--e;return e}(),r=v&&e,i=(u=xs(u)).length;(r||i)&&(a.polygonStart(),r&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&ys(u,s,e,o,a),a.polygonEnd()),_=a,u=l=c=null}};function w(t,e){i(t,e)&&_.point(t,e)}function E(o,a){var s=i(o,a);if(l&&c.push([o,a]),m)h=o,p=a,f=s,m=!1,s&&(_.lineStart(),_.point(o,a));else if(s&&y)_.point(o,a);else{var u=[d=Math.max(ws,Math.min(bs,d)),g=Math.max(ws,Math.min(bs,g))],x=[o=Math.max(ws,Math.min(bs,o)),a=Math.max(ws,Math.min(bs,a))];!function(t,e,r,n,i,o){var a,s=t[0],u=t[1],l=0,c=1,h=e[0]-s,p=e[1]-u;if(a=r-s,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=p,p<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,p||!(a<0)){if(a/=p,p<0){if(a>c)return;a>l&&(l=a)}else if(p>0){if(a0&&(t[0]=s+l*h,t[1]=u+l*p),c<1&&(e[0]=s+c*h,e[1]=u+c*p),!0}}}}}(u,x,t,e,r,n)?s&&(_.lineStart(),_.point(o,a),v=!1):(y||(_.lineStart(),_.point(u[0],u[1])),_.point(x[0],x[1]),s||_.lineEnd(),v=!1)}d=o,g=a,y=s}return b}}var Is=Pa();Pa(),Pa(),Pa();var Ss=1/0,Cs=Ss,Ps=-Ss,Ms=Ps;const Ts={point:function(t,e){tPs&&(Ps=t),eMs&&(Ms=e)},lineStart:Za,lineEnd:Za,polygonStart:Za,polygonEnd:Za,result:function(){var t=[[Ss,Cs],[Ps,Ms]];return Ps=Ms=-(Cs=Ss=1/0),t}};function As(t,e,r,n){return function(i,o){var a,s,u,l=e(o),c=i.invert(n[0],n[1]),h=fs(),p=e(h),f=!1,d={point:g,lineStart:m,lineEnd:v,polygonStart:function(){d.point=_,d.lineStart=x,d.lineEnd=b,s=[],a=[]},polygonEnd:function(){d.point=g,d.lineStart=m,d.lineEnd=v,s=xs(s);var t=function(t,e){var r=e[0],n=e[1],i=[qa(r),-Va(r),0],o=0,a=0;Is.reset();for(var s=0,u=t.length;s=0?1:-1,I=E*w,S=I>ka,C=d*x;if(Is.add(Ua(C*E*qa(I),g*b+C*Va(I))),o+=S?w+E*Da:w,S^p>=r^v>=r){var P=ns(es(h),es(m));as(P);var M=ns(i,P);as(M);var T=(S^w>=0?-1:1)*Xa(M[2]);(n>T||n===T&&(P[0]||P[1]))&&(a+=S^w>=0?1:-1)}}return(o<-1e-6||o0){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t1&&2&i&&l.push(l.pop().concat(l.shift())),s.push(l.filter(Ls))}return d}}function Ls(t){return t.length>1}function ks(t,e){return((t=t.x)[0]<0?t[1]-Ra-La:Ra-t[1])-((e=e.x)[0]<0?e[1]-Ra-La:Ra-e[1])}Pa();const Rs=As((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?ka:-ka,u=Fa(o-r);Fa(u-ka)0?Ra:-Ra),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),e=0):i!==s&&u>=ka&&(Fa(r-i)La?Ba((qa(e)*(o=Va(n))*qa(r)-qa(n)*(i=Va(e))*qa(t))/(i*o*a)):(e+n)/2}(r,n,o,a),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=o,n=a),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*Ra,n.point(-ka,i),n.point(0,i),n.point(ka,i),n.point(ka,0),n.point(ka,-i),n.point(0,-i),n.point(-ka,-i),n.point(-ka,0),n.point(-ka,i);else if(Fa(t[0]-e[0])>La){var o=t[0]0,i=Fa(r)>La;function o(t,e){return Va(t)*Va(e)>r}function a(t,e,n){var i=[1,0,0],o=ns(es(t),es(e)),a=rs(o,o),s=o[0],u=a-s*s;if(!u)return!n&&t;var l=r*a/u,c=-r*s/u,h=ns(i,o),p=os(i,l);is(p,os(o,c));var f=h,d=rs(p,f),g=rs(f,f),y=d*d-g*(rs(p,p)-1);if(!(y<0)){var m=ja(y),v=os(f,(-d-m)/g);if(is(v,p),v=ts(v),!n)return v;var _,x=t[0],b=e[0],w=t[1],E=e[1];b0^v[1]<(Fa(v[0]-x)ka^(x<=v[0]&&v[0]<=b)){var C=os(f,(-d+m)/g);return is(C,p),[v,ts(C)]}}}function s(e,r){var i=n?t:ka-t,o=0;return e<-i?o|=1:e>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}return As(o,(function(t){var e,r,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,p){var f,d=[h,p],g=o(h,p),y=n?g?0:s(h,p):g?s(h+(h<0?ka:-ka),p):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(f=a(e,d))||ds(e,f)||ds(d,f))&&(d[0]+=La,d[1]+=La,g=o(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),f=a(d,e),t.point(f[0],f[1])):(f=a(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(i&&e&&n^g){var m;y&r||!(m=a(d,e,!0))||(c=0,n?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&ds(e,d)||t.point(d[0],d[1]),e=d,u=g,r=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(r,n,i,o){!function(t,e,r,n,i,o){if(r){var a=Va(e),s=qa(e),u=n*r;null==i?(i=e+n*Da,o=e-u/2):(i=ps(a,i),o=ps(a,o),(n>0?io)&&(i+=n*Da));for(var l,c=i;n>0?c>o:c4*e&&g--){var x=a+p,b=s+f,w=u+d,E=ja(x*x+b*b+w*w),I=Xa(w/=E),S=Fa(Fa(w)-1)e||Fa((m*T+v*A)/_-.5)>.3||a*p+s*f+u*d2?t[2]%360*za:0,M()):[y*Oa,m*Oa,v*Oa]},S.precision=function(t){return arguments.length?(I=Us(P,E=t*t),T()):ja(E)},S.fitExtent=function(t,e){return Fs(S,t,e)},S.fitSize=function(t,e){return function(t,e,r){return Fs(t,[[0,0],e],r)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&C,M()}}((function(){return t}))()}function js(t){return function(e,r){var n=Va(e),i=Va(r),o=t(n*i);return[o*i*qa(e),o*qa(r)]}}function Gs(t){return function(e,r){var n=ja(e*e+r*r),i=t(n),o=qa(i),a=Va(i);return[Ua(e*o,n*a),Xa(n&&r*o/n)]}}js((function(t){return ja(2/(1+t))})).invert=Gs((function(t){return 2*Xa(t/2)}));var Xs=js((function(t){return(t=Ga(t))&&t/qa(t)}));function Zs(t,e){return[t,e]}function Ys(t,e,r,n){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var a=[];return tt(t,(function(t){var i=Ys(t,e,r,n);i&&a.push(i)})),b(a)}var s=function(t){var e=Me(t).geometry.coordinates,r=[-e[0],-e[1]];return qs(Xs).scale(79.4188).clipAngle(179.999).rotate(r).scale(l)}(o),u={type:o.type,coordinates:Hs(o.coordinates,s)},c=(new Ca.GeoJSONReader).read(u),h=P(M(e,r),"meters"),p=Ca.BufferOp.bufferOp(c,h,n);if(!Ws((p=(new Ca.GeoJSONWriter).write(p)).coordinates))return f({type:p.type,coordinates:Ks(p.coordinates,s)},i)}function Ws(t){return Array.isArray(t[0])?Ws(t[0]):isNaN(t[0])}function Hs(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return Hs(t,e)}))}function Ks(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Ks(t,e)}))}Xs.invert=Gs((function(t){return t})),Zs.invert=Zs,Gs(Ba),Gs(Xa),Gs((function(t){return 2*Ba(t)}));const Js=function(t,e,r){var n=(r=r||{}).units||"kilometers",i=r.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof r)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return tt(t,(function(t){var r=Ys(t,e,n,i);r&&o.push(r)})),b(o);case"FeatureCollection":return J(t,(function(t){var r=Ys(t,e,n,i);r&&J(r,(function(t){t&&o.push(t)}))})),b(o)}return Ys(t,e,n,i)},Qs=function(t,e,r){void 0===r&&(r={});var n=X(t),i=X(e),o=Ia.union(n.coordinates,i.coordinates);return 0===o.length?null:1===o.length?m(o[0],r.properties):I(o,r.properties)};function $s(t,e,r){void 0===r&&(r={});var n=X(t),i=X(e),o=Ia.intersection(n.coordinates,i.coordinates);return 0===o.length?null:1===o.length?m(o[0],r.properties):I(o,r.properties)}function tu(t,e){return function(t,e,r){var n,i;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach((function(e,r){var o=function(t,e){return t-e}(e,t);o>=0&&(void 0===i||o0&&0!==h)if(h>o[o.length-1])h-=o.length;else{var p=tu(h,o);0!==p&&(h-=p)}if(h!==+s){var f=i[h];f&&u&&(void 0!==r&&f.properties[r]!==u.properties[r]||Vi(u,f)&&(e=f,n=_($(u)),c=_($(e)),Ue(n,c).features.length>0)&&(i[s]=Qs(u,f),o.push(t.properties.origIndexPosition),o.sort((function(t,e){return t-e})),a.remove(t),i.splice(h,1),u.properties.origIndexPosition=s,a.remove(u,(function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition})),l=!0))}})),l){if(!u)continue;u.properties.origIndexPosition=s,a.insert(u),s--}}return i.forEach((function(t){delete t.properties.origIndexPosition,delete t.bbox})),n};function ru(t,e,r,n,i,o){for(var a=[],s=0;s<6;s++){var u=t[0]+e*i[s],l=t[1]+r*o[s];a.push([u,l])}return a.push(a[0].slice()),m([a],n)}function nu(t,e,r,n,i,o){for(var a=[],s=0;s<6;s++){var u=[];u.push(t),u.push([t[0]+e*i[s],t[1]+r*o[s]]),u.push([t[0]+e*i[(s+1)%6],t[1]+r*o[(s+1)%6]]),u.push(t),a.push(m([u],n))}return a}const iu=function(t,e,r){void 0===r&&(r={});var n=JSON.stringify(r.properties||{}),i=t[0],o=t[1],a=t[2],s=t[3],u=(o+s)/2,l=(i+a)/2,c=2*e/Ct([i,u],[a,u],r)*(a-i),h=2*e/Ct([l,o],[l,s],r)*(s-o),p=c/2,f=2*p,d=Math.sqrt(3)/2*h,g=a-i,y=s-o,m=3/4*f,v=d,_=(g-f)/(f-p/2),x=Math.floor(_),w=(x*m-p/2-g)/2-p/2+m/2,E=Math.floor((y-d)/d),I=(y-E*d)/2,S=E*d-y>d/2;S&&(I-=d/4);for(var C=[],P=[],M=0;M<6;M++){var T=2*Math.PI/6*M;C.push(Math.cos(T)),P.push(Math.sin(T))}for(var A=[],L=0;L<=x;L++)for(var k=0;k<=E;k++){var R=L%2==1;if(!(0===k&&R||0===k&&S)){var N=L*m+i-w,D=k*v+o+I;if(R&&(D-=d/2),!0===r.triangles)nu([N,D],c/2,h/2,JSON.parse(n),C,P).forEach((function(t){r.mask?$s(r.mask,t)&&A.push(t):A.push(t)}));else{var O=ru([N,D],c/2,h/2,JSON.parse(n),C,P);r.mask?$s(r.mask,O)&&A.push(O):A.push(O)}}}return b(A)};function ou(t){if(t.features.length<=1)return t;var e=function(t){var e=re(),r=[];return rt(t,(function(t,e){var n=ht(t);r.push({minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],geojson:t,index:e})})),e.load(r),e}(t),r=[],n={};return rt(t,(function(t,i){if(n[i])return!0;for(e.remove({index:i},au),n[i]=!0;;){var o=ht(t),a=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(a.length>0)for(var s=a.map((function(t){return n[t.index]=!0,e.remove({index:t.index},au),t.geojson})),u=0,l=s.length;u{"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){var e=s(n,a,arguments);if(u&&l){var r=u(e,"length");r.configurable&&l(e,"length",{value:1+c(0,t.length-(arguments.length-1))})}return e};var h=function(){return s(n,o,arguments)};l?l(t.exports,"apply",{value:h}):t.exports.apply=h},2273:(t,e,r)=>{"use strict";var n=r(1662),i=r(3842),o=r(6960);const a=r(8639).orient2d;function s(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;var i=function(t){for(var e=t[0],r=t[0],n=t[0],i=t[0],a=0;an[0]&&(n=s),s[1]i[1]&&(i=s)}var u=[e,r,n,i],l=u.slice();for(a=0;a=2&&f(e[e.length-2],e[e.length-1],t[r])<=0;)e.pop();e.push(t[r])}for(var n=[],i=t.length-1;i>=0;i--){for(;n.length>=2&&f(n[n.length-2],n[n.length-1],t[i])<=0;)n.pop();n.push(t[i])}return n.pop(),e.pop(),e.concat(n)}(l)}(t),a=new n(16);a.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},a.compareMinX=function(t,e){return t[0]-e[0]},a.compareMinY=function(t,e){return t[1]-e[1]},a.load(t);for(var s,l=[],c=0;ca||u.push({node:d,dist:g})}for(;u.length&&!u.peek().node.children;){var y=u.pop(),v=y.node,_=m(v,e,r),x=m(v,n,o);if(y.dist<_&&y.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function p(t,e,r){for(var n,i,o,a,s=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),l=Math.max(t[0],e[0]),c=Math.max(t[1],e[1]),h=r.search({minX:s,minY:u,maxX:l,maxY:c}),p=0;p0!=f(n,i,a)>0&&f(o,a,n)>0!=f(o,a,i)>0)return!1;return!0}function f(t,e,r){return a(t[0],t[1],e[0],e[1],r[0],r[1])}function d(t){var e=t.p,r=t.next.p;return t.minX=Math.min(e[0],r[0]),t.minY=Math.min(e[1],r[1]),t.maxX=Math.max(e[0],r[0]),t.maxY=Math.max(e[1],r[1]),t}function g(t,e){var r={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function y(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function m(t,e,r){var n=e[0],i=e[1],o=r[0]-n,a=r[1]-i;if(0!==o||0!==a){var s=((t[0]-n)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(n=r[0],i=r[1]):s>0&&(n+=o*s,i+=a*s)}return(o=t[0]-n)*o+(a=t[1]-i)*a}function v(t,e,r,n,i,o,a,s){var u,l,c,h,p=r-t,f=n-e,d=a-i,g=s-o,y=t-i,m=e-o,v=p*p+f*f,_=p*d+f*g,x=d*d+g*g,b=p*y+f*m,w=d*y+g*m,E=v*x-_*_,I=E,S=E;0===E?(l=0,I=1,h=w,S=x):(h=v*w-_*b,(l=_*w-x*b)<0?(l=0,h=w,S=x):l>I&&(l=I,h=w+_,S=x)),h<0?(h=0,-b<0?l=0:-b>v?l=I:(l=-b,I=v)):h>S&&(h=S,-b+_<0?l=0:-b+_>v?l=I:(l=-b+_,I=v));var C=(1-(c=0===h?0:h/S))*i+c*a-((1-(u=0===l?0:l/I))*t+u*r),P=(1-c)*o+c*s-((1-u)*e+u*n);return C*C+P*P}function _(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}t.exports=s,t.exports.default=s},1662:function(t){t.exports=function(){"use strict";function t(t,n,i,o,a){!function t(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(r,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var p=r[n],f=i,d=o;for(e(r,i,n),a(r[o],p)>0&&e(r,i,o);f0;)d--}0===a(r[i],p)?e(r,i,d):e(r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(t,n,i||0,o||t.length-1,a||r)}function e(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function r(t,e){return te?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,r,n,i,o){for(var a=[r,n];a.length;)if(!((n=a.pop())-(r=a.pop())<=i)){var s=r+Math.ceil((n-r)/i/2)*i;t(e,s,r,n,o),a.push(r,s,s,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,r=[];if(!f(t,e))return r;for(var n=this.toBBox,i=[];e;){for(var o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)},n.prototype._split=function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var a=this._chooseSplitIndex(r,i,n),s=d(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,o(r,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},n.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,r){for(var n,i,o,s,u,l,h,p=1/0,f=1/0,d=e;d<=r-e;d++){var g=a(t,0,d,this.toBBox),y=a(t,d,r,this.toBBox),m=(i=g,o=y,void 0,void 0,void 0,void 0,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,h-u)),v=c(g)+c(y);m=e;f--){var d=t.children[f];s(u,t.leaf?i(d):d),l+=h(u)}return l},n.prototype._adjustParentBBoxes=function(t,e,r){for(var n=r;n>=0;n--)s(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},n}()},8754:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(3645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,"html,\nbody {\n height: 100%;\n padding: 0;\n margin: 0;\n}\n\n#map {\n z-index: 0;\n height: 100%;\n}\n",""]);const o=i},7113:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(3645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}",""]);const o=i},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,n){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(n)for(var o=0;o{var n=r(2215),i=r(2584),o=r(609),a=r(8420),s=r(2847),u=r(8923),l=Date.prototype.getTime;function c(t){return null==t}function h(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}t.exports=function t(e,r,p){var f=p||{};return!!(f.strict?o(e,r):e===r)||(!e||!r||"object"!=typeof e&&"object"!=typeof r?f.strict?o(e,r):e==r:function(e,r,o){var p,f;if(typeof e!=typeof r)return!1;if(c(e)||c(r))return!1;if(e.prototype!==r.prototype)return!1;if(i(e)!==i(r))return!1;var d=a(e),g=a(r);if(d!==g)return!1;if(d||g)return e.source===r.source&&s(e)===s(r);if(u(e)&&u(r))return l.call(e)===l.call(r);var y=h(e),m=h(r);if(y!==m)return!1;if(y||m){if(e.length!==r.length)return!1;for(p=0;p=0;p--)if(v[p]!=_[p])return!1;for(p=v.length-1;p>=0;p--)if(!t(e[f=v[p]],r[f],o))return!1;return!0}(e,r,f))}},4289:(t,e,r)=>{"use strict";var n=r(2215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=s&&function(){var t={};try{for(var e in s(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(u?s(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},c=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s{function e(t,e,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,r,n)}e.prototype.run=function(t,e,r,n){this._init(t,e,r,n);for(var i=0;i=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],r=0;r{function e(t,e,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,r)}e.prototype.init=function(t,e,r){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==r&&(this.distance=r)},e.prototype.run=function(t,e){this.init(t,e);for(var r=this.dataset.length,n=0;n0){for(u=0;u=0);return t},e.prototype.assign=function(){for(var t,e=!1,r=this.dataset.length,n=0;n{if(t.exports)var n=r(7985);function i(t,e,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,r,n)}i.prototype.run=function(t,e,r,i){this._init(t,e,r,i);for(var o=0,a=this.dataset.length;o=this.minPts)return r},i.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var r=[],n=0,i=this.dataset.length;n{function e(t,e,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,r)}e.prototype.insert=function(t,e){for(var r=this._queue.length,n=r;n--;){var i=this._priorities[n];"desc"===this._sorting?e>i&&(r=n):e{t.exports&&(t.exports={DBSCAN:r(8317),KMEANS:r(3781),OPTICS:r(3763),PriorityQueue:r(7985)})},9187:t=>{"use strict";function e(t,e,o){o=o||2;var a,s,u,h,p,d,g,y=e&&e.length,m=y?e[0]*o:t.length,v=r(t,0,m,o,!0),_=[];if(!v||v.next===v.prev)return _;if(y&&(v=function(t,e,i,o){var a,s,u,h=[];for(a=0,s=e.length;a80*o){a=u=t[0],s=h=t[1];for(var x=o;xu&&(u=p),d>h&&(h=d);g=0!==(g=Math.max(u-a,h-s))?1/g:0}return i(v,_,o,a,s,g),_}function r(t,e,r,n,i){var o,a;if(i===C(t,e,r,n)>0)for(o=e;o=e;o-=n)a=E(o,t[o],t[o+1],a);return a&&m(a,a.next)&&(I(a),a=a.next),a}function n(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!m(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(I(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function i(t,e,r,l,c,h,f){if(t){!f&&h&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=p(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,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,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--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,l,c,h);for(var d,g,y=t;t.prev!==t.next;)if(d=t.prev,g=t.next,h?a(t,l,c,h):o(t))e.push(d.i/r),e.push(t.i/r),e.push(g.i/r),I(t),t=g.next,y=g.next;else if((t=g)===y){f?1===f?i(t=s(n(t),e,r),e,r,l,c,h,2):2===f&&u(t,e,r,l,c,h):i(n(t),e,r,l,c,h,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(d(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&y(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(t,e,r,n){var i=t.prev,o=t,a=t.next;if(y(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=p(s,u,e,r,n),f=p(l,c,e,r,n),g=t.prevZ,m=t.nextZ;g&&g.z>=h&&m&&m.z<=f;){if(g!==t.prev&&g!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,m!==t.prev&&m!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;g&&g.z>=h;){if(g!==t.prev&&g!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;m&&m.z<=f;){if(m!==t.prev&&m!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function s(t,e,r){var i=t;do{var o=i.prev,a=i.next.next;!m(o,a)&&v(o,i,i.next,a)&&b(o,a)&&b(a,o)&&(e.push(o.i/r),e.push(i.i/r),e.push(a.i/r),I(i),I(i.next),i=t=a),i=i.next}while(i!==t);return n(i)}function u(t,e,r,o,a,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var c=w(u,l);return u=n(u,u.next),c=n(c,c.next),i(u,e,r,o,a,s),void i(c,e,r,o,a,s)}l=l.next}u=u.next}while(u!==t)}function l(t,e){return t.x-e.x}function c(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&d(or.x||n.x===r.x&&h(r,n)))&&(r=n,f=u)),n=n.next}while(n!==l);return r}(t,e)){var r=w(e,t);n(e,e.next),n(r,r.next)}}function h(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(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 f(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function g(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&&v(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||m(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,r,n){var i=x(y(t,e,r)),o=x(y(t,e,n)),a=x(y(r,n,t)),s=x(y(r,n,e));return i!==o&&a!==s||!(0!==i||!_(t,r,e))||!(0!==o||!_(t,n,e))||!(0!==a||!_(r,t,n))||!(0!==s||!_(r,e,n))}function _(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 x(t){return t>0?1:t<0?-1:0}function b(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function w(t,e){var r=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function E(t,e,r,n){var i=new S(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 I(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 S(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 C(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var a,s=r.call(arguments,1),u=function(){if(this instanceof a){var e=o.apply(this,s.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,s.concat(r.call(arguments)))},l=Math.max(0,o.length-s.length),c=[],h=0;h{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},9657:(t,e,r)=>{var n=r(251),i=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:s};function o(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function a(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function s(t,e){return n(t,e,{strict:!0})}i.prototype.compare=function(t,e){if(t.type!==e.type||!a(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var r=this,n=o(t),i=o(e);return n.every((function(t){return this.some((function(e){return r.compare(t,e)}))}),i)}}return!1},i.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var r=0;r=0&&(r=[].concat(t.slice(n,t.length),t.slice(1,n+1))),r},i.prototype.comparePath=function(t,e){var r=this;return t.every((function(t,e){return r.compareCoord(t,this[e])}),e)},i.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length),i=this;return r.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),n)}return!1},i.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},i.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},i.prototype.removePseudo=function(t){return t},t.exports=i},1787:(t,e,r)=>{var n=r(5510),i=r(4102),o=r(1540),a=r(9705).Z,s=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function l(t){var e=n(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),n.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})),n.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),n.prototype.remove.call(this,t,e)},e.clear=function(){return n.prototype.clear.call(this)},e.search=function(t){var e=n.prototype.search.call(this,this.toBBox(t));return u(e)},e.collides=function(t){return n.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=n.prototype.all.call(this);return u(t)},e.toJSON=function(){return n.prototype.toJSON.call(this)},e.fromJSON=function(t){return n.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=l,t.exports.default=l},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var l=function(){throw new a},c=u?function(){try{return l}catch(t){try{return u(arguments,"callee").get}catch(t){return l}}}():l,h=r(1405)(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d="undefined"==typeof Uint8Array?n:p(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function t(e){var r;if("%AsyncFunction%"===e)r=s("async function () {}");else if("%GeneratorFunction%"===e)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=s("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=p(i.prototype))}return g[e]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=r(8612),_=r(7642),x=v.call(Function.call,Array.prototype.concat),b=v.call(Function.apply,Array.prototype.splice),w=v.call(Function.call,String.prototype.replace),E=v.call(Function.call,String.prototype.slice),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,C=function(t){var e=E(t,0,1),r=E(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return w(t,I,(function(t,e,r,i){n[n.length]=r?w(i,S,"$1"):e||t})),n},P=function(t,e){var r,n=t;if(_(m,n)&&(n="%"+(r=m[n])[0]+"%"),_(g,n)){var o=g[n];if(o===f&&(o=y(n)),void 0===o&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');var r=C(t),n=r.length>0?r[0]:"",o=P("%"+n+"%",e),s=o.name,l=o.value,c=!1,h=o.alias;h&&(n=h[0],b(r,x([0,1],h)));for(var p=1,f=!0;p=r.length){var v=u(l,d);l=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[d]}else f=_(l,d),l=l[d];f&&!c&&(g[s]=l)}}return l}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},2584:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},8923:t=>{"use strict";var e=Date.prototype.getDay,r=Object.prototype.toString,n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(n?function(t){try{return e.call(t),!0}catch(t){return!1}}(t):"[object Date]"===r.call(t))}},8420:(t,e,r)=>{"use strict";var n,i,o,a,s=r(1924),u=r(1405)()&&"symbol"==typeof Symbol.toStringTag;if(u){n=s("Object.prototype.hasOwnProperty"),i=s("RegExp.prototype.exec"),o={};var l=function(){throw o};a={toString:l,valueOf:l},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=l)}var c=s("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=u?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{i(t,a)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===c(t)}},6158:function(t){t.exports=function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),r=i(a),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=i;else t=i}return n(0,(function(t){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,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)(n=1))return n;for(;ro?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=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(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}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}var l=u(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function h(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(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 y(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 m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function v(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(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 b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?_(t,b):t}var w={};function E(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function S(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var M=null;function T(t){if(null==M){var e=t.navigator?t.navigator.userAgent:null;M=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return M}function A(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,k,R,N,D=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),O=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,z=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,F={now:D,frame:function(t){var e=O(t);return{cancel:function(){return z(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.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 L||(L=a.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==k&&(k=a.matchMedia("(prefers-reduced-motion: reduce)")),k.matches)}},B={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!V&&N&&(q?j(t):R=t)}},V=!1,q=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,N),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),V=!0}a.document&&((N=a.document.createElement("img")).onload=function(){R&&j(R),R=null,q=!0},N.onerror=function(){V=!0,R=null},N.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",X=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}X.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},X.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},X.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},X.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return Z(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},X.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var r=K(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(F.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!B.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||B.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function W(t){return Y.test(t)}var H=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(H);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Q(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,r=Q(B.ACCESS_TOKEN);return e=r&&r.u?a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):B.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},$.prototype.fetchEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=a.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=a.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){E("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){E("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,r,n){var i=this;if(B.EVENTS_URL){var o=K(B.EVENTS_URL);o.params.push("access_token="+(n||B.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.0",skuId:G,userId:this.anonId},s=e?p(a,e):a,u={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(B.EVENTS_URL&&n||B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||W(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(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}($),nt=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){B.EVENTS_URL&&B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||W(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Q(B.ACCESS_TOKEN),n=r?r.u:B.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}($)),it=nt.postTurnstileEvent.bind(nt),ot=new rt,at=ot.postMapLoadEvent.bind(ot),st=500,ut=50;function lt(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,pt=1/0;function ft(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var gt,yt,mt=function(t){function e(e,r,n){401===r&&W(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=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),vt=C()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},_t=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(vt())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:vt(),signal:n.signal}),o=!1,s=!1,u=(r=i.url).indexOf("sku=")>0&&W(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,o){if(!s){if(r&&"SecurityError"!==r.message&&E(r),n&&o)return c(n);var l=Date.now();a.fetch(i).then((function(r){if(r.ok){var n=u?r.clone():null;return c(r,n,l)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(lt(),tt){var n={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=P(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===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,n);lt(),tt&&tt.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return E(t.message)}))})))}}(i,n,u),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(lt(),!tt)return e(null);var r=ct(t.url);tt.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=P(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,l):l(null,null),{cancel:function(){s=!0,o||n.abort()}}}(t,e);if(C()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new a.XMLHttpRequest;for(var n in r.open(t.method||"GET",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 mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return _t(p(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return _t(p(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";gt=[],yt=0;var Et=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),yt>=B.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}yt++;var n=!1,i=function(){if(!n)for(n=!0,yt--;gt.length&&yt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Mt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Tt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},At=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Lt(t){var e=t.value;return e?[new At(t.key,e,"constants have been deprecated as of v8")]:[]}function kt(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 Ht=[zt,Ft,Bt,Ut,Vt,Xt,qt,Yt(jt),Zt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Ht;r255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var c=s.substr(0,u),h=s.substr(u+1,l-(u+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),g=o(h[2]),y=g<=.5?g*(d+1):g+d-g*d,m=2*g-y;return[n(255*a(m,y,f+1/3)),n(255*a(m,y,f)),n(255*a(m,y,f-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.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+")"},te.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]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=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"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.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}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.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 ae(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 te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],n++}else o=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Yt(o,a)}else r=he[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Xt,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Ft)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Yt(Bt))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Vt)))return null;var c=n[n.length-1];c.scale=s,c.font=u,c.textColor=l}else{var h=e.parse(t[o],1,jt);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)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 fe(n)},fe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Zt?new re("",r,null,null,null):new re(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var ge={"to-boolean":Ut,"to-color":Vt,"to-number":Ft,"to-string":Bt},ye=function(t,e){this.type=t,this.args=e};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=ge[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ee(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 Ie(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 Se(t,e){for(var r,n,i,o,a,s,u,l=!1,c=0,h=e.length;c0&&s<0||a<0&&s>0}function Me(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}be(e,t)}function Ne(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Be(t,e)&&(r=!1)})),r}Oe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ce("Input is not a number.");o=a-1}return 0}Ve.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)},Ve.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new pe(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var 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 o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof le)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ue)return t(e.boundExpression);if(e instanceof _e&&"error"===e.name)return!1;if(e instanceof xe)return!1;if(e instanceof Oe)return!1;var r=e instanceof ye||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof le})),!!n&&ze(e)&&Be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new ve;try{o=new le(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}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.")},Ve.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 Ve(this.registry,n,e||null,i,this.errors)},Ve.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 Dt(n,t))},Ve.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var je=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=e.parse(s,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new je(i,r,n)},je.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[qe(e,n)].evaluate(t)},je.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 Xe=Object.freeze({__proto__:null,number:Ge,color:function(t,e,r){return new te(Ge(t.r,e.r,r),Ge(t.g,e.g,r),Ge(t.b,e.b,r),Ge(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ge(t,e[n],r)}))}}),Ze=6/29*3*(6/29),Ye=Math.PI/180,We=180/Math.PI;function He(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ze+4/29}function Ke(t){return t>6/29?t*t*t:Ze*(t-4/29)}function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Qe(t.r),r=Qe(t.g),n=Qe(t.b),i=He((.4124564*e+.3575761*r+.1804375*n)/.95047),o=He((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-He((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function tr(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*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Je(3.2404542*r-1.5371385*e-.4985314*n),Je(-.969266*r+1.8760108*e+.041556*n),Je(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function er(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var rr={forward:$e,reverse:tr,interpolate:function(t,e,r){return{l:Ge(t.l,e.l,r),a:Ge(t.a,e.a,r),b:Ge(t.b,e.b,r),alpha:Ge(t.alpha,e.alpha,r)}}},nr={forward:function(t){var e=$e(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*We;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Ye,r=t.c;return tr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:er(t.h,e.h,r),c:Ge(t.c,e.c,r),l:Ge(t.l,e.l,r),alpha:Ge(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:rr,hcl:nr}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))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,Ft)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=Vt:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var g=e.parse(p,d,l);if(!g)return null;l=l||g.type,u.push([h,g])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new or(l,r,n,i,u):e.error("Type "+Wt(l)+" is not interpolatable.")},or.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 o=qe(e,n),a=or.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Xe[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?nr.reverse(nr.interpolate(nr.forward(s),nr.forward(u),a)):rr.reverse(rr.interpolate(rr.forward(s),rr.forward(u),a))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},lr.prototype.eachChild=function(t){t(this.index),t(this.input)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cr=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);return r&&n?Jt(r.type,[Ut,Bt,Ft,zt,jt])?new cr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");return r.indexOf(e)>=0},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Ft,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);if(!r||!n)return null;if(!Jt(r.type,[Ut,Bt,Ft,zt,jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new hr(r,n,i):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};pr.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={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,se(p)))return null}else r=se(p);if(void 0!==i[String(p)])return l.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,jt);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,o,g):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=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,jt),n=e.parse(t[2],2,Ft);if(!r||!n)return null;if(!Jt(r.type,[Yt(jt),Bt,jt]))return e.error("Expected first argument to be of type array or string, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new dr(r.type,r,n,i):null}return new dr(r.type,r,n)},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Wt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},dr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},dr.prototype.outputDefined=function(){return!1},dr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var vr=mr("==",(function(t,e,r){return e===r}),yr),_r=mr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!yr(0,e,r,n)})),xr=mr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),wr=mr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Er=mr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Ir=function(t,e,r,n,i){this.type=Bt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Ir.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ft);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,Bt)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Bt)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Ft)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ft))?null:new Ir(r,i,o,a,s)},Ir.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))},Ir.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)},Ir.prototype.outputDefined=function(){return!1},Ir.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 Sr=function(t){this.type=Ft,this.input=t};Sr.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 "+Wt(r.type)+" instead."):new Sr(r):null},Sr.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 ce("Expected value to be of type string or array, but found "+Wt(se(e))+" instead.")},Sr.prototype.eachChild=function(t){t(this.input)},Sr.prototype.outputDefined=function(){return!1},Sr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Cr={"==":vr,"!=":_r,">":br,"<":xr,">=":Er,"<=":wr,array:pe,at:lr,boolean:pe,case:fr,coalesce:sr,collator:xe,format:fe,image:de,in:cr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Sr,let:ur,literal:le,match:pr,number:pe,"number-format":Ir,object:pe,slice:dr,step:je,string:pe,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:Ue,within:Oe};function Pr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(r,n,i,a);if(s)throw new ce(s);return new te(r/255*a,n/255*a,i/255*a,a)}function Mr(t,e){return t in e}function Tr(t,e){var r=e[t];return void 0===r?null:r}function Ar(t){return{type:t}}function Lr(t){return{result:"success",value:t}}function kr(t){return{result:"error",value:t}}function Rr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Nr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Dr(t){return!!t.expression&&t.expression.interpolated}function Or(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function zr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Fr(t){return t}function Br(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,i){return Br(typeof r===i?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Or(r))return Br(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=qe(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Or(r))return Br(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=qe(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=Xe[e.type]||Fr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ir[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function jr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):Or(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Br(r,t.default,e.default)}_e.register(Cr,{error:[{kind:"error"},[Bt],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[Bt,[jt],function(t,e){return Wt(se(e[0].evaluate(t)))}],"to-rgba":[Yt(Ft,4),[Vt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Vt,[Ft,Ft,Ft],Pr],rgba:[Vt,[Ft,Ft,Ft,Ft],Pr],has:{type:Ut,overloads:[[[Bt],function(t,e){return Mr(e[0].evaluate(t),t.properties())}],[[Bt,qt],function(t,e){var r=e[1];return Mr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:jt,overloads:[[[Bt],function(t,e){return Tr(e[0].evaluate(t),t.properties())}],[[Bt,qt],function(t,e){var r=e[1];return Tr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[jt,[Bt],function(t,e){return Tr(e[0].evaluate(t),t.featureState||{})}],properties:[qt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[Ft,[],function(t){return t.globals.zoom}],"heatmap-density":[Ft,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ft,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ft,Ar(Ft),function(t,e){for(var r=0,n=0,i=e;n":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ut,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Yt(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Yt(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[Bt,Yt(jt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ut,[Bt,Yt(jt)],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:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Ar(Ut),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Cr}function Zr(t,e){var r=new Ve(Cr,[],e?function(t){var e={color:Vt,string:Bt,number:Ft,enum:Bt,boolean:Ut,formatted:Xt,resolvedImage:Zt};return"array"===t.type?Yt(e[t.value]||jt,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?Lr(new Gr(n,e)):kr(r.errors)}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){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=o,this.expression.evaluate(this._evaluator)},Gr.prototype.evaluate=function(t,e,r,n,i,o){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=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Yr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Fe(e.expression)};Yr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Yr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Wr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Fe(e.expression),this.interpolationType=n};function Hr(t,e){if("error"===(t=Zr(t,e)).result)return t;var r=t.value.expression,n=ze(r);if(!n&&!Rr(e))return kr([new Dt("","data expressions not supported")]);var i=Be(r,["zoom"]);if(!i&&!Nr(e))return kr([new Dt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof sr)for(var n=0,i=e.args;nn.maximum?[new At(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function tn(t){var e,r,n,i=t.valueSpec,o=Rt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Or(t.value.stops)&&"array"===Or(t.value.stops[0])&&"object"===Or(t.value.stops[0][0]),c=Jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Qr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Or(r)&&0===r.length&&e.push(new At(t.key,r,"array must have at least one stop")),e},default:function(t){return En({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new At(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Dr(t.valueSpec)&&c.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Rr(t.valueSpec)?c.push(new At(t.key,t.value,"property functions not supported")):s&&!Nr(t.valueSpec)&&c.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new At(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==Or(o))return[new At(s,o,"array expected, "+Or(o)+" found")];if(2!==o.length)return[new At(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Or(o[0]))return[new At(s,o,"object expected, "+Or(o[0])+" found")];if(void 0===o[0].zoom)return[new At(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new At(s,o,"object stop key must have value")];if(n&&n>Rt(o[0].zoom))return[new At(s,o[0].zoom,"stop zoom values must appear in ascending order")];Rt(o[0].zoom)!==n&&(n=Rt(o[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:$r,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Xr(Nt(o[1]))?e.concat([new At(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(En({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=Or(t.value),u=Rt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new At(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 At(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Rr(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"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 un(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?ln(t[1],t[2],"=="):"!="===r?pn(ln(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?ln(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(un))):"all"===r?["all"].concat(t.slice(1).map(un)):"none"===r?["all"].concat(t.slice(1).map(un).map(pn)):"in"===r?cn(t[1],t.slice(2)):"!in"===r?pn(cn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?pn(hn(t[1])):"within"!==r||t}function ln(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 cn(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(sn)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function fn(t){return nn(Nt(t.value))?en(kt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Or(r))return[new At(n,r,"array expected, "+Or(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new At(n,r,"filter array must have at least 1 element")];switch(a=a.concat(rn({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Rt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Rt(r[1])&&a.push(new At(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new At(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Or(r[1]))&&a.push(new At(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=c[f+0]&&n>=c[f+1])?(a[p]=!0,o.push(l[p])):a[p]=!1}}},Nn.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=u;p<=c;p++)for(var f=l;f<=h;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,o,a,s))return}},Nn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Nn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Nn.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 c=t[l];u[l]=zn[s].shallow.indexOf(l)>=0?c:qn(c,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 jn(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||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Dn)return t;if(Array.isArray(t))return t.map(jn);if("object"==typeof t){var e=t.$name||"Object",r=zn[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,o=Object.keys(t);i=0?s:jn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Gn=function(){this.first=!0};Gn.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=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Zn(t){for(var e=0,r=t;e=65097&&t<=65103)||Xn["CJK Compatibility Ideographs"](t)||Xn["CJK Compatibility"](t)||Xn["CJK Radicals Supplement"](t)||Xn["CJK Strokes"](t)||!(!Xn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Xn["CJK Unified Ideographs Extension A"](t)||Xn["CJK Unified Ideographs"](t)||Xn["Enclosed CJK Letters and Months"](t)||Xn["Hangul Compatibility Jamo"](t)||Xn["Hangul Jamo Extended-A"](t)||Xn["Hangul Jamo Extended-B"](t)||Xn["Hangul Jamo"](t)||Xn["Hangul Syllables"](t)||Xn.Hiragana(t)||Xn["Ideographic Description Characters"](t)||Xn.Kanbun(t)||Xn["Kangxi Radicals"](t)||Xn["Katakana Phonetic Extensions"](t)||Xn.Katakana(t)&&12540!==t||!(!Xn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Xn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Xn["Unified Canadian Aboriginal Syllabics"](t)||Xn["Unified Canadian Aboriginal Syllabics Extended"](t)||Xn["Vertical Forms"](t)||Xn["Yijing Hexagram Symbols"](t)||Xn["Yi Syllables"](t)||Xn["Yi Radicals"](t))))}function Wn(t){return!(Yn(t)||function(t){return!!(Xn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Xn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Xn["Letterlike Symbols"](t)||Xn["Number Forms"](t)||Xn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Xn["Control Pictures"](t)&&9251!==t||Xn["Optical Character Recognition"](t)||Xn["Enclosed Alphanumerics"](t)||Xn["Geometric Shapes"](t)||Xn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Xn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Xn["CJK Symbols and Punctuation"](t)||Xn.Katakana(t)||Xn["Private Use Area"](t)||Xn["CJK Compatibility Forms"](t)||Xn["Small Form Variants"](t)||Xn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Hn(t){return t>=1424&&t<=2303||Xn["Arabic Presentation Forms-A"](t)||Xn["Arabic Presentation Forms-B"](t)}function Kn(t,e){return!(!e&&Hn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Xn.Khmer(t))}function Jn(t){for(var e=0,r=t;e-1&&($n="error"),Qn&&Qn(t)};function ri(){ni.fire(new Ct("pluginStateChange",{pluginStatus:$n,pluginURL:ti}))}var ni=new Mt,ii=function(){return $n},oi=function(){if("deferred"!==$n||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$n="loading",ri(),ti&&xt({url:ti},(function(t){t?ei(t):($n="loaded",ri())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$n||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===$n},setState:function(t){$n=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=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 Gn,this.transition={})};si.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 ui=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(zr(t))return new Kr(t,e);if(Xr(t)){var r=Hr(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=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ui.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var li=function(t){this.property=t,this.value=new ui(t,void 0)};li.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},li.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ci.prototype.getValue=function(t){return b(this._values[t].value.value)},ci.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].value=new ui(this._values[t].property,null===e?void 0:b(e))},ci.prototype.getTransition=function(t){return b(this._values[t].transition)},ci.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].transition=b(e)||void 0},ci.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)}(a))}return i};var pi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};pi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new gi(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(mi),_i=function(t){this.specification=t};_i.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 si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},_i.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},_i.prototype.interpolate=function(t){return t};var xi=function(t){this.specification=t};xi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},xi.prototype.interpolate=function(){return!1};var bi=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 ui(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new li(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Fn("DataDrivenProperty",mi),Fn("DataConstantProperty",yi),Fn("CrossFadedDataDrivenProperty",vi),Fn("CrossFadedProperty",_i),Fn("ColorRampProperty",xi);var wi=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),r.layout&&(this._unevaluatedLayout=new fi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ci(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 gi(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(Ln,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(An,"layers."+this.id+".paint."+t,t,e,r))return!1;if(v(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"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&kn(this,t.call(Mn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Tt,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 di&&Rr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Mt),Ei={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ii=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},Si=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ci(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=Ei[t.type].BYTES_PER_ELEMENT,o=r=Pi(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Pi(r,Math.max(n,e)),alignment:e}}function Pi(t,e){return Math.ceil(t/e)*e}Si.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Si.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},Si.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Si.prototype.clear=function(){this.length=0},Si.prototype.resize=function(t){this.reserve(t),this.length=t},Si.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)}},Si.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Mi=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}(Si);Mi.prototype.bytesPerElement=4,Fn("StructArrayLayout2i4",Mi);var Ti=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 o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Si);Ti.prototype.bytesPerElement=8,Fn("StructArrayLayout4i8",Ti);var Ai=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.int16[s+5]=a,t},e}(Si);Ai.prototype.bytesPerElement=12,Fn("StructArrayLayout2i4i12",Ai);var Li=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.uint8[u+7]=a,t},e}(Si);Li.prototype.bytesPerElement=8,Fn("StructArrayLayout2i4ub8",Li);var ki=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}(Si);ki.prototype.bytesPerElement=8,Fn("StructArrayLayout2f8",ki);var Ri=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,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c){var h=10*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]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=l,this.uint16[h+9]=c,t},e}(Si);Ri.prototype.bytesPerElement=20,Fn("StructArrayLayout10ui20",Ri);var Ni=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,o,a,s,u,l,c,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,l,c,h)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p){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]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,t},e}(Si);Ni.prototype.bytesPerElement=24,Fn("StructArrayLayout4i4ui4i24",Ni);var Di=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}(Si);Di.prototype.bytesPerElement=12,Fn("StructArrayLayout3f12",Di);var Oi=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}(Si);Oi.prototype.bytesPerElement=4,Fn("StructArrayLayout1ul4",Oi);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[h+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Si);zi.prototype.bytesPerElement=20,Fn("StructArrayLayout6i1ul2ui20",zi);var Fi=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.int16[s+5]=a,t},e}(Si);Fi.prototype.bytesPerElement=12,Fn("StructArrayLayout2i2i2i12",Fi);var Bi=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 o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Si);Bi.prototype.bytesPerElement=16,Fn("StructArrayLayout2f1f2i16",Bi);var Ui=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 o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Si);Ui.prototype.bytesPerElement=12,Fn("StructArrayLayout2ub2f12",Ui);var Vi=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}(Si);Vi.prototype.bytesPerElement=6,Fn("StructArrayLayout3ui6",Vi);var qi=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,o,a,s,u,l,c,h,p,f,d,g,y){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y,m){var v=24*t,_=12*t,x=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[_+2]=o,this.uint32[_+3]=a,this.uint32[_+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=l,this.uint16[v+12]=c,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=g,this.uint32[_+10]=y,this.int16[v+22]=m,t},e}(Si);qi.prototype.bytesPerElement=48,Fn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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,o,a,s,u,l,c,h,p,f,d,g,y,m,v,_,x,b,w,E,I,S,C,P){var M=this.length;return this.resize(M+1),this.emplace(M,t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y,m,v,_,x,b,w,E,I,S,C,P)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y,m,v,_,x,b,w,E,I,S,C,P,M){var T=34*t,A=17*t;return this.int16[T+0]=e,this.int16[T+1]=r,this.int16[T+2]=n,this.int16[T+3]=i,this.int16[T+4]=o,this.int16[T+5]=a,this.int16[T+6]=s,this.int16[T+7]=u,this.uint16[T+8]=l,this.uint16[T+9]=c,this.uint16[T+10]=h,this.uint16[T+11]=p,this.uint16[T+12]=f,this.uint16[T+13]=d,this.uint16[T+14]=g,this.uint16[T+15]=y,this.uint16[T+16]=m,this.uint16[T+17]=v,this.uint16[T+18]=_,this.uint16[T+19]=x,this.uint16[T+20]=b,this.uint16[T+21]=w,this.uint16[T+22]=E,this.uint32[A+12]=I,this.float32[A+13]=S,this.float32[A+14]=C,this.float32[A+15]=P,this.float32[A+16]=M,t},e}(Si);ji.prototype.bytesPerElement=68,Fn("StructArrayLayout8i15ui1ul4f68",ji);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Si);Gi.prototype.bytesPerElement=4,Fn("StructArrayLayout1f4",Gi);var Xi=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}(Si);Xi.prototype.bytesPerElement=6,Fn("StructArrayLayout3i6",Xi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Si);Zi.prototype.bytesPerElement=8,Fn("StructArrayLayout1ul2ui8",Zi);var Yi=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}(Si);Yi.prototype.bytesPerElement=4,Fn("StructArrayLayout2ui4",Yi);var Wi=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}(Si);Wi.prototype.bytesPerElement=2,Fn("StructArrayLayout1ui2",Wi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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 o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Si);Hi.prototype.bytesPerElement=16,Fn("StructArrayLayout4f16",Hi);var Ki=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}(Ii);Ki.prototype.size=20;var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ki(this,t)},e}(zi);Fn("CollisionBoxArray",Ji);var Qi=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}(Ii);Qi.prototype.size=48;var $i=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 Qi(this,t)},e}(qi);Fn("PlacedSymbolArray",$i);var to=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}(Ii);to.prototype.size=68;var eo=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 to(this,t)},e}(ji);Fn("SymbolInstanceArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Gi);Fn("GlyphOffsetArray",ro);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.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}(Xi);Fn("SymbolLineVertexArray",no);var io=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}(Ii);io.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(Zi);Fn("FeatureIndexArray",oo);var ao=Ci([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function uo(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&E("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.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},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>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)))*a+(((u>>>16)*a&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}})),ho=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<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,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),po=co,fo=ho;po.murmur3=co,po.murmur2=fo;var go=function(){this.ids=[],this.positions=[],this.indexed=!1};go.prototype.add=function(t,e,r,n){this.ids.push(mo(t)),this.positions.push(e,r,n)},go.prototype.getPositions=function(t){for(var e=mo(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},go.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],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;vo(e,a,s),vo(r,3*a,3*s),vo(r,3*a+1,3*s+1),vo(r,3*a+2,3*s+2)}s-na.x+1||ua.y+1)&&E("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Vo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Uo(t):[]}}function qo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var jo=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 Mi,this.indexArray=new Vi,this.segments=new so,this.programConfigurations=new Do(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Go(t,e){for(var r=0;r1){if(Wo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Qo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function $o(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ta(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 o=I(t,e,r[0]);return o!==I(t,e,r[1])||o!==I(t,e,r[2])||o!==I(t,e,r[3])}function ea(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ra(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function na(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u=8192||c<0||c>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;qo(this.layoutVertexArray,l,c,-1,-1),qo(this.layoutVertexArray,l,c,1,-1),qo(this.layoutVertexArray,l,c,1,1),qo(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Fn("CircleBucket",jo,{omit:["layers"]});var ia=new bi({"circle-sort-key":new mi(Tt.layout_circle["circle-sort-key"])}),oa={paint:new bi({"circle-radius":new mi(Tt.paint_circle["circle-radius"]),"circle-color":new mi(Tt.paint_circle["circle-color"]),"circle-blur":new mi(Tt.paint_circle["circle-blur"]),"circle-opacity":new mi(Tt.paint_circle["circle-opacity"]),"circle-translate":new yi(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new yi(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new yi(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new yi(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mi(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mi(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mi(Tt.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(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 ua(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],g=e[12],y=e[13],m=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*h+w*g,t[1]=_*i+x*u+b*p+w*y,t[2]=_*o+x*l+b*f+w*m,t[3]=_*a+x*c+b*d+w*v,t[4]=(_=r[4])*n+(x=r[5])*s+(b=r[6])*h+(w=r[7])*g,t[5]=_*i+x*u+b*p+w*y,t[6]=_*o+x*l+b*f+w*m,t[7]=_*a+x*c+b*d+w*v,t[8]=(_=r[8])*n+(x=r[9])*s+(b=r[10])*h+(w=r[11])*g,t[9]=_*i+x*u+b*p+w*y,t[10]=_*o+x*l+b*f+w*m,t[11]=_*a+x*c+b*d+w*v,t[12]=(_=r[12])*n+(x=r[13])*s+(b=r[14])*h+(w=r[15])*g,t[13]=_*i+x*u+b*p+w*y,t[14]=_*o+x*l+b*f+w*m,t[15]=_*a+x*c+b*d+w*v,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 la,ca=ua;function ha(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}la=new aa(3),aa!=Float32Array&&(la[0]=0,la[1]=0,la[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var pa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype.queryRadius=function(t){var e=t;return ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+ra(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=na(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?u:function(t,e){return t.map((function(t){return fa(t,e)}))}(u,s),p=c?l*a:l,f=0,d=n;ft.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 a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var d=r;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return La(p,f,r,n,i,l),f}function Ta(t,e,r,n,i){var o,a;if(i===$a(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Ka(o,t[o],t[o+1],a);return a&&Ga(a,a.next)&&(Ja(a),a=a.next),a}function Aa(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ga(n,n.next)&&0!==ja(n.prev,n,n.next))n=n.next;else{if(Ja(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function La(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ba(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,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,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--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Ra(t,n,i,o):ka(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ja(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?La(t=Na(Aa(t),e,r),e,r,n,i,o,2):2===a&&Da(t,e,r,n,i,o):La(Aa(t),e,r,n,i,o,1);break}}}function ka(t){var e=t.prev,r=t,n=t.next;if(ja(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Va(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ja(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ra(t,e,r,n){var i=t.prev,o=t,a=t.next;if(ja(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=Ba(i.x=l&&p&&p.z<=c;){if(h!==t.prev&&h!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=l;){if(h!==t.prev&&h!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Na(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ga(i,o)&&Xa(i,n,n.next,o)&&Wa(i,o)&&Wa(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ja(n),Ja(n.next),n=t=o),n=n.next}while(n!==t);return Aa(n)}function Da(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&qa(a,s)){var u=Ha(a,s);return a=Aa(a,a.next),u=Aa(u,u.next),La(a,e,r,n,i,o),void La(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Oa(t,e){return t.x-e.x}function za(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&Va(or.x||n.x===r.x&&Fa(r,n)))&&(r=n,p=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ha(e,t);Aa(e,e.next),Aa(r,r.next)}}function Fa(t,e){return ja(t.prev,t,e.prev)<0&&ja(e.next,t,t.next)<0}function Ba(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 Ua(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function qa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Xa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Wa(t,e)&&Wa(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ja(t.prev,t,e.prev)||ja(t,e.prev,e))||Ga(t,e)&&ja(t.prev,t,t.next)>0&&ja(e.prev,e,e.next)>0)}function ja(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ga(t,e){return t.x===e.x&&t.y===e.y}function Xa(t,e,r,n){var i=Ya(ja(t,e,r)),o=Ya(ja(t,e,n)),a=Ya(ja(r,n,t)),s=Ya(ja(r,n,e));return i!==o&&a!==s||!(0!==i||!Za(t,r,e))||!(0!==o||!Za(t,n,e))||!(0!==a||!Za(r,t,n))||!(0!==s||!Za(r,e,n))}function Za(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 Ya(t){return t>0?1:t<0?-1:0}function Wa(t,e){return ja(t.prev,t,t.next)<0?ja(t,e,t.next)>=0&&ja(t,t.prev,e)>=0:ja(t,e,t.prev)<0||ja(t,t.next,e)<0}function Ha(t,e){var r=new Qa(t.i,t.x,t.y),n=new Qa(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ka(t,e,r,n){var i=new Qa(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 Ja(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Qa(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 $a(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+c)),Math.min(i,Math.floor(r+(a-s)*l/a+c)),o)}var h=e[r],p=n,f=i;for(es(e,n,r),o(e[i],h)>0&&es(e,n,i);p0;)f--}0===o(e[n],h)?es(e,n,f):es(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||rs)}function es(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function rs(t,e){return te?1:0}function ns(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},Ca.default=Pa;var ss=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Mi,this.indexArray=new Vi,this.indexArray2=new Yi,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,r){this.hasPattern=os("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},fs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=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),(o+=t.readSVarint())l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},fs.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=fs.types[this.type];function c(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 _s(t,e,r){if(3===t){var n=new ys(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ms.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 ps(this._pbf,e,this.extent,this._keys,this._values)};var xs={VectorTile:function(t,e){this.layers=t.readFields(_s,{},e)},VectorTileFeature:ps,VectorTileLayer:ys},bs=xs.VectorTileFeature.types,ws=Math.pow(2,13);function Es(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*ws)+a,i*ws*2,o*ws*2,Math.round(s))}var Is=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 Ai,this.indexArray=new Vi,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ss(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Is.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||k.every((function(t){return t.y<0}))||k.every((function(t){return t.y>8192}))))for(var g=0,y=0;y=1){var v=d[y-1];if(!Ss(m,v)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=m.sub(v)._perp()._unit(),x=v.dist(m);g+x>32768&&(g=0),Es(this.layoutVertexArray,m.x,m.y,_.x,_.y,0,0,g),Es(this.layoutVertexArray,m.x,m.y,_.x,_.y,0,1,g),Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,g+=x),Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,g);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+u>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===bs[t.type]){for(var w=[],E=[],I=h.vertexLength,S=0,C=s;S=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(E&&m>l){var S=c.dist(f);if(S>2*h){var C=c.sub(c.sub(f)._mult(h/S)._round());this.updateDistance(f,C),this.addCurrentVertex(C,g,0,0,p),f=C}}var P=f&&d,M=P?r:s?"butt":n;if(P&&"round"===M&&(bi&&(M="bevel"),"bevel"===M&&(b>2&&(M="flipbevel"),b100)v=y.mult(-1);else{var T=b*g.add(y).mag()/g.sub(y).mag();v._perp()._mult(T*(I?-1:1))}this.addCurrentVertex(c,v,0,0,p),this.addCurrentVertex(c,v.mult(-1),0,0,p)}else if("bevel"===M||"fakeround"===M){var A=-Math.sqrt(b*b-1),L=I?A:0,k=I?0:A;if(f&&this.addCurrentVertex(c,g,L,k,p),"fakeround"===M)for(var R=Math.round(180*w/Math.PI/20),N=1;N2*h){var U=c.add(d.sub(c)._mult(h/B)._round());this.updateDistance(c,U),this.addCurrentVertex(U,y,0,0,p),c=U}}}}},Ds.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>Ns/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Ds.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Ns-1):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===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Ds.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ds.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Fn("LineBucket",Ds,{omit:["layers","patternFeatures"]});var Os=new bi({"line-cap":new yi(Tt.layout_line["line-cap"]),"line-join":new mi(Tt.layout_line["line-join"]),"line-miter-limit":new yi(Tt.layout_line["line-miter-limit"]),"line-round-limit":new yi(Tt.layout_line["line-round-limit"]),"line-sort-key":new mi(Tt.layout_line["line-sort-key"])}),zs={paint:new bi({"line-opacity":new mi(Tt.paint_line["line-opacity"]),"line-color":new mi(Tt.paint_line["line-color"]),"line-translate":new yi(Tt.paint_line["line-translate"]),"line-translate-anchor":new yi(Tt.paint_line["line-translate-anchor"]),"line-width":new mi(Tt.paint_line["line-width"]),"line-gap-width":new mi(Tt.paint_line["line-gap-width"]),"line-offset":new mi(Tt.paint_line["line-offset"]),"line-blur":new mi(Tt.paint_line["line-blur"]),"line-dasharray":new _i(Tt.paint_line["line-dasharray"]),"line-pattern":new vi(Tt.paint_line["line-pattern"]),"line-gradient":new xi(Tt.paint_line["line-gradient"])}),layout:Os},Fs=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 si(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=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(mi))(zs.paint.properties["line-width"].specification);Fs.useIntegerZoom=!0;var Bs=function(t){function e(e){t.call(this,e,zs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof je,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Fs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ds(t)},e.prototype.queryRadius=function(t){var e=t,r=Us(ea("line-width",this,e),ea("line-gap-width",this,e)),n=ea("line-offset",this,e);return r/2+Math.abs(n)+ra(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var u=na(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Us(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var Vs=Ci([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=Ci([{name:"a_projected_pos",components:3,type:"Float32"}],4),js=(Ci([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ci([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Gs=(Ci([{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"}]),Ci([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Xs=Ci([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Zs(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()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ci([{name:"triangle",components:3,type:"Uint16"}]),Ci([{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"}]),Ci([{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"}]),Ci([{type:"Float32",name:"offsetX"}]),Ci([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ys={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ws=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},Hs=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*g},Ks=Js;function Js(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Js.Varint=0,Js.Fixed64=1,Js.Bytes=2,Js.Fixed32=5;var Qs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $s(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function tu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function eu(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 ru(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function fu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function du(t,e,r){1===t&&r.readMessage(gu,e)}function gu(t,e,r){if(3===t){var n=r.readMessage(yu,{}),i=n.width,o=n.height,a=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new va({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function yu(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 mu(t){for(var e=0,r=0,n=0,i=t;n=0;p--){var f=a[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=a.pop();p>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*fu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ws(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ws(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,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return tu(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return tu(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&&Qs?function(t,e,r){return Qs.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+c>r)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=c}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!==Js.Bytes)return t.push(this.readVarint(e));var r=$s(this);for(t=t||[];this.pos127;);else if(e===Js.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Js.Fixed32)this.pos+=4;else{if(e!==Js.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;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,o=0;o55295&&n<57344){if(!i){n>56319||o+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&&eu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Hs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Hs(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&&eu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cu,e)},writeBytesField:function(t,e){this.writeTag(t,Js.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Js.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Js.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var vu=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},_u={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};_u.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},_u.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},_u.tlbr.get=function(){return this.tl.concat(this.br)},_u.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(vu.prototype,_u);var xu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=mu(i),a=new _a({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;_a.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var h=e[c],p=n[c].paddedRect,f=p.x+1,d=p.y+1,g=h.data.width,y=h.data.height;_a.copy(h.data,a,{x:0,y:0},{x:f,y:d},h.data),_a.copy(h.data,a,{x:0,y:y-1},{x:f,y:d-1},{width:g,height:1}),_a.copy(h.data,a,{x:0,y:0},{x:f,y:d+y},{width:g,height:1}),_a.copy(h.data,a,{x:g-1,y:0},{x:f-1,y:d},{width:1,height:y}),_a.copy(h.data,a,{x:0,y:0},{x:f+g,y:d},{width:1,height:y})}this.image=a,this.iconPositions=r,this.patternPositions=n};xu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new vu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},xu.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)},xu.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]})}},Fn("ImagePosition",vu),Fn("ImageAtlas",xu);var bu={horizontal:1,vertical:2,horizontalOnly:3},wu=function(){this.scale=1,this.fontStack="",this.imageName=null};wu.forText=function(t,e){var r=new wu;return r.scale=t||1,r.fontStack=e,r},wu.forImage=function(t){var e=new wu;return e.imageName=t,e};var Eu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Iu(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g){var y,m=Eu.fromFeature(t,i);h===bu.vertical&&m.verticalizePunctuation();var v=ai.processBidirectionalText,_=ai.processStyledBidirectionalText;if(v&&1===m.sections.length){y=[];for(var x=0,b=v(m.toString(),Lu(m,l,o,e,n,f,d));x0&&F>S&&(S=F)}else{var B=r[P.fontStack],U=B&&B[T];if(U&&U.rect)k=U.rect,L=U.metrics;else{var V=e[P.fontStack],q=V&&V[T];if(!q)continue;L=q.metrics}A=24*(b-P.scale)}D?(t.verticalizable=!0,I.push({glyph:T,imageName:R,x:p,y:f+A,vertical:D,scale:P.scale,fontStack:P.fontStack,sectionIndex:M,metrics:L,rect:k}),p+=N*P.scale+l):(I.push({glyph:T,imageName:R,x:p,y:f+A,vertical:D,scale:P.scale,fontStack:P.fontStack,sectionIndex:M,metrics:L,rect:k}),p+=L.advance*P.scale+l)}0!==I.length&&(d=Math.max(p-l,d),Ru(I,0,I.length-1,y,S)),p=0;var j=o*b+S;E.lineOffset=Math.max(S,w),f+=j,g=Math.max(j,g),++m}else f+=o,++m}var G,X=f- -17,Z=ku(a),Y=Z.horizontalAlign,W=Z.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,c=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var h=0,p=t;h=0&&n>=t&&Su[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Eu.prototype.substring=function(t,e){var r=new Eu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Eu.prototype.toString=function(){return this.text},Eu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Eu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(wu.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 Su={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Cu={};function Pu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Mu(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,p=0;p-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function Vu(t){for(var e=0,r=0;rl){var d=(l-u)/f,g=Ge(h.x,p.x,d),y=Ge(h.y,p.y,d),m=new Du(g,y,p.angleTo(h),c);return m._round(),!a||Uu(t,m,s,a,e)?m:void 0}u+=f}}function Xu(t,e,r,n,i,o,a,s,u){var l=qu(n,o,a),c=ju(n,i),h=c*a,p=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h=0&&b=0&&w=0&&f+c<=h){var E=new Du(b,w,_,g);E._round(),i&&!Uu(e,E,a,i,o)||d.push(E)}}p+=v}return u||d.length||s||(d=t(e,p/2,n,i,o,a,s,!0,l)),d}(t,p?e/2*s%e:(c/2+2*o)*a*s%e,e,l,r,h,p,!1,u)}function Zu(t,e,r,n,o){for(var a=[],s=0;s=n&&p.x>=n||(h.x>=n?h=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=n&&(p=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round():p.y>=o&&(p=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round()),l&&h.equals(l[l.length-1])||a.push(l=[h]),l.push(p)))))}return a}function Yu(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},g=p.reduce(d,0),y=f.reduce(d,0),m=u-g,v=l-y,_=0,x=g,b=0,w=y,E=0,I=m,S=0,C=v;if(a.content&&n){var P=a.content;_=Wu(p,0,P[0]),b=Wu(f,0,P[1]),x=Wu(p,P[0],P[2]),w=Wu(f,P[1],P[3]),E=P[0]-_,S=P[1]-b,I=P[2]-P[0]-x,C=P[3]-P[1]-w}var M=function(n,o,u,l){var p=Ku(n.stretch-_,x,c,t.left),f=Ju(n.fixed-E,I,n.stretch,g),d=Ku(o.stretch-b,w,h,t.top),m=Ju(o.fixed-S,C,o.stretch,y),v=Ku(u.stretch-_,x,c,t.left),P=Ju(u.fixed-E,I,u.stretch,g),M=Ku(l.stretch-b,w,h,t.top),T=Ju(l.fixed-S,C,l.stretch,y),A=new i(p,d),L=new i(v,d),k=new i(v,M),R=new i(p,M),N=new i(f/s,m/s),D=new i(P/s,T/s),O=e*Math.PI/180;if(O){var z=Math.sin(O),F=Math.cos(O),B=[F,-z,z,F];A._matMult(B),L._matMult(B),R._matMult(B),k._matMult(B)}var U=n.stretch+n.fixed,V=o.stretch+o.fixed;return{tl:A,tr:L,bl:R,br:k,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+V,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:N,pixelOffsetBR:D,minFontScaleX:I/s/c,minFontScaleY:C/s/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var T=Hu(p,m,g),A=Hu(f,v,y),L=0;L0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var g=a.top*s-u,y=a.bottom*s+u,m=a.left*s-u,v=a.right*s+u,_=a.collisionPadding;if(_&&(m-=_[0]*s,g-=_[1]*s,v+=_[2]*s,y+=_[3]*s),c){var x=new i(m,g),b=new i(v,g),w=new i(m,y),E=new i(v,y),I=c*Math.PI/180;x._rotate(I),b._rotate(I),w._rotate(I),E._rotate(I),m=Math.min(x.x,b.x,w.x,E.x),v=Math.max(x.x,b.x,w.x,E.x),g=Math.min(x.y,b.y,w.y,E.y),y=Math.max(x.y,b.y,w.y,E.y)}t.emplaceBack(e.x,e.y,m,g,v,y,r,n,o)}this.boxEndIndex=t.length},$u=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tl),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 tl(t,e){return te?1:0}function el(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;la)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var h=Math.min(a-n,s-o),p=h/2,f=new $u([],rl);if(0===h)return new i(n,o);for(var d=n;dy.d||!y.d)&&(y=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,m)),v.max-y.d<=e||(f.push(new nl(v.p.x-(p=v.h/2),v.p.y-p,p,t)),f.push(new nl(v.p.x+p,v.p.y-p,p,t)),f.push(new nl(v.p.x-p,v.p.y+p,p,t)),f.push(new nl(v.p.x+p,v.p.y+p,p,t)),m+=4)}return r&&(console.log("num probes: "+m),console.log("best distance: "+y.d)),y.p}function rl(t,e){return e.max-t.max}function nl(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!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(r=!r),n=Math.min(n,Jo(t,l,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}$u.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$u.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}},$u.prototype.peek=function(){return this.data[0]},$u.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},$u.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var il=Number.POSITIVE_INFINITY;function ol(t,e){return e[1]!==il?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 al(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sl(t,e,r,n,o,a,s,u,l,c,h,p,f,d,g){var y=function(t,e,r,n,o,a,s,u){for(var l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=0,p=e.positionedLines;h32640&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===m.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},g),128*d.compositeTextSizes[1].evaluate(s,{},g)])[0]>32640||v[1]>32640)&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,v,u,a,s,c,e,l.lineStartIndex,l.lineLength,f,g);for(var _=0,x=h;_=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],u||l){for(var h=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new si(this.zoom),g=0,y=t;g=0;for(var k=0,R=I.sections;k=0;s--)o[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},ml.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ml.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ml.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ml.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ml.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)}},Fn("SymbolBucket",ml,{omit:["layers","collisionBoxArray","features","compareText"]}),ml.MAX_GLYPHS=65535,ml.addDynamicAttributes=fl;var vl=new bi({"symbol-placement":new yi(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new yi(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new yi(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mi(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new yi(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new yi(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new yi(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new yi(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new yi(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new mi(Tt.layout_symbol["icon-size"]),"icon-text-fit":new yi(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new yi(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new mi(Tt.layout_symbol["icon-image"]),"icon-rotate":new mi(Tt.layout_symbol["icon-rotate"]),"icon-padding":new yi(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new yi(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new mi(Tt.layout_symbol["icon-offset"]),"icon-anchor":new mi(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new yi(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new yi(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new yi(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new mi(Tt.layout_symbol["text-field"]),"text-font":new mi(Tt.layout_symbol["text-font"]),"text-size":new mi(Tt.layout_symbol["text-size"]),"text-max-width":new mi(Tt.layout_symbol["text-max-width"]),"text-line-height":new yi(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new mi(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new mi(Tt.layout_symbol["text-justify"]),"text-radial-offset":new mi(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new yi(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new mi(Tt.layout_symbol["text-anchor"]),"text-max-angle":new yi(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new yi(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new mi(Tt.layout_symbol["text-rotate"]),"text-padding":new yi(Tt.layout_symbol["text-padding"]),"text-keep-upright":new yi(Tt.layout_symbol["text-keep-upright"]),"text-transform":new mi(Tt.layout_symbol["text-transform"]),"text-offset":new mi(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new yi(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new yi(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new yi(Tt.layout_symbol["text-optional"])}),_l={paint:new bi({"icon-opacity":new mi(Tt.paint_symbol["icon-opacity"]),"icon-color":new mi(Tt.paint_symbol["icon-color"]),"icon-halo-color":new mi(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new mi(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mi(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new yi(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new yi(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new mi(Tt.paint_symbol["text-opacity"]),"text-color":new mi(Tt.paint_symbol["text-color"],{runtimeType:Vt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new mi(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new mi(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new mi(Tt.paint_symbol["text-halo-blur"]),"text-translate":new yi(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new yi(Tt.paint_symbol["text-translate-anchor"])}),layout:vl},xl=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:zt,this.defaultValue=t};xl.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},xl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},xl.prototype.outputDefined=function(){return!1},xl.prototype.serialize=function(){return null},Fn("FormatSectionOverride",xl,{omit:["defaultValue"]});var bl=function(t){function e(e){t.call(this,e,_l)}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=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},Dl.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else C()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Dl.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Dl.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(jn(e.error)):n(null,jn(e.data)))}else{var i=!1,o=T(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,o)},o)}:function(t){i=!0},s=null,u=jn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Dl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var zl=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]))};zl.prototype.setNorthEast=function(t){return this._ne=t instanceof Fl?new Fl(t.lng,t.lat):Fl.convert(t),this},zl.prototype.setSouthWest=function(t){return this._sw=t instanceof Fl?new Fl(t.lng,t.lat):Fl.convert(t),this},zl.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Fl)e=t,r=t;else{if(!(t instanceof zl))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(zl.convert(t)):this.extend(Fl.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 Fl(e.lng,e.lat),this._ne=new Fl(r.lng,r.lat)),this},zl.prototype.getCenter=function(){return new Fl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},zl.prototype.getSouthWest=function(){return this._sw},zl.prototype.getNorthEast=function(){return this._ne},zl.prototype.getNorthWest=function(){return new Fl(this.getWest(),this.getNorth())},zl.prototype.getSouthEast=function(){return new Fl(this.getEast(),this.getSouth())},zl.prototype.getWest=function(){return this._sw.lng},zl.prototype.getSouth=function(){return this._sw.lat},zl.prototype.getEast=function(){return this._ne.lng},zl.prototype.getNorth=function(){return this._ne.lat},zl.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},zl.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},zl.prototype.isEmpty=function(){return!(this._sw&&this._ne)},zl.prototype.contains=function(t){var e=Fl.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},zl.convert=function(t){return!t||t instanceof zl?t:new zl(t)};var Fl=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Fl.prototype.wrap=function(){return new Fl(h(this.lng,-180,180),this.lat)},Fl.prototype.toArray=function(){return[this.lng,this.lat]},Fl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Fl.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))},Fl.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 zl(new Fl(this.lng-r,this.lat-e),new Fl(this.lng+r,this.lat+e))},Fl.convert=function(t){if(t instanceof Fl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Fl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Fl(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 Bl=2*Math.PI*6371008.8;function Ul(t){return Bl*Math.cos(t*Math.PI/180)}function Vl(t){return(180+t)/360}function ql(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jl(t,e){return t/Ul(e)}function Gl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Xl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Xl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Fl.convert(t);return new Xl(Vl(r.lng),ql(r.lat),jl(e,r.lat))},Xl.prototype.toLngLat=function(){return new Fl(360*this.x-180,Gl(this.y))},Xl.prototype.toAltitude=function(){return this.z*Ul(Gl(this.y))},Xl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Bl*(t=Gl(this.y),1/Math.cos(t*Math.PI/180));var t};var Zl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Hl(0,t,t,e,r)};Zl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Zl.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=Ol(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=Ol(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new Wl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Wl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Hl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Hl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Wl.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},Wl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Wl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Wl(e,this.wrap,e,r,n),new Wl(e,this.wrap,e,r+1,n),new Wl(e,this.wrap,e,r,n+1),new Wl(e,this.wrap,e,r+1,n+1)]},Wl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=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)},Kl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Kl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Kl.prototype.getPixels=function(){return new _a({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kl.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,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},ec.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new xs.VectorTile(new Ks(this.rawTileData)).layers,this.sourceLayerCoder=new Jl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ec.prototype.query=function(t,e,r,n){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=an(a.filter),l=t.queryGeometry,c=t.queryPadding*s,h=nc(l),p=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),f=nc(t.cameraQueryGeometry),d=0,g=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var c=0,h=l;c=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var g=Vo(d,!0);if(!i.filter(new si(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),d))return;for(var y=this.getId(d,f),m=0;mn)i=!1;else if(e)if(this.expirationTimeut&&(t.getActor().send("enforceCacheSizeLimit",st),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Zu,t.clone=function(t){var e=new aa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Xs,t.config=B,t.create=function(){var t=new aa(16);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new aa(9);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Zr,t.createLayout=Ci,t.createStyleLayer=function(t){return"custom"===t.type?new Cl(t):new Pl[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ge,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ks(t).readFields(du,[])},t.pbf=Ks,t.performSymbolLayout=function(t,e,r,n,i,o,a){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 c=t.textSizeData,h=c.maxZoom;l.compositeTextSizes=[u["text-size"].possiblyEvaluate(new si(c.minZoom),a),u["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,f=p.maxZoom;l.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new si(p.minZoom),a),u["icon-size"].possiblyEvaluate(new si(f),a)]}l.layoutTextSize=u["text-size"].possiblyEvaluate(new si(t.zoom+1),a),l.layoutIconSize=u["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),l.textMaxSize=u["text-size"].possiblyEvaluate(new si(18));for(var d=24*s.get("text-line-height"),g="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),y=s.get("text-keep-upright"),m=s.get("text-size"),v=function(){var o=x[_],u=s.get("text-font").evaluate(o,{},a).join(","),c=m.evaluate(o,{},a),h=l.layoutTextSize.evaluate(o,{},a),p=l.layoutIconSize.evaluate(o,{},a),f={horizontal:{},vertical:void 0},v=o.text,b=[0,0];if(v){var w=v.toString(),I=24*s.get("text-letter-spacing").evaluate(o,{},a),S=function(t){for(var e=0,r=t;e=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y,m,v,_,x,b,w,I,S){var C,P,M,T,A,L=t.addToLineVertexArray(e,r),k=0,R=0,N=0,D=0,O=-1,z=-1,F={},B=po(""),U=0,V=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(C=s.layout.get("text-offset").evaluate(x,{},I).map((function(t){return 24*t})))[0],V=C[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},I),V=il),t.allowVerticalPlacement&&n.vertical){var q=s.layout.get("text-rotate").evaluate(x,{},I)+90;T=new Qu(u,e,l,c,h,n.vertical,p,f,d,q),a&&(A=new Qu(u,e,l,c,h,a,y,m,d,q))}if(i){var j=s.layout.get("icon-rotate").evaluate(x,{}),G="none"!==s.layout.get("icon-text-fit"),X=Yu(i,j,w,G),Z=a?Yu(a,j,w,G):void 0;M=new Qu(u,e,l,c,h,i,y,m,!1,j),k=4*X.length;var Y=t.iconSizeData,W=null;"source"===Y.kind?(W=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((W=[128*b.compositeIconSizes[0].evaluate(x,{},I),128*b.compositeIconSizes[1].evaluate(x,{},I)])[0]>32640||W[1]>32640)&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,X,W,_,v,x,!1,e,L.lineStartIndex,L.lineLength,-1,I),O=t.icon.placedSymbolArray.length-1,Z&&(R=4*Z.length,t.addSymbols(t.icon,Z,W,_,v,x,bu.vertical,e,L.lineStartIndex,L.lineLength,-1,I),z=t.icon.placedSymbolArray.length-1)}for(var H in n.horizontal){var K=n.horizontal[H];if(!P){B=po(K.text);var J=s.layout.get("text-rotate").evaluate(x,{},I);P=new Qu(u,e,l,c,h,K,p,f,d,J)}var Q=1===K.positionedLines.length;if(N+=sl(t,e,K,o,s,d,x,g,L,n.vertical?bu.horizontal:bu.horizontalOnly,Q?Object.keys(n.horizontal):[H],F,O,b,I),Q)break}n.vertical&&(D+=sl(t,e,n.vertical,o,s,d,x,g,L,bu.vertical,["vertical"],F,z,b,I));var $=P?P.boxStartIndex:t.collisionBoxArray.length,tt=P?P.boxEndIndex:t.collisionBoxArray.length,et=T?T.boxStartIndex:t.collisionBoxArray.length,rt=T?T.boxEndIndex:t.collisionBoxArray.length,nt=M?M.boxStartIndex:t.collisionBoxArray.length,it=M?M.boxEndIndex:t.collisionBoxArray.length,ot=A?A.boxStartIndex:t.collisionBoxArray.length,at=A?A.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(P,st),st=ut(T,st),st=ut(M,st);var lt=(st=ut(A,st))>-1?1:0;lt&&(st*=S/24),t.glyphOffsetArray.length>=ml.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,O,z,B,$,tt,et,rt,nt,it,ot,at,l,N,D,k,R,lt,0,p,U,V,st)}(t,h,s,r,n,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,S,u,_,w,C,d,e,o,l,c,a)};if("line"===P)for(var L=0,k=Zu(e.geometry,0,0,8192,8192);L1){var U=Gu(B,I,r.vertical||g,n,24,v);U&&A(B,U)}}else if("Polygon"===e.type)for(var V=0,q=ns(e.geometry,0);V=M.maxzoom||"none"!==M.visibility&&(a(P,this.zoom,n),(g[M.id]=M.createBucket({index:c.bucketLayerIDs.length,layers:P,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,y,this.tileID.canonical),c.bucketLayerIDs.push(P.map((function(t){return t.id}))))}}}var T=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(T).length?o.send("getGlyphs",{uid:this.uid,stacks:T},(function(t,e){h||(h=t,p=e,k.call(u))})):p={};var A=Object.keys(y.iconDependencies);A.length?o.send("getImages",{icons:A,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,f=e,k.call(u))})):f={};var L=Object.keys(y.patternDependencies);function k(){if(h)return s(h);if(p&&f&&d){var e=new i(p),r=new t.ImageAtlas(f,d);for(var o in g){var u=g[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,n),t.performSymbolLayout(u,p,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,n),u.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(g).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}L.length?o.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,k.call(u))})):d={},k.call(this)};var u=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var u=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);var c={};if(a){var h=a.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,l,c))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},u.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var l=t.window.ImageBitmap,c=function(){this.loaded={}};function h(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=l&&o instanceof l?this.getImageData(o):o,s=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function M(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var p=r[2*n+a],f=i,d=o;for(A(e,r,i,n),r[2*o+a]>p&&A(e,r,i,o);fp;)d--}r[2*i+a]===p?A(e,r,i,d):A(e,r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};D.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var h=l.pop(),p=l.pop(),f=l.pop();if(p-f<=a)for(var d=f;d<=p;d++)u=e[2*d+1],(s=e[2*d])>=r&&s<=i&&u>=n&&u<=o&&c.push(t[d]);else{var g=Math.floor((f+p)/2);u=e[2*g+1],(s=e[2*g])>=r&&s<=i&&u>=n&&u<=o&&c.push(t[g]);var y=(h+1)%2;(0===h?r<=s:n<=u)&&(l.push(f),l.push(g-1),l.push(y)),(0===h?i>=s:o>=u)&&(l.push(g+1),l.push(p),l.push(y))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},D.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)k(e[2*p],e[2*p+1],r,n)<=u&&s.push(t[p]);else{var f=Math.floor((h+c)/2),d=e[2*f],g=e[2*f+1];k(d,g,r,n)<=u&&s.push(t[f]);var y=(l+1)%2;(0===l?r-i<=d:n-i<=g)&&(a.push(h),a.push(f-1),a.push(y)),(0===l?r+i>=d:n+i>=g)&&(a.push(f+1),a.push(c),a.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var O={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},z=function(t){this.options=G(Object.create(O),t),this.trees=new Array(this.options.maxZoom+1)};function F(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function B(t,e){var r=t.geometry.coordinates,n=r[1];return{x:q(r[0]),y:j(n),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:V(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function V(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function q(t){return t/360+.5}function j(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function G(t,e){for(var r in e)t[r]=e[r];return t}function X(t){return t.x}function Z(t){return t.y}function Y(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function W(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)H(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],c=e[r+1],h=e[n],p=e[n+1],f=r+3;fa)o=f,a=d;else if(d===a){var g=Math.abs(f-s);gi&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function $(t,e,r,n){for(var i=0;i1?1:r}function rt(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],l=0;l=r&&d=n)){var g=[];if("Point"===p||"MultiPoint"===p)nt(h,g,r,n,i);else if("LineString"===p)it(h,g,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)at(h,g,r,n,i,!1);else if("Polygon"===p)at(h,g,r,n,i,!0);else if("MultiPolygon"===p)for(var y=0;y=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,r,n,i,o,a){for(var s,u,l=ot(t),c=0===i?ut:lt,h=t.start,p=0;pr&&(u=c(l,f,d,y,m,r),a&&(l.start=h+s*u)):v>n?_=r&&(u=c(l,f,d,y,m,r),x=!0),_>n&&v<=n&&(u=c(l,f,d,y,m,n),x=!0),!o&&x&&(a&&(l.end=h+s*u),e.push(l),l=ot(t)),a&&(h+=s)}var b=t.length-3;f=t[b],d=t[b+1],g=t[b+2],(v=0===i?f:d)>=r&&v<=n&&st(l,f,d,g),b=l.length-3,o&&b>=3&&(l[b]!==l[0]||l[b+1]!==l[1])&&st(l,l[0],l[1],l[2]),l.length&&e.push(l)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function gt(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(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,o=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;n=n;l--){var c=+Date.now();s=this._cluster(s,l),this.trees[l]=new D(s,X,Z,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},z.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],c=0,h=u.range(q(r),j(o),q(i),j(n));ce&&(p+=g.numPoints||1)}if(p>=o){for(var y=u.x*h,m=u.y*h,v=i&&h>1?this._map(u,!0):null,_=(s<<5)+(e+1)+this.points.length,x=0,b=c;x1)for(var I=0,S=c;I>5},z.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},z.prototype._map=function(t,e){if(t.numPoints)return e?G({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?G({},n):n},mt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},mt.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<1&&console.time("creation"),p=this.tiles[h]=dt(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,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var g,y,m,v,_,x,b=.5*u.buffer/u.extent,w=.5-b,E=.5+b,I=1+b;g=y=m=v=null,_=rt(t,c,r-b,r+E,0,p.minX,p.maxX,u),x=rt(t,c,r+w,r+I,0,p.minX,p.maxX,u),t=null,_&&(g=rt(_,c,n-b,n+E,1,p.minY,p.maxY,u),y=rt(_,c,n+w,n+I,1,p.minY,p.maxY,u),_=null),x&&(m=rt(x,c,n-b,n+E,1,p.minY,p.maxY,u),v=rt(x,c,n+w,n+I,1,p.minY,p.maxY,u),x=null),l>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(y||[],e+1,2*r,2*n+1),s.push(m||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},mt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,c=e,h=r;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[vt(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?pt(this.tiles[s],i):null):null};var xt=function(e){function r(t,r,n,i){e.call(this,t,r,n,_t),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function m(t,e,r,n,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,a=u;i1&&(s=t[++a]);var l=Math.abs(u-s.left),c=Math.abs(u-s.right),h=Math.min(l,c),p=void 0,f=i/r*(n+1);if(s.isDash){var d=n-Math.abs(f);p=Math.sqrt(h*h+d*d)}else p=n-Math.sqrt(h*h+f*f);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},E.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l1&&(u=t[++s]);var c=Math.abs(l-u.left),h=Math.abs(l-u.right),p=Math.min(c,h);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},E.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=n&&e.x=i&&e.y0&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{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,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),k=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=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(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;ar.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(k),N=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},B.prototype.has=function(t){return t.wrapped().key in this.data},B.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},B.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},B.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},B.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},B.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},B.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},B.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=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)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(kt(this._source.type)){for(var l={},c={},h=0,p=Object.keys(u);hthis._source.maxzoom){var y=d.children(this._source.maxzoom)[0],m=this.getTile(y);if(m&&m.hasData()){n[y.key]=y;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var _=g.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(i[b.key])break;if(i[b.key]=!0,!(g=this.getTile(b))&&_&&(g=this._addTile(b)),g&&(n[b.key]=b,_=g.wasRequested(),g.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var o=0,a=e;o0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),l=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,g=0,y=l;g=0&&m[1].y+y>=0){var v=u.map((function(t){return s.getTilePoint(t)})),_=l.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:g})}}},_=0;_=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Lt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function kt(t){return"raster"===t||"image"===t||"video"===t}function Rt(){return new t.window.Worker(Hi.workerUrl)}At.maxOverzooming=10,At.maxUnderzooming=3;var Nt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[r].mult(u))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function re(e,r,n,i,o,a,s,u){var l=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,y=!1,m=0;mMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,o,a,s,u,l,c,h,p,f,d){var g,y=r/24,m=e.lineOffsetX*y,v=e.lineOffsetY*y;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ne(y,u,m,v,n,h,p,e,l,a,f);if(!w)return{notEnoughRoom:!0};var E=$t(w.first.point,s).point,I=$t(w.last.point,s).point;if(i&&!n){var S=ie(e.writingMode,E,I,d);if(S)return S}g=[w.first];for(var C=e.glyphStartIndex+1;C<_-1;C++)g.push(se(y*u.getoffsetX(C),m,v,n,h,p,e.segment,x,b,l,a,f));g.push(w.last)}else{if(i&&!n){var P=$t(p,o).point,M=e.lineStartIndex+e.segment+1,T=new t.Point(l.getx(M),l.gety(M)),A=$t(T,o),L=A.signedDistanceFromCamera>0?A.point:ae(p,T,P,1,o),k=ie(e.writingMode,P,L,d);if(k)return k}var R=se(y*u.getoffsetX(e.glyphStartIndex),m,v,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f);if(!R)return{notEnoughRoom:!0};g=[R]}for(var N=0,D=g;N0?1:-1,g=0;i&&(d*=-1,g=Math.PI),d<0&&(g+=Math.PI);for(var y=d>0?u+s:u+s+1,m=o,v=o,_=0,x=0,b=Math.abs(f),w=[];_+x<=b;){if((y+=d)=l)return null;if(v=m,w.push(m),void 0===(m=p[y])){var E=new t.Point(c.getx(y),c.gety(y)),I=$t(E,h);if(I.signedDistanceFromCamera>0)m=p[y]=I.point;else{var S=y-d;m=ae(0===_?a:new t.Point(c.getx(S),c.gety(S)),E,v,b-_+1,h)}}_+=x,x=v.dist(m)}var C=(b-_)/x,P=m.sub(v),M=P.mult(C)._add(v);M._add(P._unit()._perp()._mult(n*d));var T=g+Math.atan2(m.y-v.y,m.x-v.x);return w.push(M),{point:M,angle:T,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},Kt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:a},Kt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!n&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?l.length>0:l},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=a.seenUids,l=this.boxCells[i];if(null!==l)for(var c=this.bboxes,h=0,p=l;h=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var g=this.circleCells[i];if(null!==g)for(var y=this.circles,m=0,v=g;ma*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,u=Math.abs(t-(n+s));if(u>s+r)return!1;var l=(a-i)/2,c=Math.abs(e-(i+l));if(c>l+r)return!1;if(u<=s||c<=l)return!0;var h=u-s,p=c-l;return h*h+p*p<=r*r};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(t,e){for(var r=0;r=1;L--)A.push(M.path[L]);for(var k=1;k0){for(var O=A[0].clone(),z=A[0].clone(),F=1;F=S.x&&z.x<=C.x&&O.y>=S.y&&z.y<=C.y?[A]:z.xC.x||z.yC.y?[]:t.clipLine([A],S.x,S.y,C.x,C.y)}for(var B=0,U=D;B=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(g=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:y,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:g},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:m,placedGlyphBoxes:v}):void 0},be.prototype.placeLayerBucketPart=function(e,r,n){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,l=o.textLabelPlaneMatrix,c=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,f=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,g=o.collisionGroup,y=s.get("text-optional"),m=s.get("icon-optional"),v=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order"),I=v&&(_||!a.hasIconData()||m),S=_&&(v||!a.hasTextData()||y);!a.collisionArrays&&f&&a.deserializeCollisionBoxes(f);var C=function(e,o){if(!r[e.crossTileID])if(p)i.placements[e.crossTileID]=new ge(!1,!1,!1);else{var f,E=!1,C=!1,P=!0,M=null,T={box:null,offscreen:null},A={box:null,offscreen:null},L=null,k=null,R=0,N=0,D=0;o.textFeatureIndex?R=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(R=e.featureIndex),o.verticalTextFeatureIndex&&(N=o.verticalTextFeatureIndex);var O=o.textBox;if(O){var z=function(r){var n=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,n=o,e))}return n},F=function(r,n){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i0&&(B=B.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var V=function(t,r,n){for(var o=t.x2-t.x1,s=t.y2-t.y1,l=e.textBoxScale,c=w&&!_?r:null,p={box:[],offscreen:!1},f=v?2*B.length:B.length,d=0;d=B.length,e,a,n,c);if(y&&(p=y.placedGlyphBoxes)&&p.box&&p.box.length){E=!0,M=y.shift;break}}return p};F((function(){return V(O,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(T&&T.box&&T.box.length)&&e.numVerticalGlyphVertices>0&&r?V(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),T&&(E=T.box,P=T.offscreen);var q=z(T&&T.box);if(!E&&i.prevPlacement){var j=i.prevPlacement.variableOffsets[e.crossTileID];j&&(i.variableOffsets[e.crossTileID]=j,i.markUsedJustification(a,j.anchor,e,q))}}else{var G=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,u,g.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(a,r,e),i.placedOrientations[e.crossTileID]=r),n};F((function(){return G(O,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?G(r,t.WritingMode.vertical):{box:null,offscreen:null}})),z(T&&T.box&&T.box.length)}}if(E=(f=T)&&f.box&&f.box.length>0,P=f&&f.offscreen,e.useRuntimeCollisionCircles){var X=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(a.textSizeData,d,X),Y=s.get("text-padding");L=i.collisionIndex.placeCollisionCircles(v,X,a.lineVertexArray,a.glyphOffsetArray,Z,u,l,c,n,b,g.predicate,e.collisionCircleDiameter,Y),E=v||L.circles.length>0&&!L.collisionDetected,P=P&&L.offscreen}if(o.iconFeatureIndex&&(D=o.iconFeatureIndex),o.iconBox){var W=function(t){var e=w&&M?xe(t,M.x,M.y,x,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,_,h,u,g.predicate)};C=A&&A.box&&A.box.length&&o.verticalIconBox?(k=W(o.verticalIconBox)).box.length>0:(k=W(o.iconBox)).box.length>0,P=P&&k.offscreen}var H=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=m||0===e.numIconVertices;if(H||K?K?H||(C=C&&E):E=C&&E:C=E=C&&E,E&&f&&f.box&&i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),a.bucketInstanceId,A&&A.box&&N?N:R,g.ID),C&&k&&i.collisionIndex.insertCollisionBox(k.box,s.get("icon-ignore-placement"),a.bucketInstanceId,D,g.ID),L&&(E&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),a.bucketInstanceId,R,g.ID),n)){var J=a.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new ye);for(var $=0;$=0;--M){var T=P[M];C(a.symbolInstances.get(T),a.collisionArrays[T])}else for(var A=e.symbolInstanceStart;A=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:n.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a0,v=i.placedOrientations[o.crossTileID],_=v===t.WritingMode.vertical,x=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||u>0){var b=Ae(y.text);d(e.text,s,_?Le:b),d(e.text,u,x?Le:b);var w=y.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||_?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var E=i.variableOffsets[o.crossTileID];E&&i.markUsedJustification(e,E.anchor,o,v);var I=i.placedOrientations[o.crossTileID];I&&(i.markUsedJustification(e,"left",o,I),i.markUsedOrientation(e,I,o))}if(m){var S=Ae(y.icon),C=!(p&&o.verticalPlacedIconSymbolIndex&&_);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,C?S:Le),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=y.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,C?Le:S),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var P=e.collisionArrays[n];if(P){var M=new t.Point(0,0);if(P.textBox||P.verticalTextBox){var T=!0;if(l){var A=i.variableOffsets[g];A?(M=_e(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),c&&M._rotate(h?i.transform.angle:-i.transform.angle)):T=!1}P.textBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!T||_,M.x,M.y),P.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!T||x,M.x,M.y)}var L=Boolean(!x&&P.verticalIconBox);P.iconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,L,p?M.x:0,p?M.y:0),P.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!L,p?M.x:0,p?M.y:0)}}},y=0;yt},be.prototype.setStale=function(){this.stale=!0};var Ee=Math.pow(2,25),Ie=Math.pow(2,24),Se=Math.pow(2,17),Ce=Math.pow(2,16),Pe=Math.pow(2,9),Me=Math.pow(2,8),Te=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,r=Math.floor(127*t.opacity);return r*Ee+e*Ie+r*Se+e*Ce+r*Pe+e*Me+r*Te+e}var Le=0,ke=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=[]};ke.prototype.continuePlacement=function(t,e,r,n,i){for(var o=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new ke(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Re.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Ne=512/t.EXTENT/2,De=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,i)}}for(var c=0;c1?"@2x":"",u=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,c())})),l=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,a||(a=t,o=e,c())}));function c(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var u=i[s],l=u.width,c=u.height,h=u.x,p=u.y,f=u.sdf,d=u.pixelRatio,g=u.stretchX,y=u.stretchY,m=u.content,v=new t.RGBAImage({width:l,height:c});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:l,height:c}),r[s]={data:v,pixelRatio:d,sdf:f,stretchX:g,stretchY:y,content:m}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new At(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Be(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,u=t;s=0;f--){var d=this._order[f];if(r(d))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.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;}"),$e=mr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=mr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=mr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=mr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=mr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=mr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=mr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=mr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=mr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=mr("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;}"),lr=mr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=mr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=mr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=mr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),fr=mr("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;}"),dr=mr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gr=mr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),yr=mr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function mr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var o="float"===n?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:a}}var vr=Object.freeze({__proto__:null,prelude:Xe,background:Ze,backgroundPattern:Ye,circle:We,clippingMask:He,heatmap:Ke,heatmapTexture:Je,collisionBox:Qe,collisionCircle:$e,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:ur,line:lr,lineGradient:cr,linePattern:hr,lineSDF:pr,raster:fr,symbolIcon:dr,symbolSDF:gr,symbolTextAndIcon:yr}),_r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function xr(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}br.prototype.draw=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g){var y,m=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var _=(y={},y[m.LINES]=2,y[m.TRIANGLES]=3,y[m.LINE_STRIP]=1,y)[e],x=0,b=c.get();x0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:qr(i.paint.get("raster-hue-rotate"))};var o,a};function qr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var jr,Gr=function(t,e,r,n,i,o,a,s,u,l){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+n,u_texsize:l,u_texture:0}},Xr=function(e,r,n,i,o,a,s,u,l,c,h){var p=o.transform;return t.extend(Gr(e,r,n,i,o,a,s,u,l,c),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Zr=function(e,r,n,i,o,a,s,u,l,c){return t.extend(Xr(e,r,n,i,o,a,s,u,!0,l,!0),{u_texsize_icon:c,u_texture_icon:1})},Yr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Wr=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,h=c*(n.tileID.canonical.x+n.tileID.wrap*l),p=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Hr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,o,a,s){for(var u=e.context,l=u.gl,c=e.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d0){var b=t.create(),w=v;t.mul(b,m.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,m.placementViewportMatrix),h.push({circleArray:x,circleOffset:f,transform:w,invTransform:b}),f=p+=x.length/4}_&&c.draw(u,l.LINES,St.disabled,Ct.disabled,e.colorModeForRenderPass(),Mt.disabled,Ar(v,e.transform,y),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&h.length){var E=e.useProgram("collisionCircle"),I=new t.StructArrayLayout2f1f2i16;I.resize(4*p),I._trim();for(var S=0,C=0,P=h;C=0&&(g[m.associatedIconIndex]={shiftedAnchor:I,angle:S})}else le(m.numGlyphs,f)}if(h){d.clear();for(var P=e.icon.placedSymbolArray,M=0;M0){var s=t.browser.now(),u=(s-e.timeAdded)/a,l=r?(s-r.timeAdded)/a:-1,c=n.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-l,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var ln=new t.Color(1,0,0,1),cn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),fn=new t.Color(0,1,1,1);function dn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function gn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function mn(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),u=St.disabled,l=Ct.disabled,c=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,l,c,Mt.disabled,kr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),f=r.getTile(n).tileSize,d=512/Math.min(f,512)*(n.overscaledZ/e.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,g+" "+p+"kb"),s.draw(i,o.TRIANGLES,u,l,Pt.alphaBlended,Mt.disabled,kr(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var vn={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=Ct.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var u=r.transform,l="map"===o,c="map"===a,h=0,p=e;h256&&this.clearStencil(),r.setColorMode(Pt.disabled),r.setDepthMode(St.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Ct({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Ct({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var x=this.style._layers[i[this.currentLayer]],b=o[x.source],w=c[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,t,vr[t],e,Hr[t],this._showOverdrawInspector)),this.cache[r]},_n.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()},_n.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)},_n.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))},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var xn=function(t,e){this.points=t,this.planes=e};xn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],r,n)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new xn(o,a)};var bn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o=0;if(0===a)return 0;a!==r.length&&(n=!1)}if(n)return 2;for(var u=0;u<3;u++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;hthis.max[u]-this.min[u])return 0}return 1};var wn=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};wn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},wn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},wn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var En=function(e,r,n,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},In={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}};En.prototype.clone=function(){var t=new En(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},In.minZoom.get=function(){return this._minZoom},In.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},In.maxZoom.get=function(){return this._maxZoom},In.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},In.minPitch.get=function(){return this._minPitch},In.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},In.maxPitch.get=function(){return this._maxPitch},In.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},In.renderWorldCopies.get=function(){return this._renderWorldCopies},In.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},In.worldSize.get=function(){return this.tileSize*this.scale},In.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},In.size.get=function(){return new t.Point(this.width,this.height)},In.bearing.get=function(){return-this.angle/Math.PI*180},In.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},In.pitch.get=function(){return this._pitch/Math.PI*180},In.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},In.fov.get=function(){return this._fov/Math.PI*180},In.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())},In.zoom.get=function(){return this._zoom},In.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())},In.center.get=function(){return this._center},In.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},In.padding.get=function(){return this._edgeInsets.toJSON()},In.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},In.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},En.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},En.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},En.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)},En.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),u=Math.floor(Math.max(n.x,i.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&r.push(new t.UnwrappedTileID(l,e));return r},En.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*i.x,o*i.y,0],s=xn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var l=function(t){return{aabb:new bn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],p=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(l(-d)),c.push(l(d));for(c.push(l(0));c.length>0;){var g=c.pop(),y=g.x,m=g.y,v=g.fullyVisible;if(!v){var _=g.aabb.intersects(s);if(0===_)continue;v=2===_}var x=g.aabb.distanceX(a),b=g.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(g.zoom===p||w>3+(1<=u)h.push({tileID:new t.OverscaledTileID(g.zoom===p?f:g.zoom,g.wrap,g.zoom,y,m),distanceSq:t.sqrLen([a[0]-.5-y,a[1]-.5-m])});else for(var E=0;E<4;E++){var I=(y<<1)+E%2,S=(m<<1)+(E>>1);c.push({aabb:g.aabb.quadrant(E),zoom:g.zoom+1,x:I,y:S,wrap:g.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},En.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},In.unmodified.get=function(){return this._unmodified},En.prototype.zoomScale=function(t){return Math.pow(2,t)},En.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},En.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},En.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},In.point.get=function(){return this.project(this.center)},En.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},En.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},En.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},En.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},En.prototype.coordinateLocation=function(t){return t.toLngLat()},En.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[1]/i,s=n[1]/o,u=r[2]/i,l=n[2]/o,c=u===l?0:(0-u)/(l-u);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/o,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},En.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},En.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},En.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},En.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])},En.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,r?this.alignedProjMatrix:this.projMatrix,u),i[n]=new Float32Array(u),i[n]},En.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},En.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-oa&&(i=a-y)}if(this.lngRange){var m=f.x,v=l.x/2;m-vu&&(n=u-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},En.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,l,u),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),g=a-Math.round(a)+f*h+d*p,y=s-Math.round(s)+f*p+d*h,m=new Float64Array(c);if(t.translate(m,m,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=m,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},En.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},En.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},En.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,u=e;s=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},Sn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Cn={linearity:.3,easing:t.bezier(0,0,.3,1)},Pn=t.extend({deceleration:2500,maxSpeed:1400},Cn),Mn=t.extend({deceleration:20,maxSpeed:1400},Cn),Tn=t.extend({deceleration:1e3,maxSpeed:360},Cn),An=t.extend({deceleration:1e3,maxSpeed:90},Cn),Ln=function(t){this._map=t,this.clear()};function kn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Ln.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Nn(t.type,this._map,t))},zn.prototype.dblclick=function(t){return this._firePreventable(new Nn(t.type,this._map,t))},zn.prototype.mouseover=function(t){this._map.fire(new Nn(t.type,this._map,t))},zn.prototype.mouseout=function(t){this._map.fire(new Nn(t.type,this._map,t))},zn.prototype.touchstart=function(t){return this._firePreventable(new Dn(t.type,this._map,t))},zn.prototype.touchmove=function(t){this._map.fire(new Dn(t.type,this._map,t))},zn.prototype.touchend=function(t){this._map.fire(new Dn(t.type,this._map,t))},zn.prototype.touchcancel=function(t){this._map.fire(new Dn(t.type,this._map,t))},zn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},zn.prototype.isEnabled=function(){return!0},zn.prototype.isActive=function(){return!1},zn.prototype.enable=function(){},zn.prototype.disable=function(){};var Fn=function(t){this._map=t};Fn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Fn.prototype.mousemove=function(t){this._map.fire(new Nn(t.type,this._map,t))},Fn.prototype.mousedown=function(){this._delayContextMenu=!0},Fn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Nn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Fn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Nn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var Bn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Un(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Vn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var qn=function(t){this.singleTap=new Vn(t),this.numTaps=t.numTaps,this.reset()};qn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},qn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},qn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},qn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var jn=function(){this._zoomIn=new qn({numTouches:1,numTaps:2}),this._zoomOut=new qn({numTouches:2,numTaps:1}),this.reset()};jn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},jn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},jn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},jn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},jn.prototype.touchcancel=function(){this.reset()},jn.prototype.enable=function(){this._enabled=!0},jn.prototype.disable=function(){this._enabled=!1,this.reset()},jn.prototype.isEnabled=function(){return this._enabled},jn.prototype.isActive=function(){return this._active};var Gn={0:1,2:2},Xn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Xn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Xn.prototype._correctButton=function(t,e){return!1},Xn.prototype._move=function(t,e){return{}},Xn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Xn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Gn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Un(n,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var l=i[u],c=this._touches[u];c&&(o._add(l),a._add(l.sub(c)),s++,i[u]=l)}if(this._touches=i,!(sMath.abs(t.x)}var ni=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,ri(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ri(t)&&ri(e)&&o}},e}(Kn),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function ai(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active},oi.prototype.disableRotation=function(){this._rotationDisabled=!0},oi.prototype.enableRotation=function(){this._rotationDisabled=!1};var si=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.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 n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,u=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&u&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=l(h);a=t.number(u,s,p),h<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},si.prototype.reset=function(){this._active=!1};var ui=function(t,e){this._clickZoom=t,this._tapZoom=e};ui.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ui.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ui.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ui.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var li=function(){this.reset()};li.prototype.reset=function(){this._active=!1},li.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var ci=function(){this._tap=new qn({numTouches:1,numTaps:1}),this.reset()};ci.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ci.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},ci.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},ci.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},ci.prototype.touchcancel=function(){this.reset()},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var hi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};fi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},gi=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 yi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var mi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ln(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;oo?Math.min(2,b):Math.max(.5,b),w=Math.pow(y,1-e),E=i.unproject(_.add(x.mult(e*w)).mult(g));i.setLocationAtPoint(i.renderWorldCopies?E.wrap():E,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:u,f="padding"in e?e.padding:o.padding,d=o.zoomScale(c-a),g=t.Point.convert(e.offset),y=o.centerPoint.add(g),m=o.pointLocation(y),v=t.LngLat.convert(e.center||m);this._normalizeCenter(v);var _=o.project(m),x=o.project(v).sub(_),b=e.curve,w=Math.max(o.width,o.height),E=w/d,I=x.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),C=w/o.zoomScale(S-a);b=Math.sqrt(C/I*2)}var P=b*b;function M(t){var e=(E*E-w*w+(t?-1:1)*P*P*I*I)/(2*(t?E:w)*P*I);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}var L=M(0),k=function(t){return A(L)/A(L+b*t)},R=function(t){return w*((A(L)*(T(e=L+b*t)/A(e))-T(L))/P)/I;var e},N=(M(1)-L)/b;if(Math.abs(I)<1e-6||!isFinite(N)){if(Math.abs(w-E)<1e-6)return this.easeTo(e,r);var D=Ee.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==u,this._padding=!o.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var i=e*N,d=1/k(i);o.zoom=1===e?c:a+o.scaleZoom(d),n._rotating&&(o.bearing=t.number(s,h,e)),n._pitching&&(o.pitch=t.number(u,p,e)),n._padding&&(o.interpolatePadding(l,f,e),y=o.centerPoint.add(g));var m=1===e?v:o.unproject(_.add(x.mult(R(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?m.wrap():m,y),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),_i=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};_i.prototype.getDefaultPosition=function(){return"bottom-right"},_i.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_i.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},_i.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},_i.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},_i.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_i.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var xi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xi.prototype.getDefaultPosition=function(){return"bottom-left"},xi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},xi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var bi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.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 i=new En(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new bi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wi,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ii))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new mi(this,e),this._hash=e.hash&&new Sn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new _i({customAttribution:e.customAttribution})),this.addControl(new xi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&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")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.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")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new Nn(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new Nn(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new Nn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var o=n[t],a=0;a180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Li.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Li.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Li.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()},Li.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Li.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)},Li.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Li.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Li.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))},Li.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))},Li.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Fi=0,Bi=!1,Ui=function(e){function n(r){e.call(this),this.options=t.extend({},zi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Di?n(Di):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){n(Di="denied"!==t.state)})):n(Di=!!t.window.navigator.geolocation),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fi=0,Bi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Bi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Oi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Oi({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"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.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":Fi--,Bi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Fi>1?(e={maximumAge:6e5,timeout:0},Bi=!0):(e=this.options.positionOptions,Bi=!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},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Vi={maxWidth:100,unit:"metric"},qi=function(e){this.options=t.extend({},Vi,e),t.bindAll(["_onMove","setUnit"],this)};function ji(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([n,i]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var u=3.2808*s;u>5280?Gi(e,n,u/5280,t._getUIString("ScaleControl.Miles")):Gi(e,n,u,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Gi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Gi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Gi(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+n}qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._onMove=function(){ji(this._map,this._container,this.options)},qi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qi.prototype.setUnit=function(t){this.options.unit=t,ji(this._map,this._container,this.options)};var Xi=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")};Xi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Xi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Xi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Xi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Xi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Xi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Xi.prototype._isFullscreen=function(){return this._fullscreen},Xi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Xi.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 Zi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Yi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Wi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Zi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.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},n.prototype.getLngLat=function(){return this._lngLat},n.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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ki(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,l=this._container.offsetHeight;s=i.y+a.bottom.ythis._map.transform.height-l?["bottom"]:[],i.xthis._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var c=i.add(a[o]).round();r.setTransform(this._container,Ri[o]+" translate("+c.x+"px,"+c.y+"px)"),Ni(this._container,o,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Yi);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),Hi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Pi,NavigationControl:Ai,GeolocateControl:Ui,AttributionControl:_i,ScaleControl:qi,FullscreenControl:Xi,Popup:Wi,Marker:Oi,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Ft().acquire(Nt)},clearPrewarmedResources:function(){var t=Ot;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Nt),Ot=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Hi})),r}()},7418:t=>{"use strict";var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,o){for(var a,s,u=i(t),l=1;l{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},609:(t,e,r)=>{"use strict";var n=r(4289),i=r(5559),o=r(4244),a=r(5624),s=r(2281),u=i(a(),Object);n(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},5624:(t,e,r)=>{"use strict";var n=r(4244);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:(t,e,r)=>{"use strict";var n=r(5624),i=r(4289);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8987:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(1414),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),l=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=a(t),s=e&&"[object String]"===o.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=l&&r;if(s&&t.length>0&&!i.call(t,0))for(var g=0;g0)for(var y=0;y{"use strict";var n=Array.prototype.slice,i=r(1414),o=Object.keys,a=o?function(t){return o(t)}:r(8987),s=Object.keys;a.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return i(t)?s(n.call(t)):s(t)}):Object.keys=a,Object.keys||a},t.exports=a},1414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6960:t=>{t.exports=function(t,e){for(var r=t[0],n=t[1],i=!1,o=0,a=e.length-1;on!=c>n&&r<(l-s)*(n-u)/(c-u)+s&&(i=!i)}return i}},2676:function(t){t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;re?1:t0))break;if(null===e.right)break;if(r(t,e.right.key)>0&&(u=e.right,e.right=u.left,u.left=e,null===(e=u).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,a.left=e.right,e.left=i.right,e.right=i.left,e}function a(t,e,r,i){var a=new n(t,e);if(null===r)return a.left=a.right=null,a;var s=i(t,(r=o(t,r,i)).key);return s<0?(a.left=r.left,a.right=r,r.left=null):s>=0&&(a.right=r.right,a.left=r,r.right=null),a}function s(t,e,r){var n=null,i=null;if(e){var a=r((e=o(t,e,r)).key,t);0===a?(n=e.left,i=e.right):a<0?(i=e.right,e.right=null,n=e):(n=e.left,e.left=null,i=e)}return{left:n,right:i}}function u(t,e,r,n,i){if(t){n(e+(r?"└── ":"├── ")+i(t)+"\n");var o=e+(r?" ":"│ ");t.left&&u(t.left,o,!1,n,i),t.right&&u(t.right,o,!0,n,i)}}var l=function(){function t(t){void 0===t&&(t=i),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=a(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var r=new n(t,e);null===this._root&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,a=o(t,this._root,i),s=i(t,a.key);return 0===s?this._root=a:(s<0?(r.left=a.left,r.right=a,a.left=null):s>0&&(r.right=a.right,r.left=a,a.right=null),this._size++,this._root=r),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,r){var n;return null===e?null:0===r(t,(e=o(t,e,r)).key)?(null===e.left?n=e.right:(n=o(t,e.left,r)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=o(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var n=r(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=o(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var n=r(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var r=this._root,n=[],i=!1;!i;)null!==r?(n.push(r),r=r.left):0!==n.length?(r=n.pop(),t.call(e,r),r=r.right):i=!0;return this},t.prototype.range=function(t,e,r,n){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,e)>0)break;if(o(a.key,t)>=0&&r.call(n,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var r=e.key;return t.push(r)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var r=e.data;return t.push(r)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,r=!1,n=0,i=[];!r;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),n===t)return e;n++,e=e.right}else r=!0;return null},t.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var n=this._comparator;e;){var i=n(t.key,e.key);if(0===i)break;i<0?(r=e,e=e.left):e=e.right}return r},t.prototype.prev=function(t){var e=this._root,r=null;if(null!==t.left){for(r=t.left;r.right;)r=r.right;return r}for(var n=this._comparator;e;){var i=n(t.key,e.key);if(0===i)break;i<0?e=e.left:(r=e,e=e.right)}return r},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,r=[],i=!1,o=new n(null,null),a=o;!i;)e?(r.push(e),e=e.left):r.length>0?e=(e=a=a.next=r.pop()).right:i=!0;return a.next=null,o.next}(this._root)},t.prototype.load=function(t,e,r){void 0===e&&(e=[]),void 0===r&&(r=!1);var i=t.length,o=this._comparator;if(r&&p(t,e,0,i-1,o),null===this._root)this._root=c(t,e,0,i),this._size=i;else{var a=function(t,e,r){for(var i=new n(null,null),o=i,a=t,s=e;null!==a&&null!==s;)r(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),i.next}(this.toList(),function(t,e){for(var r=new n(null,null),i=r,o=0;o0){var a=r+Math.floor(o/2),s=t[a],u=e[a],l=new n(s,u);return l.left=c(t,e,r,a),l.right=c(t,e,a+1,i),l}return null}function h(t,e,r){var n=r-e;if(n>0){var i=e+Math.floor(n/2),o=h(t,e,i),a=t.head;return a.left=o,t.head=t.head.next,a.right=h(t,i+1,r),a}return null}function p(t,e,r,n,i){if(!(r>=n)){for(var o=t[r+n>>1],a=r-1,s=n+1;;){do{a++}while(i(t[a],o)<0);do{s--}while(i(t[s],o)>0);if(a>=s)break;var u=t[a];t[a]=t[s],t[s]=u,u=e[a],e[a]=e[s],e[s]=u}p(t,e,r,s,i),p(t,e,s+1,n,i)}}var f=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},d=function(t,e){if(e.ur.xe.x?1:t.ye.y?1:0}}]),r(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,r=0,n=e.length;r=0&&u>=0?al?-1:0:o<0&&u<0?al?1:0:uo?1:0}}}]),e}(),T=0,A=function(){function e(r,n,i,o){t(this,e),this.id=++T,this.leftSE=r,r.segment=this,r.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=r,this.rings=i,this.windings=o}return r(e,null,[{key:"compare",value:function(t,e){var r=t.leftSE.point.x,n=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(oa&&s>u)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(r>n){if(as&&a>l)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(as)return 1;if(io){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(i!==o){var y=u-a,m=i-r,v=l-s,_=o-n;if(y>m&&v<_)return 1;if(y_)return-1}return i>o?1:il?1:t.ide.id?1:0}}]),r(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,r=this.rightSE.point,n=this.vector();if(e.x===r.x)return t.x===e.x?0:t.x0&&s.swapEvents(),M.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),r}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,r=this.windings.length;e0){var o=r;r=n,n=o}if(r.prev===n){var a=r;r=n,n=a}for(var s=0,u=n.rings.length;s0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=r,o=t,a=-1}return new e(new M(i,!0),new M(o,!1),[n],[a])}}]),e}(),L=function(){function e(r,n,i){if(t(this,e),!Array.isArray(r)||0===r.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=i,this.segments=[],"number"!=typeof r[0][0]||"number"!=typeof r[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=x.round(r[0][0],r[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,u=r.length;sthis.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),a=l)}o.x===a.x&&o.y===a.y||this.segments.push(A.fromRing(a,o,this))}return r(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,r=this.segments.length;ethis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=n}return r(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,r=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=n}return r(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,r=this.polys.length;e0&&(t=n)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),e}(),D=function(){function e(r){t(this,e),this.exteriorRing=r,r.poly=this,this.interiorRings=[]}return r(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,r=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:A.compare;t(this,e),this.queue=r,this.tree=new l(n),this.segments=[]}return r(e,[{key:"process",value:function(t){var e=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),r;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=n,o=n,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(t.isLeft){var u=null;if(a){var l=a.getIntersection(e);if(null!==l&&(e.isAnEndpoint(l)||(u=l),!a.isAnEndpoint(l)))for(var c=this._splitSafely(a,l),h=0,p=c.length;h0?(this.tree.remove(e),r.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var w=a.getIntersection(s);if(null!==w){if(!a.isAnEndpoint(w))for(var E=this._splitSafely(a,w),I=0,S=E.length;IF)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new z(g),E=g.size,I=g.pop();I;){var S=I.key;if(g.size===E){var C=S.segment;throw new Error("Unable to pop() ".concat(S.isLeft?"left":"right"," SweepEvent ")+"[".concat(S.point.x,", ").concat(S.point.y,"] from segment #").concat(C.id," ")+"[".concat(C.leftSE.point.x,", ").concat(C.leftSE.point.y,"] -> ")+"[".concat(C.rightSE.point.x,", ").concat(C.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(g.size>F)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>B)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var P=w.process(S),T=0,A=P.length;T1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n{"use strict";t.exports=i,t.exports.default=i;var n=r(4291);function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,r,i,o){for(var a,s=[e,r];s.length;)(r=s.pop())-(e=s.pop())<=i||(a=e+Math.ceil((r-e)/i/2)*i,n(t,a,e,r,o),s.push(e,a,a,r))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!d(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),s=g(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,a(r,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,u,l,c,p,f,d,g,y,m,v;for(l=c=1/0,n=e;n<=r-e;n++)f=i=s(t,0,n,this.toBBox),d=o=s(t,n,r,this.toBBox),void 0,void 0,void 0,void 0,g=Math.max(f.minX,d.minX),y=Math.max(f.minY,d.minY),m=Math.min(f.maxX,d.maxX),v=Math.min(f.maxY,d.maxY),a=Math.max(0,m-g)*Math.max(0,v-y),u=h(i)+h(o),a=e;i--)o=t.children[i],u(c,t.leaf?a(o):o),h+=p(c);return h},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)u(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():a(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},4291:function(t){t.exports=function(){"use strict";function t(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(r,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var p=r[n],f=i,d=o;for(e(r,i,n),a(r[o],p)>0&&e(r,i,o);f0;)d--}0===a(r[i],p)?e(r,i,d):e(r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}function e(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function r(t,e){return te?1:0}return function(e,n,i,o,a){t(e,n,i||0,o||e.length-1,a||r)}}()},3697:t=>{"use strict";var e=Object,r=TypeError;t.exports=function(){if(null!=this&&this!==e(this))throw new r("RegExp.prototype.flags getter called on non-object");var t="";return this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.sticky&&(t+="y"),t}},2847:(t,e,r)=>{"use strict";var n=r(4289),i=r(5559),o=r(3697),a=r(1721),s=r(2753),u=i(o);n(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},1721:(t,e,r)=>{"use strict";var n=r(3697),i=r(4289).supportsDescriptors,o=Object.getOwnPropertyDescriptor,a=TypeError;t.exports=function(){if(!i)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof/a/.dotAll)return t.get}return n}},2753:(t,e,r)=>{"use strict";var n=r(4289).supportsDescriptors,i=r(1721),o=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,l=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=i(),e=u(l),r=o(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},8639:function(t,e){!function(t){"use strict";const e=134217729;function r(t,e,r,n,i){let o,a,s,u,l=e[0],c=n[0],h=0,p=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=n[++p]);let f=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=e[++h]):(s=o-((a=c+o)-c),c=n[++p]),o=a,0!==s&&(i[f++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=e[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=n[++p]),o=a,0!==s&&(i[f++]=s);for(;h0!=d>0)return g;const y=Math.abs(f+d);return Math.abs(g)>=33306690738754716e-32*y?g:-function(t,n,l,c,h,p,f){let d,g,y,m,v,_,x,b,w,E,I,S,C,P,M,T,A,L;const k=t-h,R=l-h,N=n-p,D=c-p;v=(M=(b=k-(x=(_=e*k)-(_-k)))*(E=D-(w=(_=e*D)-(_-D)))-((P=k*D)-x*w-b*w-x*E))-(I=M-(A=(b=N-(x=(_=e*N)-(_-N)))*(E=R-(w=(_=e*R)-(_-R)))-((T=N*R)-x*w-b*w-x*E))),i[0]=M-(I+v)+(v-A),v=(C=P-((S=P+I)-(v=S-P))+(I-v))-(I=C-T),i[1]=C-(I+v)+(v-T),v=(L=S+I)-S,i[2]=S-(L-v)+(I-v),i[3]=L;let O=function(t,e){let r=e[0];for(let t=1;t<4;t++)r+=e[t];return r}(0,i),z=22204460492503146e-32*f;if(O>=z||-O>=z)return O;if(d=t-(k+(v=t-k))+(v-h),y=l-(R+(v=l-R))+(v-h),g=n-(N+(v=n-N))+(v-p),m=c-(D+(v=c-D))+(v-p),0===d&&0===g&&0===y&&0===m)return O;if(z=11093356479670487e-47*f+33306690738754706e-32*Math.abs(O),(O+=k*m+D*d-(N*y+R*g))>=z||-O>=z)return O;v=(M=(b=d-(x=(_=e*d)-(_-d)))*(E=D-(w=(_=e*D)-(_-D)))-((P=d*D)-x*w-b*w-x*E))-(I=M-(A=(b=g-(x=(_=e*g)-(_-g)))*(E=R-(w=(_=e*R)-(_-R)))-((T=g*R)-x*w-b*w-x*E))),u[0]=M-(I+v)+(v-A),v=(C=P-((S=P+I)-(v=S-P))+(I-v))-(I=C-T),u[1]=C-(I+v)+(v-T),v=(L=S+I)-S,u[2]=S-(L-v)+(I-v),u[3]=L;const F=r(4,i,4,u,o);v=(M=(b=k-(x=(_=e*k)-(_-k)))*(E=m-(w=(_=e*m)-(_-m)))-((P=k*m)-x*w-b*w-x*E))-(I=M-(A=(b=N-(x=(_=e*N)-(_-N)))*(E=y-(w=(_=e*y)-(_-y)))-((T=N*y)-x*w-b*w-x*E))),u[0]=M-(I+v)+(v-A),v=(C=P-((S=P+I)-(v=S-P))+(I-v))-(I=C-T),u[1]=C-(I+v)+(v-T),v=(L=S+I)-S,u[2]=S-(L-v)+(I-v),u[3]=L;const B=r(F,o,4,u,a);v=(M=(b=d-(x=(_=e*d)-(_-d)))*(E=m-(w=(_=e*m)-(_-m)))-((P=d*m)-x*w-b*w-x*E))-(I=M-(A=(b=g-(x=(_=e*g)-(_-g)))*(E=y-(w=(_=e*y)-(_-y)))-((T=g*y)-x*w-b*w-x*E))),u[0]=M-(I+v)+(v-A),v=(C=P-((S=P+I)-(v=S-P))+(I-v))-(I=C-T),u[1]=C-(I+v)+(v-T),v=(L=S+I)-S,u[2]=S-(L-v)+(I-v),u[3]=L;const U=r(B,a,4,u,s);return s[U-1]}(t,n,l,c,h,p,y)},t.orient2dfast=function(t,e,r,n,i,o){return(e-o)*(r-i)-(t-i)*(n-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},5697:t=>{"use strict";t.exports={eudist:function(t,e,r){for(var n=t.length,i=0,o=0;o{"use strict";var n=r(5697),i=n.eudist,o=n.dist;t.exports={kmrand:function(t,e){for(var r={},n=[],i=e<<2,o=t.length,a=t[0].length>0;n.length0;){var s=t[Math.floor(Math.random()*o)],u=a?s.join("_"):""+s;r[u]||(r[u]=!0,n.push(s))}if(n.length0,u=t[Math.floor(Math.random()*a)];for(s&&u.join("_"),n.push(u);n.length{"use strict";var n=r(5697),i=r(7035),o=n.eudist,a=(n.mandist,n.dist,i.kmrand),s=i.kmpp;function u(t,e,r){r=r||[];for(var n=0;n0,m=[];if(r)i="kmrand"==r?a(t,e):"kmpp"==r?s(t,e):r;else for(var v={};i.length{"use strict";var n,i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),o=[];function a(t){for(var e=-1,r=0;r{"use strict";r.r(e),r.d(e,{default:()=>n});class n{constructor(t=[],e=i){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t=0)break;e[t]=o,t=n}e[t]=i}}function i(t,e){return te?1:0}},675:function(t,e){!function(t){"use strict";function e(){}function r(t){this.message=t||""}function n(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function a(t){return null===t?Nt:t.color}function s(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function l(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function p(){}function f(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}function d(){}function g(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),r=Math.max(Math.min(e.length,9007199254740991),0)||0,n=1 in arguments&&parseInt(Number(arguments[1]),10)||0;n=n<0?Math.max(r+n,0):Math.min(n,r);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:r;for(i=i<0?Math.max(r+arguments[2],0):Math.min(i,r);ne.x?1:this.ye.y?1:0},I.prototype.clone=function(){},I.prototype.copy=function(){return new I(this)},I.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},I.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+r*r+n*n)},I.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},I.prototype.hashCode=function(){var t=17;return 37*(t=37*t+I.hashCode(this.x))+I.hashCode(this.y)},I.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},I.prototype.interfaces_=function(){return[b,w,e]},I.prototype.getClass=function(){return I},I.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=_.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},S.DimensionalComparator.get=function(){return C},S.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},S.NULL_ORDINATE.get=function(){return _.NaN},S.X.get=function(){return 0},S.Y.get=function(){return 1},S.Z.get=function(){return 2},Object.defineProperties(I,S);var C=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new v("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};C.prototype.compare=function(t,e){var r=t,n=e,i=C.compare(r.x,n.x);if(0!==i)return i;var o=C.compare(r.y,n.y);return 0!==o?o:this._dimensionsToTest<=2?0:C.compare(r.z,n.z)},C.prototype.interfaces_=function(){return[E]},C.prototype.getClass=function(){return C},C.compare=function(t,e){return te?1:_.isNaN(t)?_.isNaN(e)?0:-1:_.isNaN(e)?1:0};var P=function(){};P.prototype.create=function(){},P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P};var M=function(){},T={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.toLocationSymbol=function(t){switch(t){case M.EXTERIOR:return"e";case M.BOUNDARY:return"b";case M.INTERIOR:return"i";case M.NONE:return"-"}throw new v("Unknown location value: "+t)},T.INTERIOR.get=function(){return 0},T.BOUNDARY.get=function(){return 1},T.EXTERIOR.get=function(){return 2},T.NONE.get=function(){return-1},Object.defineProperties(M,T);var A=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},L=function(){},k={LOG_10:{configurable:!0}};L.prototype.interfaces_=function(){return[]},L.prototype.getClass=function(){return L},L.log10=function(t){var e=Math.log(t);return _.isInfinite(e)||_.isNaN(e)?e:e/L.LOG_10},L.min=function(t,e,r,n){var i=t;return er?r:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var n=arguments[0],i=arguments[1],o=arguments[2];return no?o:n}},L.wrap=function(t,e){return t<0?e- -t%e:t%e},L.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],r=arguments[0];return t>r&&(r=t),e>r&&(r=e),r}if(4===arguments.length){var n=arguments[1],i=arguments[2],o=arguments[3],a=arguments[0];return n>a&&(a=n),i>a&&(a=i),o>a&&(a=o),a}},L.average=function(t,e){return(t+e)/2},k.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(L,k);var R=function(t){this.str=t};R.prototype.append=function(t){this.str+=t},R.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},R.prototype.toString=function(t){return this.str};var N=function(t){this.value=t};N.prototype.intValue=function(){return this.value},N.prototype.compareTo=function(t){return this.valuet?1:0},N.isNaN=function(t){return Number.isNaN(t)};var D=function(){};D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()};var O=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var r=arguments[0];this.init(r)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n,i)}},z={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};O.prototype.le=function(t){return(this._hi9?(c=!0,h="9"):h="0"+l,a.append(h),r=r.subtract(O.valueOf(l)).multiply(O.TEN),c&&r.selfAdd(O.TEN);var p=!0,f=O.magnitude(r._hi);if(f<0&&Math.abs(f)>=s-u&&(p=!1),!p)break}return e[0]=n,a.toString()},O.prototype.sqr=function(){return this.multiply(this)},O.prototype.doubleValue=function(){return this._hi+this._lo},O.prototype.subtract=function(){if(arguments[0]instanceof O){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},O.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},O.prototype.isZero=function(){return 0===this._hi&&0===this._lo},O.prototype.selfSubtract=function(){if(arguments[0]instanceof O){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},O.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},O.prototype.min=function(t){return this.le(t)?this:t},O.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,l=null,c=null,h=null;return u=this._hi/r,h=(i=(l=O.SPLIT*u)-(i=l-u))*(a=(h=O.SPLIT*r)-(a=h-r))-(c=u*r)+i*(s=r-a)+(o=u-i)*a+o*s,h=u+(l=(this._hi-c-h+this._lo-u*n)/r),this._hi=h,this._lo=u-h+l,this}},O.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},O.prototype.divide=function(){if(arguments[0]instanceof O){var t=arguments[0],e=null,r=null,n=null,i=null,o=null,a=null,s=null,u=null;return r=(o=this._hi/t._hi)-(e=(a=O.SPLIT*o)-(e=a-o)),u=e*(n=(u=O.SPLIT*t._hi)-(n=u-t._hi))-(s=o*t._hi)+e*(i=t._hi-n)+r*n+r*i,a=(this._hi-s-u+this._lo-o*t._lo)/t._hi,new O(u=o+a,o-u+a)}if("number"==typeof arguments[0]){var l=arguments[0];return _.isNaN(l)?O.createNaN():O.copy(this).selfDivide(l,0)}},O.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},O.prototype.pow=function(t){if(0===t)return O.valueOf(1);var e=new O(this),r=O.valueOf(1),n=Math.abs(t);if(n>1)for(;n>0;)n%2==1&&r.selfMultiply(e),(n/=2)>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},O.prototype.ceil=function(){if(this.isNaN())return O.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new O(t,e)},O.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},O.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},O.prototype.setValue=function(){if(arguments[0]instanceof O){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},O.prototype.max=function(t){return this.ge(t)?this:t},O.prototype.sqrt=function(){if(this.isZero())return O.valueOf(0);if(this.isNegative())return O.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=O.valueOf(e),n=this.subtract(r.sqr())._hi*(.5*t);return r.add(n)},O.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],r=null,n=null,i=null,o=null,a=null,s=null;return o=(i=this._hi+e)-(a=i-this._hi),n=(s=(o=e-a+(this._hi-o))+this._lo)+(i-(r=i+s)),this._hi=r+n,this._lo=n+(r-this._hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],c=null,h=null,p=null,f=null,d=null,g=null,y=null;f=this._hi+u,h=this._lo+l,d=f-(g=f-this._hi),p=h-(y=h-this._lo);var m=(c=f+(g=(d=u-g+(this._hi-d))+h))+(g=(p=l-y+(this._lo-p))+(g+(f-c))),v=g+(c-m);return this._hi=m,this._lo=v,this}},O.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,l=null;i=(u=O.SPLIT*this._hi)-this._hi,l=O.SPLIT*r,i=u-i,o=this._hi-i,a=l-r;var c=(u=this._hi*r)+(l=i*(a=l-a)-u+i*(s=r-a)+o*a+o*s+(this._hi*n+this._lo*r)),h=l+(i=u-c);return this._hi=c,this._lo=h,this}},O.prototype.selfSqr=function(){return this.selfMultiply(this)},O.prototype.floor=function(){if(this.isNaN())return O.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new O(t,e)},O.prototype.negate=function(){return this.isNaN()?this:new O(-this._hi,-this._lo)},O.prototype.clone=function(){},O.prototype.multiply=function(){if(arguments[0]instanceof O){var t=arguments[0];return t.isNaN()?O.createNaN():O.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return _.isNaN(e)?O.createNaN():O.copy(this).selfMultiply(e,0)}},O.prototype.isNaN=function(){return _.isNaN(this._hi)},O.prototype.intValue=function(){return Math.trunc(this._hi)},O.prototype.toString=function(){var t=O.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},O.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),n=e[0]+1,i=r;if("."===r.charAt(0))i="0"+r;else if(n<0)i="0."+O.stringOfChar("0",-n)+r;else if(-1===r.indexOf(".")){var o=n-r.length;i=r+O.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},O.prototype.reciprocal=function(){var t,e,r,n,i=null,o=null,a=null,s=null;t=(r=1/this._hi)-(i=(a=O.SPLIT*r)-(i=a-r)),o=(s=O.SPLIT*this._hi)-this._hi;var u=r+(a=(1-(n=r*this._hi)-(s=i*(o=s-o)-n+i*(e=this._hi-o)+t*o+t*e)-r*this._lo)/this._hi);return new O(u,r-u+a)},O.prototype.toSciNotation=function(){if(this.isZero())return O.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),n=O.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===r.charAt(0))throw new Error("Found leading zero: "+r);var i="";r.length>1&&(i=r.substring(1));var o=r.charAt(0)+"."+i;return this.isNegative()?"-"+o+n:o+n},O.prototype.abs=function(){return this.isNaN()?O.NaN:this.isNegative()?this.negate():new O(this)},O.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},O.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},O.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},O.prototype.trunc=function(){return this.isNaN()?O.NaN:this.isPositive()?this.floor():this.ceil()},O.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},O.prototype.interfaces_=function(){return[e,b,w]},O.prototype.getClass=function(){return O},O.sqr=function(t){return O.valueOf(t).selfMultiply(t)},O.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return O.parse(t)}if("number"==typeof arguments[0])return new O(arguments[0])},O.sqrt=function(t){return O.valueOf(t).sqrt()},O.parse=function(t){for(var e=0,r=t.length;D.isWhitespace(t.charAt(e));)e++;var n=!1;if(e=r);){var l=t.charAt(e);if(e++,D.isDigit(l)){var c=l-"0";o.selfMultiply(O.TEN),o.selfAdd(c),a++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=N.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}s=a}}var p=o,f=a-s-u;if(0===f)p=o;else if(f>0){var d=O.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=O.TEN.pow(-f);p=o.multiply(g)}return n?p.negate():p},O.createNaN=function(){return new O(_.NaN,_.NaN)},O.copy=function(t){return new O(t)},O.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),n=Math.trunc(Math.floor(r));return 10*Math.pow(10,n)<=e&&(n+=1),n},O.stringOfChar=function(t,e){for(var r=new R,n=0;n0){if(o<=0)return F.signum(a);n=i+o}else{if(!(i<0))return F.signum(a);if(o>=0)return F.signum(a);n=-i-o}var s=F.DP_SAFE_EPSILON*n;return a>=s||-a>=s?F.signum(a):2},F.signum=function(t){return t>0?1:t<0?-1:0},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(F,B);var U=function(){},V={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};V.X.get=function(){return 0},V.Y.get=function(){return 1},V.Z.get=function(){return 2},V.M.get=function(){return 3},U.prototype.setOrdinate=function(t,e,r){},U.prototype.size=function(){},U.prototype.getOrdinate=function(t,e){},U.prototype.getCoordinate=function(){},U.prototype.getCoordinateCopy=function(t){},U.prototype.getDimension=function(){},U.prototype.getX=function(t){},U.prototype.clone=function(){},U.prototype.expandEnvelope=function(t){},U.prototype.copy=function(){},U.prototype.getY=function(t){},U.prototype.toCoordinateArray=function(){},U.prototype.interfaces_=function(){return[w]},U.prototype.getClass=function(){return U},Object.defineProperties(U,V);var q=function(){},j=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(q),G=function(){};G.arraycopy=function(t,e,r,n,i){for(var o=0,a=e;at._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,n=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&n>=this._miny&&n<=this._maxy}},Z.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Z){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||rthis._maxy||nthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=n,this._maxy=n):(rthis._maxx&&(this._maxx=r),nthis._maxy&&(this._maxy=n))}},Z.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Z.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Z.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Z.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Z.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Z.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Z.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Z.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Z){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof I){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return this.covers(r,n)}},Z.prototype.centre=function(){return this.isNull()?null:new I((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Z.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Z){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.init(r.x,n.x,r.y,n.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];it._maxx&&(e=this._minx-t._maxx);var r=0;return this._maxyt._maxy&&(r=this._miny-t._maxy),0===e?r:0===r?e:Math.sqrt(e*e+r*r)},Z.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+I.hashCode(this._minx))+I.hashCode(this._maxx))+I.hashCode(this._miny))+I.hashCode(this._maxy)},Z.prototype.interfaces_=function(){return[b,e]},Z.prototype.getClass=function(){return Z},Z.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.xe.x?t.x:e.x)&&r.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),u=Math.max(o.x,a.x),l=Math.min(n.x,i.x),c=Math.max(n.x,i.x);return!(l>u||cu||cthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},rt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},rt.prototype.setPrecisionModel=function(t){this._precisionModel=t},rt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?n:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=n>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},rt.nonRobustComputeEdgeDistance=function(t,e,r){var n=t.x-e.x,i=t.y-e.y,o=Math.sqrt(n*n+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},nt.DONT_INTERSECT.get=function(){return 0},nt.DO_INTERSECT.get=function(){return 1},nt.COLLINEAR.get=function(){return 2},nt.NO_INTERSECTION.get=function(){return 0},nt.POINT_INTERSECTION.get=function(){return 1},nt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(rt,nt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Z(this._inputLines[0][0],this._inputLines[0][1]),r=new Z(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&r.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],r=arguments[1],n=arguments[2];if(this._isProper=!1,Z.intersects(r,n,e)&&0===st.orientationIndex(r,n,e)&&0===st.orientationIndex(n,r,e))return this._isProper=!0,(e.equals(r)||e.equals(n))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,r,n,i){i.x=this.smallestInAbsValue(t.x,e.x,r.x,n.x),i.y=this.smallestInAbsValue(t.y,e.y,r.y,n.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,r.x-=i.x,r.y-=i.y,n.x-=i.x,n.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,r,n,i){var o=null;try{o=X.intersection(t,r,n,i)}catch(a){if(!(a instanceof j))throw a;o=e.nearestEndpoint(t,r,n,i)}return o},e.prototype.intersection=function(t,r,n,i){var o=this.intersectionWithNormalization(t,r,n,i);return this.isInSegmentEnvelopes(o)||(o=new I(e.nearestEndpoint(t,r,n,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,r,n){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&G.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,r,n){var i=new I(t),o=new I(e),a=new I(r),s=new I(n),u=new I;this.normalizeToEnvCentre(i,o,a,s,u);var l=this.safeHCoordinateIntersection(i,o,a,s);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,r,n,i){var o=Z.intersects(e,r,n),a=Z.intersects(e,r,i),s=Z.intersects(n,i,e),u=Z.intersects(n,i,r);return o&&a?(this._intPt[0]=n,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=e,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||a||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=n,this._intPt[1]=r,!n.equals(r)||a||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&u?(this._intPt[0]=i,this._intPt[1]=r,!i.equals(r)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,r,n,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=r.xn.x?r.x:n.x,p=r.y>n.y?r.y:n.y,f=((o>l?o:l)+(sc?a:c)+(u0&&a>0||o<0&&a<0)return t.NO_INTERSECTION;var s=st.orientationIndex(n,i,e),u=st.orientationIndex(n,i,r);return s>0&&u>0||s<0&&u<0?t.NO_INTERSECTION:0===o&&0===a&&0===s&&0===u?this.computeCollinearIntersection(e,r,n,i):(0===o||0===a||0===s||0===u?(this._isProper=!1,e.equals2D(n)||e.equals2D(i)?this._intPt[0]=e:r.equals2D(n)||r.equals2D(i)?this._intPt[0]=r:0===o?this._intPt[0]=new I(n):0===a?this._intPt[0]=new I(i):0===s?this._intPt[0]=new I(e):0===u&&(this._intPt[0]=new I(r))):(this._isProper=!0,this._intPt[0]=this.intersection(e,r,n,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,r,n){var i=t,o=st.distancePointLine(t,r,n),a=st.distancePointLine(e,r,n);return a0?r>0?-i:i:r>0?i:-i;if(0===e||0===r)return n>0?t>0?i:-i:t>0?-i:i;if(e>0?n>0?e<=n||(i=-i,o=t,t=r,r=o,o=e,e=n,n=o):e<=-n?(i=-i,r=-r,n=-n):(o=t,t=-r,r=o,o=e,e=-n,n=o):n>0?-e<=n?(i=-i,t=-t,e=-e):(o=-t,t=r,r=o,o=-e,e=n,n=o):e>=n?(t=-t,e=-e,r=-r,n=-n):(i=-i,o=-t,t=-r,r=o,o=-e,e=-n,n=o),t>0){if(!(r>0))return i;if(!(t<=r))return i}else{if(r>0)return-i;if(!(t>=r))return-i;i=-i,t=-t,r=-r}for(;;){if((n-=(a=Math.floor(r/t))*e)<0)return-i;if(n>e)return i;if(t>(r-=a*t)+r){if(en+n)return-i;r=t-r,n=e-n,i=-i}if(0===n)return 0===r?0:-i;if(0===r)return i;if((e-=(a=Math.floor(t/r))*n)<0)return i;if(e>n)return-i;if(r>(t-=a*r)+t){if(ne+e)return i;t=r-t,e=n-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var at=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};at.prototype.countSegment=function(t,e){if(t.xn&&(r=e.x,n=t.x),this._p.x>=r&&this._p.x<=n&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,s=e.y-this._p.y,u=ot.signOfDet2x2(i,o,a,s);if(0===u)return this._isPointOnSegment=!0,null;s0&&this._crossingCount++}},at.prototype.isPointInPolygon=function(){return this.getLocation()!==M.EXTERIOR},at.prototype.getLocation=function(){return this._isPointOnSegment?M.BOUNDARY:this._crossingCount%2==1?M.INTERIOR:M.EXTERIOR},at.prototype.isOnSegment=function(){return this._isPointOnSegment},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.locatePointInRing=function(){if(arguments[0]instanceof I&&A(arguments[1],U)){for(var t=arguments[1],e=new at(arguments[0]),r=new I,n=new I,i=1;i1||s<0||s>1)&&(i=!0)}}else i=!0;return i?L.min(st.distancePointLine(t,r,n),st.distancePointLine(e,r,n),st.distancePointLine(r,t,e),st.distancePointLine(n,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==M.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,n=new I;t.getCoordinate(0,n);for(var i=n.x,o=n.y,a=1;ar.y&&(r=o,n=i)}var a=n;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(r)&&a!==n);var s=n;do{s=(s+1)%e}while(t[s].equals2D(r)&&s!==n);var u=t[a],l=t[s];if(u.equals2D(r)||l.equals2D(r)||u.equals2D(l))return!1;var c=st.computeOrientation(u,r,l);return 0===c?u.x>l.x:c>0},st.locatePointInRing=function(t,e){return at.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,r){var n=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),i=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/n;return Math.abs(i)*Math.sqrt(n)},st.computeOrientation=function(t,e,r){return st.orientationIndex(t,e,r)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new v("Line array must contain at least one vertex");for(var r=t.distance(e[0]),n=0;n=1)return o.distance(s);var c=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/u;return Math.abs(c)*Math.sqrt(u)}},st.isOnLine=function(t,e){for(var r=new it,n=1;n0},mt.prototype.interfaces_=function(){return[dt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.isInBoundary=function(t){return t>1},vt.prototype.interfaces_=function(){return[dt]},vt.prototype.getClass=function(){return vt};var _t=function(){};_t.prototype.isInBoundary=function(t){return 1===t},_t.prototype.interfaces_=function(){return[dt]},_t.prototype.getClass=function(){return _t};var xt=function(){};xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){},(r.prototype=new Error).name="IndexOutOfBoundsException";var bt=function(){};bt.prototype.hasNext=function(){},bt.prototype.next=function(){},bt.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(xt);(n.prototype=new Error).name="NoSuchElementException";var Et=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,xt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var r=this.array_[t];return this.array_[t]=e,r},e.prototype.iterator=function(){return new It(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new r;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l=0;c--)this.add(s[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof I){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(hm&&(v=-1);for(var _=y;_!==m;_+=v)this.add(d[_],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new I(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,r),e}(Et),Ct=function(){},Pt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Pt.ForwardComparator.get=function(){return Mt},Pt.BidirectionalComparator.get=function(){return Tt},Pt.coordArrayType.get=function(){return new Array(0).fill(null)},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Ct.ptNotInList=function(t,e){for(var r=0;r=t?e:[]},Ct.indexOf=function(t,e){for(var r=0;r0)&&(e=t[r]);return e},Ct.extract=function(t,e,r){e=L.clamp(e,0,t.length);var n=(r=L.clamp(r,-1,t.length))-e+1;r<0&&(n=0),e>=t.length&&(n=0),rn.length)return 1;if(0===r.length)return 0;var i=Ct.compare(r,n);return Ct.isEqualReversed(r,n)?0:i},Tt.prototype.OLDcompare=function(t,e){var r=t,n=e;if(r.lengthn.length)return 1;if(0===r.length)return 0;for(var i=Ct.increasingDirection(r),o=Ct.increasingDirection(n),a=i>0?0:r.length-1,s=o>0?0:r.length-1,u=0;u0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var r,n,i=this.root_;do{if(r=i,(n=t.compareTo(i.key))<0)i=i.left;else{if(!(n>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:r,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}};return n<0?r.left=a:r.right=a,this.fixAfterInsertion(a),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===l(s(s(t)))){var e=c(s(s(t)));1===a(e)?(u(s(t),Nt),u(e,Nt),u(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateLeft(t)),u(s(t),Nt),u(s(s(t)),1),this.rotateRight(s(s(t))))}else{var r=l(s(s(t)));1===a(r)?(u(s(t),Nt),u(r,Nt),u(s(s(t)),1),t=s(s(t))):(t===l(s(t))&&(t=s(t),this.rotateRight(t)),u(s(t),Nt),u(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=Nt},h.prototype.values=function(){var t=new Et,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new kt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var r=t.parent,n=t;null!==r&&n===r.right;)n=r,r=r.parent;return r},h.prototype.size=function(){return this.size_};var Dt=function(){};Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},p.prototype=new o,(f.prototype=new p).contains=function(t){for(var e=0,r=this.array_.length;e=0;){var a=i.substring(0,o);n.add(a),o=(i=i.substring(o+r)).indexOf(e)}i.length>0&&n.add(i);for(var s=new Array(n.size()).fill(null),u=0;u0)for(var o=i;o0&&n.append(" ");for(var o=0;o0&&n.append(","),n.append(Zt.toString(t.getOrdinate(i,o)))}return n.append(")"),n.toString()}},Wt.ensureValidRing=function(t,e){var r=e.size();return 0===r?e:r<=3?Wt.createClosedRing(t,e,4):e.getOrdinate(0,U.X)===e.getOrdinate(r-1,U.X)&&e.getOrdinate(0,U.Y)===e.getOrdinate(r-1,U.Y)?e:Wt.createClosedRing(t,e,r+1)},Wt.createClosedRing=function(t,e,r){var n=t.create(r,e.getDimension()),i=e.size();Wt.copy(e,0,n,0,i);for(var o=i;o0&&Wt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Wt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,r=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.MINIMUM_VALID_SIZE.get=function(){return 4},r.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,r),e}(Ht),re=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],r=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,r)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),r=0;r0?e.createPoint(r[0]):e.createPoint():t},ae.prototype.interfaces_=function(){return[ne.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Ht?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Jt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[ne.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new R(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(e=3),e<2?new ue(t):new ue(t,e)}},ce.prototype.interfaces_=function(){return[P,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he);var pe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Et,e=this.map_.values(),r=e.next();!r.done;)t.add(r.value),r=e.next();return t},e.prototype.entrySet=function(){var t=new kt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(At),fe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ge){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var r=arguments[0];this._modelType=t.FIXED,this.setScale(r)}else if(arguments[0]instanceof t){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}},de={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fe.prototype.equals=function(t){if(!(t instanceof fe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fe.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),n=e.getMaximumSignificantDigits();return new N(r).compareTo(new N(n))},fe.prototype.getScale=function(){return this._scale},fe.prototype.isFloating=function(){return this._modelType===fe.FLOATING||this._modelType===fe.FLOATING_SINGLE},fe.prototype.getType=function(){return this._modelType},fe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fe.FLOATING?t="Floating":this._modelType===fe.FLOATING_SINGLE?t="Floating-Single":this._modelType===fe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return _.isNaN(t)||this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof I){var e=arguments[0];if(this._modelType===fe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fe.FLOATING?t=16:this._modelType===fe.FLOATING_SINGLE?t=6:this._modelType===fe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fe.prototype.setScale=function(t){this._scale=Math.abs(t)},fe.prototype.interfaces_=function(){return[e,b]},fe.prototype.getClass=function(){return fe},fe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},de.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},de.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,de);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new pe},Object.defineProperties(ge,ye),fe.Type=ge,fe.FIXED=new ge("FIXED"),fe.FLOATING=new ge("FLOATING"),fe.FLOATING_SINGLE=new ge("FLOATING SINGLE");var me=function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?A(arguments[0],P)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ve={serialVersionUID:{configurable:!0}};me.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new I(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new I(t.getMinX(),t.getMinY()),new I(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new I(t.getMinX(),t.getMinY()),new I(t.getMinX(),t.getMaxY()),new I(t.getMaxX(),t.getMaxY()),new I(t.getMaxX(),t.getMinY()),new I(t.getMinX(),t.getMinY())]),null)},me.prototype.createLineString=function(t){return t?t instanceof Array?new Ht(this.getCoordinateSequenceFactory().create(t),this):A(t,U)?new Ht(t,this):void 0:new Ht(this.getCoordinateSequenceFactory().create([]),this)},me.prototype.createMultiLineString=function(){return 0===arguments.length?new jt(null,this):1===arguments.length?new jt(arguments[0],this):void 0},me.prototype.buildGeometry=function(t){for(var e=null,r=!1,n=!1,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===e&&(e=a),a!==e&&(r=!0),o.isGeometryCollectionOrDerived()&&(n=!0)}if(null===e)return this.createGeometryCollection();if(r||n)return this.createGeometryCollection(me.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof $t)return this.createMultiPolygon(me.toPolygonArray(t));if(s instanceof Ht)return this.createMultiLineString(me.toLineStringArray(t));if(s instanceof Jt)return this.createMultiPoint(me.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},me.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},me.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(A(arguments[0],U))return new Jt(arguments[0],this)}},me.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},me.prototype.createPolygon=function(){if(0===arguments.length)return new $t(null,null,this);if(1===arguments.length){if(A(arguments[0],U)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var r=arguments[0];return this.createPolygon(r,null)}}else if(2===arguments.length)return new $t(arguments[0],arguments[1],this)},me.prototype.getSRID=function(){return this._SRID},me.prototype.createGeometryCollection=function(){return 0===arguments.length?new qt(null,this):1===arguments.length?new qt(arguments[0],this):void 0},me.prototype.createGeometry=function(t){return new ne(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},me.prototype.getPrecisionModel=function(){return this._precisionModel},me.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(A(arguments[0],U))return new ee(arguments[0],this)}},me.prototype.createMultiPolygon=function(){return 0===arguments.length?new re(null,this):1===arguments.length?new re(arguments[0],this):void 0},me.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(A(arguments[0],U)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(e.size()).fill(null),n=0;n=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e0&&this._minIndexthis._minCoord.y&&r.y>this._minCoord.y&&n===st.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Pe.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge().getCoordinates();if(e<0||e+1>=r.length)return-1;if(r[e].y===r[e+1].y)return-1;var n=Se.LEFT;return r[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=r,this._minCoord=e[r])},Pe.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Pe.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.isForward()&&this.checkForRightmostCoordinate(r)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Se.LEFT&&(this._orientedDe=this._minDe.getSym())},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe};var Me=function(t){function e(r,n){t.call(this,e.msgWithCoord(r,n)),this.pt=n?new I(n):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}($),Te=function(){this.array_=[]};Te.prototype.addLast=function(t){this.array_.push(t)},Te.prototype.removeFirst=function(){return this.array_.shift()},Te.prototype.isEmpty=function(){return 0===this.array_.length};var Ae=function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new Pe};Ae.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ae.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ae.prototype.computeNodeDepth=function(t){for(var e=null,r=t.getEdges().iterator();r.hasNext();){var n=r.next();if(n.isVisited()||n.getSym().isVisited()){e=n;break}}if(null===e)throw new Me("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ae.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Se.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ae.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ae.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Se.RIGHT)>=1&&e.getDepth(Se.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ae.prototype.computeDepths=function(t){var e=new kt,r=new Te,n=t.getNode();for(r.addLast(n),e.add(n),t.setVisited(!0);!r.isEmpty();){var i=r.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(r.addLast(s),e.add(s))}}}},Ae.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},Ae.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Z,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next().getEdge().getCoordinates(),n=0;nthis.location.length){var e=new Array(3).fill(null);e[Se.ON]=this.location[Se.ON],e[Se.LEFT]=M.NONE,e[Se.RIGHT]=M.NONE,this.location=e}for(var r=0;r1&&t.append(M.toLocationSymbol(this.location[Se.LEFT])),t.append(M.toLocationSymbol(this.location[Se.ON])),this.location.length>1&&t.append(M.toLocationSymbol(this.location[Se.RIGHT])),t.toString()},Le.prototype.setLocations=function(t,e,r){this.location[Se.ON]=t,this.location[Se.LEFT]=e,this.location[Se.RIGHT]=r},Le.prototype.get=function(t){return t1},Le.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Re.prototype.addPoints=function(t,e,r){var n=t.getCoordinates();if(e){var i=1;r&&(i=0);for(var o=i;o=0;s--)this._pts.add(n[s])}},Re.prototype.isHole=function(){return this._isHole},Re.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Re.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();)if(r.next().containsPoint(t))return!1;return!0},Re.prototype.addHole=function(t){this._holes.add(t)},Re.prototype.isShell=function(){return null===this._shell},Re.prototype.getLabel=function(){return this._label},Re.prototype.getEdges=function(){return this._edges},Re.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Re.prototype.getShell=function(){return this._shell},Re.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],r=arguments[0].getLocation(e,Se.RIGHT);if(r===M.NONE)return null;if(this._label.getLocation(e)===M.NONE)return this._label.setLocation(e,r),null}},Re.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Re.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(t)},Oe.prototype.isInResult=function(){return this._isInResult},Oe.prototype.isVisited=function(){return this._isVisited},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe};var ze=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new ke(0,M.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var r=M.NONE;if(r=this._label.getLocation(e),!t.isNull(e)){var n=t.getLocation(e);r!==M.BOUNDARY&&(r=n)}return r},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],r=arguments[1];null===this._label?this._label=new ke(e,r):this._label.setLocation(e,r)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof ke)for(var r=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(r,n);this._label.getLocation(n)===M.NONE&&this._label.setLocation(n,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=M.NONE;null!==this._label&&(e=this._label.getLocation(t));var r=null;switch(e){case M.BOUNDARY:r=M.INTERIOR;break;case M.INTERIOR:default:r=M.BOUNDARY}this._label.setLocation(t,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),Fe=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Fe.prototype.find=function(t){return this.nodeMap.get(t)},Fe.prototype.addNode=function(){if(arguments[0]instanceof I){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof ze){var r=arguments[0],n=this.nodeMap.get(r.getCoordinate());return null===n?(this.nodeMap.put(r.getCoordinate(),r),r):(n.mergeLabel(r),n)}},Fe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Fe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Fe.prototype.values=function(){return this.nodeMap.values()},Fe.prototype.getBoundaryNodes=function(t){for(var e=new Et,r=this.iterator();r.hasNext();){var n=r.next();n.getLabel().getLocation(t)===M.BOUNDARY&&e.add(n)}return e},Fe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var Be=function(){},Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.isNorthern=function(t){return t===Be.NE||t===Be.NW},Be.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Be.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var r=te?t:e)?3:r},Be.isInHalfPlane=function(t,e){return e===Be.SE?t===Be.SE||t===Be.SW:t===e||t===e+1},Be.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Be.NE:Be.SE:e>=0?Be.NW:Be.SW}if(arguments[0]instanceof I&&arguments[1]instanceof I){var r=arguments[0],n=arguments[1];if(n.x===r.x&&n.y===r.y)throw new v("Cannot compute the quadrant for two identical points "+r);return n.x>=r.x?n.y>=r.y?Be.NE:Be.SE:n.y>=r.y?Be.NW:Be.SW}},Ue.NE.get=function(){return 0},Ue.NW.get=function(){return 1},Ue.SW.get=function(){return 2},Ue.SE.get=function(){return 3},Object.defineProperties(Be,Ue);var Ve=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._edge=e,this.init(r,n),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}};Ve.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):r.addAll(a)}else n.add(o)}return n},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new Et,r=t.iterator();r.hasNext();){var n=r.next();if(n.isInResult()&&n.getLabel().isArea()&&null===n.getEdgeRing()){var i=new De(n,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next();n.isHole()&&n.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),n=r.getEnvelopeInternal(),i=r.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var u=s.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(n)&&st.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||a.contains(c))&&(o=u)}return o},Xe.prototype.findShell=function(t){for(var e=0,r=null,n=t.iterator();n.hasNext();){var i=n.next();i.isHole()||(r=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},Xe.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],r=arguments[1];Ge.linkResultDirectedEdges(r);var n=this.buildMaximalEdgeRings(e),i=new Et,o=this.buildMinimalEdgeRings(n,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var Ze=function(){};Ze.prototype.getBounds=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Ye=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ye.prototype.getItem=function(){return this._item},Ye.prototype.getBounds=function(){return this._bounds},Ye.prototype.interfaces_=function(){return[Ze,e]},Ye.prototype.getClass=function(){return Ye};var We=function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)};We.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},We.prototype.size=function(){return this._size},We.prototype.reorder=function(t){for(var e=null,r=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(r)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,r)},We.prototype.clear=function(){this._size=0,this._items.clear()},We.prototype.isEmpty=function(){return 0===this._size},We.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var He=function(){};He.prototype.visitItem=function(t){},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Ke=function(){};Ke.prototype.insert=function(t,e){},Ke.prototype.remove=function(t,e){},Ke.prototype.query=function(){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Je=function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Qe={serialVersionUID:{configurable:!0}};Je.prototype.getLevel=function(){return this._level},Je.prototype.size=function(){return this._childBoundables.size()},Je.prototype.getChildBoundables=function(){return this._childBoundables},Je.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Je.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Je.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Je.prototype.interfaces_=function(){return[Ze,e]},Je.prototype.getClass=function(){return Je},Qe.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Je,Qe);var $e=function(){};$e.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$e.min=function(t){return $e.sort(t),t.get(0)},$e.sort=function(t,e){var r=t.toArray();e?zt.sort(r,e):zt.sort(r);for(var n=t.iterator(),i=0,o=r.length;itr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(n)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new v("neither boundable is composite")},tr.prototype.isLeaves=function(){return!(tr.isComposite(this._boundable1)||tr.isComposite(this._boundable2))},tr.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},tr.prototype.expand=function(t,e,r,n){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new tr(o,e,this._itemDistance);a.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=r}},rr={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};er.prototype.getNodeCapacity=function(){return this._nodeCapacity},er.prototype.lastNode=function(t){return t.get(t.size()-1)},er.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var r=e.next();r instanceof Je?t+=this.size(r):r instanceof Ye&&(t+=1)}return t}},er.prototype.removeItem=function(t,e){for(var r=null,n=t.getChildBoundables().iterator();n.hasNext();){var i=n.next();i instanceof Ye&&i.getItem()===e&&(r=i)}return null!==r&&(t.getChildBoundables().remove(r),!0)},er.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Et:t}if(1===arguments.length){for(var e=arguments[0],r=new Et,n=e.getChildBoundables().iterator();n.hasNext();){var i=n.next();if(i instanceof Je){var o=this.itemsTree(i);null!==o&&r.add(o)}else i instanceof Ye?r.add(i.getItem()):et.shouldNeverReachHere()}return r.size()<=0?null:r}},er.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ye(t,e))},er.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];if(et.isTrue(r>-2),n.getLevel()===r)return i.add(n),null;for(var o=n.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Je?this.boundablesAtLevel(r,a,i):(et.isTrue(a instanceof Ye),-1===r&&i.add(a))}return null}},er.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var r=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,n)}else if(3===arguments.length)if(A(arguments[2],He)&&arguments[0]instanceof Object&&arguments[1]instanceof Je)for(var i=arguments[0],o=arguments[2],a=arguments[1].getChildBoundables(),s=0;st&&(t=n)}}return t+1}},er.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=new Et;r.add(this.createNode(e));var n=new Et(t);$e.sort(n,this.getComparator());for(var i=n.iterator();i.hasNext();){var o=i.next();this.lastNode(r).getChildBoundables().size()===this.getNodeCapacity()&&r.add(this.createNode(e)),this.lastNode(r).addChildBoundable(o)}return r},er.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},er.prototype.interfaces_=function(){return[e]},er.prototype.getClass=function(){return er},er.compareDoubles=function(t,e){return t>e?1:t0);for(var r=new Et,n=0;n0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],d=new Ye(arguments[0],arguments[1]),g=new tr(this.getRoot(),d,f);return this.nearestNeighbour(g)[0]}},r.prototype.interfaces_=function(){return[Ke,e]},r.prototype.getClass=function(){return r},r.centreX=function(t){return r.avg(t.getMinX(),t.getMaxX())},r.avg=function(t,e){return(t+e)/2},r.centreY=function(t){return r.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return ar},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,n){return t.compareDoubles(r.centreX(e.getBounds()),r.centreX(n.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,n){return t.compareDoubles(r.centreY(e.getBounds()),r.centreY(n.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(r,n),r}(er),ar=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var r=e.next();null===t?t=new Z(r.getBounds()):t.expandToInclude(r.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Je),sr=function(){};sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},sr.relativeSign=function(t,e){return te?1:0},sr.compare=function(t,e,r){if(e.equals2D(r))return 0;var n=sr.relativeSign(e.x,r.x),i=sr.relativeSign(e.y,r.y);switch(t){case 0:return sr.compareValue(n,i);case 1:return sr.compareValue(i,n);case 2:return sr.compareValue(i,-n);case 3:return sr.compareValue(-n,i);case 4:return sr.compareValue(-n,-i);case 5:return sr.compareValue(-i,-n);case 6:return sr.compareValue(-i,n);case 7:return sr.compareValue(n,-i)}return et.shouldNeverReachHere("invalid octant value"),0},sr.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ur=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._segString=t,this.coord=new I(e),this.segmentIndex=r,this._segmentOctant=n,this._isInterior=!e.equals2D(t.getCoordinate(r))};ur.prototype.getCoordinate=function(){return this.coord},ur.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ur.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:sr.compare(this._segmentOctant,this.coord,e.coord)},ur.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ur.prototype.isInterior=function(){return this._isInterior},ur.prototype.interfaces_=function(){return[b]},ur.prototype.getClass=function(){return ur};var lr=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};lr.prototype.getSplitCoordinates=function(){var t=new St;this.addEndpoints();for(var e=this.iterator(),r=e.next();e.hasNext();){var n=e.next();this.addEdgeCoordinates(r,n,t),r=n}return t.toCoordinateArray()},lr.prototype.addCollapsedNodes=function(){var t=new Et;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var r=e.next().intValue();this.add(this._edge.getCoordinate(r),r)}},lr.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},lr.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?r>=n?0:1:r>=n?7:6:e>=0?r>=n?3:2:r>=n?4:5}if(arguments[0]instanceof I&&arguments[1]instanceof I){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new v("Cannot compute the octant for two identical points "+i);return cr.octant(a,s)}};var hr=function(){};hr.prototype.getCoordinates=function(){},hr.prototype.size=function(){},hr.prototype.getCoordinate=function(t){},hr.prototype.isClosed=function(){},hr.prototype.setData=function(t){},hr.prototype.getData=function(){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var pr=function(){};pr.prototype.addIntersection=function(t,e){},pr.prototype.interfaces_=function(){return[hr]},pr.prototype.getClass=function(){return pr};var fr=function(){this._nodeList=new lr(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};fr.prototype.getCoordinates=function(){return this._pts},fr.prototype.size=function(){return this._pts.length},fr.prototype.getCoordinate=function(t){return this._pts[t]},fr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},fr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},fr.prototype.setData=function(t){this._data=t},fr.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:cr.octant(t,e)},fr.prototype.getData=function(){return this._data},fr.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var r=arguments[1],n=arguments[3],i=new I(arguments[0].getIntersection(n));this.addIntersection(i,r)}},fr.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},fr.prototype.getNodeList=function(){return this._nodeList},fr.prototype.addIntersectionNode=function(t,e){var r=e,n=r+1;if(n=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}if(arguments[0]instanceof I){var n=arguments[0];return st.orientationIndex(this.p0,this.p1,n)}},dr.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dr.prototype.isVertical=function(){return this.p0.x===this.p1.x},dr.prototype.equals=function(t){if(!(t instanceof dr))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dr.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dr.prototype.project=function(){if(arguments[0]instanceof I){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new I(t);var e=this.projectionFactor(t),r=new I;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof dr){var n=arguments[0],i=this.projectionFactor(n.p0),o=this.projectionFactor(n.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(n.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(n.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new dr(a,s)}},dr.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dr.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dr.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dr.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},dr.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dr.prototype.midPoint=function(){return dr.midPoint(this.p0,this.p1)},dr.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,n=e*e+r*r;return n<=0?_.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/n},dr.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var r=new Array(2).fill(null),n=_.MAX_VALUE,i=null,o=this.closestPoint(t.p0);n=o.distance(t.p0),r[0]=o,r[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||_.isNaN(e))&&(e=1),e},dr.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dr.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dr.prototype.distance=function(){if(arguments[0]instanceof dr){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof I){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},dr.prototype.pointAlong=function(t){var e=new I;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},dr.prototype.hashCode=function(){var t=_.doubleToLongBits(this.p0.x);t^=31*_.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),r=_.doubleToLongBits(this.p1.x);return r^=31*_.doubleToLongBits(this.p1.y),e^Math.trunc(r)^Math.trunc(r>>32)},dr.prototype.interfaces_=function(){return[b,e]},dr.prototype.getClass=function(){return dr},dr.midPoint=function(t,e){return new I((t.x+e.x)/2,(t.y+e.y)/2)},gr.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dr,gr);var yr=function(){this.tempEnv1=new Z,this.tempEnv2=new Z,this._overlapSeg1=new dr,this._overlapSeg2=new dr};yr.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],r=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var mr=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=n};mr.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},mr.prototype.computeSelect=function(t,e,r,n){var i=this._pts[e],o=this._pts[r];if(n.tempEnv1.init(i,o),r-e==1)return n.select(this,e),null;if(!t.intersects(n.tempEnv1))return null;var a=Math.trunc((e+r)/2);e=t.length-1)return t.length-1;for(var n=Be.quadrant(t[r],t[r+1]),i=e+1;ir.getId()&&(r.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.SegmentOverlapAction.get=function(){return wr},Object.defineProperties(e,r),e}(xr),wr=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],r=arguments[2],n=arguments[3],i=arguments[0].getContext(),o=r.getContext();this._si.processIntersections(i,e,o,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yr),Er=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.setQuadrantSegments(r),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},Ir={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Er.prototype.getEndCapStyle=function(){return this._endCapStyle},Er.prototype.isSingleSided=function(){return this._isSingleSided},Er.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Er.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Er.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Er.JOIN_ROUND&&(this._quadrantSegments=Er.DEFAULT_QUADRANT_SEGMENTS)},Er.prototype.getJoinStyle=function(){return this._joinStyle},Er.prototype.setJoinStyle=function(t){this._joinStyle=t},Er.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Er.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Er.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Er.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Er.prototype.getMitreLimit=function(){return this._mitreLimit},Er.prototype.setMitreLimit=function(t){this._mitreLimit=t},Er.prototype.setSingleSided=function(t){this._isSingleSided=t},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er},Er.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Ir.CAP_ROUND.get=function(){return 1},Ir.CAP_FLAT.get=function(){return 2},Ir.CAP_SQUARE.get=function(){return 3},Ir.JOIN_ROUND.get=function(){return 1},Ir.JOIN_MITRE.get=function(){return 2},Ir.JOIN_BEVEL.get=function(){return 3},Ir.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ir.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ir.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Er,Ir);var Sr=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},Cr={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Sr.prototype.isDeletable=function(t,e,r,n){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[r];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,n)&&this.isShallowSampled(i,o,t,r,n)},Sr.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(e),n=!1;r=0;n--)this.addPt(t[n])},Pr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=Tr.PI_TIMES_2;for(;t<=-Math.PI;)t+=Tr.PI_TIMES_2;return t},Tr.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],r=arguments[1],n=r.x-e.x,i=r.y-e.y;return Math.atan2(i,n)}},Tr.isAcute=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)>0},Tr.isObtuse=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)<0},Tr.interiorAngle=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r);return Math.abs(i-n)},Tr.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Tr.PI_TIMES_2;t>=Tr.PI_TIMES_2&&(t=0)}else{for(;t>=Tr.PI_TIMES_2;)t-=Tr.PI_TIMES_2;t<0&&(t=0)}return t},Tr.angleBetween=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r);return Tr.diff(n,i)},Tr.diff=function(t,e){var r=null;return(r=tMath.PI&&(r=2*Math.PI-r),r},Tr.toRadians=function(t){return t*Math.PI/180},Tr.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?Tr.COUNTERCLOCKWISE:r<0?Tr.CLOCKWISE:Tr.NONE},Tr.angleBetweenOriented=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r)-n;return i<=-Math.PI?i+Tr.PI_TIMES_2:i>Math.PI?i-Tr.PI_TIMES_2:i},Ar.PI_TIMES_2.get=function(){return 2*Math.PI},Ar.PI_OVER_2.get=function(){return Math.PI/2},Ar.PI_OVER_4.get=function(){return Math.PI/4},Ar.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},Ar.CLOCKWISE.get=function(){return st.CLOCKWISE},Ar.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Tr,Ar);var Lr=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new dr,this._seg1=new dr,this._offset0=new dr,this._offset1=new dr,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=r,this._li=new it,this._filletAngleQuantum=Math.PI/2/r.getQuadrantSegments(),r.getQuadrantSegments()>=8&&r.getJoinStyle()===Er.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},kr={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Lr.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=st.computeOrientation(this._s0,this._s1,this._s2),n=r===st.CLOCKWISE&&this._side===Se.LEFT||r===st.COUNTERCLOCKWISE&&this._side===Se.RIGHT;0===r?this.addCollinear(e):n?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},Lr.prototype.addLineEndCap=function(t,e){var r=new dr(t,e),n=new dr;this.computeOffsetSegment(r,Se.LEFT,this._distance,n);var i=new dr;this.computeOffsetSegment(r,Se.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Er.CAP_ROUND:this._segList.addPt(n.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Er.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(i.p1);break;case Er.CAP_SQUARE:var u=new I;u.x=Math.abs(this._distance)*Math.cos(s),u.y=Math.abs(this._distance)*Math.sin(s);var l=new I(n.p1.x+u.x,n.p1.y+u.y),c=new I(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},Lr.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Lr.prototype.addMitreJoin=function(t,e,r,n){var i=!0,o=null;try{o=X.intersection(e.p0,e.p1,r.p0,r.p1),(n<=0?1:o.distance(t)/Math.abs(n))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof j))throw t;o=new I(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,r,n,this._bufParams.getMitreLimit())},Lr.prototype.addFilletCorner=function(t,e,r,n,i){var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o),u=r.x-t.x,l=r.y-t.y,c=Math.atan2(l,u);n===st.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,n,i),this._segList.addPt(r)},Lr.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var r=new I((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var n=new I((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Lr.prototype.createCircle=function(t){var e=new I(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Lr.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Lr.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Pr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Lr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Lr.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Er.JOIN_BEVEL||this._bufParams.getJoinStyle()===Er.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,st.CLOCKWISE,this._distance))},Lr.prototype.closeRing=function(){this._segList.closeRing()},Lr.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},kr.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},kr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},kr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},kr.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Lr,kr);var Rr=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Rr.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var r=e<0,n=Math.abs(e),i=this.getSegGen(n);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,r,i);var o=i.getCoordinates();return r&&Ct.reverse(o),o},Rr.prototype.computeSingleSidedBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var i=Sr.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],Se.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{r.addSegments(t,!1);var s=Sr.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],Se.LEFT),r.addFirstSegment();for(var l=2;l<=u;l++)r.addNextSegment(s[l],!0)}r.addLastSegment(),r.closeRing()},Rr.prototype.computeRingBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);e===Se.RIGHT&&(n=-n);var i=Sr.simplify(t,n),o=i.length-1;r.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;r.addNextSegment(i[a],s)}r.closeRing()},Rr.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),n=Sr.simplify(t,r),i=n.length-1;e.initSideSegments(n[0],n[1],Se.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(n[o],!0);e.addLastSegment(),e.addLineEndCap(n[i-1],n[i]);var a=Sr.simplify(t,-r),s=a.length-1;e.initSideSegments(a[s],a[s-1],Se.LEFT);for(var u=s-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},Rr.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Er.CAP_ROUND:e.createCircle(t);break;case Er.CAP_SQUARE:e.createSquare(t)}},Rr.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var r=Math.abs(e),n=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],n);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,n)}else this.computeLineBufferCurve(t,n);return n.getCoordinates()},Rr.prototype.getBufferParameters=function(){return this._bufParams},Rr.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Rr.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return Rr.copyCoordinates(t);var n=this.getSegGen(r);return this.computeRingBufferCurve(t,e,n),n.getCoordinates()},Rr.prototype.computeOffsetCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){var i=Sr.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],Se.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{var s=Sr.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],Se.LEFT),r.addFirstSegment();for(var l=2;l<=u;l++)r.addNextSegment(s[l],!0)}r.addLastSegment()},Rr.prototype.getSegGen=function(t){return new Lr(this._precisionModel,this._bufParams,t)},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;ri.getMaxY()||this.findStabbedSegments(t,n.getDirectedEdges(),e)}return e}if(3===arguments.length)if(A(arguments[2],wt)&&arguments[0]instanceof I&&arguments[1]instanceof qe){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=a.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,o)===st.RIGHT)){var c=a.getDepth(Se.LEFT);this._seg.p0.equals(u[l])||(c=a.getDepth(Se.RIGHT));var h=new Or(this._seg,c);s.add(h)}}else if(A(arguments[2],wt)&&arguments[0]instanceof I&&A(arguments[1],wt))for(var p=arguments[0],f=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(p,g,f)}},Nr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:$e.min(e)._leftDepth},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Dr.DepthSegment.get=function(){return Or},Object.defineProperties(Nr,Dr);var Or=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dr(t),this._leftDepth=e};Or.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==r||0!=(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?r:this._upwardSeg.compareTo(e._upwardSeg)},Or.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return 0!==r?r:t.p1.compareTo(e.p1)},Or.prototype.toString=function(){return this._upwardSeg.toString()},Or.prototype.interfaces_=function(){return[b]},Or.prototype.getClass=function(){return Or};var zr=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};zr.prototype.area=function(){return zr.area(this.p0,this.p1,this.p2)},zr.prototype.signedArea=function(){return zr.signedArea(this.p0,this.p1,this.p2)},zr.prototype.interpolateZ=function(t){if(null===t)throw new v("Supplied point is null.");return zr.interpolateZ(t,this.p0,this.p1,this.p2)},zr.prototype.longestSideLength=function(){return zr.longestSideLength(this.p0,this.p1,this.p2)},zr.prototype.isAcute=function(){return zr.isAcute(this.p0,this.p1,this.p2)},zr.prototype.circumcentre=function(){return zr.circumcentre(this.p0,this.p1,this.p2)},zr.prototype.area3D=function(){return zr.area3D(this.p0,this.p1,this.p2)},zr.prototype.centroid=function(){return zr.centroid(this.p0,this.p1,this.p2)},zr.prototype.inCentre=function(){return zr.inCentre(this.p0,this.p1,this.p2)},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},zr.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},zr.det=function(t,e,r,n){return t*n-e*r},zr.interpolateZ=function(t,e,r,n){var i=e.x,o=e.y,a=r.x-i,s=n.x-i,u=r.y-o,l=n.y-o,c=a*l-s*u,h=t.x-i,p=t.y-o,f=(l*h-s*p)/c,d=(-u*h+a*p)/c;return e.z+f*(r.z-e.z)+d*(n.z-e.z)},zr.longestSideLength=function(t,e,r){var n=t.distance(e),i=e.distance(r),o=r.distance(t),a=n;return i>a&&(a=i),o>a&&(a=o),a},zr.isAcute=function(t,e,r){return!!Tr.isAcute(t,e,r)&&!!Tr.isAcute(e,r,t)&&!!Tr.isAcute(r,t,e)},zr.circumcentre=function(t,e,r){var n=r.x,i=r.y,o=t.x-n,a=t.y-i,s=e.x-n,u=e.y-i,l=2*zr.det(o,a,s,u),c=zr.det(a,o*o+a*a,u,s*s+u*u),h=zr.det(o,o*o+a*a,s,s*s+u*u);return new I(n-c/l,i+h/l)},zr.perpendicularBisector=function(t,e){var r=e.x-t.x,n=e.y-t.y,i=new X(t.x+r/2,t.y+n/2,1),o=new X(t.x-n+r/2,t.y+r+n/2,1);return new X(i,o)},zr.angleBisector=function(t,e,r){var n=e.distance(t),i=n/(n+e.distance(r)),o=r.x-t.x,a=r.y-t.y;return new I(t.x+i*o,t.y+i*a)},zr.area3D=function(t,e,r){var n=e.x-t.x,i=e.y-t.y,o=e.z-t.z,a=r.x-t.x,s=r.y-t.y,u=r.z-t.z,l=i*u-o*s,c=o*a-n*u,h=n*s-i*a,p=l*l+c*c+h*h;return Math.sqrt(p)/2},zr.centroid=function(t,e,r){var n=(t.x+e.x+r.x)/3,i=(t.y+e.y+r.y)/3;return new I(n,i)},zr.inCentre=function(t,e,r){var n=e.distance(r),i=t.distance(r),o=t.distance(e),a=n+i+o,s=(n*t.x+i*e.x+o*r.x)/a,u=(n*t.y+i*e.y+o*r.y)/a;return new I(s,u)};var Fr=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};Fr.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,M.EXTERIOR,M.INTERIOR)},Fr.prototype.addPolygon=function(t){var e=this._distance,r=Se.LEFT;this._distance<0&&(e=-this._distance,r=Se.RIGHT);var n=t.getExteriorRing(),i=Ct.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,r,M.EXTERIOR,M.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,e,Se.opposite(r),M.INTERIOR,M.EXTERIOR)}},Fr.prototype.isTriangleErodedCompletely=function(t,e){var r=new zr(t[0],t[1],t[2]),n=r.inCentre();return st.distancePointLine(n,r.p0,r.p1)=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(o=i,a=n,r=Se.opposite(r));var s=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(s,o,a)},Fr.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $t?this.addPolygon(t):t instanceof Ht?this.addLineString(t):t instanceof Jt?this.addPoint(t):(t instanceof te||t instanceof jt||t instanceof re||t instanceof qt)&&this.addCollection(t)},Fr.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(4===r.length)return this.isTriangleErodedCompletely(r,e);var n=t.getEnvelopeInternal(),i=Math.min(n.getHeight(),n.getWidth());return e<0&&2*Math.abs(e)>i},Fr.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new n;var t=this._parent.getGeometryN(this._index++);return t instanceof qt?(this._subcollectionIterator=new Ur(t),this._subcollectionIterator.next()):t},Ur.prototype.remove=function(){throw new Error(this.getClass().getName())},Ur.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Ur.prototype.interfaces_=function(){return[bt]},Ur.prototype.getClass=function(){return Ur},Ur.isAtomic=function(t){return!(t instanceof qt)};var Vr=function(){this._geom=null;var t=arguments[0];this._geom=t};Vr.prototype.locate=function(t){return Vr.locate(t,this._geom)},Vr.prototype.interfaces_=function(){return[Br]},Vr.prototype.getClass=function(){return Vr},Vr.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},Vr.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Vr.isPointInRing(t,r))return!1;for(var n=0;n=0;r--){var n=this._edgeList.get(r),i=n.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=n}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),r=t.getDepth(Se.LEFT),n=t.getDepth(Se.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),r);if(this.computeDepths(0,e,i)!==n)throw new Me("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],a=arguments[2],s=arguments[0];s=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),n){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;r=a,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;r.setNextMin(o),n=this._SCANNING_FOR_INCOMING}}n===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),r.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var r=arguments[0],n=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===r&&n++;return n}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=M.NONE,e=this.iterator();e.hasNext();){var r=e.next(),n=r.getSym();if(!r.isLineEdge()){if(r.isInResult()){t=M.INTERIOR;break}if(n.isInResult()){t=M.EXTERIOR;break}}}if(t===M.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===M.INTERIOR):(a.isInResult()&&(i=M.EXTERIOR),s.isInResult()&&(i=M.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new ke(M.NONE);for(var r=this.iterator();r.hasNext();)for(var n=r.next().getEdge().getLabel(),i=0;i<2;i++){var o=n.getLocation(i);o!==M.INTERIOR&&o!==M.BOUNDARY||this._label.setLocation(i,M.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(qr),Gr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new ze(t,new jr)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),Xr=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Xr.prototype.compareTo=function(t){var e=t;return Xr.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Xr.prototype.interfaces_=function(){return[b]},Xr.prototype.getClass=function(){return Xr},Xr.orientation=function(t){return 1===Ct.increasingDirection(t)},Xr.compareOriented=function(t,e,r,n){for(var i=e?1:-1,o=n?1:-1,a=e?t.length:-1,s=n?r.length:-1,u=e?0:t.length-1,l=n?0:r.length-1;;){var c=t[u].compareTo(r[l]);if(0!==c)return c;var h=(u+=i)===a,p=(l+=o)===s;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Zr=function(){this._edges=new Et,this._ocaMap=new h};Zr.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var n=r.getCoordinates(),i=0;i0&&t.print(","),t.print(n[i].x+" "+n[i].y);t.println(")")}t.print(") ")},Zr.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Zr.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(n);i||r--;var o=new Array(r).fill(null),a=0;o[a++]=new I(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new en(o,new ke(this.edge._label))},Kr.prototype.add=function(t,e,r){var n=new Hr(t,e,r),i=this._nodeMap.get(n);return null!==i?i:(this._nodeMap.put(n,n),n)},Kr.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr};var Jr=function(){};Jr.prototype.getChainStartIndices=function(t){var e=0,r=new Et;r.add(new N(e));do{var n=this.findChainEnd(t,e);r.add(new N(n)),e=n}while(er?e:r},Qr.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return ee&&(n=1),this._depth[t][r]=n}}},$r.prototype.getDelta=function(t){return this._depth[t][Se.RIGHT]-this._depth[t][Se.LEFT]},$r.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?M.EXTERIOR:M.INTERIOR},$r.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},$r.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var r=1;r<3;r++){var n=t.getLocation(e,r);n!==M.EXTERIOR&&n!==M.INTERIOR||(this.isNull(e,r)?this._depth[e][r]=$r.depthAtLocation(n):this._depth[e][r]+=$r.depthAtLocation(n))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===M.INTERIOR&&this._depth[i][o]++}},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.depthAtLocation=function(t){return t===M.EXTERIOR?0:t===M.INTERIOR?1:$r.NULL_VALUE},tn.NULL_VALUE.get=function(){return-1},Object.defineProperties($r,tn);var en=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kr(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new $r,this._depthDelta=0,1===arguments.length){var r=arguments[0];e.call(this,r,null)}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,ke.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;if(this.pts.length!==r.pts.length)return!1;for(var n=!0,i=!0,o=this.pts.length,a=0;a0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Qr(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Z;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;en||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(a&&s),"Found bad envelope test"),s},sn.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new I(this._maxx,this._maxy),this._corner[1]=new I(this._minx,this._maxy),this._corner[2]=new I(this._minx,this._miny),this._corner[3]=new I(this._maxx,this._miny)},sn.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sn.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sn.prototype.getCoordinate=function(){return this._originalPt},sn.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sn.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sn.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Z(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sn.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},sn.prototype.intersectsToleranceSquare=function(t,e){var r=!1,n=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||r&&n||t.equals(this._pt)||e.equals(this._pt)))))},sn.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),n=t.getCoordinate(e+1);return!!this.intersects(r,n)&&(t.addIntersection(this.getCoordinate(),e),!0)},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},un.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sn,un);var ln=function(){this.tempEnv1=new Z,this.selectedSegment=new dr};ln.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var cn=function(){this._index=null;var t=arguments[0];this._index=t},hn={HotPixelSnapAction:{configurable:!0}};cn.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2],i=e.getSafeEnvelope(),o=new pn(e,r,n);return this._index.query(i,{interfaces_:function(){return[He]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},hn.HotPixelSnapAction.get=function(){return pn},Object.defineProperties(cn,hn);var pn=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],r=arguments[0].getContext();if(null!==this._parentEdge&&r===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ln),fn=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Et};fn.prototype.processIntersections=function(t,e,r,n){if(t===r&&e===n)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Me))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var r=arguments[0],n=gn.precisionScaleFactor(this._argGeom,this._distance,r),i=new fe(n);this.bufferFixedPrecision(i)}},gn.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gn.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gn.prototype.bufferOriginalPrecision=function(){try{var t=new rn(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof $))throw t;this._saveException=t}},gn.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gn.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn},gn.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new gn(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],r=arguments[2],n=new gn(arguments[0]);return n.setQuadrantSegments(r),n.getResultGeometry(e)}if(arguments[2]instanceof Er&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var i=arguments[1];return new gn(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],a=arguments[2],s=arguments[3],u=new gn(arguments[0]);return u.setQuadrantSegments(a),u.setEndCapStyle(s),u.getResultGeometry(o)}},gn.precisionScaleFactor=function(t,e,r){var n=t.getEnvelopeInternal(),i=L.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY()))+2*(e>0?e:0),o=r-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},yn.CAP_ROUND.get=function(){return Er.CAP_ROUND},yn.CAP_BUTT.get=function(){return Er.CAP_FLAT},yn.CAP_FLAT.get=function(){return Er.CAP_FLAT},yn.CAP_SQUARE.get=function(){return Er.CAP_SQUARE},yn.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gn,yn);var mn=function(){this._pt=[new I,new I],this._distance=_.NaN,this._isNull=!0};mn.prototype.getCoordinates=function(){return this._pt},mn.prototype.getCoordinate=function(t){return this._pt[t]},mn.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var n=e.distance(r);nthis._distance&&this.initialize(e,r,n)}},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var vn=function(){};vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.computeDistance=function(){if(arguments[2]instanceof mn&&arguments[0]instanceof Ht&&arguments[1]instanceof I)for(var t=arguments[1],e=arguments[2],r=arguments[0].getCoordinates(),n=new dr,i=0;i0||this._isIn?M.INTERIOR:M.EXTERIOR)},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn};var Cn=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._component=e,this._segIndex=r,this._pt=n}},Pn={INSIDE_AREA:{configurable:!0}};Cn.prototype.isInsideArea=function(){return this._segIndex===Cn.INSIDE_AREA},Cn.prototype.getCoordinate=function(){return this._pt},Cn.prototype.getGeometryComponent=function(){return this._component},Cn.prototype.getSegmentIndex=function(){return this._segIndex},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Pn.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Cn,Pn);var Mn=function(t){this._pts=t||null};Mn.prototype.filter=function(t){t instanceof Jt&&this._pts.add(t)},Mn.prototype.interfaces_=function(){return[Ut]},Mn.prototype.getClass=function(){return Mn},Mn.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Jt?$e.singletonList(t):Mn.getPoints(t,new Et)}if(2===arguments.length){var e=arguments[0],r=arguments[1];return e instanceof Jt?r.add(e):e instanceof qt&&e.apply(new Mn(r)),r}};var Tn=function(){this._locations=null;var t=arguments[0];this._locations=t};Tn.prototype.filter=function(t){(t instanceof Jt||t instanceof Ht||t instanceof $t)&&this._locations.add(new Cn(t,0,t.getCoordinate()))},Tn.prototype.interfaces_=function(){return[Ut]},Tn.prototype.getClass=function(){return Tn},Tn.getLocations=function(t){var e=new Et;return t.apply(new Tn(e)),e};var An=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Sn,this._minDistanceLocation=null,this._minDistance=_.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=n,this._terminateDistance=i}};An.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=1-e,i=En.getPolygons(this._geom[e]);if(i.size()>0){var o=Tn.getLocations(this._geom[n]);if(this.computeContainmentDistance(o,i,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=r[0],this._minDistanceLocation[e]=r[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&A(arguments[0],wt)&&A(arguments[1],wt)){for(var a=arguments[0],s=arguments[1],u=arguments[2],l=0;lthis._minDistance)return null;for(var n=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var h=u.getCoordinates(),p=l.getCoordinates(),f=0;fthis._distance&&this.initialize(e,r,n)}},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln};var kn=function(){};kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.computeDistance=function(){if(arguments[2]instanceof Ln&&arguments[0]instanceof Ht&&arguments[1]instanceof I)for(var t=arguments[0],e=arguments[1],r=arguments[2],n=new dr,i=t.getCoordinates(),o=0;o1||t<=0)throw new v("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Rn.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Rn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Rn.prototype.computeOrientedDistance=function(t,e,r){var n=new Dn(e);if(t.apply(n),r.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var i=new On(e,this._densifyFrac);t.apply(i),r.setMaximum(i.getMaxPointDistance())}},Rn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},Rn.distance=function(){if(2===arguments.length)return new Rn(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Rn(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Nn.MaxPointDistanceFilter.get=function(){return Dn},Nn.MaxDensifiedByFractionDistanceFilter.get=function(){return On},Object.defineProperties(Rn,Nn);var Dn=function(){this._maxPtDist=new Ln,this._minPtDist=new Ln,this._euclideanDist=new kn,this._geom=null;var t=arguments[0];this._geom=t};Dn.prototype.filter=function(t){this._minPtDist.initialize(),kn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Dn.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dn.prototype.interfaces_=function(){return[ft]},Dn.prototype.getClass=function(){return Dn};var On=function(){this._maxPtDist=new Ln,this._minPtDist=new Ln,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};On.prototype.filter=function(t,e){if(0===e)return null;for(var r=t.getCoordinate(e-1),n=t.getCoordinate(e),i=(n.x-r.x)/this._numSubSegs,o=(n.y-r.y)/this._numSubSegs,a=0;ar){this._isValid=!1;var i=n.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Q.toLineString(i[0],i[1])+")"}},zn.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=zn.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),zn.VERBOSE&&G.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},zn.prototype.checkNegativeValid=function(){if(!(this._input instanceof $t||this._input instanceof re||this._input instanceof qt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},zn.prototype.getErrorIndicator=function(){return this._errorIndicator},zn.prototype.checkMinimumDistance=function(t,e,r){var n=new An(t,e,r);if(this._minDistanceFound=n.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Bn.prototype.report=function(t){if(!Bn.VERBOSE)return null;G.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Bn.prototype.getErrorMessage=function(){return this._errorMsg},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Bn.isValidMsg=function(t,e,r){var n=new Bn(t,e,r);return n.isValid()?null:n.getErrorMessage()},Bn.isValid=function(t,e,r){return!!new Bn(t,e,r).isValid()},Un.VERBOSE.get=function(){return!1},Un.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Bn,Un);var Vn=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Vn.prototype.getCoordinates=function(){return this._pts},Vn.prototype.size=function(){return this._pts.length},Vn.prototype.getCoordinate=function(t){return this._pts[t]},Vn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Vn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:cr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Vn.prototype.setData=function(t){this._data=t},Vn.prototype.getData=function(){return this._data},Vn.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},Vn.prototype.interfaces_=function(){return[hr]},Vn.prototype.getClass=function(){return Vn};var qn=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};qn.prototype.getInteriorIntersection=function(){return this._interiorIntersection},qn.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},qn.prototype.getIntersectionSegments=function(){return this._intSegments},qn.prototype.count=function(){return this._intersectionCount},qn.prototype.getIntersections=function(){return this._intersections},qn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qn.prototype.setKeepIntersections=function(t){this._keepIntersections=t},qn.prototype.processIntersections=function(t,e,r,n){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===r&&e===n)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(r,n))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},qn.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},qn.prototype.hasIntersection=function(){return null!==this._interiorIntersection},qn.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},qn.prototype.interfaces_=function(){return[Yr]},qn.prototype.getClass=function(){return qn},qn.createAllIntersectionsFinder=function(t){var e=new qn(t);return e.setFindAllIntersections(!0),e},qn.createAnyIntersectionFinder=function(t){return new qn(t)},qn.createIntersectionCounter=function(t){var e=new qn(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var jn=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};jn.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jn.prototype.getIntersections=function(){return this._segInt.getIntersections()},jn.prototype.isValid=function(){return this.execute(),this._isValid},jn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jn.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new qn(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new br;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jn.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Me(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jn.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Q.toLineString(t[0],t[1])+" and "+Q.toLineString(t[2],t[3])},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.computeIntersections=function(t){var e=new jn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Gn=function t(){this._nv=null;var e=arguments[0];this._nv=new jn(t.toSegmentStrings(e))};Gn.prototype.checkValid=function(){this._nv.checkValid()},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn},Gn.toSegmentStrings=function(t){for(var e=new Et,r=t.iterator();r.hasNext();){var n=r.next();e.add(new Vn(n.getCoordinates(),n))}return e},Gn.checkValid=function(t){new Gn(t).checkValid()};var Xn=function(t){this._mapOp=t};Xn.prototype.map=function(t){for(var e=new Et,r=0;r0&&n<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var Hn=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dr,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Ht&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],n=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=n}};Hn.prototype.snapVertices=function(t,e){for(var r=this._isClosed?t.size()-1:t.size(),n=0;n=0&&t.add(o+1,new I(i),!1)}},Hn.prototype.findSegmentIndexToSnap=function(t,e){for(var r=_.MAX_VALUE,n=-1,i=0;ie&&(e=n)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Kn.computeOverlaySnapTolerance(i),Kn.computeOverlaySnapTolerance(o))}},Kn.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Kn.SNAP_PRECISION_FACTOR},Kn.snapToSelf=function(t,e,r){return new Kn(t).snapToSelf(e,r)},Jn.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kn,Jn);var Qn=function(t){function e(e,r,n){t.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=void 0!==n&&n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var r=new Hn(t,this._snapTolerance);return r.setAllowSnappingToSourceVertices(this._isSelfSnap),r.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var r=t.toCoordinateArray(),n=this.snapLine(r,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wn),$n=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};$n.prototype.getCommon=function(){return _.longBitsToDouble(this._commonBits)},$n.prototype.add=function(t){var e=_.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=$n.signExpBits(this._commonBits),this._isFirst=!1,null):$n.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=$n.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=$n.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},$n.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=_.longBitsToDouble(t),r="0000000000000000000000000000000000000000000000000000000000000000"+_.toBinaryString(t),n=r.substring(r.length-64);return n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]"}},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.getBit=function(t,e){return 0!=(t&1<>52},$n.zeroLowerBits=function(t,e){return t&~((1<=0;n--){if($n.getBit(t,n)!==$n.getBit(e,n))return r;r++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ri},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ni(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new I(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new ni(e);return t.apply(r),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ri},ei.Translater.get=function(){return ni},Object.defineProperties(ti,ei);var ri=function(){this._commonBitsX=new $n,this._commonBitsY=new $n};ri.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ri.prototype.getCommonCoordinate=function(){return new I(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ri.prototype.interfaces_=function(){return[ft]},ri.prototype.getClass=function(){return ri};var ni=function(){this.trans=null;var t=arguments[0];this.trans=t};ni.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,n=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,n)},ni.prototype.isDone=function(){return!1},ni.prototype.isGeometryChanged=function(){return!0},ni.prototype.interfaces_=function(){return[Vt]},ni.prototype.getClass=function(){return ni};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new Kn(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=Ci.overlayOp(e[0],e[1],t);return this.prepareResult(r)},ii.prototype.checkValid=function(t){t.isValid()||G.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Kn.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Kn.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,r){return new ii(t,e).getResultGeometry(r)},ii.union=function(t,e){return ii.overlayOp(t,e,Ci.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Ci.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Ci.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Ci.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,r=!1,n=null;try{e=Ci.overlayOp(this._geom[0],this._geom[1],t),r=!0}catch(t){if(!(t instanceof $))throw t;n=t}if(!r)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof $?n:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,r){return new oi(t,e).getResultGeometry(r)},oi.union=function(t,e){return oi.overlayOp(t,e,Ci.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Ci.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Ci.DIFFERENCE)};var ai=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};ai.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var si=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],r=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=r}else if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=n,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};si.prototype.isDelete=function(){return this._eventType===si.DELETE},si.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},si.prototype.getObject=function(){return this._obj},si.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},si.prototype.getInsertEvent=function(){return this._insertEvent},si.prototype.isInsert=function(){return this._eventType===si.INSERT},si.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},si.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},si.prototype.interfaces_=function(){return[b]},si.prototype.getClass=function(){return si},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(si,ui);var li=function(){};li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var ci=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};ci.prototype.isTrivialIntersection=function(t,e,r,n){if(t===r&&1===this._li.getIntersectionNum()){if(ci.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&n===i||0===n&&e===i)return!0}}return!1},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next().getCoordinate();if(t.isIntersection(n))return!0}return!1},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.prototype.addIntersections=function(t,e,r,n){if(t===r&&e===n)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,n)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),r.addIntersections(this._li,n,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var hi=function(t){function e(){t.call(this),this.events=new Et,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$e.sort(this.events);for(var t=0;te||this._maxo?1:0},di.prototype.interfaces_=function(){return[E]},di.prototype.getClass=function(){return di};var gi=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],r=arguments[1],n=arguments[2];this._min=e,this._max=r,this._item=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;r.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),yi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,r),null!==this._node2&&this._node2.query(t,e,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),mi=function(){this._leaves=new Et,this._root=null,this._level=0};mi.prototype.buildTree=function(){$e.sort(this._leaves,new pi.NodeComparator);for(var t=this._leaves,e=null,r=new Et;;){if(this.buildLevel(t,r),1===r.size())return r.get(0);e=t,t=r,r=e}},mi.prototype.insert=function(t,e,r){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new gi(t,e,r))},mi.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(t){G.out.println(Q.toLineString(new I(t._min,this._level),new I(t._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),r=0,n=t.iterator();n.hasNext();){var i=n.next();e[r++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,r){if(this.isBoundaryNode(t,e))return null;r===M.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,r)},e.prototype.addPolygonRing=function(t,e,r){if(t.isEmpty())return null;var n=Ct.removeRepeatedPoints(t.getCoordinates());if(n.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var i=e,o=r;st.isCCW(n)&&(i=r,o=e);var a=new en(n,new ke(this._argIndex,M.BOUNDARY,i,o));this._lineEdgeMap.put(t,a),this.insertEdge(a),this.insertPoint(this._argIndex,n[0],M.BOUNDARY)},e.prototype.insertPoint=function(t,e,r){var n=this._nodes.addNode(e),i=n.getLabel();null===i?n._label=new ke(t,r):i.setLocation(t,r)},e.prototype.createEdgeSetIntersector=function(){return new hi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var r=e.next(),n=r.getLabel().getLocation(t),i=r.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,n)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof re&&(this._useBoundaryDeterminationRule=!1),e instanceof $t)this.addPolygon(e);else if(e instanceof Ht)this.addLineString(e);else if(e instanceof Jt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof jt)this.addCollection(e);else if(e instanceof re)this.addCollection(e);else{if(!(e instanceof qt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new _i(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?M.BOUNDARY:M.INTERIOR},e}(Ge),Ii=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ei(0,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=dt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,e,n),this._arg[1]=new Ei(1,r,n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,i,a),this._arg[1]=new Ei(1,o,a)}};Ii.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ii.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Si=function(){};Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.map=function(){if(arguments[0]instanceof ct&&A(arguments[1],Si.MapOp)){for(var t=arguments[0],e=arguments[1],r=new Et,n=0;n=t.size()?null:t.get(e)},Ri.union=function(t){return new Ri(t).union()},Ni.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ri,Ni);var Di=function(){};Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.UNION)},t.GeoJSONReader=Ee,t.GeoJSONWriter=Ie,t.OverlayOp=Ci,t.UnionOp=Di,t.BufferOp=gn,Object.defineProperty(t,"__esModule",{value:!0})}(e)}},e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={id:n,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t=r(3379),e=r.n(t),n=r(7113);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var i=r(8754);e()(i.Z,{insert:"head",singleton:!1}),i.Z.locals,r(9631)})()})(); \ No newline at end of file diff --git a/dist/app.js.LICENSE.txt b/dist/app.js.LICENSE.txt new file mode 100644 index 0000000..644f94c --- /dev/null +++ b/dist/app.js.LICENSE.txt @@ -0,0 +1,60 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +/*! + * @license GNU Affero General Public License. + * Copyright (c) 2015, 2015 Ronny Lorenz + * v. 1.2.0 + * https://github.com/RaumZeit/MarchingSquares.js + * + * MarchingSquaresJS is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MarchingSquaresJS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * As additional permission under GNU Affero General Public License version 3 + * section 7, third-party projects (personal or commercial) may distribute, + * include, or link against UNMODIFIED VERSIONS of MarchingSquaresJS without the + * requirement that said third-party project for that reason alone becomes + * subject to any requirement of the GNU Affero General Public License version 3. + * Any modifications to MarchingSquaresJS, however, must be shared with the public + * and made available. + * + * In summary this: + * - allows you to use MarchingSquaresJS at no cost + * - allows you to use MarchingSquaresJS for both personal and commercial purposes + * - allows you to distribute UNMODIFIED VERSIONS of MarchingSquaresJS under any + * license as long as this license notice is included + * - enables you to keep the source code of your program that uses MarchingSquaresJS + * undisclosed + * - forces you to share any modifications you have made to MarchingSquaresJS, + * e.g. bug-fixes + * + * You should have received a copy of the GNU Affero General Public License + * along with MarchingSquaresJS. If not, see . + */ + +/** + * splaytree v3.1.0 + * Fast Splay tree for Node and browser + * + * @author Alexander Milevski + * @license MIT + * @preserve + */ + +/** + * @license get-closest https://github.com/cosmosio/get-closest + * + * The MIT License (MIT) + * + * Copyright (c) 2014-2017 Olivier Scherrer + */ diff --git a/dist/index.html b/dist/index.html index 0a1148a..4693ae0 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,13 +1,13 @@ - - - - - Turf.js Starter - - -
- - + + + + + Turf.js Starter + + +
+ + diff --git a/docs/app.js b/docs/app.js index e667883..22be4c1 100644 --- a/docs/app.js +++ b/docs/app.js @@ -1 +1,2 @@ -(()=>{var t={631:(t,e,r)=>{var n=r(158),i=r(530);const o=new n.Map({container:"map",style:{version:8,sources:{m_mono:{type:"raster",tiles:["https://tile.mierune.co.jp/mierune_mono/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"m_mono",type:"raster",source:"m_mono",minzoom:0,maxzoom:18}]},center:[139.77,35.676],zoom:13});o.on("load",(function(){const t=i.featureCollection([i.point([139.7594,35.6865]),i.point([139.7692,35.6665]),i.point([139.7812,35.6849])]);o.addSource("FeaturesPoint",{type:"geojson",data:t}),o.addLayer({id:"FeaturesPoint",type:"circle",source:"FeaturesPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#1253A4","circle-stroke-width":5,"circle-stroke-opacity":.8,"circle-color":"#1253A4","circle-radius":5,"circle-opacity":.5}});const e=i.center(t);o.addSource("CenterPoint",{type:"geojson",data:e}),o.addLayer({id:"CenterPoint",type:"circle",source:"CenterPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#8DCF3F","circle-stroke-width":10,"circle-stroke-opacity":.8,"circle-color":"#8DCF3F","circle-radius":10,"circle-opacity":.5}})})),o.addControl(new n.NavigationControl)},530:function(t,e){!function(t){"use strict";function e(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.bbox,i=r.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");n&&S(n),i&&C(i);var o={type:"Feature"};return i&&(o.id=i),n&&(o.bbox=n),o.properties=e||{},o.geometry=t,o}function r(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var i,a=r.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");switch(a&&S(a),t){case"Point":i=n(e).geometry;break;case"LineString":i=s(e).geometry;break;case"Polygon":i=o(e).geometry;break;case"MultiPoint":i=h(e).geometry;break;case"MultiLineString":i=c(e).geometry;break;case"MultiPolygon":i=p(e).geometry;break;default:throw new Error(t+" is invalid")}return a&&(i.bbox=a),i}function n(t,r,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!E(t[0])||!E(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},r,n)}function i(t,e,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return l(t.map((function(t){return n(t,e)})),r)}function o(t,r,n){if(!t)throw new Error("coordinates is required");for(var i=0;i=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function g(t,e){if(null==t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var r=Ao[e||"kilometers"];if(!r)throw new Error(e+" units is invalid");return t*r}function m(t,e){if(null==t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var r=Ao[e||"kilometers"];if(!r)throw new Error(e+" units is invalid");return t/r}function y(t,e){return v(m(t,e))}function _(t){if(null==t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function v(t){if(null==t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function x(t){if(null==t)throw new Error("degrees is required");return t%360*Math.PI/180}function b(t,e,r){if(null==t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return g(m(t,e),r||"kilometers")}function w(t,e,r){if(null==t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var n=Do[e||"meters"];if(!n)throw new Error("invalid original units");var i=Do[r||"kilometers"];if(!i)throw new Error("invalid final units");return t/n*i}function E(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function I(t){return!!t&&t.constructor===Object}function S(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!E(t))throw new Error("bbox must only contain numbers")}))}function C(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function T(t,e,r){if(null!==t)for(var n,i,o,a,s,u,l,c,h=0,p=0,f=t.type,d="FeatureCollection"===f,g="Feature"===f,m=d?t.features.length:1,y=0;yt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]1&&E(e[0])&&E(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function G(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return X(e),e;throw new Error("No valid coordinates")}function X(t){if(t.length>1&&E(t[0])&&E(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return X(t[0]);throw new Error("coordinates must only contain numbers")}function Z(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)}function Y(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)}function W(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0;n=0&&g>=0&&g=0;c--)if(Math.abs(e[c][0][0]-u)<=1e-7&&Math.abs(e[c][0][1]-l)<=1e-7){for(var h=a.path.length-2;h>=0;--h)e[c].unshift(a.path[h]);s=!0;break}s||(e[r++]=a.path)}}))})),e}(function(t,e){for(var r=t.length-1,n=t[0].length-1,i={rows:r,cols:n,cells:[]},o=0;o=e?8:0,s|=l>=e?4:0,s|=c>=e?2:0;var p,f,d,g,m=!1;if(5==(s|=h>=e?1:0)||10===s){var y=(u+l+c+h)/4;5===s&&y=t.minX&&e.maxY>=t.minY}function dt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function gt(t,e,r,n,i){for(var o,a=[e,r];a.length;)(r=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((r-e)/n/2)*n,Fo(t,o,e,r,i),a.push(e,o,o,r))}function mt(t,e){return t(e={exports:{}},e.exports),e.exports}function yt(t,e){if(!(this instanceof yt))return new yt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||function(t,e){return te?1:0},this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}function _t(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;for(var n,i=function(t){for(var e=t[0],r=t[0],n=t[0],i=t[0],o=0;on[0]&&(n=a),a[1]i[1]&&(i=a)}var s=[e,r,n,i],u=s.slice();for(o=0;oo||s.push({node:c,dist:h})}for(;s.length&&!s.peek().node.children;){var p=s.pop(),f=p.node,d=St(f,e,r),g=St(f,n,i);if(p.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function bt(t,e,r){for(var n=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),a=Math.max(t[1],e[1]),s=r.search({minX:n,minY:i,maxX:o,maxY:a}),u=0;u0!=Qo(t,e,n)>0&&Qo(r,n,t)>0!=Qo(r,n,e)>0}(s[u].p,s[u].next.p,t,e))return!1;return!0}function wt(t){var e=t.p,r=t.next.p;return t.minX=Math.min(e[0],r[0]),t.minY=Math.min(e[1],r[1]),t.maxX=Math.max(e[0],r[0]),t.maxY=Math.max(e[1],r[1]),t}function Et(t,e){var r={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function It(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function St(t,e,r){var n=e[0],i=e[1],o=r[0]-n,a=r[1]-i;if(0!==o||0!==a){var s=((t[0]-n)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(n=r[0],i=r[1]):s>0&&(n+=o*s,i+=a*s)}return(o=t[0]-n)*o+(a=t[1]-i)*a}function Ct(t,e,r,n,i,o,a,s){var u,l,c,h,p=r-t,f=n-e,d=a-i,g=s-o,m=t-i,y=e-o,_=p*p+f*f,v=p*d+f*g,x=d*d+g*g,b=p*m+f*y,w=d*m+g*y,E=_*x-v*v,I=E,S=E;0===E?(l=0,I=1,h=w,S=x):(h=_*w-v*b,(l=v*w-x*b)<0?(l=0,h=w,S=x):l>I&&(l=I,h=w+v,S=x)),h<0?(h=0,-b<0?l=0:-b>_?l=I:(l=-b,I=_)):h>S&&(h=S,-b+v<0?l=0:-b+v>_?l=I:(l=-b+v,I=_));var C=(1-(c=0===h?0:h/S))*i+c*a-((1-(u=0===l?0:l/I))*t+u*r),T=(1-c)*o+c*s-((1-u)*e+u*n);return C*C+T*T}function Tt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.concavity||1/0,n=[];if(T(t,(function(t){n.push([t[0],t[1]])})),!n.length)return null;var i=$o(n,r);return i.length>3?o([i]):null}function Pt(t,e,r){if("object"!=typeof(r=r||{}))throw new Error("options is invalid");var n=r.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=j(t),o=G(e),a=e.geometry?e.geometry.type:e.type,s=e.bbox;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,s))return!1;"Polygon"===a&&(o=[o]);for(var u=0,l=!1;ut[1]!=l>t[1]&&t[0]<(u-a)*(t[1]-s)/(l-s)+a&&(n=!n)}return n}function At(t,e){var r=[];return z(e,(function(e){L(t,(function(t){Pt(t,e)&&r.push(t)}))})),l(r)}function Lt(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var r=!1;return l(function(t){if(t.length<3)return[];t.sort(Nt);for(var e,r,n,i,o,a,s=t.length-1,u=t[s].x,l=t[0].x,c=t[s].y,h=c;s--;)t[s].yh&&(h=t[s].y);var p,f=l-u,d=h-c,g=f>d?f:d,m=.5*(l+u),y=.5*(h+c),_=[new Dt({x:m-20*g,y:y-g,__sentinel:!0},{x:m,y:y+20*g,__sentinel:!0},{x:m+20*g,y:y-g,__sentinel:!0})],v=[],x=[];for(s=t.length;s--;){for(x.length=0,p=_.length;p--;)(f=t[s].x-_[p].x)>0&&f*f>_[p].r?(v.push(_[p]),_.splice(p,1)):f*f+(d=t[s].y-_[p].y)*d>_[p].r||(x.push(_[p].a,_[p].b,_[p].b,_[p].c,_[p].c,_[p].a),_.splice(p,1));for(zt(x),p=x.length;p;)r=x[--p],e=x[--p],n=t[s],i=r.x-e.x,o=r.y-e.y,a=2*(i*(n.y-r.y)-o*(n.x-r.x)),Math.abs(a)>1e-12&&_.push(new Dt(e,r,n))}for(Array.prototype.push.apply(v,_),s=v.length;s--;)(v[s].a.__sentinel||v[s].b.__sentinel||v[s].c.__sentinel)&&v.splice(s,1);return v}(t.features.map((function(t){var n={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?n.z=t.properties[e]:3===t.geometry.coordinates.length&&(r=!0,n.z=t.geometry.coordinates[2]),n}))).map((function(t){var e=[t.a.x,t.a.y],n=[t.b.x,t.b.y],i=[t.c.x,t.c.y],a={};return r?(e.push(t.a.z),n.push(t.b.z),i.push(t.c.z)):a={a:t.a.z,b:t.b.z,c:t.c.z},o([[e,n,i,e]],a)})))}function Dt(t,e,r){this.a=t,this.b=e,this.c=r;var n,i,o=e.x-t.x,a=e.y-t.y,s=r.x-t.x,u=r.y-t.y,l=o*(t.x+e.x)+a*(t.y+e.y),c=s*(t.x+r.x)+u*(t.y+r.y),h=2*(o*(r.y-e.y)-a*(r.x-e.x));this.x=(u*l-a*c)/h,this.y=(o*c-s*l)/h,n=this.x-t.x,i=this.y-t.y,this.r=n*n+i*i}function Nt(t,e){return e.x-t.x}function zt(t){var e,r,n,i,o,a=t.length;t:for(;a;)for(r=t[--a],e=t[--a],n=a;n;)if(o=t[--n],i=t[--n],e===i&&r===o||e===o&&r===i){t.splice(a,2),t.splice(n,2),a-=2;continue t}}function Rt(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.units,i=j(t),o=j(e),a=x(o[1]-i[1]),s=x(o[0]-i[0]),u=x(i[1]),l=x(o[1]),c=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(u)*Math.cos(l);return g(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),n)}function kt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Ot(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return Ot(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Bt(t);default:throw new Error("unknown GeoJSON type")}}function Ot(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=Ft(t.properties),e.geometry=Bt(t.geometry),e}function Ft(t){var e={};return t?(Object.keys(t).forEach((function(r){var n=t[r];"object"==typeof n?null===n?e[r]=null:n.length?e[r]=n.map((function(t){return t})):e[r]=Ft(n):e[r]=n})),e):e}function Bt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Bt(t)})),e):(e.coordinates=Ut(t.coordinates),e)}function Ut(t){return"object"!=typeof t[0]?t.slice():t.map((function(t){return Ut(t)}))}function Vt(t,e){function r(t,e){e.length&&e.pop();for(var r=u[t<0?~t:t],n=0,i=r.length;n1)for(var a,s,u=1,l=n(o[0]);ul&&(s=o[0],o[0]=o[u],o[u]=s,l=a);return o}))}}function jt(t,e,r){for(var n,i=e+(r---e>>1);e=Math.abs(c)?l>0?o<=n&&n<=s:s<=n&&n<=o:c>0?a<=i&&i<=u:u<=i&&i<=a)}(r,i=e[s+1],n)||o.push(n);return o.push(i),o}function $t(t,e){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n}function te(t,e,r){var n=e.x,i=e.y,o=r.x-n,a=r.y-i;if(0!==o||0!==a){var s=((t.x-n)*o+(t.y-i)*a)/(o*o+a*a);s>1?(n=r.x,i=r.y):s>0&&(n+=o*s,i+=a*s)}return(o=t.x-n)*o+(a=t.y-i)*a}function ee(t,e,r,n,i){for(var o,a=n,s=e+1;sa&&(o=s,a=u)}a>n&&(o-e>1&&ee(t,e,o,n,i),i.push(t[o]),r-o>1&&ee(t,o,r,n,i))}function re(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return function(t,e){var r=t.length-1,n=[t[0]];return ee(t,0,r,e,n),n.push(t[r]),n}(t=r?t:function(t,e){for(var r,n=t[0],i=[n],o=1,a=t.length;oe&&(i.push(r),n=r);return n!==r&&i.push(r),i}(t,n),n)}function ne(t,e,r){return re(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,r).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function ie(t,e,r){return t.map((function(t){var n=t.map((function(t){return{x:t[0],y:t[1]}}));if(n.length<4)throw new Error("invalid polygon");for(var i=re(n,e,r).map((function(t){return[t.x,t.y]}));!function(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}(i);)i=re(n,e-=.01*e,r).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function oe(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.resolution||1e4,n=e.sharpness||.85;if(!t)throw new Error("line is required");if(!E(r))throw new Error("resolution must be an number");if(!E(n))throw new Error("sharpness must be an number");for(var i=[],o=new da({points:H(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),duration:r,sharpness:n}),a=0;a=Rt(t.slice(0,2),[e,i])){var o=(r+i)/2;return[e,o-(n-e)/2,n,o+(n-e)/2]}var a=(e+n)/2;return[a-(i-r)/2,r,a+(i-r)/2,i]}function le(t,e,r,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,a=i.properties,s=j(t),u=x(s[0]),l=x(s[1]),c=x(r),h=m(e,o),p=Math.asin(Math.sin(l)*Math.cos(h)+Math.cos(l)*Math.sin(h)*Math.cos(c));return n([v(u+Math.atan2(Math.sin(c)*Math.sin(h)*Math.cos(l),Math.cos(h)-Math.sin(l)*Math.sin(p))),v(p)],a)}function ce(t,e,r){var n=(r=r||{}).steps||64,i=r.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof r)throw new Error("options must be an object");if("number"!=typeof n)throw new Error("steps must be a number");n=n||64,i=i||t.properties||{};for(var a=[],s=0;s=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&be(or.x)&&Se(n,t)&&(r=n,p=u),n=n.next;return r}(t,e)){var r=Ce(e,t);ye(r,r.next)}}(s[i],r),r=ye(r,r.next);return r}(t,e,p,r)),t.length>80*r){n=o=t[0],i=a=t[1];for(var d=r;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return _e(p,f,r,n,i,l),f}function me(t,e,r,n,i){var o,a;if(i===Ae(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Te(o,t[o],t[o+1],a);return a&&Ee(a,a.next)&&(Pe(a),a=a.next),a}function ye(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ee(n,n.next)&&0!==we(n.prev,n,n.next))n=n.next;else{if(Pe(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function _e(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=xe(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,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,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--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?function(t,e,r,n){var i=t.prev,o=t,a=t.next;if(we(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=xe(s,u,e,r,n),p=xe(l,c,e,r,n),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&be(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&we(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&be(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&we(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}(t,n,i,o):function(t){var e=t.prev,r=t,n=t.next;if(we(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(be(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&we(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Pe(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?_e(t=function(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ee(i,o)&&Ie(i,n,n.next,o)&&Se(i,o)&&Se(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Pe(n),Pe(n.next),n=t=o),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,o,2):2===a&&function(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&function(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&&Ie(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&Se(t,e)&&Se(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(a,s)){var u=Ce(a,s);return a=ye(a,a.next),u=ye(u,u.next),_e(a,e,r,n,i,o),void _e(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}(t,e,r,n,i,o):_e(ye(t),e,r,n,i,o,1);break}}}function ve(t,e){return t.x-e.x}function xe(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 be(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function we(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ee(t,e){return t.x===e.x&&t.y===e.y}function Ie(t,e,r,n){return!!(Ee(t,e)&&Ee(r,n)||Ee(t,n)&&Ee(r,e))||we(t,e,r)>0!=we(t,e,n)>0&&we(r,n,t)>0!=we(r,n,e)>0}function Se(t,e){return we(t.prev,t,t.next)<0?we(t,e,t.next)>=0&&we(t,t.prev,e)>=0:we(t,e,t.prev)<0||we(t,t.next,e)<0}function Ce(t,e){var r=new Me(t.i,t.x,t.y),n=new Me(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Te(t,e,r,n){var i=new Me(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 Pe(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 Me(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 Ae(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}(t),r=ga(e.vertices,e.holes,2),n=[],i=[];r.forEach((function(t,n){var o=r[n];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var a=0;ae?1:0})}function ze(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);ze(t,e,Math.max(r,Math.floor(e-a*u/o+l)),Math.min(n,Math.floor(e+(o-a)*u/o+l)),i)}var c=t[e],h=r,p=n;for(Re(t,r,e),i(t[n],c)>0&&Re(t,r,n);h0;)p--}0===i(t[r],c)?Re(t,r,p):Re(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function Re(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ke(t,e){if(!(this instanceof ke))return new ke(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function Oe(t,e){Fe(t,0,t.children.length,e,t)}function Fe(t,e,r,n,i){i||(i=Ze(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,a=e;a=t.minX&&e.maxY>=t.minY}function Ze(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ye(t,e,r,n,i){for(var o,a=[e,r];a.length;)(r=a.pop())-(e=a.pop())<=n||(Ne(t,o=e+Math.ceil((r-e)/n/2)*n,e,r,i),a.push(e,o,o,r))}function We(t){var e=ke(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=He(e)).bbox=e}else t.bbox=t.bbox?t.bbox:Ke(t);return ke.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){var r=He(t);r.bbox=t,e.push(r)})):L(t,(function(t){t.bbox=t.bbox?t.bbox:Ke(t),e.push(t)})),ke.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=He(e)).bbox=e}return ke.prototype.remove.call(this,t)},e.clear=function(){return ke.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:ke.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return ke.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:ke.prototype.all.call(this)}},e.toJSON=function(){return ke.prototype.toJSON.call(this)},e.fromJSON=function(t){return ke.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return{minX:(e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:Ke(t))[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function He(t){var e=[t[0],t[1]],r=[t[0],t[3]],n=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],n,r,e]]}}}function Ke(t){var e=[1/0,1/0,-1/0,-1/0];return T(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]i?r:i,n>o?n:o]}(t,n),r.push(i),n})),r})(r,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}(t,e)})),l(e)}function Qe(t,r){var n={},i=[];if("LineString"===t.type&&(t=e(t)),"LineString"===r.type&&(r=e(r)),"Feature"===t.type&&"Feature"===r.type&&"LineString"===t.geometry.type&&"LineString"===r.geometry.type&&2===t.geometry.coordinates.length&&2===r.geometry.coordinates.length){var o=$e(t,r);return o&&i.push(o),l(i)}var a=We();return a.load(Je(r)),L(Je(t),(function(t){L(a.search(t),(function(e){var r=$e(t,e);if(r){var o=G(r).join(",");n[o]||(n[o]=!0,i.push(r))}}))})),l(i)}function $e(t,e){var r=G(t),i=G(e);if(2!==r.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var o=r[0][0],a=r[0][1],s=r[1][0],u=r[1][1],l=i[0][0],c=i[0][1],h=i[1][0],p=i[1][1],f=(p-c)*(s-o)-(h-l)*(u-a);if(0===f)return null;var d=((h-l)*(a-c)-(p-c)*(o-l))/f,g=((s-o)*(a-c)-(u-a)*(o-l))/f;return d>=0&&d<=1&&g>=0&&g<=1?n([o+d*(s-o),a+d*(u-a)]):null}function tr(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var o=n([1/0,1/0],{dist:1/0}),a=0;return k(t,(function(t){for(var i=G(t),u=0;u0&&((y=m.features[0]).properties.dist=Rt(e,y,r),y.properties.location=a+Rt(l,y,r)),l.properties.dist180?-(360-n):n}function rr(t,e){var r=x(t[1]),n=x(e[1]),i=x(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(r/2+Math.PI/4));return(v(Math.atan2(i,o))+360)%360}function nr(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=j(t),o=j(e);return o[0]+=o[0]-i[0]>180?-360:i[0]-o[0]>180?360:0,b(function(t,e,r){var n=r=void 0===r?Mo:Number(r),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,a=o-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?a/u:Math.cos(i);return Math.sqrt(a*a+l*l*s*s)*n}(i,o),"meters",n)}function ir(t,e){return ar(t,"mercator",e)}function or(t,e){return ar(t,"wgs84",e)}function ar(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&E(t[0])?t="mercator"===e?sr(t):ur(t):(!0!==n&&(t=kt(t)),T(t,(function(t){var r="mercator"===e?sr(t):ur(t);t[0]=r[0],t[1]=r[1]}))),t}function sr(t){var e=Math.PI/180,r=20037508.342789244,n=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return n[0]>r&&(n[0]=r),n[0]<-r&&(n[0]=-r),n[1]>r&&(n[1]=r),n[1]<-r&&(n[1]=-r),n}function ur(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function lr(t,r,i){if(!I(i=i||{}))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=n(t):"Point"===t.type?t=e(t):Y(t,"Point","point"),!r)throw new Error("line is required");Array.isArray(r)?r=s(r):"LineString"===r.type?r=e(r):Y(r,"LineString","line");var o=1/0,a=t.geometry.coordinates;return F(r,(function(t){var e=t.geometry.coordinates[0],r=t.geometry.coordinates[1],s=function(t,e,r,i){var o=i.mercator,a=!0!==o?Rt(e,t,i):cr(e,t,i),s=_(!0!==o?he(e,t):er(e,t)),u=_(!0!==o?he(e,r):er(e,r)),l=Math.abs(s-u);if(l>90)return a;var c=(u+180)%360,h=_(!0!==o?he(r,t):er(r,t)),p=Math.abs(h-c);return p>180&&(p=Math.abs(p-360)),p>90?!0!==o?Rt(t,r,i):cr(t,r,i):!0!==o?a*Math.sin(x(l)):function(t,e,r,i){var o=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(r[0])>=180)&&(o=t[0]>0||e[0]>0||r[0]>0?-180:180);var a=n(r),s=or(function(t,e,r){var n=t[0],i=t[1],o=e[0]-n,a=e[1]-i,s=((r[0]-n)*o+(r[1]-i)*a)/(o*o+a*a);return[n+s*o,i+s*a]}(ir([t[0]+o,t[1]]),ir([e[0]+o,e[1]]),ir([r[0]+o,r[1]])));return 0!==o&&(s[0]-=o),nr(a,s,i)}(e,r,t,i)}(a,e,r,i);o>s&&(o=s)})),o}function cr(t,e,r){var n=r.units,i=0;Math.abs(t[0])>=180&&(i=t[0]>0?-180:180),Math.abs(e[0])>=180&&(i=e[0]>0?-180:180);var o=ir([t[0]+i,t[1]]),a=ir([e[0]+i,e[1]]),s=function(t){return t*t},u=s(o[0]-a[0])+s(o[1]-a[1]);return b(Math.sqrt(u),"meters",n)}function hr(t){for(var r=function(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?l([e(t)]):l([t]):t}(t),i=pe(r),o=!1,a=0;!o&&a0){e+=Math.abs(mr(t[0]));for(var r=1;r2){for(a=0;a=c&&h===i.length-1);h++){if(c>e&&0===o.length){if(!(a=e-c))return o.push(i[h]),s(o);u=he(i[h],i[h-1])-180,l=le(i[h],a,u,n),o.push(l.geometry.coordinates)}if(c>=r)return(a=r-c)?(u=he(i[h],i[h-1])-180,l=le(i[h],a,u,n),o.push(l.geometry.coordinates),s(o)):(o.push(i[h]),s(o));if(c>=e&&o.push(i[h]),h===i.length-1)return s(o);c+=Rt(i[h],i[h+1],n)}return s(i[i.length-1])}function xr(t,e,r){var n=(r=r||{}).ignoreEndVertices;if(!I(r))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var i=j(t),o=G(e),a=0;a=Math.abs(h)?c>0?a0?s=Math.abs(h)?c>0?a<=i&&i0?s<=o&&o=Math.abs(h)?c>0?a0?s=Math.abs(h)?c>0?a<=i&&i<=u:u<=i&&i<=a:h>0?s<=o&&o<=l:l<=o&&o<=s)}(o[a],o[a+1],i,s))return!0}return!1}function br(t,e){var r=J(t),n=J(e),i=H(t),o=H(e);switch(r){case"Point":switch(n){case"MultiPoint":return function(t,e){var r,n=!1;for(r=0;re[0]||t[2]e[1]||t[3] is required");if("number"!=typeof r)throw new Error(" must be a number");if("number"!=typeof n)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,r);return T(t,(function(t){!function(t,e,r){t.length>r&&t.splice(r,t.length);for(var n=0;n=0==e}function Pr(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var r=0,n=t.length;r1&&r.push(s(h)),l(r)}function Lr(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var r,n=1/0;return L(e,(function(e){var i=tr(e,t).properties.dist;ip&&d.push(le(t,e,p,a).geometry.coordinates),s(d,c)}function zr(t){var e=t%360;return e<0&&(e+=360),e}function Rr(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.properties,n=J(t),i=G(t);if(r=r||t.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(n){case"Polygon":return kr(i,r);case"MultiPolygon":var o=[];return i.forEach((function(t){o.push(kr(t,r))})),l(o);default:throw new Error("geom "+n+" not supported")}}function kr(t,e){return t.length>1?c(t,e):s(t[0],e)}function Or(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.properties,n=e.autoComplete,i=e.orderCoords;if(!t)throw new Error("lines is required");switch(n=void 0===n||n,i=void 0===i||i,J(t)){case"FeatureCollection":case"GeometryCollection":var o=[];return(t.features?t.features:t.geometries).forEach((function(t){o.push(G(Fr(t,{},n,i)))})),p(o,r)}return Fr(t,r,n,i)}function Fr(t,e,r,n){e=e||t.properties||{};var i=G(t),a=J(t);if(!i.length)throw new Error("line must contain coordinates");switch(a){case"LineString":return r&&(i=Br(i)),o([i],e);case"MultiLineString":var u=[],l=0;return i.forEach((function(t){if(r&&(t=Br(t)),n){var e=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.abs(e-n)*Math.abs(r-i)}(q(s(t)));e>l?(u.unshift(t),l=e):u.push(t)}else u.push(t)})),o(u,e);default:throw new Error("geometry type "+a+" is not supported")}}function Br(t){var e=t[0],r=e[0],n=e[1],i=t[t.length-1],o=i[0],a=i[1];return r===o&&n===a||t.push(e),t}function Ur(t,e,r){var n,i,o,a,s,u=t.length,l=qr(t[0],e),c=[];for(r||(r=[]),n=1;ne[2]&&(r|=2),t[1]e[3]&&(r|=8),r}function jr(t,e){for(var r=[],n=0;n0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&r.push(i))}return r}function Gr(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function Xr(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?(r.strict,t===e):function(t,e,r){var n,i;if(Zr(t)||Zr(e))return!1;if(t.prototype!==e.prototype)return!1;if(Gr(t))return!!Gr(e)&&Xr(t=Ma.call(t),e=Ma.call(e),r);if(Yr(t)){if(!Yr(e))return!1;if(t.length!==e.length)return!1;for(n=0;n=0;n--)if(o[n]!==a[n])return!1;for(n=o.length-1;n>=0;n--)if(!Xr(t[i=o[n]],e[i],r))return!1;return typeof t==typeof e}(t,e,r))}function Zr(t){return null==t}function Yr(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}function Wr(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n,i=r.tolerance||0,o=[],a=We();return a.load(Je(t)),F(e,(function(t){var e=!1;L(a.search(t),(function(r){if(!1===e){var o=G(t).sort(),a=G(r).sort();Xr(o,a)||(0===i?xr(o[0],r)&&xr(o[1],r):tr(r,o[0]).properties.dist<=i&&tr(r,o[1]).properties.dist<=i)?(e=!0,n=n?Hr(n,t):t):(0===i?xr(a[0],t)&&xr(a[1],t):tr(t,a[0]).properties.dist<=i&&tr(t,a[1]).properties.dist<=i)&&(n=n?Hr(n,r):r)}})),!1===e&&n&&(o.push(n),n=void 0)})),n&&o.push(n),l(o)}function Hr(t,e){var r=G(e),n=G(t),i=n[0],o=n[n.length-1],a=t.geometry.coordinates;return Xr(r[0],i)?a.unshift(r[1]):Xr(r[0],o)?a.push(r[1]):Xr(r[1],i)?a.unshift(r[0]):Xr(r[1],o)&&a.push(r[0]),t}function Kr(t){var e=t%360;return e<0&&(e+=360),e}function Jr(t,e,r,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,a=i.properties;if(!t)throw new Error("origin is required");if(null==e)throw new Error("distance is required");if(null==r)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var s=b(e,o,"meters"),u=j(t),l=function(t,e,r,n){var i=e/(n=void 0===n?Mo:Number(n)),o=t[0]*Math.PI/180,a=x(t[1]),s=x(r),u=i*Math.cos(s),l=a+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),h=Math.abs(c)>1e-11?u/c:Math.cos(a);return[(180*(o+i*Math.sin(s)/h)/Math.PI+540)%360-180,180*l/Math.PI]}(u,s,r);return l[0]+=l[0]-u[0]>180?-360:u[0]-l[0]>180?360:0,n(l,a)}function Qr(t,e,r,n,i,o){for(var a=0;a0?function(t,e,r){return $r(t,e,r)<0}(e,s,i)||(i=s):r>0&&n<=0&&(function(t,e,r){return $r(t,e,r)>0}(e,s,o)||(o=s)),r=n}return[i,o]}function $r(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(r[0]-t[0])*(e[1]-t[1])}function tn(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var r,n,i=G(t),o=0,a=1;a0}function en(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return z(t,(function(t){en(t,e)})),t;case"LineString":return rn(G(t),e),t;case"Polygon":return nn(G(t),e),t;case"MultiLineString":return G(t).forEach((function(t){rn(t,e)})),t;case"MultiPolygon":return G(t).forEach((function(t){nn(t,e)})),t;case"Point":case"MultiPoint":return t}}function rn(t,e){tn(t)===e&&t.reverse()}function nn(t,e){tn(t[0])!==e&&t[0].reverse();for(var r=1;ra?128:64,l|=ha?32:16,l|=pa?8:4;var d=+(l|=fa?2:1),g=0;if(17===l||18===l||33===l||34===l||38===l||68===l||72===l||98===l||102===l||132===l||136===l||137===l||152===l||153===l){var m=(c+h+p+f)/4;g=m>a?2:m0?(l=156,g=4):l=152:33===l?g>0?(l=139,g=4):l=137:72===l?g>0?(l=99,g=4):l=98:132===l&&(g>0?(l=39,g=4):l=38)}if(0!=l&&170!=l){var y,_,v,x,b,w,E,I;y=_=v=x=b=w=E=I=.5;var S=[];1===l?(v=1-an(e,p,f),I=1-an(e,c,f),S.push(ys[l])):169===l?(v=an(a,f,p),I=an(a,f,c),S.push(ys[l])):4===l?(w=1-an(e,h,p),x=an(e,f,p),S.push(gs[l])):166===l?(w=an(a,p,h),x=1-an(a,p,f),S.push(gs[l])):16===l?(b=an(e,p,h),_=an(e,c,h),S.push(ds[l])):154===l?(b=1-an(a,h,p),_=1-an(a,h,c),S.push(ds[l])):64===l?(E=an(e,f,c),y=1-an(e,h,c),S.push(vs[l])):106===l?(E=1-an(a,c,f),y=an(a,c,h),S.push(vs[l])):168===l?(x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),S.push(ms[l]),S.push(ys[l])):2===l?(x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),S.push(ms[l]),S.push(ys[l])):162===l?(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),S.push(ms[l]),S.push(ys[l])):8===l?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),S.push(ds[l]),S.push(gs[l])):138===l?(b=1-an(e,h,p),w=1-an(a,h,p),y=1-an(a,h,c),_=1-an(e,h,c),S.push(ds[l]),S.push(gs[l])):32===l?(b=an(a,p,h),w=an(e,p,h),y=an(e,c,h),_=an(a,c,h),S.push(ds[l]),S.push(gs[l])):42===l?(I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h),S.push(_s[l]),S.push(vs[l])):128===l&&(I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c),S.push(_s[l]),S.push(vs[l])),5===l?(w=1-an(e,h,p),I=1-an(e,c,f),S.push(gs[l])):165===l?(w=an(a,p,h),I=an(a,f,c),S.push(gs[l])):20===l?(x=an(e,f,p),_=an(e,c,h),S.push(ms[l])):150===l?(x=1-an(a,p,f),_=1-an(a,h,c),S.push(ms[l])):80===l?(b=an(e,p,h),E=an(e,f,c),S.push(ds[l])):90===l?(b=1-an(a,h,p),E=1-an(a,c,f),S.push(ds[l])):65===l?(v=1-an(e,p,f),y=1-an(e,h,c),S.push(ys[l])):105===l?(v=an(a,f,p),y=an(a,c,h),S.push(ys[l])):160===l?(b=an(a,p,h),w=an(e,p,h),I=an(e,f,c),E=an(a,f,c),S.push(ds[l]),S.push(gs[l])):10===l?(b=1-an(e,h,p),w=1-an(a,h,p),I=1-an(a,c,f),E=1-an(e,c,f),S.push(ds[l]),S.push(gs[l])):130===l?(x=1-an(e,p,f),v=1-an(a,p,f),y=1-an(a,h,c),_=1-an(e,h,c),S.push(ms[l]),S.push(ys[l])):40===l?(x=an(a,f,p),v=an(e,f,p),y=an(e,c,h),_=an(a,c,h),S.push(ms[l]),S.push(ys[l])):101===l?(w=an(a,p,h),y=an(a,c,h),S.push(gs[l])):69===l?(w=1-an(e,h,p),y=1-an(e,h,c),S.push(gs[l])):149===l?(I=an(a,f,c),_=1-an(a,h,c),S.push(_s[l])):21===l?(I=1-an(e,c,f),_=an(e,c,h),S.push(_s[l])):86===l?(x=1-an(a,p,f),E=1-an(a,c,f),S.push(ms[l])):84===l?(x=an(e,f,p),E=an(e,f,c),S.push(ms[l])):89===l?(b=1-an(a,h,p),v=an(a,f,p),S.push(ys[l])):81===l?(b=an(e,p,h),v=1-an(e,p,f),S.push(ys[l])):96===l?(b=an(a,p,h),w=an(e,p,h),E=an(e,f,c),y=an(a,c,h),S.push(ds[l]),S.push(gs[l])):74===l?(b=1-an(e,h,p),w=1-an(a,h,p),E=1-an(a,c,f),y=1-an(e,h,c),S.push(ds[l]),S.push(gs[l])):24===l?(b=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),_=an(e,c,h),S.push(ds[l]),S.push(ys[l])):146===l?(b=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),_=1-an(a,h,c),S.push(ds[l]),S.push(ys[l])):6===l?(w=1-an(e,h,p),x=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),S.push(gs[l]),S.push(ms[l])):164===l?(w=an(a,p,h),x=an(e,f,p),I=an(e,f,c),E=an(a,f,c),S.push(gs[l]),S.push(ms[l])):129===l?(v=1-an(e,p,f),I=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c),S.push(ys[l]),S.push(_s[l])):41===l?(v=an(a,f,p),I=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h),S.push(ys[l]),S.push(_s[l])):66===l?(x=1-an(e,p,f),v=1-an(a,p,f),E=1-an(a,c,f),y=1-an(e,h,c),S.push(ms[l]),S.push(ys[l])):104===l?(x=an(a,f,p),v=an(e,f,p),E=an(e,f,c),y=an(a,c,h),S.push(ys[l]),S.push(xs[l])):144===l?(b=an(e,p,h),I=an(e,f,c),E=an(a,f,c),_=1-an(a,h,c),S.push(ds[l]),S.push(vs[l])):26===l?(b=1-an(a,h,p),I=1-an(a,c,f),E=1-an(e,c,f),_=an(e,c,h),S.push(ds[l]),S.push(vs[l])):36===l?(w=an(a,p,h),x=an(e,f,p),y=an(e,c,h),_=an(a,c,h),S.push(gs[l]),S.push(ms[l])):134===l?(w=1-an(e,h,p),x=1-an(a,p,f),y=1-an(a,h,c),_=1-an(e,h,c),S.push(gs[l]),S.push(ms[l])):9===l?(b=1-an(e,h,p),w=1-an(a,h,p),v=an(a,f,p),I=1-an(e,c,f),S.push(ds[l]),S.push(gs[l])):161===l?(b=an(a,p,h),w=an(e,p,h),v=1-an(e,p,f),I=an(a,f,c),S.push(ds[l]),S.push(gs[l])):37===l?(w=an(a,p,h),I=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h),S.push(gs[l]),S.push(_s[l])):133===l?(w=1-an(e,h,p),I=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c),S.push(gs[l]),S.push(_s[l])):148===l?(x=an(e,f,p),I=an(e,f,c),E=an(a,f,c),_=1-an(a,h,c),S.push(ms[l]),S.push(vs[l])):22===l?(x=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),_=an(e,c,h),S.push(ms[l]),S.push(vs[l])):82===l?(b=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),E=1-an(a,c,f),S.push(ds[l]),S.push(ys[l])):88===l?(b=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),E=an(e,f,c),S.push(ds[l]),S.push(ys[l])):73===l?(b=1-an(e,h,p),w=1-an(a,h,p),v=an(a,f,p),y=1-an(e,h,c),S.push(ds[l]),S.push(gs[l])):97===l?(b=an(a,p,h),w=an(e,p,h),v=1-an(e,p,f),y=an(a,c,h),S.push(ds[l]),S.push(gs[l])):145===l?(b=an(e,p,h),v=1-an(e,p,f),I=an(a,f,c),_=1-an(a,h,c),S.push(ds[l]),S.push(_s[l])):25===l?(b=1-an(a,h,p),v=an(a,f,p),I=1-an(e,c,f),_=an(e,c,h),S.push(ds[l]),S.push(_s[l])):70===l?(w=1-an(e,h,p),x=1-an(a,p,f),E=1-an(a,c,f),y=1-an(e,h,c),S.push(gs[l]),S.push(ms[l])):100===l?(w=an(a,p,h),x=an(e,f,p),E=an(e,f,c),y=an(a,c,h),S.push(gs[l]),S.push(ms[l])):34===l?(0===g?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)):(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)),S.push(ds[l]),S.push(gs[l]),S.push(_s[l]),S.push(vs[l])):35===l?(4===g?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)):(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)),S.push(ds[l]),S.push(gs[l]),S.push(ys[l]),S.push(vs[l])):136===l?(0===g?(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)):(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)),S.push(ds[l]),S.push(gs[l]),S.push(_s[l]),S.push(vs[l])):153===l?(0===g?(b=an(e,p,h),v=1-an(e,p,f),I=1-an(e,c,f),_=an(e,c,h)):(b=1-an(a,h,p),v=an(a,f,p),I=an(a,f,c),_=1-an(a,h,c)),S.push(ds[l]),S.push(ys[l])):102===l?(0===g?(w=1-an(e,h,p),x=an(e,f,p),E=an(e,f,c),y=1-an(e,h,c)):(w=an(a,p,h),x=1-an(a,p,f),E=1-an(a,c,f),y=an(a,c,h)),S.push(gs[l]),S.push(vs[l])):155===l?(4===g?(b=an(e,p,h),v=1-an(e,p,f),I=1-an(e,c,f),_=an(e,c,h)):(b=1-an(a,h,p),v=an(a,f,p),I=an(a,f,c),_=1-an(a,h,c)),S.push(ds[l]),S.push(_s[l])):103===l?(4===g?(w=1-an(e,h,p),x=an(e,f,p),E=an(e,f,c),y=1-an(e,h,c)):(w=an(a,p,h),x=1-an(a,p,f),E=1-an(a,c,f),y=an(a,c,h)),S.push(gs[l]),S.push(ms[l])):152===l?(0===g?(b=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),_=an(e,c,h)):(b=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),_=1-an(a,h,c)),S.push(ds[l]),S.push(ms[l]),S.push(ys[l])):156===l?(4===g?(b=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),_=an(e,c,h)):(b=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),I=an(e,f,c),E=an(a,f,c),_=1-an(a,h,c)),S.push(ds[l]),S.push(ys[l]),S.push(vs[l])):137===l?(0===g?(b=an(a,p,h),w=an(e,p,h),v=1-an(e,p,f),I=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)):(b=1-an(e,h,p),w=1-an(a,h,p),v=an(a,f,p),I=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)),S.push(ds[l]),S.push(gs[l]),S.push(ys[l])):139===l?(4===g?(b=an(a,p,h),w=an(e,p,h),v=1-an(e,p,f),I=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)):(b=1-an(e,h,p),w=1-an(a,h,p),v=an(a,f,p),I=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)),S.push(ds[l]),S.push(gs[l]),S.push(_s[l])):98===l?(0===g?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),E=an(e,f,c),y=1-an(e,h,c)):(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),E=1-an(a,c,f),y=an(a,c,h)),S.push(ds[l]),S.push(gs[l]),S.push(vs[l])):99===l?(4===g?(b=1-an(e,h,p),w=1-an(a,h,p),x=an(a,f,p),v=an(e,f,p),E=an(e,f,c),y=1-an(e,h,c)):(b=an(a,p,h),w=an(e,p,h),x=1-an(e,p,f),v=1-an(a,p,f),E=1-an(a,c,f),y=an(a,c,h)),S.push(ds[l]),S.push(gs[l]),S.push(ys[l])):38===l?(0===g?(w=1-an(e,h,p),x=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)):(w=an(a,p,h),x=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)),S.push(gs[l]),S.push(_s[l]),S.push(vs[l])):39===l?(4===g?(w=1-an(e,h,p),x=an(e,f,p),I=an(e,f,c),E=an(a,f,c),y=1-an(a,h,c),_=1-an(e,h,c)):(w=an(a,p,h),x=1-an(a,p,f),I=1-an(a,c,f),E=1-an(e,c,f),y=an(e,c,h),_=an(a,c,h)),S.push(gs[l]),S.push(ms[l]),S.push(vs[l])):85===l&&(b=1,w=0,x=1,v=0,I=0,E=1,y=0,_=1),(y<0||y>1||_<0||_>1||b<0||b>1||x<0||x>1||I<0||I>1||E<0||E>1)&&console.log("MarchingSquaresJS-isoBands: "+l+" "+d+" "+c+","+h+","+p+","+f+" "+g+" "+y+" "+_+" "+b+" "+w+" "+x+" "+v+" "+I+" "+E),o.cells[s][u]={cval:l,cval_real:d,flipped:g,topleft:y,topright:_,righttop:b,rightbottom:w,bottomright:x,bottomleft:v,leftbottom:I,lefttop:E,edges:S}}}}}return o}(t,e,r);return La.polygons?(La.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],r=0;return t.cells.forEach((function(t,n){t.forEach((function(t,i){if(void 0!==t){var o=ws[t.cval](t);"object"==typeof o&&sn(o)?"object"==typeof o[0]&&sn(o[0])?"object"==typeof o[0][0]&&sn(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=n})),e[r++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=n})),e[r++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),e}(l)):(La.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],r=t.rows,n=t.cols,i=[],o=0;o0){var s=function(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],r=t.cval_real;switch(e){case 0:return r&Na?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return r&za?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return r&Ra?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return r&Na?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return r&za?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return r&Ra?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return r&Ra?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return r&Ra?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return r&Da?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return r&Ra?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return r&Ra?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return r&Da?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return r&za?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return r&Da?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return r&Ra?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return r&Da?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return r&Da?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return r&Na?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return r&Da?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return r&Na?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}(t.cells[o][a]),u=null,l=a,c=o;null!==s&&i.push([s.p[0]+l,s.p[1]+c]);do{if(null===(u=function(t,e,r,n){var i,o,a,s,u,l=t.cval;switch(e){case-1:switch(n){case 0:i=gs[l],a=Xa[l],s=Za[l],u=Ya[l];break;default:i=ds[l],a=qa[l],s=ja[l],u=Ga[l]}break;case 1:switch(n){case 0:i=_s[l],a=ns[l],s=is[l],u=os[l];break;default:i=vs[l],a=ts[l],s=es[l],u=rs[l]}break;default:switch(r){case-1:switch(n){case 0:i=xs[l],a=ka[l],s=Oa[l],u=Fa[l];break;default:i=bs[l],a=Ba[l],s=Ua[l],u=Va[l]}break;case 1:switch(n){case 0:i=ys[l],a=Wa[l],s=Ha[l],u=Ka[l];break;default:i=ms[l],a=Ja[l],s=Qa[l],u=$a[l]}}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var r=e+1;r=r||l<0||l>=n||void 0===t.cells[c][l]){var h=function(t,e,r,n,i,o){for(var a=t.cells[r][e],s=a.cval_real,u=e+n,l=r+i,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=i,u-=n,s=(a=t.cells[l][u]).cval_real,-1===i)if(0===o)if(s&Ra)c.push([u,l]),n=-1,i=0,o=0;else{if(!(s&za)){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u+1,l]),n=1,i=0,o=0}else{if(!(s&Ra)){if(s&za){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u+a.bottomleft,l]),n=0,i=1,o=0,h=!0;break}c.push([u,l]),n=-1,i=0,o=0}else if(1===i)if(0===o){if(!(s&Na)){if(s&Da){c.push([u+a.topleft,l+1]),n=0,i=-1,o=0,h=!0;break}c.push([u+a.topright,l+1]),n=0,i=-1,o=1,h=!0;break}c.push([u+1,l+1]),n=1,i=0,o=1}else c.push([u+1,l+1]),n=1,i=0,o=1;else if(-1===n)if(0===o){if(!(s&Da)){if(s&Ra){c.push([u,l+a.leftbottom]),n=1,i=0,o=0,h=!0;break}c.push([u,l+a.lefttop]),n=1,i=0,o=1,h=!0;break}c.push([u,l+1]),n=0,i=1,o=0}else{if(!(s&Da)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),n=0,i=1,o=0}else{if(1!==n){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(s&za)){c.push([u+1,l+a.rightbottom]),n=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}else{if(!(s&za)){if(s&Na){c.push([u+1,l+a.righttop]),n=-1,i=0,o=1;break}c.push([u+1,l+a.rightbottom]),n=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}}else if(s=(a=t.cells[l][u]).cval_real,-1===n)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])n=0,i=-1,o=1;else{if(!(s&Ra)){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u,l])}else{if(!(s&Da)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===n){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])n=0,i=1,o=0;else{if(!(s&Na)){c.push([u+a.topleft,l+1]),n=0,i=-1,o=0,h=!0;break}c.push([u+1,l+1]),n=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])n=1,i=0,o=1;else{if(!(s&za)){c.push([u+1,l+a.righttop]),n=-1,i=0,o=1,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])n=-1,i=0,o=0;else{if(!(s&Da)){c.push([u,l+a.leftbottom]),n=1,i=0,o=0,h=!0;break}c.push([u,l+1]),n=0,i=1,o=0}}if(l+=i,(u+=n)===e&&l===r)break}return{path:c,i:u,j:l,x:n,y:i,o}}(t,l-=u.x,c-=u.y,u.x,u.y,u.o);if(null===h)break;h.path.forEach((function(t){i.push(t)})),l=h.i,c=h.j,s=h}}while(void 0!==t.cells[c][l]&&t.cells[c][l].edges.length>0);e.push(i),i=[],t.cells[o][a].edges.length>0&&a--}return e}(l)),"function"==typeof La.successCallback&&La.successCallback(u),u}function an(t,e,r){return(t-e)/(r-e)}function sn(t){return t.constructor.toString().indexOf("Array")>-1}function un(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.pivot,i=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");return 0===e||(n||(n=fe(t)),!1!==i&&void 0!==i||(t=kt(t)),T(t,(function(t){var r=er(n,t)+e,i=nr(n,t),o=G(Jr(n,i,r));t[0]=o[0],t[1]=o[1]}))),t}function ln(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.origin,i=r.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(n)||"object"==typeof n;return!0!==i&&(t=kt(t)),"FeatureCollection"!==t.type||o?cn(t,e,n):(L(t,(function(r,i){t.features[i]=cn(r,e,n)})),t)}function cn(t,e,r){var i="Point"===J(t);return r=function(t,e){if(null!=e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return j(e);var r=t.bbox?t.bbox:q(t),i=r[0],o=r[1],a=r[2],s=r[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return n([i,o]);case"se":case"southeast":case"eastsouth":case"bottomright":return n([a,o]);case"nw":case"northwest":case"westnorth":case"topleft":return n([i,s]);case"ne":case"northeast":case"eastnorth":case"topright":return n([a,s]);case"center":return pe(t);case void 0:case null:case"centroid":return fe(t);default:throw new Error("invalid origin")}}(t,r),1===e||i||T(t,(function(t){var n=nr(r,t),i=er(r,t),o=G(Jr(r,n*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)})),t}function hn(t){var e=t[0],r=t[1];return[r[0]-e[0],r[1]-e[1]]}function pn(t,e){return t[0]*e[1]-e[0]*t[1]}function fn(t,e,r){var n=[],i=y(e,r),o=G(t),a=[];return o.forEach((function(t,e){if(e!==o.length-1){var r=function(t,e,r){var n=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+r*(e[1]-t[1])/n,o=e[0]+r*(e[1]-t[1])/n;return[[i,t[1]+r*(t[0]-e[0])/n],[o,e[1]+r*(t[0]-e[0])/n]]}(t,o[e+1],i);if(n.push(r),e>0){var s=n[e-1],u=function(t,e){return!function(t,e){return 0===pn(hn(t),hn(e))}(t,e)&&function(t,e){var r=t[0],n=hn(t),i=e[0],o=hn(e),a=pn(n,o);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(r,function(t,e){return[t*e[0],t*e[1]]}(pn(function(t,e){return[t[0]-e[0],t[1]-e[1]]}(i,r),o)/a,n))}(t,e)}(r,s);!1!==u&&(s[1]=u,r[0]=u),a.push(s[0]),e===o.length-2&&(a.push(r[0]),a.push(r[1]))}2===o.length&&(a.push(r[0]),a.push(r[1]))}})),s(a,t.properties)}function dn(t,e,r){var n=e[0]-t[0],i=e[1]-t[1],o=r[0]-e[0],a=r[1]-e[1];return Math.sign(n*a-o*i)}function gn(t,e){return e.geometry.coordinates[0].every((function(e){return Pt(n(e),t)}))}function mn(t,e){for(var r=0;r=Math.abs(a)?o>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:a>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1])}(t.coordinates[r],t.coordinates[r+1],e.coordinates))return!0;return!1}function yn(t,e){return Qe(e,Rr(t)).features.length>0}function _n(t,e){return!(t[0]>e[0]||t[2]e[1]||t[3]0}function wn(t,e){for(var r=!1,i=!1,o=t.coordinates[0].length,a=0;a=Math.abs(s)?a>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:s>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1]:Math.abs(a)>=Math.abs(s)?a>0?t[0]0?t[1]0}function Pn(t,e,r){r=r||[];for(var n=0;n0)){if(o/=p,p<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=n-u,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o0)){if(o/=f,f<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=i-l,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o0||h<1)||(c>0&&(t[0]=[u+c*p,l+c*f]),h<1&&(t[1]=[u+h*p,l+h*f]),!0)}}}}}function Xn(t,e,r,n,i){var o=t[1];if(o)return!0;var a,s,u=t[0],l=t.left,c=t.right,h=l[0],p=l[1],f=c[0],d=c[1],g=(h+f)/2,m=(p+d)/2;if(d===p){if(g=n)return;if(h>f){if(u){if(u[1]>=i)return}else u=[g,r];o=[g,i]}else{if(u){if(u[1]1)if(h>f){if(u){if(u[1]>=i)return}else u=[(r-s)/a,r];o=[(i-s)/a,i]}else{if(u){if(u[1]=n)return}else u=[e,a*e+s];o=[n,a*n+s]}else{if(u){if(u[0]=-$s)){var f=u*u+l*l,d=c*c+h*h,g=(h*f-l*d)/p,m=(u*d-c*f)/p,y=Ks.pop()||new function(){On(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=t,y.site=i,y.x=g+a,y.y=(y.cy=m+s)+Math.sqrt(g*g+m*m),t.circle=y;for(var _=null,v=Ws._;v;)if(y.yQs)s=s.L;else{if(!((i=o-function(t,e){var r=t.N;if(r)return ei(r,e);var n=t.site;return n[1]===e?n[0]:1/0}(s,a))>Qs)){n>-Qs?(e=s.P,r=s):i>-Qs?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}!function(t){Ys[t.index]={site:t,halfedges:[]}}(t);var u=Jn(t);if(Zs.insert(e,u),e||r){if(e===r)return Kn(e),r=Jn(e.site),Zs.insert(u,r),u.edge=r.edge=Vn(e.site,u.site),Hn(e),void Hn(r);if(r){Kn(e),Kn(r);var l=e.site,c=l[0],h=l[1],p=t[0]-c,f=t[1]-h,d=r.site,g=d[0]-c,m=d[1]-h,y=2*(p*m-f*g),_=p*p+f*f,v=g*g+m*m,x=[(m*_-f*v)/y+c,(p*v-g*_)/y+h];jn(r.edge,l,d,x),u.edge=Vn(l,t,null,x),r.edge=Vn(t,d,null,x),Hn(e),Hn(r)}else u.edge=Vn(e.site,u.site)}}function ei(t,e){var r=t.site,n=r[0],i=r[1],o=i-e;if(!o)return n;var a=t.P;if(!a)return-1/0;var s=(r=a.site)[0],u=r[1],l=u-e;if(!l)return s;var c=s-n,h=1/o-1/l,p=c/l;return h?(-p+Math.sqrt(p*p-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+n:(n+s)/2}function ri(t,e,r){return(t[0]-r[0])*(e[1]-t[1])-(t[0]-e[0])*(r[1]-t[1])}function ni(t,e){return e[1]-t[1]||e[0]-t[0]}function ii(t,e){var r,n,i,o=t.sort(ni).pop();for(Hs=[],Ys=new Array(t.length),Zs=new kn,Ws=new kn;;)if(i=Xs,o&&(!i||o[1]Qs||Math.abs(i[0][1]-i[1][1])>Qs)||delete Hs[o]}(a,s,u,l),function(t,e,r,n){var i,o,a,s,u,l,c,h,p,f,d,g,m=Ys.length,y=!0;for(i=0;iQs||Math.abs(g-p)>Qs)&&(u.splice(s,0,Hs.push(qn(a,f,Math.abs(d-t)Qs?[t,Math.abs(h-t)Qs?[Math.abs(p-n)Qs?[r,Math.abs(h-r)Qs?[Math.abs(p-e)=-270&&(g=-g),d<-180&&d>=-360&&(m=-m),"degrees"===a){var y=g*Math.cos(h)+m*Math.sin(h),_=m*Math.cos(h)-g*Math.sin(h);g=y,m=_}p.push([g+c[0],m+c[1]])}return p.push(p[0]),"degrees"===a?o([p],l):un(o([p],l),s,{pivot:u})}function si(t){var e=t*Math.PI/180;return Math.tan(e)}function ui(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.properties,i=e.weight;if(!t)throw new Error("geojson is required");var o=0,a=0,s=0;return z(t,(function(t,e,r){var n=r[i];if(!E(n=null==n?1:n))throw new Error("weight value must be a number for feature index "+e);(n=Number(n))>0&&T(t,(function(t){o+=t[0]*n,a+=t[1]*n,s+=n}))})),n([o/s,a/s],r)}function li(t,e,r,i){var o=r.properties.tolerance||.001,a=0,s=0,u=0,l=0;if(L(r,(function(e){var r=e.properties.weight,n=null==r?1:r;if(!E(n=Number(n)))throw new Error("weight value must be a number");if(n>0){l+=1;var i=n*Rt(e,t);0===i&&(i=1);var o=n/i;a+=e.geometry.coordinates[0]*o,s+=e.geometry.coordinates[1]*o,u+=o}})),l<1)throw new Error("no features to measure");var c=a/u,h=s/u;return 1===l||0===i||Math.abs(c-e[0])0?t+r[e-1]:t})),c.forEach((function(t){t=2*t*Math.PI/c[c.length-1];var e=Math.random();u.push([e*i*Math.sin(t),e*i*Math.cos(t)])})),u[u.length-1]=u[0],u=u.map(function(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}(hi(r))),a.push(o([u]))}return l(a)}function di(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.bbox,n=e.num_vertices,i=e.max_length,o=e.max_rotation;null!=t||(t=1),(!E(n)||n<2)&&(n=10),E(i)||(i=1e-4),E(o)||(o=Math.PI/8);for(var a=[],u=0;u1?t:null;case"MultiPolygon":var e=[];if(k(t,(function(t){fr(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}function Bi(){this.reset()}function Ui(t,e,r){var n=t.s=e+r,i=n-e,o=n-i;t.t=e-o+(r-i)}function Vi(t){return t>1?Cf:t<-1?-Cf:Math.asin(t)}function qi(){}function ji(t,e){t&&Vf.hasOwnProperty(t.type)&&Vf[t.type](t,e)}function Gi(t,e,r){var n,i=-1,o=t.length-r;for(e.lineStart();++iSf?t-Pf:t<-Sf?t+Pf:t,e]}function to(t,e,r){return(t%=Pf)?e||r?jf(ro(t),no(e,r)):ro(t):e||r?no(e,r):$i}function eo(t){return function(e,r){return[(e+=t)>Sf?e-Pf:e<-Sf?e+Pf:e,r]}}function ro(t){var e=eo(t);return e.invert=eo(-t),e}function no(t,e){function r(t,e){var r=zf(e),s=zf(t)*r,u=Of(t)*r,l=Of(e),c=l*n+s*i;return[Nf(u*o-c*a,s*n-l*i),Vi(c*o+u*a)]}var n=zf(t),i=Of(t),o=zf(e),a=Of(e);return r.invert=function(t,e){var r=zf(e),s=zf(t)*r,u=Of(t)*r,l=Of(e),c=l*o-u*a;return[Nf(u*o+l*a,s*n+c*i),Vi(c*n-s*i)]},r}function io(t,e){(e=Yi(e))[0]-=t,Qi(e);var r=function(t){return t>1?0:t<-1?Sf:Math.acos(t)}(-e[1]);return((-e[2]<0?-r:r)+Pf-If)%Pf}function oo(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function ao(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0)do{l.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+s+4)%4)!==h);else l.point(o[0],o[1])}function a(n,i){return Lf(n[0]-t)0?0:3:Lf(n[0]-r)0?2:1:Lf(n[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(a){function u(t,e){i(t,e)&&b.point(t,e)}function l(o,a){var s=i(o,a);if(h&&p.push([o,a]),v)f=o,d=a,g=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&_)b.point(o,a);else{var u=[m=Math.max(Jf,Math.min(Kf,m)),y=Math.max(Jf,Math.min(Kf,y))],l=[o=Math.max(Jf,Math.min(Kf,o)),a=Math.max(Jf,Math.min(Kf,a))];Xf(u,l,t,e,r,n)?(_||(b.lineStart(),b.point(u[0],u[1])),b.point(l[0],l[1]),s||b.lineEnd(),x=!1):s&&(b.lineStart(),b.point(o,a),x=!1)}m=o,y=a,_=s}var c,h,p,f,d,g,m,y,_,v,x,b=a,w=Gf(),E={point:u,lineStart:function(){E.point=l,h&&h.push(p=[]),v=!0,_=!1,m=y=NaN},lineEnd:function(){c&&(l(f,d),g&&_&&w.rejoin(),c.push(w.result())),E.point=u,_&&b.lineEnd()},polygonStart:function(){b=w,c=[],h=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,r=0,i=h.length;rn&&(p-o)*(n-a)>(f-a)*(t-o)&&++e:f<=n&&(p-o)*(n-a)<(f-a)*(t-o)&&--e;return e}(),r=x&&e,i=(c=Hf(c)).length;(r||i)&&(a.polygonStart(),r&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Yf(c,s,e,o,a),a.polygonEnd()),b=a,c=h=p=null}};return E}}function uo(t){return t.length>1}function lo(t,e){return((t=t.x)[0]<0?t[1]-Cf-If:Cf-t[1])-((e=e.x)[0]<0?e[1]-Cf-If:Cf-e[1])}function co(t){return function(e){var r=new ho;for(var n in t)r[n]=t[n];return r.stream=e,r}}function ho(){}function po(t,e,r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),qf(r,t.stream(id));var a=id.result(),s=Math.min(n/(a[1][0]-a[0][0]),i/(a[1][1]-a[0][1])),u=+e[0][0]+(n-s*(a[1][0]+a[0][0]))/2,l=+e[0][1]+(i-s*(a[1][1]+a[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*s).translate([u,l])}function fo(t,e){return[t,kf(Bf((Cf+e)/2))]}function go(t,e){return[kf(Bf((Cf+e)/2)),-t]}function mo(t,r,n,i){var o=t.properties||{},a="Feature"===t.type?t.geometry:t;if("GeometryCollection"===a.type){var s=[];return z(t,(function(t){var e=mo(t,r,n,i);e&&s.push(e)})),l(s)}var u,c=q(t),h=c[1]>50&&c[3]>50;u=h?{type:a.type,coordinates:_o(a.coordinates,xo(a))}:ir(a);var p,f=(new lc).read(u),d=g(m(r,n),"meters"),y=tp.bufferOp(f,d);if(!yo((y=(new cc).write(y)).coordinates))return(p=h?{type:y.type,coordinates:vo(y.coordinates,xo(a))}:or(y)).geometry?p:e(p,o)}function yo(t){return Array.isArray(t[0])?yo(t[0]):isNaN(t[0])}function _o(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return _o(t,e)}))}function vo(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return vo(t,e)}))}function xo(t){var e=pe(t).geometry.coordinates.reverse(),r=e.map((function(t){return-t}));return hd().center(e).rotate(r).scale(Mo)}function bo(){for(var t=new lc,e=t.read(JSON.stringify(arguments[0].geometry)),r=1;r=0&&(void 0===i||o_/2;A&&(M-=_/4);for(var L=[],D=[],N=0;N<6;N++){var z=2*Math.PI/6*N;L.push(Math.cos(z)),D.push(Math.sin(z))}for(var R=[],k=0;k<=C;k++)for(var O=0;O<=P;O++){var F=k%2==1;if(!(0===O&&F||0===O&&A)){var B=k*b+s-T,U=O*w+u+M;if(F&&(U-=_/2),!0===i)(function(t,e,r,n,i,a){for(var s=[],u=0;u<6;u++){var l=[];l.push(t),l.push([t[0]+e*i[u],t[1]+r*a[u]]),l.push([t[0]+e*i[(u+1)%6],t[1]+r*a[(u+1)%6]]),l.push(t),s.push(o([l],n))}return s})([B,U],d/2,g/2,n,L,D).forEach((function(t){a?wo(a,t)&&R.push(t):R.push(t)}));else{var V=function(t,e,r,n,i,a){for(var s=[],u=0;u<6;u++){var l=t[0]+e*i[u],c=t[1]+r*a[u];s.push([l,c])}return s.push(s[0].slice()),o([s],n)}([B,U],d/2,g/2,n,L,D);a?wo(a,V)&&R.push(V):R.push(V)}}}return l(R)}function So(t){if(t.features.length<=1)return t;var e=function(t){var e=Bo(),r=[];return k(t,(function(t,e){var n=q(t);r.push({minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],geojson:t,index:e})})),e.load(r),e}(t),r=[],n={};return k(t,(function(t,i){if(n[i])return!0;for(e.remove({index:i},Co),n[i]=!0;;){var o=q(t),a=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(a.length>0){var s=a.map((function(t){return n[t.index]=!0,e.remove({index:t.index},Co),t.geojson}));s.push(t),t=bo.apply(this,s)}if(0===a.length)break}r.push(t)})),l(r)}function Co(t,e){return t.index===e.index}function To(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.properties,i=r.mask,a=[];if(null==e)throw new Error("cellSide is required");if(!E(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(J(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var s=t[0],u=t[1],c=t[2],h=t[3],p=e/Rt([s,u],[c,u],r)*(c-s),f=e/Rt([s,u],[s,h],r)*(h-u),d=c-s,g=h-u,m=Math.floor(d/p),y=Math.floor(g/f),_=(g-y*f)/2,v=s+(d-m*p)/2,x=0;xe?1:0};i>n;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+c)),Math.min(i,Math.floor(r+(a-s)*l/a+c)),o)}var h=e[r],p=n,f=i;for(nt(e,n,r),o(e[i],h)>0&&nt(e,n,i);p0;)f--}0===o(e[n],h)?nt(e,n,f):nt(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}},Bo=it;it.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!ft(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),a=dt(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,ot(r,this.toBBox),ot(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},_splitRoot:function(t,e){this.data=dt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ot(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,s,u,l,c;for(u=l=1/0,n=e;n<=r-e;n++)a=function(t,e){var r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}(i=at(t,0,n,this.toBBox),o=at(t,n,r,this.toBBox)),s=ct(i)+ct(o),a=e;i--)o=t.children[i],st(u,t.leaf?a(o):o),l+=ht(u);return l},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)st(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():ot(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Uo=function(t,e,r){var n=t*e,i=Vo*t,o=i-(i-t),a=t-o,s=Vo*e,u=s-(s-e),l=e-u,c=a*l-(n-o*u-a*u-o*l);return r?(r[0]=c,r[1]=n,r):[c,n]},Vo=+(Math.pow(2,27)+1),qo=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,i=t-(r-n)+(e-n);return i?[i,r]:[r]}(t[0],e[0]);var i,o,a=new Array(r+n),s=0,u=0,l=0,c=Math.abs,h=t[u],p=c(h),f=e[l],d=c(f);p=n?(i=h,(u+=1)=n?(i=h,(u+=1)>1;return["sum(",n(t.slice(0,e)),",",n(t.slice(e)),")"].join("")}function i(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var o=[],a=0;a0){if(o<=0)return s;n=i+o}else{if(!(i<0))return s;if(o>=0)return s;n=-(i+o)}var u=33306690738754716e-32*n;return s>=u||s<=-u?s:a(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],o=e[0]-n[0],a=r[0]-n[0],u=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],h=t[2]-n[2],p=e[2]-n[2],f=r[2]-n[2],d=o*c,g=a*l,m=a*u,y=i*c,_=i*l,v=o*u,x=h*(d-g)+p*(m-y)+f*(_-v),b=7771561172376103e-31*((Math.abs(d)+Math.abs(g))*Math.abs(h)+(Math.abs(m)+Math.abs(y))*Math.abs(p)+(Math.abs(_)+Math.abs(v))*Math.abs(f));return x>b||-x>b?x:s(t,e,r,n)}];!function(){for(;u.length<=5;)u.push(o(u.length));for(var e=[],r=["slow"],n=0;n<=5;++n)e.push("a"+n),r.push("o"+n);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)i.push("case ",n,":return o",n,"(",e.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i1&&Wo(t[o[l-2]],t[o[l-1]],u)<=0;)l-=1,o.pop();for(o.push(s),l=a.length;l>1&&Wo(t[a[l-2]],t[a[l-1]],u)>=0;)l-=1,a.pop();a.push(s)}r=new Array(a.length+o.length-2);for(var c=0,h=(n=0,o.length);n0;--p)r[c++]=a[p];return r},Wo=Zo[3],Ho=yt,Ko=yt;yt.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},_down:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=s,t=o}e[t]=i}},Ho.default=Ko;var Jo=function(t,e){for(var r=t[0],n=t[1],i=!1,o=0,a=e.length-1;on!=c>n&&r<(l-s)*(n-u)/(c-u)+s&&(i=!i)}return i},Qo=Zo[3],$o=_t,ta=_t;$o.default=ta;var ea=function(t){return t},ra=function(t){if(null==t)return ea;var e,r,n=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=r=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*n+o,c[1]=(r+=t[1])*i+a;u=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=n,s[l]=o,o},maybeSet:function(n,o){for(var l=e(n)&u,c=a[l],h=0;c!=i;){if(r(c,n))return s[l];if(++h>=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=n,s[l]=o,o},get:function(n,o){for(var l=e(n)&u,c=a[l],h=0;c!=i;){if(r(c,n))return s[l];if(++h>=t)break;c=a[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,r=a.length;e>7^ca[2]^ca[3])},pa=function(t){var e,r,n,i=function(t){function e(t,e,r,n){if(p[r]!==t){p[r]=t;var i=f[r];if(i>=0){var o=d[r];i===e&&o===n||i===n&&o===e||(++m,g[r]=1)}else f[r]=e,d[r]=n}}function r(t){return ha(u[t])}function n(t,e){return sa(u[t],u[e])}var i,o,a,s,u=t.coordinates,l=t.lines,c=t.rings,h=function(){for(var t=aa(1.4*u.length,r,n,Int32Array,-1,Int32Array),e=new Int32Array(u.length),i=0,o=u.length;i=t)throw new Error("full hashset");u=o[s=s+1&a]}return o[s]=n,!0},has:function(n){for(var s=e(n)&a,u=o[s],l=0;u!=i;){if(r(u,n))return!0;if(++l>=t)break;u=o[s=s+1&a]}return!1},values:function(){for(var t=[],e=0,r=o.length;es&&(s=e),ru&&(u=r)}function n(t){t.forEach(r)}function i(t){t.forEach(n)}var o=1/0,a=1/0,s=-1/0,u=-1/0,l={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){r(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(r)},LineString:function(t){n(t.arcs)},MultiLineString:function(t){t.arcs.forEach(n)},Polygon:function(t){t.arcs.forEach(n)},MultiPolygon:function(t){t.arcs.forEach(i)}};for(var c in t)e(t[c]);return s>=o&&u>=a?[o,a,s,u]:void 0}(t=function(t){var e,r={};for(e in t)r[e]=Gt(t[e]);return r}(t)),a=e>0&&o&&function(t,e,r){function n(t){return[Math.round((t[0]-l)*f),Math.round((t[1]-c)*d)]}function i(t,e){for(var r,n,i,o,a,s=-1,u=0,h=t.length,p=new Array(h);++st&&(e.push(n),r=i)}return e},da.prototype.vector=function(t){var e=this.pos(t+10),r=this.pos(t-10);return{angle:180*Math.atan2(e.y-r.y,e.x-r.x)/3.14,speed:Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y)+(r.z-e.z)*(r.z-e.z))}},da.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var r=e/this.duration;if(r>=1)return this.points[this.length-1];var n=Math.floor((this.points.length-1)*r);return function(t,e,r,n,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+n.x*o[1]+r.x*o[2]+e.x*o[3],y:i.y*o[0]+n.y*o[1]+r.y*o[2]+e.y*o[3],z:i.z*o[0]+n.z*o[1]+r.z*o[2]+e.z*o[3]}}((this.length-1)*r-n,this.points[n],this.controls[n][1],this.controls[n+1][0],this.points[n+1])};var ga=ge,ma=ge;ge.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(Ae(t,0,o,r));if(i)for(var s=0,u=e.length;s0&&(n+=t[i-1].length,r.holes.push(n))}return r},ga.default=ma,ke.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!Xe(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),a=Ze(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Oe(r,this.toBBox),Oe(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},_splitRoot:function(t,e){this.data=Ze([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Oe(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,s,u,l,c;for(u=l=1/0,n=e;n<=r-e;n++)a=function(t,e){var r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}(i=Fe(t,0,n,this.toBBox),o=Fe(t,n,r,this.toBBox)),s=qe(i)+qe(o),a=e;i--)o=t.children[i],Be(u,t.leaf?a(o):o),l+=je(u);return l},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)Be(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():Oe(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var ya=Object.freeze({toMercator:ir,toWgs84:or}),_a=6378137,va=function(t){function e(){for(var t=[],e=0;e1)for(e=0;e=1||u<=0||l>=1||l<=0))){var g=d,m=!s[g];m&&(s[g]=!0),e?a.push(e(d,t,r,c,h,u,n,i,p,f,l,m)):a.push(d)}}function i(t,e){var r,n,i,a,s=o[t][e],u=o[t][e+1];return s[0]m[e.isect].coord?-1:1})),f=[];S.length>0;){var A=S.pop(),L=A.isect,D=A.parent,N=A.winding,z=f.length,R=[m[L].coord],k=L;if(m[L].ringAndEdge1Walkable)var O=m[L].ringAndEdge1,F=m[L].nxtIsectAlongRingAndEdge1;else O=m[L].ringAndEdge2,F=m[L].nxtIsectAlongRingAndEdge2;for(;!Pr(m[L].coord,m[F].coord);){R.push(m[F].coord);var B=void 0;for(s=0;sp&&(g>c&&dc&&gu&&(u=m)}var y=[];if(s&&u0&&Math.abs(x-r[v-1][0])>p){var b=parseFloat(r[v-1][0]),w=parseFloat(r[v-1][1]),E=parseFloat(r[v][0]),I=parseFloat(r[v][1]);if(b>-180&&b-180&&r[v-1][0]c&&b<180&&-180===E&&v+1c&&r[v-1][0]<180){_.push([180,r[v][1]]),v++,_.push([r[v][0],r[v][1]]);continue}if(bc){var S=b;b=E,E=S;var C=w;w=I,I=C}if(b>c&&E=180&&bc?180:-180,P]),(_=[]).push([r[v-1][0]>c?-180:180,P]),y.push(_)}else _=[],y.push(_);_.push([x,r[v][1]])}else _.push([r[v][0],r[v][1]])}}else{var M=[];y.push(M);for(var A=0;A=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(n.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(n.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return n.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?n.coordinates[1]-i.coordinates[1]:i.coordinates[1]-n.coordinates[1];var o=dn(t.coordinates,n.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(n.coordinates[0]-t.coordinates[0],2)+Math.pow(n.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},Es.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},Es.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},Es.prototype.addInnerEdge=function(t){this.innerEdges.push(t)};var Is=function(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)};Is.prototype.getSymetric=function(){return this.symetric||(this.symetric=new Is(this.to,this.from),this.symetric.symetric=this),this.symetric},Is.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},Is.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},Is.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},Is.prototype.toLineString=function(){return s([this.from.coordinates,this.to.coordinates])},Is.prototype.compareTo=function(t){return dn(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var Ss=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},Cs={length:{configurable:!0}};Ss.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},Ss.prototype.get=function(t){return this.edges[t]},Cs.length.get=function(){return this.edges.length},Ss.prototype.forEach=function(t){this.edges.forEach(t)},Ss.prototype.map=function(t){return this.edges.map(t)},Ss.prototype.some=function(t){return this.edges.some(t)},Ss.prototype.isValid=function(){return!0},Ss.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,r,n){return r.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=n),e}),0),r=(0===e?this.length:e)-1,n=(e+1)%this.length,i=dn(this.edges[r].from.coordinates,this.edges[e].from.coordinates,this.edges[n].from.coordinates);return 0===i?this.edges[r].from.coordinates[0]>this.edges[n].from.coordinates[0]:i>0},Ss.prototype.toMultiPoint=function(){return h(this.edges.map((function(t){return t.from.coordinates})))},Ss.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=o([t])},Ss.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=se(this.toPolygon())},Ss.findEdgeRingContaining=function(t,e){var r,i,o=t.getEnvelope();return e.forEach((function(e){var a=e.getEnvelope();if(i&&(r=i.getEnvelope()),!function(t,e){var r=t.geometry.coordinates.map((function(t){return t[0]})),n=t.geometry.coordinates.map((function(t){return t[1]})),i=e.geometry.coordinates.map((function(t){return t[0]})),o=e.geometry.coordinates.map((function(t){return t[1]}));return Math.max(null,r)===Math.max(null,i)&&Math.max(null,n)===Math.max(null,o)&&Math.min(null,r)===Math.min(null,i)&&Math.min(null,n)===Math.min(null,o)}(a,o)&&gn(a,o)){var s=t.map((function(t){return t.from.coordinates})).find((function(t){return!e.some((function(e){return function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t,e.from.coordinates)}))}));s&&e.inside(n(s))&&(i&&!gn(r,a)||(i=e))}})),i},Ss.prototype.inside=function(t){return Pt(t,this.toPolygon())},Object.defineProperties(Ss.prototype,Cs);var Ts=function(){this.edges=[],this.nodes={}};Ts.fromGeoJson=function(t){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(t);var e=new Ts;return k(t,(function(t){Y(t,"LineString","Graph::fromGeoJson"),P(t,(function(t,r){if(t){var n=e.getNode(t),i=e.getNode(r);e.addEdge(n,i)}return r}))})),e},Ts.prototype.getNode=function(t){var e=Es.buildId(t),r=this.nodes[e];return r||(r=this.nodes[e]=new Es(t)),r},Ts.prototype.addEdge=function(t,e){var r=new Is(t,e),n=r.getSymetric();this.edges.push(r),this.edges.push(n)},Ts.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},Ts.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var r=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),r.forEach((function(t){return e._removeIfDangle(t)}))}},Ts.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},Ts.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,r){t.getOuterEdge((0===r?t.getOuterEdges().length:r)-1).symetric.next=e}))},Ts.prototype._computeNextCCWEdges=function(t,e){for(var r,n,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var a=i[o],s=a.symetric,u=void 0,l=void 0;a.label===e&&(u=a),s.label===e&&(l=s),u&&l&&(l&&(n=l),u&&(n&&(n.next=u,n=void 0),r||(r=u)))}n&&(n.next=r)},Ts.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(r){if(!(r.label>=0)){t.push(r);var n=r;do{n.label=e,n=n.next}while(!r.isEqual(n));e++}})),t},Ts.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(r){t._computeNextCCWEdges(r,e.label)}))}));var e=[];return this.edges.forEach((function(r){r.ring||e.push(t._findEdgeRing(r))})),e},Ts.prototype._findIntersectionNodes=function(t){var e=[],r=t,n=function(){var n=0;r.from.getOuterEdges().forEach((function(e){e.label===t.label&&++n})),n>1&&e.push(r.from),r=r.next};do{n()}while(!t.isEqual(r));return e},Ts.prototype._findEdgeRing=function(t){var e=t,r=new Ss;do{r.push(e),e.ring=r,e=e.next}while(!t.isEqual(e));return r},Ts.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},Ts.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()};var Ps=mt((function(t,e){function r(t){var e=[];for(var r in t)e.push(r);return e}(t.exports="function"==typeof Object.keys?Object.keys:r).shim=r})),Ms=(Ps.shim,mt((function(t,e){function r(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function n(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(e=t.exports=i?r:n).supported=r,e.unsupported=n}))),As=(Ms.supported,Ms.unsupported,mt((function(t){function e(t){return null==t}function r(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}var n=Array.prototype.slice,i=t.exports=function(t,o,a){return a||(a={}),t===o||(t instanceof Date&&o instanceof Date?t.getTime()===o.getTime():!t||!o||"object"!=typeof t&&"object"!=typeof o?a.strict?t===o:t==o:function(t,o,a){var s,u;if(e(t)||e(o))return!1;if(t.prototype!==o.prototype)return!1;if(Ms(t))return!!Ms(o)&&(t=n.call(t),o=n.call(o),i(t,o,a));if(r(t)){if(!r(o))return!1;if(t.length!==o.length)return!1;for(s=0;s=0;s--)if(l[s]!=c[s])return!1;for(s=l.length-1;s>=0;s--)if(u=l[s],!i(t[u],o[u],a))return!1;return typeof t==typeof o}(t,o,a))}}))),Ls=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:Cn};Ls.prototype.compare=function(t,e){if(t.type!==e.type||!Sn(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var r=this,n=In(t),i=In(e);return n.every((function(t){return this.some((function(e){return r.compare(t,e)}))}),i)}}return!1},Ls.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var r=0;r=0&&(r=[].concat(t.slice(n,t.length),t.slice(1,n+1))),r},Ls.prototype.comparePath=function(t,e){var r=this;return t.every((function(t,e){return r.compareCoord(t,this[e])}),e)},Ls.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length),i=this;return r.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),n)}return!1},Ls.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},Ls.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},Ls.prototype.removePseudo=function(t){return t};var Ds=Ls,Ns=mt((function(t){function e(t,e,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,r,n)}e.prototype.run=function(t,e,r,n){this._init(t,e,r,n);for(var i=0;i=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],r=0;r0){for(u=0;u=0);return t},e.prototype.assign=function(){for(var t,e=!1,r=this.dataset.length,n=0;ni&&(r=n):e=this.minPts)return r},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var r=[],n=0,i=this.dataset.length;n0,f=[];if(r)i="kmrand"==r?function(t,e){for(var r={},n=[],i=e<<2,o=t.length,a=t[0].length>0;n.length0;){var s=t[Math.floor(Math.random()*o)],u=a?s.join("_"):""+s;r[u]||(r[u]=!0,n.push(s))}if(n.length0,a=t[Math.floor(Math.random()*i)];for(o&&a.join("_"),n.push(a);n.length0;){var u=a.pop();if(u===r)return An(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),r=this.content.pop();e!==this.content.length-1&&(this.content[e]=r,this.scoreFunction(r)0;){var r=(t+1>>1)-1,n=this.content[r];if(!(this.scoreFunction(e)=s)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[n=a],a=null,i.halfedges.forEach((function(r){var n=o.edges[r],s=n.left;if(s!==i.site&&s||(s=n.right)){var u=t-s[0],l=e-s[1],h=u*u+l*l;he.x?1:this.ye.y?1:0},lu.prototype.clone=function(){},lu.prototype.copy=function(){return new lu(this)},lu.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},lu.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+r*r+n*n)},lu.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},lu.prototype.hashCode=function(){var t=17;return 37*(t=37*t+lu.hashCode(this.x))+lu.hashCode(this.y)},lu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},lu.prototype.interfaces_=function(){return[au,su,Ei]},lu.prototype.getClass=function(){return lu},lu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=iu.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},cu.DimensionalComparator.get=function(){return hu},cu.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},cu.NULL_ORDINATE.get=function(){return iu.NaN},cu.X.get=function(){return 0},cu.Y.get=function(){return 1},cu.Z.get=function(){return 2},Object.defineProperties(lu,cu);var hu=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new nu("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};hu.prototype.compare=function(t,e){var r=t,n=e,i=hu.compare(r.x,n.x);if(0!==i)return i;var o=hu.compare(r.y,n.y);return 0!==o?o:this._dimensionsToTest<=2?0:hu.compare(r.z,n.z)},hu.prototype.interfaces_=function(){return[uu]},hu.prototype.getClass=function(){return hu},hu.compare=function(t,e){return te?1:iu.isNaN(t)?iu.isNaN(e)?0:-1:iu.isNaN(e)?1:0};var pu=function(){};pu.prototype.create=function(){},pu.prototype.interfaces_=function(){return[]},pu.prototype.getClass=function(){return pu};var fu=function(){},du={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};fu.prototype.interfaces_=function(){return[]},fu.prototype.getClass=function(){return fu},fu.toLocationSymbol=function(t){switch(t){case fu.EXTERIOR:return"e";case fu.BOUNDARY:return"b";case fu.INTERIOR:return"i";case fu.NONE:return"-"}throw new nu("Unknown location value: "+t)},du.INTERIOR.get=function(){return 0},du.BOUNDARY.get=function(){return 1},du.EXTERIOR.get=function(){return 2},du.NONE.get=function(){return-1},Object.defineProperties(fu,du);var gu=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},mu=function(){},yu={LOG_10:{configurable:!0}};mu.prototype.interfaces_=function(){return[]},mu.prototype.getClass=function(){return mu},mu.log10=function(t){var e=Math.log(t);return iu.isInfinite(e)||iu.isNaN(e)?e:e/mu.LOG_10},mu.min=function(t,e,r,n){var i=t;return er?r:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var n=arguments[0],i=arguments[1],o=arguments[2];return no?o:n}},mu.wrap=function(t,e){return t<0?e- -t%e:t%e},mu.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],r=arguments[0];return t>r&&(r=t),e>r&&(r=e),r}if(4===arguments.length){var n=arguments[1],i=arguments[2],o=arguments[3],a=arguments[0];return n>a&&(a=n),i>a&&(a=i),o>a&&(a=o),a}},mu.average=function(t,e){return(t+e)/2},yu.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(mu,yu);var _u=function(t){this.str=t};_u.prototype.append=function(t){this.str+=t},_u.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},_u.prototype.toString=function(t){return this.str};var vu=function(t){this.value=t};vu.prototype.intValue=function(){return this.value},vu.prototype.compareTo=function(t){return this.valuet?1:0},vu.isNaN=function(t){return Number.isNaN(t)};var xu=function(){};xu.isWhitespace=function(t){return t<=32&&t>=0||127===t},xu.toUpperCase=function(t){return t.toUpperCase()};var bu=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var r=arguments[0];this.init(r)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n,i)}},wu={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};bu.prototype.le=function(t){return(this._hi9?(c=!0,h="9"):h="0"+l,a.append(h),r=r.subtract(bu.valueOf(l)).multiply(bu.TEN),c&&r.selfAdd(bu.TEN);var p=!0,f=bu.magnitude(r._hi);if(f<0&&Math.abs(f)>=s-u&&(p=!1),!p)break}return e[0]=n,a.toString()},bu.prototype.sqr=function(){return this.multiply(this)},bu.prototype.doubleValue=function(){return this._hi+this._lo},bu.prototype.subtract=function(){if(arguments[0]instanceof bu){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},bu.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},bu.prototype.isZero=function(){return 0===this._hi&&0===this._lo},bu.prototype.selfSubtract=function(){if(arguments[0]instanceof bu){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},bu.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},bu.prototype.min=function(t){return this.le(t)?this:t},bu.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,l=null,c=null,h=null;return u=this._hi/r,h=(i=(l=bu.SPLIT*u)-(i=l-u))*(a=(h=bu.SPLIT*r)-(a=h-r))-(c=u*r)+i*(s=r-a)+(o=u-i)*a+o*s,h=u+(l=(this._hi-c-h+this._lo-u*n)/r),this._hi=h,this._lo=u-h+l,this}},bu.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},bu.prototype.divide=function(){if(arguments[0]instanceof bu){var t=arguments[0],e=null,r=null,n=null,i=null,o=null,a=null,s=null,u=null;return r=(o=this._hi/t._hi)-(e=(a=bu.SPLIT*o)-(e=a-o)),u=e*(n=(u=bu.SPLIT*t._hi)-(n=u-t._hi))-(s=o*t._hi)+e*(i=t._hi-n)+r*n+r*i,a=(this._hi-s-u+this._lo-o*t._lo)/t._hi,new bu(u=o+a,o-u+a)}if("number"==typeof arguments[0]){var l=arguments[0];return iu.isNaN(l)?bu.createNaN():bu.copy(this).selfDivide(l,0)}},bu.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},bu.prototype.pow=function(t){if(0===t)return bu.valueOf(1);var e=new bu(this),r=bu.valueOf(1),n=Math.abs(t);if(n>1)for(;n>0;)n%2==1&&r.selfMultiply(e),(n/=2)>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},bu.prototype.ceil=function(){if(this.isNaN())return bu.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new bu(t,e)},bu.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},bu.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},bu.prototype.setValue=function(){if(arguments[0]instanceof bu){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},bu.prototype.max=function(t){return this.ge(t)?this:t},bu.prototype.sqrt=function(){if(this.isZero())return bu.valueOf(0);if(this.isNegative())return bu.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=bu.valueOf(e),n=this.subtract(r.sqr())._hi*(.5*t);return r.add(n)},bu.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],r=null,n=null,i=null,o=null,a=null,s=null;return o=(i=this._hi+e)-(a=i-this._hi),n=(s=(o=e-a+(this._hi-o))+this._lo)+(i-(r=i+s)),this._hi=r+n,this._lo=n+(r-this._hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],c=null,h=null,p=null,f=null,d=null,g=null,m=null;f=this._hi+u,h=this._lo+l,d=f-(g=f-this._hi),p=h-(m=h-this._lo);var y=(c=f+(g=(d=u-g+(this._hi-d))+h))+(g=(p=l-m+(this._lo-p))+(g+(f-c))),_=g+(c-y);return this._hi=y,this._lo=_,this}},bu.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,l=null;i=(u=bu.SPLIT*this._hi)-this._hi,l=bu.SPLIT*r,i=u-i,o=this._hi-i,a=l-r;var c=(u=this._hi*r)+(l=i*(a=l-a)-u+i*(s=r-a)+o*a+o*s+(this._hi*n+this._lo*r)),h=l+(i=u-c);return this._hi=c,this._lo=h,this}},bu.prototype.selfSqr=function(){return this.selfMultiply(this)},bu.prototype.floor=function(){if(this.isNaN())return bu.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new bu(t,e)},bu.prototype.negate=function(){return this.isNaN()?this:new bu(-this._hi,-this._lo)},bu.prototype.clone=function(){},bu.prototype.multiply=function(){if(arguments[0]instanceof bu){var t=arguments[0];return t.isNaN()?bu.createNaN():bu.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return iu.isNaN(e)?bu.createNaN():bu.copy(this).selfMultiply(e,0)}},bu.prototype.isNaN=function(){return iu.isNaN(this._hi)},bu.prototype.intValue=function(){return Math.trunc(this._hi)},bu.prototype.toString=function(){var t=bu.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},bu.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),n=e[0]+1,i=r;if("."===r.charAt(0))i="0"+r;else if(n<0)i="0."+bu.stringOfChar("0",-n)+r;else if(-1===r.indexOf(".")){var o=n-r.length;i=r+bu.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},bu.prototype.reciprocal=function(){var t,e,r,n,i=null,o=null,a=null,s=null;t=(r=1/this._hi)-(i=(a=bu.SPLIT*r)-(i=a-r)),o=(s=bu.SPLIT*this._hi)-this._hi;var u=r+(a=(1-(n=r*this._hi)-(s=i*(o=s-o)-n+i*(e=this._hi-o)+t*o+t*e)-r*this._lo)/this._hi);return new bu(u,r-u+a)},bu.prototype.toSciNotation=function(){if(this.isZero())return bu.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),n=bu.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===r.charAt(0))throw new Error("Found leading zero: "+r);var i="";r.length>1&&(i=r.substring(1));var o=r.charAt(0)+"."+i;return this.isNegative()?"-"+o+n:o+n},bu.prototype.abs=function(){return this.isNaN()?bu.NaN:this.isNegative()?this.negate():new bu(this)},bu.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},bu.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},bu.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},bu.prototype.trunc=function(){return this.isNaN()?bu.NaN:this.isPositive()?this.floor():this.ceil()},bu.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},bu.prototype.interfaces_=function(){return[Ei,au,su]},bu.prototype.getClass=function(){return bu},bu.sqr=function(t){return bu.valueOf(t).selfMultiply(t)},bu.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return bu.parse(t)}if("number"==typeof arguments[0])return new bu(arguments[0])},bu.sqrt=function(t){return bu.valueOf(t).sqrt()},bu.parse=function(t){for(var e=0,r=t.length;xu.isWhitespace(t.charAt(e));)e++;var n=!1;if(e=r);){var l=t.charAt(e);if(e++,xu.isDigit(l)){var c=l-"0";o.selfMultiply(bu.TEN),o.selfAdd(c),a++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=vu.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}s=a}}var p=o,f=a-s-u;if(0===f)p=o;else if(f>0){var d=bu.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=bu.TEN.pow(-f);p=o.multiply(g)}return n?p.negate():p},bu.createNaN=function(){return new bu(iu.NaN,iu.NaN)},bu.copy=function(t){return new bu(t)},bu.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),n=Math.trunc(Math.floor(r));return 10*Math.pow(10,n)<=e&&(n+=1),n},bu.stringOfChar=function(t,e){for(var r=new _u,n=0;n0){if(o<=0)return Eu.signum(a);n=i+o}else{if(!(i<0))return Eu.signum(a);if(o>=0)return Eu.signum(a);n=-i-o}var s=Eu.DP_SAFE_EPSILON*n;return a>=s||-a>=s?Eu.signum(a):2},Eu.signum=function(t){return t>0?1:t<0?-1:0},Iu.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Eu,Iu);var Su=function(){},Cu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Cu.X.get=function(){return 0},Cu.Y.get=function(){return 1},Cu.Z.get=function(){return 2},Cu.M.get=function(){return 3},Su.prototype.setOrdinate=function(t,e,r){},Su.prototype.size=function(){},Su.prototype.getOrdinate=function(t,e){},Su.prototype.getCoordinate=function(){},Su.prototype.getCoordinateCopy=function(t){},Su.prototype.getDimension=function(){},Su.prototype.getX=function(t){},Su.prototype.clone=function(){},Su.prototype.expandEnvelope=function(t){},Su.prototype.copy=function(){},Su.prototype.getY=function(t){},Su.prototype.toCoordinateArray=function(){},Su.prototype.interfaces_=function(){return[su]},Su.prototype.getClass=function(){return Su},Object.defineProperties(Su,Cu);var Tu=function(){},Pu=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Tu),Mu=function(){};Mu.arraycopy=function(t,e,r,n,i){for(var o=0,a=e;at._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,n=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&n>=this._miny&&n<=this._maxy}},Lu.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Lu){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||rthis._maxy||nthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=n,this._maxy=n):(rthis._maxx&&(this._maxx=r),nthis._maxy&&(this._maxy=n))}},Lu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Lu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Lu.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Lu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Lu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Lu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Lu.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Lu.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Lu){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof lu){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return this.covers(r,n)}},Lu.prototype.centre=function(){return this.isNull()?null:new lu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Lu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof lu){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Lu){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.init(r.x,n.x,r.y,n.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];it._maxx&&(e=this._minx-t._maxx);var r=0;return this._maxyt._maxy&&(r=this._miny-t._maxy),0===e?r:0===r?e:Math.sqrt(e*e+r*r)},Lu.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+lu.hashCode(this._minx))+lu.hashCode(this._maxx))+lu.hashCode(this._miny))+lu.hashCode(this._maxy)},Lu.prototype.interfaces_=function(){return[au,Ei]},Lu.prototype.getClass=function(){return Lu},Lu.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.xe.x?t.x:e.x)&&r.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),u=Math.max(o.x,a.x),l=Math.min(n.x,i.x),c=Math.max(n.x,i.x);return!(l>u||cu||cthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},Vu.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Vu.prototype.setPrecisionModel=function(t){this._precisionModel=t},Vu.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?n:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=n>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return Uu.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},Vu.nonRobustComputeEdgeDistance=function(t,e,r){var n=t.x-e.x,i=t.y-e.y,o=Math.sqrt(n*n+i*i);return Uu.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},qu.DONT_INTERSECT.get=function(){return 0},qu.DO_INTERSECT.get=function(){return 1},qu.COLLINEAR.get=function(){return 2},qu.NO_INTERSECTION.get=function(){return 0},qu.POINT_INTERSECTION.get=function(){return 1},qu.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Vu,qu);var ju=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Lu(this._inputLines[0][0],this._inputLines[0][1]),r=new Lu(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&r.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],r=arguments[1],n=arguments[2];if(this._isProper=!1,Lu.intersects(r,n,e)&&0===Zu.orientationIndex(r,n,e)&&0===Zu.orientationIndex(n,r,e))return this._isProper=!0,(e.equals(r)||e.equals(n))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,r,n,i){i.x=this.smallestInAbsValue(t.x,e.x,r.x,n.x),i.y=this.smallestInAbsValue(t.y,e.y,r.y,n.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,r.x-=i.x,r.y-=i.y,n.x-=i.x,n.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,r,n,i){var o=null;try{o=Au.intersection(t,r,n,i)}catch(a){if(!(a instanceof Pu))throw a;o=e.nearestEndpoint(t,r,n,i)}return o},e.prototype.intersection=function(t,r,n,i){var o=this.intersectionWithNormalization(t,r,n,i);return this.isInSegmentEnvelopes(o)||(o=new lu(e.nearestEndpoint(t,r,n,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,r,n){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&Mu.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,r,n){var i=new lu(t),o=new lu(e),a=new lu(r),s=new lu(n),u=new lu;this.normalizeToEnvCentre(i,o,a,s,u);var l=this.safeHCoordinateIntersection(i,o,a,s);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,r,n,i){var o=Lu.intersects(e,r,n),a=Lu.intersects(e,r,i),s=Lu.intersects(n,i,e),u=Lu.intersects(n,i,r);return o&&a?(this._intPt[0]=n,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=e,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||a||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=n,this._intPt[1]=r,!n.equals(r)||a||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&u?(this._intPt[0]=i,this._intPt[1]=r,!i.equals(r)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,r,n,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=r.xn.x?r.x:n.x,p=r.y>n.y?r.y:n.y,f=((o>l?o:l)+(sc?a:c)+(u0&&a>0||o<0&&a<0)return t.NO_INTERSECTION;var s=Zu.orientationIndex(n,i,e),u=Zu.orientationIndex(n,i,r);return s>0&&u>0||s<0&&u<0?t.NO_INTERSECTION:0===o&&0===a&&0===s&&0===u?this.computeCollinearIntersection(e,r,n,i):(0===o||0===a||0===s||0===u?(this._isProper=!1,e.equals2D(n)||e.equals2D(i)?this._intPt[0]=e:r.equals2D(n)||r.equals2D(i)?this._intPt[0]=r:0===o?this._intPt[0]=new lu(n):0===a?this._intPt[0]=new lu(i):0===s?this._intPt[0]=new lu(e):0===u&&(this._intPt[0]=new lu(r))):(this._isProper=!0,this._intPt[0]=this.intersection(e,r,n,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,r,n){var i=t,o=Zu.distancePointLine(t,r,n),a=Zu.distancePointLine(e,r,n);return a0?r>0?-i:i:r>0?i:-i;if(0===e||0===r)return n>0?t>0?i:-i:t>0?-i:i;if(e>0?n>0?e<=n||(i=-i,o=t,t=r,r=o,o=e,e=n,n=o):e<=-n?(i=-i,r=-r,n=-n):(o=t,t=-r,r=o,o=e,e=-n,n=o):n>0?-e<=n?(i=-i,t=-t,e=-e):(o=-t,t=r,r=o,o=-e,e=n,n=o):e>=n?(t=-t,e=-e,r=-r,n=-n):(i=-i,o=-t,t=-r,r=o,o=-e,e=-n,n=o),t>0){if(!(r>0))return i;if(!(t<=r))return i}else{if(r>0)return-i;if(!(t>=r))return-i;i=-i,t=-t,r=-r}for(;;){if((n-=(a=Math.floor(r/t))*e)<0)return-i;if(n>e)return i;if(t>(r-=a*t)+r){if(en+n)return-i;r=t-r,n=e-n,i=-i}if(0===n)return 0===r?0:-i;if(0===r)return i;if((e-=(a=Math.floor(t/r))*n)<0)return i;if(e>n)return-i;if(r>(t-=a*r)+t){if(ne+e)return i;t=r-t,e=n-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var Xu=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};Xu.prototype.countSegment=function(t,e){if(t.xn&&(r=e.x,n=t.x),this._p.x>=r&&this._p.x<=n&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,s=e.y-this._p.y,u=Gu.signOfDet2x2(i,o,a,s);if(0===u)return this._isPointOnSegment=!0,null;s0&&this._crossingCount++}},Xu.prototype.isPointInPolygon=function(){return this.getLocation()!==fu.EXTERIOR},Xu.prototype.getLocation=function(){return this._isPointOnSegment?fu.BOUNDARY:this._crossingCount%2==1?fu.INTERIOR:fu.EXTERIOR},Xu.prototype.isOnSegment=function(){return this._isPointOnSegment},Xu.prototype.interfaces_=function(){return[]},Xu.prototype.getClass=function(){return Xu},Xu.locatePointInRing=function(){if(arguments[0]instanceof lu&&gu(arguments[1],Su)){for(var t=arguments[1],e=new Xu(arguments[0]),r=new lu,n=new lu,i=1;i1||s<0||s>1)&&(i=!0)}}else i=!0;return i?mu.min(Zu.distancePointLine(t,r,n),Zu.distancePointLine(e,r,n),Zu.distancePointLine(r,t,e),Zu.distancePointLine(n,t,e)):0},Zu.isPointInRing=function(t,e){return Zu.locatePointInRing(t,e)!==fu.EXTERIOR},Zu.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,n=new lu;t.getCoordinate(0,n);for(var i=n.x,o=n.y,a=1;ar.y&&(r=o,n=i)}var a=n;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(r)&&a!==n);var s=n;do{s=(s+1)%e}while(t[s].equals2D(r)&&s!==n);var u=t[a],l=t[s];if(u.equals2D(r)||l.equals2D(r)||u.equals2D(l))return!1;var c=Zu.computeOrientation(u,r,l);return 0===c?u.x>l.x:c>0},Zu.locatePointInRing=function(t,e){return Xu.locatePointInRing(t,e)},Zu.distancePointLinePerpendicular=function(t,e,r){var n=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),i=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/n;return Math.abs(i)*Math.sqrt(n)},Zu.computeOrientation=function(t,e,r){return Zu.orientationIndex(t,e,r)},Zu.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new nu("Line array must contain at least one vertex");for(var r=t.distance(e[0]),n=0;n=1)return o.distance(s);var c=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/u;return Math.abs(c)*Math.sqrt(u)}},Zu.isOnLine=function(t,e){for(var r=new ju,n=1;n0},rl.prototype.interfaces_=function(){return[$u]},rl.prototype.getClass=function(){return rl};var nl=function(){};nl.prototype.isInBoundary=function(t){return t>1},nl.prototype.interfaces_=function(){return[$u]},nl.prototype.getClass=function(){return nl};var il=function(){};il.prototype.isInBoundary=function(t){return 1===t},il.prototype.interfaces_=function(){return[$u]},il.prototype.getClass=function(){return il};var ol=function(){};ol.prototype.add=function(){},ol.prototype.addAll=function(){},ol.prototype.isEmpty=function(){},ol.prototype.iterator=function(){},ol.prototype.size=function(){},ol.prototype.toArray=function(){},ol.prototype.remove=function(){};var al=function(t){function e(e){t.call(this),this.message=e||""}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={name:{configurable:!0}};return r.name.get=function(){return"IndexOutOfBoundsException"},Object.defineProperties(e,r),e}(Error),sl=function(){};sl.prototype.hasNext=function(){},sl.prototype.next=function(){},sl.prototype.remove=function(){};var ul=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(ol);(Ii.prototype=new Error).name="NoSuchElementException";var ll=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof ol&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,ol]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var r=this.array_[t];return this.array_[t]=e,r},e.prototype.iterator=function(){return new cl(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new al;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l=0;c--)this.add(s[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof lu){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(hy&&(_=-1);for(var v=m;v!==y;v+=_)this.add(d[v],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new lu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,r),e}(ll),pl=function(){},fl={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};fl.ForwardComparator.get=function(){return dl},fl.BidirectionalComparator.get=function(){return gl},fl.coordArrayType.get=function(){return new Array(0).fill(null)},pl.prototype.interfaces_=function(){return[]},pl.prototype.getClass=function(){return pl},pl.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},pl.ptNotInList=function(t,e){for(var r=0;r=t?e:[]},pl.indexOf=function(t,e){for(var r=0;r0)&&(e=t[r]);return e},pl.extract=function(t,e,r){e=mu.clamp(e,0,t.length);var n=(r=mu.clamp(r,-1,t.length))-e+1;r<0&&(n=0),e>=t.length&&(n=0),rn.length)return 1;if(0===r.length)return 0;var i=pl.compare(r,n);return pl.isEqualReversed(r,n)?0:i},gl.prototype.OLDcompare=function(t,e){var r=t,n=e;if(r.lengthn.length)return 1;if(0===r.length)return 0;for(var i=pl.increasingDirection(r),o=pl.increasingDirection(n),a=i>0?0:r.length-1,s=o>0?0:r.length-1,u=0;u0))return e.value;e=e.right}}return null},Di.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:xl,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var r,n,i=this.root_;do{if(r=i,(n=t.compareTo(i.key))<0)i=i.left;else{if(!(n>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:r,color:xl,getValue:function(){return this.value},getKey:function(){return this.key}};return n<0?r.left=a:r.right=a,this.fixAfterInsertion(a),this.size_++,null},Di.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(Pi(t)===Ai(Pi(Pi(t)))){var e=Li(Pi(Pi(t)));1===Ti(e)?(Mi(Pi(t),xl),Mi(e,xl),Mi(Pi(Pi(t)),1),t=Pi(Pi(t))):(t===Li(Pi(t))&&(t=Pi(t),this.rotateLeft(t)),Mi(Pi(t),xl),Mi(Pi(Pi(t)),1),this.rotateRight(Pi(Pi(t))))}else{var r=Ai(Pi(Pi(t)));1===Ti(r)?(Mi(Pi(t),xl),Mi(r,xl),Mi(Pi(Pi(t)),1),t=Pi(Pi(t))):(t===Ai(Pi(t))&&(t=Pi(t),this.rotateRight(t)),Mi(Pi(t),xl),Mi(Pi(Pi(t)),1),this.rotateLeft(Pi(Pi(t))))}this.root_.color=xl},Di.prototype.values=function(){var t=new ll,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Di.successor(e));)t.add(e.value);return t},Di.prototype.entrySet=function(){var t=new _l,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Di.successor(e));)t.add(e);return t},Di.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},Di.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},Di.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Di.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var r=t.parent,n=t;null!==r&&n===r.right;)n=r,r=r.parent;return r},Di.prototype.size=function(){return this.size_};var bl=function(){};bl.prototype.interfaces_=function(){return[]},bl.prototype.getClass=function(){return bl},Ni.prototype=new Ci,(zi.prototype=new Ni).contains=function(t){for(var e=0,r=this.array_.length;e=0;){var a=i.substring(0,o);n.add(a),o=(i=i.substring(o+r)).indexOf(e)}i.length>0&&n.add(i);for(var s=new Array(n.size()).fill(null),u=0;u0)for(var o=i;o0&&n.append(" ");for(var o=0;o0&&n.append(","),n.append(Dl.toString(t.getOrdinate(i,o)))}return n.append(")"),n.toString()}},zl.ensureValidRing=function(t,e){var r=e.size();return 0===r?e:r<=3?zl.createClosedRing(t,e,4):e.getOrdinate(0,Su.X)===e.getOrdinate(r-1,Su.X)&&e.getOrdinate(0,Su.Y)===e.getOrdinate(r-1,Su.Y)?e:zl.createClosedRing(t,e,r+1)},zl.createClosedRing=function(t,e,r){var n=t.create(r,e.getDimension()),i=e.size();zl.copy(e,0,n,0,i);for(var o=i;o0&&zl.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Il.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return Zu.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return zl.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,r=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.MINIMUM_VALID_SIZE.get=function(){return 4},r.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,r),e}(Rl),ql=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Hu.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],r=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,r)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),r=0;r0?e.createPoint(r[0]):e.createPoint():t},Zl.prototype.interfaces_=function(){return[jl.GeometryEditorOperation]},Zl.prototype.getClass=function(){return Zl};var Yl=function(){};Yl.prototype.edit=function(t,e){return t instanceof Vl?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Rl?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ol?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Yl.prototype.interfaces_=function(){return[jl.GeometryEditorOperation]},Yl.prototype.getClass=function(){return Yl};var Wl=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new _u(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(e=3),e<2?new Wl(t):new Wl(t,e)}},Kl.prototype.interfaces_=function(){return[pu,Ei]},Kl.prototype.getClass=function(){return Kl},Kl.instance=function(){return Kl.instanceObject},Jl.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Jl.instanceObject.get=function(){return new Kl},Object.defineProperties(Kl,Jl);var Ql=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new ll,e=this.map_.values(),r=e.next();!r.done;)t.add(r.value),r=e.next();return t},e.prototype.entrySet=function(){var t=new _l;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(ml),$l=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ec){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var r=arguments[0];this._modelType=t.FIXED,this.setScale(r)}else if(arguments[0]instanceof t){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}},tc={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};$l.prototype.equals=function(t){if(!(t instanceof $l))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},$l.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),n=e.getMaximumSignificantDigits();return new vu(r).compareTo(new vu(n))},$l.prototype.getScale=function(){return this._scale},$l.prototype.isFloating=function(){return this._modelType===$l.FLOATING||this._modelType===$l.FLOATING_SINGLE},$l.prototype.getType=function(){return this._modelType},$l.prototype.toString=function(){var t="UNKNOWN";return this._modelType===$l.FLOATING?t="Floating":this._modelType===$l.FLOATING_SINGLE?t="Floating-Single":this._modelType===$l.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},$l.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return iu.isNaN(t)||this._modelType===$l.FLOATING_SINGLE?t:this._modelType===$l.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof lu){var e=arguments[0];if(this._modelType===$l.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},$l.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===$l.FLOATING?t=16:this._modelType===$l.FLOATING_SINGLE?t=6:this._modelType===$l.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},$l.prototype.setScale=function(t){this._scale=Math.abs(t)},$l.prototype.interfaces_=function(){return[Ei,au]},$l.prototype.getClass=function(){return $l},$l.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},tc.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},tc.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties($l,tc);var ec=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},rc={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ec.prototype.readResolve=function(){return ec.nameToTypeMap.get(this._name)},ec.prototype.toString=function(){return this._name},ec.prototype.interfaces_=function(){return[Ei]},ec.prototype.getClass=function(){return ec},rc.serialVersionUID.get=function(){return-552860263173159e4},rc.nameToTypeMap.get=function(){return new Ql},Object.defineProperties(ec,rc),$l.Type=ec,$l.FIXED=new ec("FIXED"),$l.FLOATING=new ec("FLOATING"),$l.FLOATING_SINGLE=new ec("FLOATING SINGLE");var nc=function t(){this._precisionModel=new $l,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?gu(arguments[0],pu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof $l&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ic={serialVersionUID:{configurable:!0}};nc.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new lu(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new lu(t.getMinX(),t.getMinY()),new lu(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new lu(t.getMinX(),t.getMinY()),new lu(t.getMinX(),t.getMaxY()),new lu(t.getMaxX(),t.getMaxY()),new lu(t.getMaxX(),t.getMinY()),new lu(t.getMinX(),t.getMinY())]),null)},nc.prototype.createLineString=function(t){return t?t instanceof Array?new Rl(this.getCoordinateSequenceFactory().create(t),this):gu(t,Su)?new Rl(t,this):void 0:new Rl(this.getCoordinateSequenceFactory().create([]),this)},nc.prototype.createMultiLineString=function(){return 0===arguments.length?new Ml(null,this):1===arguments.length?new Ml(arguments[0],this):void 0},nc.prototype.buildGeometry=function(t){for(var e=null,r=!1,n=!1,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===e&&(e=a),a!==e&&(r=!0),o.isGeometryCollectionOrDerived()&&(n=!0)}if(null===e)return this.createGeometryCollection();if(r||n)return this.createGeometryCollection(nc.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Bl)return this.createMultiPolygon(nc.toPolygonArray(t));if(s instanceof Rl)return this.createMultiLineString(nc.toLineStringArray(t));if(s instanceof Ol)return this.createMultiPoint(nc.toPointArray(t));Uu.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},nc.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},nc.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof lu){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(gu(arguments[0],Su))return new Ol(arguments[0],this)}},nc.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},nc.prototype.createPolygon=function(){if(0===arguments.length)return new Bl(null,null,this);if(1===arguments.length){if(gu(arguments[0],Su)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Vl){var r=arguments[0];return this.createPolygon(r,null)}}else if(2===arguments.length)return new Bl(arguments[0],arguments[1],this)},nc.prototype.getSRID=function(){return this._SRID},nc.prototype.createGeometryCollection=function(){return 0===arguments.length?new Pl(null,this):1===arguments.length?new Pl(arguments[0],this):void 0},nc.prototype.createGeometry=function(t){return new jl(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},nc.prototype.getPrecisionModel=function(){return this._precisionModel},nc.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(gu(arguments[0],Su))return new Vl(arguments[0],this)}},nc.prototype.createMultiPolygon=function(){return 0===arguments.length?new ql(null,this):1===arguments.length?new ql(arguments[0],this):void 0},nc.prototype.createMultiPoint=function(){if(0===arguments.length)return new Ul(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new Ul(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(gu(arguments[0],Su)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(e.size()).fill(null),n=0;n=this.size())throw new Error;return this.array_[t]},Oi.prototype.push=function(t){return this.array_.push(t),t},Oi.prototype.pop=function(t){if(0===this.array_.length)throw new ki;return this.array_.pop()},Oi.prototype.peek=function(){if(0===this.array_.length)throw new ki;return this.array_[this.array_.length-1]},Oi.prototype.empty=function(){return 0===this.array_.length},Oi.prototype.isEmpty=function(){return this.empty()},Oi.prototype.search=function(t){return this.array_.indexOf(t)},Oi.prototype.size=function(){return this.array_.length},Oi.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e0&&this._minIndexthis._minCoord.y&&r.y>this._minCoord.y&&n===Zu.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},fc.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge().getCoordinates();if(e<0||e+1>=r.length)return-1;if(r[e].y===r[e+1].y)return-1;var n=hc.LEFT;return r[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=r,this._minCoord=e[r])},fc.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},fc.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.isForward()&&this.checkForRightmostCoordinate(r)}Uu.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===hc.LEFT&&(this._orientedDe=this._minDe.getSym())},fc.prototype.interfaces_=function(){return[]},fc.prototype.getClass=function(){return fc};var dc=function(t){function e(r,n){t.call(this,e.msgWithCoord(r,n)),this.pt=n?new lu(n):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Fu),gc=function(){this.array_=[]};gc.prototype.addLast=function(t){this.array_.push(t)},gc.prototype.removeFirst=function(){return this.array_.shift()},gc.prototype.isEmpty=function(){return 0===this.array_.length};var mc=function(){this._finder=null,this._dirEdgeList=new ll,this._nodes=new ll,this._rightMostCoord=null,this._env=null,this._finder=new fc};mc.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},mc.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},mc.prototype.computeNodeDepth=function(t){for(var e=null,r=t.getEdges().iterator();r.hasNext();){var n=r.next();if(n.isVisited()||n.getSym().isVisited()){e=n;break}}if(null===e)throw new dc("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},mc.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(hc.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},mc.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},mc.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(hc.RIGHT)>=1&&e.getDepth(hc.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},mc.prototype.computeDepths=function(t){var e=new _l,r=new gc,n=t.getNode();for(r.addLast(n),e.add(n),t.setVisited(!0);!r.isEmpty();){var i=r.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(r.addLast(s),e.add(s))}}}},mc.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},mc.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Lu,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next().getEdge().getCoordinates(),n=0;nthis.location.length){var e=new Array(3).fill(null);e[hc.ON]=this.location[hc.ON],e[hc.LEFT]=fu.NONE,e[hc.RIGHT]=fu.NONE,this.location=e}for(var r=0;r1&&t.append(fu.toLocationSymbol(this.location[hc.LEFT])),t.append(fu.toLocationSymbol(this.location[hc.ON])),this.location.length>1&&t.append(fu.toLocationSymbol(this.location[hc.RIGHT])),t.toString()},yc.prototype.setLocations=function(t,e,r){this.location[hc.ON]=t,this.location[hc.LEFT]=e,this.location[hc.RIGHT]=r},yc.prototype.get=function(t){return t1},yc.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},vc.prototype.addPoints=function(t,e,r){var n=t.getCoordinates();if(e){var i=1;r&&(i=0);for(var o=i;o=0;s--)this._pts.add(n[s])}},vc.prototype.isHole=function(){return this._isHole},vc.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},vc.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Zu.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();)if(r.next().containsPoint(t))return!1;return!0},vc.prototype.addHole=function(t){this._holes.add(t)},vc.prototype.isShell=function(){return null===this._shell},vc.prototype.getLabel=function(){return this._label},vc.prototype.getEdges=function(){return this._edges},vc.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},vc.prototype.getShell=function(){return this._shell},vc.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],r=arguments[0].getLocation(e,hc.RIGHT);if(r===fu.NONE)return null;if(this._label.getLocation(e)===fu.NONE)return this._label.setLocation(e,r),null}},vc.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},vc.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(t)},wc.prototype.isInResult=function(){return this._isInResult},wc.prototype.isVisited=function(){return this._isVisited},wc.prototype.interfaces_=function(){return[]},wc.prototype.getClass=function(){return wc};var Ec=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new _c(0,fu.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var r=fu.NONE;if(r=this._label.getLocation(e),!t.isNull(e)){var n=t.getLocation(e);r!==fu.BOUNDARY&&(r=n)}return r},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],r=arguments[1];null===this._label?this._label=new _c(e,r):this._label.setLocation(e,r)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof _c)for(var r=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(r,n);this._label.getLocation(n)===fu.NONE&&this._label.setLocation(n,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=fu.NONE;null!==this._label&&(e=this._label.getLocation(t));var r=null;switch(e){case fu.BOUNDARY:r=fu.INTERIOR;break;case fu.INTERIOR:default:r=fu.BOUNDARY}this._label.setLocation(t,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wc),Ic=function(){this.nodeMap=new Di,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Ic.prototype.find=function(t){return this.nodeMap.get(t)},Ic.prototype.addNode=function(){if(arguments[0]instanceof lu){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Ec){var r=arguments[0],n=this.nodeMap.get(r.getCoordinate());return null===n?(this.nodeMap.put(r.getCoordinate(),r),r):(n.mergeLabel(r),n)}},Ic.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Ic.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ic.prototype.values=function(){return this.nodeMap.values()},Ic.prototype.getBoundaryNodes=function(t){for(var e=new ll,r=this.iterator();r.hasNext();){var n=r.next();n.getLabel().getLocation(t)===fu.BOUNDARY&&e.add(n)}return e},Ic.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Ic.prototype.interfaces_=function(){return[]},Ic.prototype.getClass=function(){return Ic};var Sc=function(){},Cc={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Sc.prototype.interfaces_=function(){return[]},Sc.prototype.getClass=function(){return Sc},Sc.isNorthern=function(t){return t===Sc.NE||t===Sc.NW},Sc.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Sc.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var r=te?t:e)?3:r},Sc.isInHalfPlane=function(t,e){return e===Sc.SE?t===Sc.SE||t===Sc.SW:t===e||t===e+1},Sc.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new nu("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Sc.NE:Sc.SE:e>=0?Sc.NW:Sc.SW}if(arguments[0]instanceof lu&&arguments[1]instanceof lu){var r=arguments[0],n=arguments[1];if(n.x===r.x&&n.y===r.y)throw new nu("Cannot compute the quadrant for two identical points "+r);return n.x>=r.x?n.y>=r.y?Sc.NE:Sc.SE:n.y>=r.y?Sc.NW:Sc.SW}},Cc.NE.get=function(){return 0},Cc.NW.get=function(){return 1},Cc.SW.get=function(){return 2},Cc.SE.get=function(){return 3},Object.defineProperties(Sc,Cc);var Tc=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._edge=e,this.init(r,n),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}};Tc.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):r.addAll(a)}else n.add(o)}return n},Lc.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Lc.prototype.buildMaximalEdgeRings=function(t){for(var e=new ll,r=t.iterator();r.hasNext();){var n=r.next();if(n.isInResult()&&n.getLabel().isArea()&&null===n.getEdgeRing()){var i=new bc(n,this._geometryFactory);e.add(i),i.setInResult()}}return e},Lc.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next();n.isHole()&&n.setShell(t)}},Lc.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Lc.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),n=r.getEnvelopeInternal(),i=r.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var u=s.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(n)&&Zu.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||a.contains(c))&&(o=u)}return o},Lc.prototype.findShell=function(t){for(var e=0,r=null,n=t.iterator();n.hasNext();){var i=n.next();i.isHole()||(r=i,e++)}return Uu.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},Lc.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],r=arguments[1];Ac.linkResultDirectedEdges(r);var n=this.buildMaximalEdgeRings(e),i=new ll,o=this.buildMinimalEdgeRings(n,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Lc.prototype.interfaces_=function(){return[]},Lc.prototype.getClass=function(){return Lc};var Dc=function(){};Dc.prototype.getBounds=function(){},Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc};var Nc=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Nc.prototype.getItem=function(){return this._item},Nc.prototype.getBounds=function(){return this._bounds},Nc.prototype.interfaces_=function(){return[Dc,Ei]},Nc.prototype.getClass=function(){return Nc};var zc=function(){this._size=null,this._items=null,this._size=0,this._items=new ll,this._items.add(null)};zc.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},zc.prototype.size=function(){return this._size},zc.prototype.reorder=function(t){for(var e=null,r=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(r)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,r)},zc.prototype.clear=function(){this._size=0,this._items.clear()},zc.prototype.isEmpty=function(){return 0===this._size},zc.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},zc.prototype.interfaces_=function(){return[]},zc.prototype.getClass=function(){return zc};var Rc=function(){};Rc.prototype.visitItem=function(t){},Rc.prototype.interfaces_=function(){return[]},Rc.prototype.getClass=function(){return Rc};var kc=function(){};kc.prototype.insert=function(t,e){},kc.prototype.remove=function(t,e){},kc.prototype.query=function(){},kc.prototype.interfaces_=function(){return[]},kc.prototype.getClass=function(){return kc};var Oc=function(){if(this._childBoundables=new ll,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Fc={serialVersionUID:{configurable:!0}};Oc.prototype.getLevel=function(){return this._level},Oc.prototype.size=function(){return this._childBoundables.size()},Oc.prototype.getChildBoundables=function(){return this._childBoundables},Oc.prototype.addChildBoundable=function(t){Uu.isTrue(null===this._bounds),this._childBoundables.add(t)},Oc.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Oc.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Oc.prototype.interfaces_=function(){return[Dc,Ei]},Oc.prototype.getClass=function(){return Oc},Fc.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Oc,Fc);var Bc=function(){};Bc.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Bc.min=function(t){return Bc.sort(t),t.get(0)},Bc.sort=function(t,e){var r=t.toArray();e?El.sort(r,e):El.sort(r);for(var n=t.iterator(),i=0,o=r.length;iUc.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(n)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new nu("neither boundable is composite")},Uc.prototype.isLeaves=function(){return!(Uc.isComposite(this._boundable1)||Uc.isComposite(this._boundable2))},Uc.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},Uc.prototype.expand=function(t,e,r,n){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new Uc(o,e,this._itemDistance);a.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=r}},qc={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Vc.prototype.getNodeCapacity=function(){return this._nodeCapacity},Vc.prototype.lastNode=function(t){return t.get(t.size()-1)},Vc.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var r=e.next();r instanceof Oc?t+=this.size(r):r instanceof Nc&&(t+=1)}return t}},Vc.prototype.removeItem=function(t,e){for(var r=null,n=t.getChildBoundables().iterator();n.hasNext();){var i=n.next();i instanceof Nc&&i.getItem()===e&&(r=i)}return null!==r&&(t.getChildBoundables().remove(r),!0)},Vc.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new ll:t}if(1===arguments.length){for(var e=arguments[0],r=new ll,n=e.getChildBoundables().iterator();n.hasNext();){var i=n.next();if(i instanceof Oc){var o=this.itemsTree(i);null!==o&&r.add(o)}else i instanceof Nc?r.add(i.getItem()):Uu.shouldNeverReachHere()}return r.size()<=0?null:r}},Vc.prototype.insert=function(t,e){Uu.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Nc(t,e))},Vc.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new ll;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];if(Uu.isTrue(r>-2),n.getLevel()===r)return i.add(n),null;for(var o=n.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Oc?this.boundablesAtLevel(r,a,i):(Uu.isTrue(a instanceof Nc),-1===r&&i.add(a))}return null}},Vc.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new ll;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var r=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,n)}else if(3===arguments.length)if(gu(arguments[2],Rc)&&arguments[0]instanceof Object&&arguments[1]instanceof Oc)for(var i=arguments[0],o=arguments[2],a=arguments[1].getChildBoundables(),s=0;st&&(t=n)}}return t+1}},Vc.prototype.createParentBoundables=function(t,e){Uu.isTrue(!t.isEmpty());var r=new ll;r.add(this.createNode(e));var n=new ll(t);Bc.sort(n,this.getComparator());for(var i=n.iterator();i.hasNext();){var o=i.next();this.lastNode(r).getChildBoundables().size()===this.getNodeCapacity()&&r.add(this.createNode(e)),this.lastNode(r).addChildBoundable(o)}return r},Vc.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Vc.prototype.interfaces_=function(){return[Ei]},Vc.prototype.getClass=function(){return Vc},Vc.compareDoubles=function(t,e){return t>e?1:t0);for(var r=new ll,n=0;n0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],d=new Nc(arguments[0],arguments[1]),g=new Uc(this.getRoot(),d,f);return this.nearestNeighbour(g)[0]}},e.prototype.interfaces_=function(){return[kc,Ei]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return Zc},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[uu]},compare:function(r,n){return t.compareDoubles(e.centreX(r.getBounds()),e.centreX(n.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[uu]},compare:function(r,n){return t.compareDoubles(e.centreY(r.getBounds()),e.centreY(n.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,r),e}(Vc),Zc=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var r=e.next();null===t?t=new Lu(r.getBounds()):t.expandToInclude(r.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oc),Yc=function(){};Yc.prototype.interfaces_=function(){return[]},Yc.prototype.getClass=function(){return Yc},Yc.relativeSign=function(t,e){return te?1:0},Yc.compare=function(t,e,r){if(e.equals2D(r))return 0;var n=Yc.relativeSign(e.x,r.x),i=Yc.relativeSign(e.y,r.y);switch(t){case 0:return Yc.compareValue(n,i);case 1:return Yc.compareValue(i,n);case 2:return Yc.compareValue(i,-n);case 3:return Yc.compareValue(-n,i);case 4:return Yc.compareValue(-n,-i);case 5:return Yc.compareValue(-i,-n);case 6:return Yc.compareValue(-i,n);case 7:return Yc.compareValue(n,-i)}return Uu.shouldNeverReachHere("invalid octant value"),0},Yc.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Wc=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._segString=t,this.coord=new lu(e),this.segmentIndex=r,this._segmentOctant=n,this._isInterior=!e.equals2D(t.getCoordinate(r))};Wc.prototype.getCoordinate=function(){return this.coord},Wc.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Wc.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:Yc.compare(this._segmentOctant,this.coord,e.coord)},Wc.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},Wc.prototype.isInterior=function(){return this._isInterior},Wc.prototype.interfaces_=function(){return[au]},Wc.prototype.getClass=function(){return Wc};var Hc=function(){this._nodeMap=new Di,this._edge=null;var t=arguments[0];this._edge=t};Hc.prototype.getSplitCoordinates=function(){var t=new hl;this.addEndpoints();for(var e=this.iterator(),r=e.next();e.hasNext();){var n=e.next();this.addEdgeCoordinates(r,n,t),r=n}return t.toCoordinateArray()},Hc.prototype.addCollapsedNodes=function(){var t=new ll;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var r=e.next().intValue();this.add(this._edge.getCoordinate(r),r)}},Hc.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Hc.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?r>=n?0:1:r>=n?7:6:e>=0?r>=n?3:2:r>=n?4:5}if(arguments[0]instanceof lu&&arguments[1]instanceof lu){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new nu("Cannot compute the octant for two identical points "+i);return Kc.octant(a,s)}};var Jc=function(){};Jc.prototype.getCoordinates=function(){},Jc.prototype.size=function(){},Jc.prototype.getCoordinate=function(t){},Jc.prototype.isClosed=function(){},Jc.prototype.setData=function(t){},Jc.prototype.getData=function(){},Jc.prototype.interfaces_=function(){return[]},Jc.prototype.getClass=function(){return Jc};var Qc=function(){};Qc.prototype.addIntersection=function(t,e){},Qc.prototype.interfaces_=function(){return[Jc]},Qc.prototype.getClass=function(){return Qc};var $c=function(){this._nodeList=new Hc(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};$c.prototype.getCoordinates=function(){return this._pts},$c.prototype.size=function(){return this._pts.length},$c.prototype.getCoordinate=function(t){return this._pts[t]},$c.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},$c.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},$c.prototype.setData=function(t){this._data=t},$c.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Kc.octant(t,e)},$c.prototype.getData=function(){return this._data},$c.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var r=arguments[1],n=arguments[3],i=new lu(arguments[0].getIntersection(n));this.addIntersection(i,r)}},$c.prototype.toString=function(){return Ou.toLineString(new Wl(this._pts))},$c.prototype.getNodeList=function(){return this._nodeList},$c.prototype.addIntersectionNode=function(t,e){var r=e,n=r+1;if(n=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}if(arguments[0]instanceof lu){var n=arguments[0];return Zu.orientationIndex(this.p0,this.p1,n)}},th.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},th.prototype.isVertical=function(){return this.p0.x===this.p1.x},th.prototype.equals=function(t){if(!(t instanceof th))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},th.prototype.intersection=function(t){var e=new ju;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},th.prototype.project=function(){if(arguments[0]instanceof lu){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new lu(t);var e=this.projectionFactor(t),r=new lu;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof th){var n=arguments[0],i=this.projectionFactor(n.p0),o=this.projectionFactor(n.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(n.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(n.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new th(a,s)}},th.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},th.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},th.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},th.prototype.distancePerpendicular=function(t){return Zu.distancePointLinePerpendicular(t,this.p0,this.p1)},th.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},th.prototype.midPoint=function(){return th.midPoint(this.p0,this.p1)},th.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,n=e*e+r*r;return n<=0?iu.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/n},th.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var r=new Array(2).fill(null),n=iu.MAX_VALUE,i=null,o=this.closestPoint(t.p0);n=o.distance(t.p0),r[0]=o,r[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||iu.isNaN(e))&&(e=1),e},th.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},th.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},th.prototype.distance=function(){if(arguments[0]instanceof th){var t=arguments[0];return Zu.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof lu){var e=arguments[0];return Zu.distancePointLine(e,this.p0,this.p1)}},th.prototype.pointAlong=function(t){var e=new lu;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},th.prototype.hashCode=function(){var t=iu.doubleToLongBits(this.p0.x);t^=31*iu.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),r=iu.doubleToLongBits(this.p1.x);return r^=31*iu.doubleToLongBits(this.p1.y),e^Math.trunc(r)^Math.trunc(r>>32)},th.prototype.interfaces_=function(){return[au,Ei]},th.prototype.getClass=function(){return th},th.midPoint=function(t,e){return new lu((t.x+e.x)/2,(t.y+e.y)/2)},eh.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(th,eh);var rh=function(){this.tempEnv1=new Lu,this.tempEnv2=new Lu,this._overlapSeg1=new th,this._overlapSeg2=new th};rh.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],r=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},rh.prototype.interfaces_=function(){return[]},rh.prototype.getClass=function(){return rh};var nh=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=n};nh.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},nh.prototype.computeSelect=function(t,e,r,n){var i=this._pts[e],o=this._pts[r];if(n.tempEnv1.init(i,o),r-e==1)return n.select(this,e),null;if(!t.intersects(n.tempEnv1))return null;var a=Math.trunc((e+r)/2);e=t.length-1)return t.length-1;for(var n=Sc.quadrant(t[r],t[r+1]),i=e+1;ir.getId()&&(r.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.SegmentOverlapAction.get=function(){return uh},Object.defineProperties(e,r),e}(ah),uh=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],r=arguments[2],n=arguments[3],i=arguments[0].getContext(),o=r.getContext();this._si.processIntersections(i,e,o,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(rh),lh=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.setQuadrantSegments(r),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},ch={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};lh.prototype.getEndCapStyle=function(){return this._endCapStyle},lh.prototype.isSingleSided=function(){return this._isSingleSided},lh.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=lh.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=lh.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==lh.JOIN_ROUND&&(this._quadrantSegments=lh.DEFAULT_QUADRANT_SEGMENTS)},lh.prototype.getJoinStyle=function(){return this._joinStyle},lh.prototype.setJoinStyle=function(t){this._joinStyle=t},lh.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},lh.prototype.getSimplifyFactor=function(){return this._simplifyFactor},lh.prototype.getQuadrantSegments=function(){return this._quadrantSegments},lh.prototype.setEndCapStyle=function(t){this._endCapStyle=t},lh.prototype.getMitreLimit=function(){return this._mitreLimit},lh.prototype.setMitreLimit=function(t){this._mitreLimit=t},lh.prototype.setSingleSided=function(t){this._isSingleSided=t},lh.prototype.interfaces_=function(){return[]},lh.prototype.getClass=function(){return lh},lh.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},ch.CAP_ROUND.get=function(){return 1},ch.CAP_FLAT.get=function(){return 2},ch.CAP_SQUARE.get=function(){return 3},ch.JOIN_ROUND.get=function(){return 1},ch.JOIN_MITRE.get=function(){return 2},ch.JOIN_BEVEL.get=function(){return 3},ch.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},ch.DEFAULT_MITRE_LIMIT.get=function(){return 5},ch.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(lh,ch);var hh=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Zu.COUNTERCLOCKWISE,this._inputLine=t||null},ph={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};hh.prototype.isDeletable=function(t,e,r,n){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[r];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,n)&&this.isShallowSampled(i,o,t,r,n)},hh.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(e),n=!1;r=0;n--)this.addPt(t[n])},fh.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=gh.PI_TIMES_2;for(;t<=-Math.PI;)t+=gh.PI_TIMES_2;return t},gh.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],r=arguments[1],n=r.x-e.x,i=r.y-e.y;return Math.atan2(i,n)}},gh.isAcute=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)>0},gh.isObtuse=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)<0},gh.interiorAngle=function(t,e,r){var n=gh.angle(e,t),i=gh.angle(e,r);return Math.abs(i-n)},gh.normalizePositive=function(t){if(t<0){for(;t<0;)t+=gh.PI_TIMES_2;t>=gh.PI_TIMES_2&&(t=0)}else{for(;t>=gh.PI_TIMES_2;)t-=gh.PI_TIMES_2;t<0&&(t=0)}return t},gh.angleBetween=function(t,e,r){var n=gh.angle(e,t),i=gh.angle(e,r);return gh.diff(n,i)},gh.diff=function(t,e){var r=null;return(r=tMath.PI&&(r=2*Math.PI-r),r},gh.toRadians=function(t){return t*Math.PI/180},gh.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?gh.COUNTERCLOCKWISE:r<0?gh.CLOCKWISE:gh.NONE},gh.angleBetweenOriented=function(t,e,r){var n=gh.angle(e,t),i=gh.angle(e,r)-n;return i<=-Math.PI?i+gh.PI_TIMES_2:i>Math.PI?i-gh.PI_TIMES_2:i},mh.PI_TIMES_2.get=function(){return 2*Math.PI},mh.PI_OVER_2.get=function(){return Math.PI/2},mh.PI_OVER_4.get=function(){return Math.PI/4},mh.COUNTERCLOCKWISE.get=function(){return Zu.COUNTERCLOCKWISE},mh.CLOCKWISE.get=function(){return Zu.CLOCKWISE},mh.NONE.get=function(){return Zu.COLLINEAR},Object.defineProperties(gh,mh);var yh=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new th,this._seg1=new th,this._offset0=new th,this._offset1=new th,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=r,this._li=new ju,this._filletAngleQuantum=Math.PI/2/r.getQuadrantSegments(),r.getQuadrantSegments()>=8&&r.getJoinStyle()===lh.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},_h={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};yh.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=Zu.computeOrientation(this._s0,this._s1,this._s2),n=r===Zu.CLOCKWISE&&this._side===hc.LEFT||r===Zu.COUNTERCLOCKWISE&&this._side===hc.RIGHT;0===r?this.addCollinear(e):n?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},yh.prototype.addLineEndCap=function(t,e){var r=new th(t,e),n=new th;this.computeOffsetSegment(r,hc.LEFT,this._distance,n);var i=new th;this.computeOffsetSegment(r,hc.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case lh.CAP_ROUND:this._segList.addPt(n.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,Zu.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case lh.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(i.p1);break;case lh.CAP_SQUARE:var u=new lu;u.x=Math.abs(this._distance)*Math.cos(s),u.y=Math.abs(this._distance)*Math.sin(s);var l=new lu(n.p1.x+u.x,n.p1.y+u.y),c=new lu(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},yh.prototype.getCoordinates=function(){return this._segList.getCoordinates()},yh.prototype.addMitreJoin=function(t,e,r,n){var i=!0,o=null;try{o=Au.intersection(e.p0,e.p1,r.p0,r.p1),(n<=0?1:o.distance(t)/Math.abs(n))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof Pu))throw t;o=new lu(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,r,n,this._bufParams.getMitreLimit())},yh.prototype.addFilletCorner=function(t,e,r,n,i){var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o),u=r.x-t.x,l=r.y-t.y,c=Math.atan2(l,u);n===Zu.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,n,i),this._segList.addPt(r)},yh.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var r=new lu((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var n=new lu((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},yh.prototype.createCircle=function(t){var e=new lu(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},yh.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},yh.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new fh,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*yh.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},yh.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===lh.JOIN_BEVEL||this._bufParams.getJoinStyle()===lh.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Zu.CLOCKWISE,this._distance))},yh.prototype.closeRing=function(){this._segList.closeRing()},yh.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},yh.prototype.interfaces_=function(){return[]},yh.prototype.getClass=function(){return yh},_h.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},_h.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},_h.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},_h.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(yh,_h);var vh=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};vh.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var r=e<0,n=Math.abs(e),i=this.getSegGen(n);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,r,i);var o=i.getCoordinates();return r&&pl.reverse(o),o},vh.prototype.computeSingleSidedBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var i=hh.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],hc.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{r.addSegments(t,!1);var s=hh.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],hc.LEFT),r.addFirstSegment();for(var l=2;l<=u;l++)r.addNextSegment(s[l],!0)}r.addLastSegment(),r.closeRing()},vh.prototype.computeRingBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);e===hc.RIGHT&&(n=-n);var i=hh.simplify(t,n),o=i.length-1;r.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;r.addNextSegment(i[a],s)}r.closeRing()},vh.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),n=hh.simplify(t,r),i=n.length-1;e.initSideSegments(n[0],n[1],hc.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(n[o],!0);e.addLastSegment(),e.addLineEndCap(n[i-1],n[i]);var a=hh.simplify(t,-r),s=a.length-1;e.initSideSegments(a[s],a[s-1],hc.LEFT);for(var u=s-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},vh.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case lh.CAP_ROUND:e.createCircle(t);break;case lh.CAP_SQUARE:e.createSquare(t)}},vh.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var r=Math.abs(e),n=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],n);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,n)}else this.computeLineBufferCurve(t,n);return n.getCoordinates()},vh.prototype.getBufferParameters=function(){return this._bufParams},vh.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},vh.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return vh.copyCoordinates(t);var n=this.getSegGen(r);return this.computeRingBufferCurve(t,e,n),n.getCoordinates()},vh.prototype.computeOffsetCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){var i=hh.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],hc.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{var s=hh.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],hc.LEFT),r.addFirstSegment();for(var l=2;l<=u;l++)r.addNextSegment(s[l],!0)}r.addLastSegment()},vh.prototype.getSegGen=function(t){return new yh(this._precisionModel,this._bufParams,t)},vh.prototype.interfaces_=function(){return[]},vh.prototype.getClass=function(){return vh},vh.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;ri.getMaxY()||this.findStabbedSegments(t,n.getDirectedEdges(),e)}return e}if(3===arguments.length)if(gu(arguments[2],ul)&&arguments[0]instanceof lu&&arguments[1]instanceof Pc){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=a.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||Zu.computeOrientation(this._seg.p0,this._seg.p1,o)===Zu.RIGHT)){var c=a.getDepth(hc.LEFT);this._seg.p0.equals(u[l])||(c=a.getDepth(hc.RIGHT));var h=new wh(this._seg,c);s.add(h)}}else if(gu(arguments[2],ul)&&arguments[0]instanceof lu&&gu(arguments[1],ul))for(var p=arguments[0],f=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(p,g,f)}},xh.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Bc.min(e)._leftDepth},xh.prototype.interfaces_=function(){return[]},xh.prototype.getClass=function(){return xh},bh.DepthSegment.get=function(){return wh},Object.defineProperties(xh,bh);var wh=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new th(t),this._leftDepth=e};wh.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==r||0!=(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?r:this._upwardSeg.compareTo(e._upwardSeg)},wh.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return 0!==r?r:t.p1.compareTo(e.p1)},wh.prototype.toString=function(){return this._upwardSeg.toString()},wh.prototype.interfaces_=function(){return[au]},wh.prototype.getClass=function(){return wh};var Eh=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};Eh.prototype.area=function(){return Eh.area(this.p0,this.p1,this.p2)},Eh.prototype.signedArea=function(){return Eh.signedArea(this.p0,this.p1,this.p2)},Eh.prototype.interpolateZ=function(t){if(null===t)throw new nu("Supplied point is null.");return Eh.interpolateZ(t,this.p0,this.p1,this.p2)},Eh.prototype.longestSideLength=function(){return Eh.longestSideLength(this.p0,this.p1,this.p2)},Eh.prototype.isAcute=function(){return Eh.isAcute(this.p0,this.p1,this.p2)},Eh.prototype.circumcentre=function(){return Eh.circumcentre(this.p0,this.p1,this.p2)},Eh.prototype.area3D=function(){return Eh.area3D(this.p0,this.p1,this.p2)},Eh.prototype.centroid=function(){return Eh.centroid(this.p0,this.p1,this.p2)},Eh.prototype.inCentre=function(){return Eh.inCentre(this.p0,this.p1,this.p2)},Eh.prototype.interfaces_=function(){return[]},Eh.prototype.getClass=function(){return Eh},Eh.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},Eh.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},Eh.det=function(t,e,r,n){return t*n-e*r},Eh.interpolateZ=function(t,e,r,n){var i=e.x,o=e.y,a=r.x-i,s=n.x-i,u=r.y-o,l=n.y-o,c=a*l-s*u,h=t.x-i,p=t.y-o,f=(l*h-s*p)/c,d=(-u*h+a*p)/c;return e.z+f*(r.z-e.z)+d*(n.z-e.z)},Eh.longestSideLength=function(t,e,r){var n=t.distance(e),i=e.distance(r),o=r.distance(t),a=n;return i>a&&(a=i),o>a&&(a=o),a},Eh.isAcute=function(t,e,r){return!!gh.isAcute(t,e,r)&&!!gh.isAcute(e,r,t)&&!!gh.isAcute(r,t,e)},Eh.circumcentre=function(t,e,r){var n=r.x,i=r.y,o=t.x-n,a=t.y-i,s=e.x-n,u=e.y-i,l=2*Eh.det(o,a,s,u),c=Eh.det(a,o*o+a*a,u,s*s+u*u),h=Eh.det(o,o*o+a*a,s,s*s+u*u);return new lu(n-c/l,i+h/l)},Eh.perpendicularBisector=function(t,e){var r=e.x-t.x,n=e.y-t.y,i=new Au(t.x+r/2,t.y+n/2,1),o=new Au(t.x-n+r/2,t.y+r+n/2,1);return new Au(i,o)},Eh.angleBisector=function(t,e,r){var n=e.distance(t),i=n/(n+e.distance(r)),o=r.x-t.x,a=r.y-t.y;return new lu(t.x+i*o,t.y+i*a)},Eh.area3D=function(t,e,r){var n=e.x-t.x,i=e.y-t.y,o=e.z-t.z,a=r.x-t.x,s=r.y-t.y,u=r.z-t.z,l=i*u-o*s,c=o*a-n*u,h=n*s-i*a,p=l*l+c*c+h*h;return Math.sqrt(p)/2},Eh.centroid=function(t,e,r){var n=(t.x+e.x+r.x)/3,i=(t.y+e.y+r.y)/3;return new lu(n,i)},Eh.inCentre=function(t,e,r){var n=e.distance(r),i=t.distance(r),o=t.distance(e),a=n+i+o,s=(n*t.x+i*e.x+o*r.x)/a,u=(n*t.y+i*e.y+o*r.y)/a;return new lu(s,u)};var Ih=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new ll;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};Ih.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,fu.EXTERIOR,fu.INTERIOR)},Ih.prototype.addPolygon=function(t){var e=this._distance,r=hc.LEFT;this._distance<0&&(e=-this._distance,r=hc.RIGHT);var n=t.getExteriorRing(),i=pl.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,r,fu.EXTERIOR,fu.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,e,hc.opposite(r),fu.INTERIOR,fu.EXTERIOR)}},Ih.prototype.isTriangleErodedCompletely=function(t,e){var r=new Eh(t[0],t[1],t[2]),n=r.inCentre();return Zu.distancePointLine(n,r.p0,r.p1)=Vl.MINIMUM_VALID_SIZE&&Zu.isCCW(t)&&(o=i,a=n,r=hc.opposite(r));var s=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(s,o,a)},Ih.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Bl?this.addPolygon(t):t instanceof Rl?this.addLineString(t):t instanceof Ol?this.addPoint(t):(t instanceof Ul||t instanceof Ml||t instanceof ql||t instanceof Pl)&&this.addCollection(t)},Ih.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(4===r.length)return this.isTriangleErodedCompletely(r,e);var n=t.getEnvelopeInternal(),i=Math.min(n.getHeight(),n.getWidth());return e<0&&2*Math.abs(e)>i},Ih.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new Ii;var t=this._parent.getGeometryN(this._index++);return t instanceof Pl?(this._subcollectionIterator=new Ch(t),this._subcollectionIterator.next()):t},Ch.prototype.remove=function(){throw new Error(this.getClass().getName())},Ch.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Ch.prototype.interfaces_=function(){return[sl]},Ch.prototype.getClass=function(){return Ch},Ch.isAtomic=function(t){return!(t instanceof Pl)};var Th=function(){this._geom=null;var t=arguments[0];this._geom=t};Th.prototype.locate=function(t){return Th.locate(t,this._geom)},Th.prototype.interfaces_=function(){return[Sh]},Th.prototype.getClass=function(){return Th},Th.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Zu.isPointInRing(t,e.getCoordinates())},Th.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Th.isPointInRing(t,r))return!1;for(var n=0;n=0;r--){var n=this._edgeList.get(r),i=n.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=n}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),r=t.getDepth(hc.LEFT),n=t.getDepth(hc.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),r);if(this.computeDepths(0,e,i)!==n)throw new dc("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],a=arguments[2],s=arguments[0];s=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),n){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;r=a,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;r.setNextMin(o),n=this._SCANNING_FOR_INCOMING}}n===this._LINKING_TO_OUTGOING&&(Uu.isTrue(null!==e,"found null for first outgoing dirEdge"),Uu.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),r.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var r=arguments[0],n=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===r&&n++;return n}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=fu.NONE,e=this.iterator();e.hasNext();){var r=e.next(),n=r.getSym();if(!r.isLineEdge()){if(r.isInResult()){t=fu.INTERIOR;break}if(n.isInResult()){t=fu.EXTERIOR;break}}}if(t===fu.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===fu.INTERIOR):(a.isInResult()&&(i=fu.EXTERIOR),s.isInResult()&&(i=fu.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new _c(fu.NONE);for(var r=this.iterator();r.hasNext();)for(var n=r.next().getEdge().getLabel(),i=0;i<2;i++){var o=n.getLocation(i);o!==fu.INTERIOR&&o!==fu.BOUNDARY||this._label.setLocation(i,fu.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ph),Ah=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Ec(t,new Mh)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Mc),Lh=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Lh.prototype.compareTo=function(t){var e=t;return Lh.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Lh.prototype.interfaces_=function(){return[au]},Lh.prototype.getClass=function(){return Lh},Lh.orientation=function(t){return 1===pl.increasingDirection(t)},Lh.compareOriented=function(t,e,r,n){for(var i=e?1:-1,o=n?1:-1,a=e?t.length:-1,s=n?r.length:-1,u=e?0:t.length-1,l=n?0:r.length-1;;){var c=t[u].compareTo(r[l]);if(0!==c)return c;var h=(u+=i)===a,p=(l+=o)===s;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Dh=function(){this._edges=new ll,this._ocaMap=new Di};Dh.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var n=r.getCoordinates(),i=0;i0&&t.print(","),t.print(n[i].x+" "+n[i].y);t.println(")")}t.print(") ")},Dh.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Dh.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(n);i||r--;var o=new Array(r).fill(null),a=0;o[a++]=new lu(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new Vh(o,new _c(this.edge._label))},kh.prototype.add=function(t,e,r){var n=new Rh(t,e,r),i=this._nodeMap.get(n);return null!==i?i:(this._nodeMap.put(n,n),n)},kh.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},kh.prototype.interfaces_=function(){return[]},kh.prototype.getClass=function(){return kh};var Oh=function(){};Oh.prototype.getChainStartIndices=function(t){var e=0,r=new ll;r.add(new vu(e));do{var n=this.findChainEnd(t,e);r.add(new vu(n)),e=n}while(er?e:r},Fh.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return ee&&(n=1),this._depth[t][r]=n}}},Bh.prototype.getDelta=function(t){return this._depth[t][hc.RIGHT]-this._depth[t][hc.LEFT]},Bh.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?fu.EXTERIOR:fu.INTERIOR},Bh.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Bh.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var r=1;r<3;r++){var n=t.getLocation(e,r);n!==fu.EXTERIOR&&n!==fu.INTERIOR||(this.isNull(e,r)?this._depth[e][r]=Bh.depthAtLocation(n):this._depth[e][r]+=Bh.depthAtLocation(n))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===fu.INTERIOR&&this._depth[i][o]++}},Bh.prototype.interfaces_=function(){return[]},Bh.prototype.getClass=function(){return Bh},Bh.depthAtLocation=function(t){return t===fu.EXTERIOR?0:t===fu.INTERIOR?1:Bh.NULL_VALUE},Uh.NULL_VALUE.get=function(){return-1},Object.defineProperties(Bh,Uh);var Vh=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new kh(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Bh,this._depthDelta=0,1===arguments.length){var r=arguments[0];e.call(this,r,null)}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,_c.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;if(this.pts.length!==r.pts.length)return!1;for(var n=!0,i=!0,o=this.pts.length,a=0;a0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Fh(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Lu;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;en||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return Uu.isTrue(!(a&&s),"Found bad envelope test"),s},Zh.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new lu(this._maxx,this._maxy),this._corner[1]=new lu(this._minx,this._maxy),this._corner[2]=new lu(this._minx,this._miny),this._corner[3]=new lu(this._maxx,this._miny)},Zh.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Zh.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Zh.prototype.getCoordinate=function(){return this._originalPt},Zh.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Zh.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=Zh.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Lu(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Zh.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},Zh.prototype.intersectsToleranceSquare=function(t,e){var r=!1,n=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||r&&n||t.equals(this._pt)||e.equals(this._pt)))))},Zh.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),n=t.getCoordinate(e+1);return!!this.intersects(r,n)&&(t.addIntersection(this.getCoordinate(),e),!0)},Zh.prototype.interfaces_=function(){return[]},Zh.prototype.getClass=function(){return Zh},Yh.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(Zh,Yh);var Wh=function(){this.tempEnv1=new Lu,this.selectedSegment=new th};Wh.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},Wh.prototype.interfaces_=function(){return[]},Wh.prototype.getClass=function(){return Wh};var Hh=function(){this._index=null;var t=arguments[0];this._index=t},Kh={HotPixelSnapAction:{configurable:!0}};Hh.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2],i=e.getSafeEnvelope(),o=new Jh(e,r,n);return this._index.query(i,{interfaces_:function(){return[Rc]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},Hh.prototype.interfaces_=function(){return[]},Hh.prototype.getClass=function(){return Hh},Kh.HotPixelSnapAction.get=function(){return Jh},Object.defineProperties(Hh,Kh);var Jh=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],r=arguments[0].getContext();if(null!==this._parentEdge&&r===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wh),Qh=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new ll};Qh.prototype.processIntersections=function(t,e,r,n){if(t===r&&e===n)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof dc))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var r=arguments[0],n=tp.precisionScaleFactor(this._argGeom,this._distance,r),i=new $l(n);this.bufferFixedPrecision(i)}},tp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===$l.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},tp.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},tp.prototype.bufferOriginalPrecision=function(){try{var t=new qh(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Fu))throw t;this._saveException=t}},tp.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},tp.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},tp.prototype.interfaces_=function(){return[]},tp.prototype.getClass=function(){return tp},tp.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new tp(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Hu&&"number"==typeof arguments[1]){var e=arguments[1],r=arguments[2],n=new tp(arguments[0]);return n.setQuadrantSegments(r),n.getResultGeometry(e)}if(arguments[2]instanceof lh&&arguments[0]instanceof Hu&&"number"==typeof arguments[1]){var i=arguments[1];return new tp(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],a=arguments[2],s=arguments[3],u=new tp(arguments[0]);return u.setQuadrantSegments(a),u.setEndCapStyle(s),u.getResultGeometry(o)}},tp.precisionScaleFactor=function(t,e,r){var n=t.getEnvelopeInternal(),i=mu.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY()))+2*(e>0?e:0),o=r-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},ep.CAP_ROUND.get=function(){return lh.CAP_ROUND},ep.CAP_BUTT.get=function(){return lh.CAP_FLAT},ep.CAP_FLAT.get=function(){return lh.CAP_FLAT},ep.CAP_SQUARE.get=function(){return lh.CAP_SQUARE},ep.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(tp,ep);var rp=function(){this._pt=[new lu,new lu],this._distance=iu.NaN,this._isNull=!0};rp.prototype.getCoordinates=function(){return this._pt},rp.prototype.getCoordinate=function(t){return this._pt[t]},rp.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var n=e.distance(r);nthis._distance&&this.initialize(e,r,n)}},rp.prototype.interfaces_=function(){return[]},rp.prototype.getClass=function(){return rp};var np=function(){};np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np},np.computeDistance=function(){if(arguments[2]instanceof rp&&arguments[0]instanceof Rl&&arguments[1]instanceof lu)for(var t=arguments[1],e=arguments[2],r=arguments[0].getCoordinates(),n=new th,i=0;i0||this._isIn?fu.INTERIOR:fu.EXTERIOR)},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp};var hp=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._component=e,this._segIndex=r,this._pt=n}},pp={INSIDE_AREA:{configurable:!0}};hp.prototype.isInsideArea=function(){return this._segIndex===hp.INSIDE_AREA},hp.prototype.getCoordinate=function(){return this._pt},hp.prototype.getGeometryComponent=function(){return this._component},hp.prototype.getSegmentIndex=function(){return this._segIndex},hp.prototype.interfaces_=function(){return[]},hp.prototype.getClass=function(){return hp},pp.INSIDE_AREA.get=function(){return-1},Object.defineProperties(hp,pp);var fp=function(t){this._pts=t||null};fp.prototype.filter=function(t){t instanceof Ol&&this._pts.add(t)},fp.prototype.interfaces_=function(){return[Cl]},fp.prototype.getClass=function(){return fp},fp.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Ol?Bc.singletonList(t):fp.getPoints(t,new ll)}if(2===arguments.length){var e=arguments[0],r=arguments[1];return e instanceof Ol?r.add(e):e instanceof Pl&&e.apply(new fp(r)),r}};var dp=function(){this._locations=null;var t=arguments[0];this._locations=t};dp.prototype.filter=function(t){(t instanceof Ol||t instanceof Rl||t instanceof Bl)&&this._locations.add(new hp(t,0,t.getCoordinate()))},dp.prototype.interfaces_=function(){return[Cl]},dp.prototype.getClass=function(){return dp},dp.getLocations=function(t){var e=new ll;return t.apply(new dp(e)),e};var gp=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new cp,this._minDistanceLocation=null,this._minDistance=iu.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=n,this._terminateDistance=i}};gp.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=1-e,i=up.getPolygons(this._geom[e]);if(i.size()>0){var o=dp.getLocations(this._geom[n]);if(this.computeContainmentDistance(o,i,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=r[0],this._minDistanceLocation[e]=r[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&gu(arguments[0],ul)&&gu(arguments[1],ul)){for(var a=arguments[0],s=arguments[1],u=arguments[2],l=0;lthis._minDistance)return null;for(var n=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var h=u.getCoordinates(),p=l.getCoordinates(),f=0;fthis._distance&&this.initialize(e,r,n)}},mp.prototype.interfaces_=function(){return[]},mp.prototype.getClass=function(){return mp};var yp=function(){};yp.prototype.interfaces_=function(){return[]},yp.prototype.getClass=function(){return yp},yp.computeDistance=function(){if(arguments[2]instanceof mp&&arguments[0]instanceof Rl&&arguments[1]instanceof lu)for(var t=arguments[0],e=arguments[1],r=arguments[2],n=new th,i=t.getCoordinates(),o=0;o1||t<=0)throw new nu("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},_p.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},_p.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},_p.prototype.computeOrientedDistance=function(t,e,r){var n=new xp(e);if(t.apply(n),r.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var i=new bp(e,this._densifyFrac);t.apply(i),r.setMaximum(i.getMaxPointDistance())}},_p.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},_p.prototype.interfaces_=function(){return[]},_p.prototype.getClass=function(){return _p},_p.distance=function(){if(2===arguments.length)return new _p(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new _p(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},vp.MaxPointDistanceFilter.get=function(){return xp},vp.MaxDensifiedByFractionDistanceFilter.get=function(){return bp},Object.defineProperties(_p,vp);var xp=function(){this._maxPtDist=new mp,this._minPtDist=new mp,this._euclideanDist=new yp,this._geom=null;var t=arguments[0];this._geom=t};xp.prototype.filter=function(t){this._minPtDist.initialize(),yp.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xp.prototype.getMaxPointDistance=function(){return this._maxPtDist},xp.prototype.interfaces_=function(){return[Qu]},xp.prototype.getClass=function(){return xp};var bp=function(){this._maxPtDist=new mp,this._minPtDist=new mp,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};bp.prototype.filter=function(t,e){if(0===e)return null;for(var r=t.getCoordinate(e-1),n=t.getCoordinate(e),i=(n.x-r.x)/this._numSubSegs,o=(n.y-r.y)/this._numSubSegs,a=0;ar){this._isValid=!1;var i=n.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ou.toLineString(i[0],i[1])+")"}},wp.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=wp.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),wp.VERBOSE&&Mu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},wp.prototype.checkNegativeValid=function(){if(!(this._input instanceof Bl||this._input instanceof ql||this._input instanceof Pl))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},wp.prototype.getErrorIndicator=function(){return this._errorIndicator},wp.prototype.checkMinimumDistance=function(t,e,r){var n=new gp(t,e,r);if(this._minDistanceFound=n.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Ip.prototype.report=function(t){if(!Ip.VERBOSE)return null;Mu.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ip.prototype.getErrorMessage=function(){return this._errorMsg},Ip.prototype.interfaces_=function(){return[]},Ip.prototype.getClass=function(){return Ip},Ip.isValidMsg=function(t,e,r){var n=new Ip(t,e,r);return n.isValid()?null:n.getErrorMessage()},Ip.isValid=function(t,e,r){return!!new Ip(t,e,r).isValid()},Sp.VERBOSE.get=function(){return!1},Sp.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Ip,Sp);var Cp=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Cp.prototype.getCoordinates=function(){return this._pts},Cp.prototype.size=function(){return this._pts.length},Cp.prototype.getCoordinate=function(t){return this._pts[t]},Cp.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Cp.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Kc.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Cp.prototype.setData=function(t){this._data=t},Cp.prototype.getData=function(){return this._data},Cp.prototype.toString=function(){return Ou.toLineString(new Wl(this._pts))},Cp.prototype.interfaces_=function(){return[Jc]},Cp.prototype.getClass=function(){return Cp};var Tp=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new ll,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Tp.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Tp.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Tp.prototype.getIntersectionSegments=function(){return this._intSegments},Tp.prototype.count=function(){return this._intersectionCount},Tp.prototype.getIntersections=function(){return this._intersections},Tp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Tp.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Tp.prototype.processIntersections=function(t,e,r,n){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===r&&e===n)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(r,n))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Tp.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Tp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Tp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Tp.prototype.interfaces_=function(){return[Nh]},Tp.prototype.getClass=function(){return Tp},Tp.createAllIntersectionsFinder=function(t){var e=new Tp(t);return e.setFindAllIntersections(!0),e},Tp.createAnyIntersectionFinder=function(t){return new Tp(t)},Tp.createIntersectionCounter=function(t){var e=new Tp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Pp=function(){this._li=new ju,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Pp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Pp.prototype.getIntersections=function(){return this._segInt.getIntersections()},Pp.prototype.isValid=function(){return this.execute(),this._isValid},Pp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Pp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Tp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new sh;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Pp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new dc(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Pp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ou.toLineString(t[0],t[1])+" and "+Ou.toLineString(t[2],t[3])},Pp.prototype.interfaces_=function(){return[]},Pp.prototype.getClass=function(){return Pp},Pp.computeIntersections=function(t){var e=new Pp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Mp=function t(){this._nv=null;var e=arguments[0];this._nv=new Pp(t.toSegmentStrings(e))};Mp.prototype.checkValid=function(){this._nv.checkValid()},Mp.prototype.interfaces_=function(){return[]},Mp.prototype.getClass=function(){return Mp},Mp.toSegmentStrings=function(t){for(var e=new ll,r=t.iterator();r.hasNext();){var n=r.next();e.add(new Cp(n.getCoordinates(),n))}return e},Mp.checkValid=function(t){new Mp(t).checkValid()};var Ap=function(t){this._mapOp=t};Ap.prototype.map=function(t){for(var e=new ll,r=0;r0&&n<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},Np.prototype.interfaces_=function(){return[]},Np.prototype.getClass=function(){return Np};var zp=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new th,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Rl&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],n=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=n}};zp.prototype.snapVertices=function(t,e){for(var r=this._isClosed?t.size()-1:t.size(),n=0;n=0&&t.add(o+1,new lu(i),!1)}},zp.prototype.findSegmentIndexToSnap=function(t,e){for(var r=iu.MAX_VALUE,n=-1,i=0;ie&&(e=n)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Rp.computeOverlaySnapTolerance(i),Rp.computeOverlaySnapTolerance(o))}},Rp.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Rp.SNAP_PRECISION_FACTOR},Rp.snapToSelf=function(t,e,r){return new Rp(t).snapToSelf(e,r)},kp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Rp,kp);var Op=function(t){function e(e,r,n){t.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=void 0!==n&&n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var r=new zp(t,this._snapTolerance);return r.setAllowSnappingToSourceVertices(this._isSelfSnap),r.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var r=t.toCoordinateArray(),n=this.snapLine(r,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Np),Fp=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Fp.prototype.getCommon=function(){return iu.longBitsToDouble(this._commonBits)},Fp.prototype.add=function(t){var e=iu.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Fp.signExpBits(this._commonBits),this._isFirst=!1,null):Fp.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Fp.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Fp.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Fp.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=iu.longBitsToDouble(t),r="0000000000000000000000000000000000000000000000000000000000000000"+iu.toBinaryString(t),n=r.substring(r.length-64);return n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]"}},Fp.prototype.interfaces_=function(){return[]},Fp.prototype.getClass=function(){return Fp},Fp.getBit=function(t,e){return 0!=(t&1<>52},Fp.zeroLowerBits=function(t,e){return t&~((1<=0;n--){if(Fp.getBit(t,n)!==Fp.getBit(e,n))return r;r++}return 52};var Bp=function(){this._commonCoord=null,this._ccFilter=new Vp},Up={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Bp.prototype.addCommonBits=function(t){var e=new qp(this._commonCoord);t.apply(e),t.geometryChanged()},Bp.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new lu(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new qp(e);return t.apply(r),t.geometryChanged(),t},Bp.prototype.getCommonCoordinate=function(){return this._commonCoord},Bp.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Bp.prototype.interfaces_=function(){return[]},Bp.prototype.getClass=function(){return Bp},Up.CommonCoordinateFilter.get=function(){return Vp},Up.Translater.get=function(){return qp},Object.defineProperties(Bp,Up);var Vp=function(){this._commonBitsX=new Fp,this._commonBitsY=new Fp};Vp.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Vp.prototype.getCommonCoordinate=function(){return new lu(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Vp.prototype.interfaces_=function(){return[Qu]},Vp.prototype.getClass=function(){return Vp};var qp=function(){this.trans=null;var t=arguments[0];this.trans=t};qp.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,n=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,n)},qp.prototype.isDone=function(){return!1},qp.prototype.isGeometryChanged=function(){return!0},qp.prototype.interfaces_=function(){return[Tl]},qp.prototype.getClass=function(){return qp};var jp=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};jp.prototype.selfSnap=function(t){return new Rp(t).snapTo(t,this._snapTolerance)},jp.prototype.removeCommonBits=function(t){this._cbr=new Bp,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},jp.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},jp.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=pf.overlayOp(e[0],e[1],t);return this.prepareResult(r)},jp.prototype.checkValid=function(t){t.isValid()||Mu.out.println("Snapped geometry is invalid")},jp.prototype.computeSnapTolerance=function(){this._snapTolerance=Rp.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},jp.prototype.snap=function(t){var e=this.removeCommonBits(t);return Rp.snap(e[0],e[1],this._snapTolerance)},jp.prototype.interfaces_=function(){return[]},jp.prototype.getClass=function(){return jp},jp.overlayOp=function(t,e,r){return new jp(t,e).getResultGeometry(r)},jp.union=function(t,e){return jp.overlayOp(t,e,pf.UNION)},jp.intersection=function(t,e){return jp.overlayOp(t,e,pf.INTERSECTION)},jp.symDifference=function(t,e){return jp.overlayOp(t,e,pf.SYMDIFFERENCE)},jp.difference=function(t,e){return jp.overlayOp(t,e,pf.DIFFERENCE)};var Gp=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Gp.prototype.getResultGeometry=function(t){var e=null,r=!1,n=null;try{e=pf.overlayOp(this._geom[0],this._geom[1],t),r=!0}catch(t){if(!(t instanceof Fu))throw t;n=t}if(!r)try{e=jp.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Fu?n:t}return e},Gp.prototype.interfaces_=function(){return[]},Gp.prototype.getClass=function(){return Gp},Gp.overlayOp=function(t,e,r){return new Gp(t,e).getResultGeometry(r)},Gp.union=function(t,e){return Gp.overlayOp(t,e,pf.UNION)},Gp.intersection=function(t,e){return Gp.overlayOp(t,e,pf.INTERSECTION)},Gp.symDifference=function(t,e){return Gp.overlayOp(t,e,pf.SYMDIFFERENCE)},Gp.difference=function(t,e){return Gp.overlayOp(t,e,pf.DIFFERENCE)};var Xp=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Xp.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Xp.prototype.interfaces_=function(){return[]},Xp.prototype.getClass=function(){return Xp};var Zp=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],r=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=r}else if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=n,this._xValue=i,this._obj=o}},Yp={INSERT:{configurable:!0},DELETE:{configurable:!0}};Zp.prototype.isDelete=function(){return this._eventType===Zp.DELETE},Zp.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Zp.prototype.getObject=function(){return this._obj},Zp.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},Zp.prototype.getInsertEvent=function(){return this._insertEvent},Zp.prototype.isInsert=function(){return this._eventType===Zp.INSERT},Zp.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},Zp.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Zp.prototype.interfaces_=function(){return[au]},Zp.prototype.getClass=function(){return Zp},Yp.INSERT.get=function(){return 1},Yp.DELETE.get=function(){return 2},Object.defineProperties(Zp,Yp);var Wp=function(){};Wp.prototype.interfaces_=function(){return[]},Wp.prototype.getClass=function(){return Wp};var Hp=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};Hp.prototype.isTrivialIntersection=function(t,e,r,n){if(t===r&&1===this._li.getIntersectionNum()){if(Hp.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&n===i||0===n&&e===i)return!0}}return!1},Hp.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Hp.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Hp.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Hp.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next().getCoordinate();if(t.isIntersection(n))return!0}return!1},Hp.prototype.hasProperIntersection=function(){return this._hasProper},Hp.prototype.hasIntersection=function(){return this._hasIntersection},Hp.prototype.isDone=function(){return this._isDone},Hp.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},Hp.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Hp.prototype.addIntersections=function(t,e,r,n){if(t===r&&e===n)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,n)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),r.addIntersections(this._li,n,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Hp.prototype.interfaces_=function(){return[]},Hp.prototype.getClass=function(){return Hp},Hp.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Kp=function(t){function e(){t.call(this),this.events=new ll,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Bc.sort(this.events);for(var t=0;te||this._maxo?1:0},$p.prototype.interfaces_=function(){return[uu]},$p.prototype.getClass=function(){return $p};var tf=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],r=arguments[1],n=arguments[2];this._min=e,this._max=r,this._item=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;r.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Jp),ef=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,r),null!==this._node2&&this._node2.query(t,e,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Jp),rf=function(){this._leaves=new ll,this._root=null,this._level=0};rf.prototype.buildTree=function(){Bc.sort(this._leaves,new Jp.NodeComparator);for(var t=this._leaves,e=null,r=new ll;;){if(this.buildLevel(t,r),1===r.size())return r.get(0);e=t,t=r,r=e}},rf.prototype.insert=function(t,e,r){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new tf(t,e,r))},rf.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},rf.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},rf.prototype.printNode=function(t){Mu.out.println(Ou.toLineString(new lu(t._min,this._level),new lu(t._max,this._level)))},rf.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},rf.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),r=0,n=t.iterator();n.hasNext();){var i=n.next();e[r++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,r){if(this.isBoundaryNode(t,e))return null;r===fu.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,r)},e.prototype.addPolygonRing=function(t,e,r){if(t.isEmpty())return null;var n=pl.removeRepeatedPoints(t.getCoordinates());if(n.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var i=e,o=r;Zu.isCCW(n)&&(i=r,o=e);var a=new Vh(n,new _c(this._argIndex,fu.BOUNDARY,i,o));this._lineEdgeMap.put(t,a),this.insertEdge(a),this.insertPoint(this._argIndex,n[0],fu.BOUNDARY)},e.prototype.insertPoint=function(t,e,r){var n=this._nodes.addNode(e),i=n.getLabel();null===i?n._label=new _c(t,r):i.setLocation(t,r)},e.prototype.createEdgeSetIntersector=function(){return new Kp},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var r=e.next(),n=r.getLabel().getLocation(t),i=r.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,n)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ql&&(this._useBoundaryDeterminationRule=!1),e instanceof Bl)this.addPolygon(e);else if(e instanceof Rl)this.addLineString(e);else if(e instanceof Ol)this.addPoint(e);else if(e instanceof Ul)this.addCollection(e);else if(e instanceof Ml)this.addCollection(e);else if(e instanceof ql)this.addCollection(e);else{if(!(e instanceof Pl))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new of(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?fu.BOUNDARY:fu.INTERIOR},e}(Ac),cf=function(){if(this._li=new ju,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new lf(0,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=$u.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new lf(0,e,n),this._arg[1]=new lf(1,r,n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new lf(0,i,a),this._arg[1]=new lf(1,o,a)}};cf.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},cf.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},cf.prototype.interfaces_=function(){return[]},cf.prototype.getClass=function(){return cf};var hf=function(){};hf.prototype.interfaces_=function(){return[]},hf.prototype.getClass=function(){return hf},hf.map=function(){if(arguments[0]instanceof Hu&&gu(arguments[1],hf.MapOp)){for(var t=arguments[0],e=arguments[1],r=new ll,n=0;n=t.size()?null:t.get(e)},vf.union=function(t){return new vf(t).union()},xf.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(vf,xf);var bf=function(){};bf.prototype.interfaces_=function(){return[]},bf.prototype.getClass=function(){return bf},bf.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return pf.createEmptyResult(pf.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Gp.overlayOp(t,e,pf.UNION)};var wf=function(){return new Bi};Bi.prototype={constructor:Bi,reset:function(){this.s=this.t=0},add:function(t){Ui(Ef,t,this.t),Ui(this,Ef.s,this.s),this.s?this.t+=Ef.t:this.s=Ef.t},valueOf:function(){return this.s}};var Ef=new Bi,If=1e-6,Sf=Math.PI,Cf=Sf/2,Tf=Sf/4,Pf=2*Sf,Mf=180/Sf,Af=Sf/180,Lf=Math.abs,Df=Math.atan,Nf=Math.atan2,zf=Math.cos,Rf=Math.exp,kf=Math.log,Of=Math.sin,Ff=Math.sqrt,Bf=Math.tan,Uf={Feature:function(t,e){ji(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}},Xf=function(t,e,r,n,i,o){var a,s=t[0],u=t[1],l=0,c=1,h=e[0]-s,p=e[1]-u;if(a=r-s,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=p,p<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,p||!(a<0)){if(a/=p,p<0){if(a>c)return;a>l&&(l=a)}else if(p>0){if(a0&&(t[0]=s+l*h,t[1]=u+l*p),c<1&&(e[0]=s+c*h,e[1]=u+c*p),!0}}}}},Zf=function(t,e){return Lf(t[0]-e[0])=0;--o)i.point((c=l[o])[0],c[1]);else n(p.x,p.p.x,-1,i);p=p.p}l=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}},Wf=function(t,e){return te?1:t>=e?0:NaN},Hf=(function(t){1===t.length&&(t=function(t){return function(e,r){return Wf(t(e),r)}}(t))}(Wf),function(t){for(var e,r,n,i=t.length,o=-1,a=0;++o=0;)for(e=(n=t[i]).length;--e>=0;)r[--a]=n[e];return r}),Kf=1e9,Jf=-Kf,Qf=wf(),$f=(wf(),function(t){return t}),td=(wf(),wf(),1/0),ed=td,rd=-td,nd=rd,id={point:function(t,e){trd&&(rd=t),end&&(nd=e)},lineStart:qi,lineEnd:qi,polygonStart:qi,polygonEnd:qi,result:function(){var t=[[td,ed],[rd,nd]];return rd=nd=-(ed=td=1/0),t}},od=(wf(),function(t,e,r,n){return function(i,o){function a(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function s(t,e){var r=i(t,e);m.point(r[0],r[1])}function u(){b.point=s,m.lineStart()}function l(){b.point=a,m.lineEnd()}function c(t,e){g.push([t,e]);var r=i(t,e);v.point(r[0],r[1])}function h(){v.lineStart(),g=[]}function p(){c(g[0][0],g[0][1]),v.lineEnd();var t,e,r,n,i=v.clean(),a=_.result(),s=a.length;if(g.pop(),f.push(g),g=null,s)if(1&i){if((e=(r=a[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t1&&2&i&&a.push(a.pop().concat(a.shift())),d.push(a.filter(uo))}var f,d,g,m=e(o),y=i.invert(n[0],n[1]),_=Gf(),v=e(_),x=!1,b={point:a,lineStart:u,lineEnd:l,polygonStart:function(){b.point=c,b.lineStart=h,b.lineEnd=p,d=[],f=[]},polygonEnd:function(){b.point=a,b.lineStart=u,b.lineEnd=l,d=Hf(d);var t=function(t,e){var r=e[0],n=e[1],i=[Of(r),-zf(r),0],o=0,a=0;Qf.reset();for(var s=0,u=t.length;s=0?1:-1,I=E*w,S=I>Sf,C=d*x;if(Qf.add(Nf(C*E*Of(I),g*b+C*zf(I))),o+=S?w+E*Pf:w,S^p>=r^_>=r){var T=Hi(Yi(h),Yi(y));Qi(T);var P=Hi(i,T);Qi(P);var M=(S^w>=0?-1:1)*Vi(P[2]);(n>M||n===M&&(T[0]||T[1]))&&(a+=S^w>=0?1:-1)}}return(o<-If||o0?Sf:-Sf,u=Lf(o-r);Lf(u-Sf)0?Cf:-Cf),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),e=0):i!==s&&u>=Sf&&(Lf(r-i)If?Df((Of(e)*(o=zf(n))*Of(r)-Of(n)*(i=zf(e))*Of(t))/(i*o*a)):(e+n)/2}(r,n,o,a),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=o,n=a),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*Cf,n.point(-Sf,i),n.point(0,i),n.point(Sf,i),n.point(Sf,0),n.point(Sf,-i),n.point(0,-i),n.point(-Sf,-i),n.point(-Sf,0),n.point(-Sf,i);else if(Lf(t[0]-e[0])>If){var o=t[0]o}function n(t,e,r){var n=[1,0,0],i=Hi(Yi(t),Yi(e)),a=Wi(i,i),s=i[0],u=a-s*s;if(!u)return!r&&t;var l=o*a/u,c=-o*s/u,h=Hi(n,i),p=Ji(n,l);Ki(p,Ji(i,c));var f=h,d=Wi(p,f),g=Wi(f,f),m=d*d-g*(Wi(p,p)-1);if(!(m<0)){var y=Ff(m),_=Ji(f,(-d-y)/g);if(Ki(_,p),_=Zi(_),!r)return _;var v,x=t[0],b=e[0],w=t[1],E=e[1];b0^_[1]<(Lf(_[0]-x)Sf^(x<=_[0]&&_[0]<=b)){var C=Ji(f,(-d+y)/g);return Ki(C,p),[_,Zi(C)]}}}function i(e,r){var n=a?t:Sf-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var o=zf(t),a=o>0,s=Lf(o)>If;return od(r,(function(t){var e,o,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,p){var f,d=[h,p],g=r(h,p),m=a?g?0:i(h,p):g?i(h+(h<0?Sf:-Sf),p):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(f=n(e,d))||Zf(e,f)||Zf(d,f))&&(d[0]+=If,d[1]+=If,g=r(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),f=n(d,e),t.point(f[0],f[1])):(f=n(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(s&&e&&a^g){var y;m&o||!(y=n(d,e,!0))||(c=0,a?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Zf(e,d)||t.point(d[0],d[1]),e=d,u=g,o=m},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(r,n,i,o){!function(t,e,r,n,i,o){if(r){var a=zf(e),s=Of(e),u=n*r;null==i?(i=e+n*Pf,o=e-u/2):(i=io(a,i),o=io(a,o),(n>0?io)&&(i+=n*Pf));for(var l,c=i;n>0?c>o:c4*e&&g--){var x=a+p,b=s+f,w=u+d,E=Ff(x*x+b*b+w*w),I=Vi(w/=E),S=Lf(Lf(w)-1)e||Lf((y*M+_*A)/v-.5)>.3||a*p+s*f+u*d2?t[2]*Af:0),e.invert=function(e){return(e=t.invert(e[0]*Af,e[1]*Af))[0]*=Mf,e[1]*=Mf,e},e}(o.rotate()).invert([0,0]));return l(null==c?[[a[0]-e,a[1]-e],[a[0]+e,a[1]+e]]:t===fo?[[Math.max(a[0]-e,c),r],[Math.min(a[0]+e,n),i]]:[[c,Math.max(a[1]-e,r)],[n,Math.min(a[1]+e,i)]])}var r,n,i,o=function(t){return function(t){function e(t){return[(t=l(t[0]*Af,t[1]*Af))[0]*g+a,s-t[1]*g]}function r(t,e){return[(t=o(t,e))[0]*g+a,s-t[1]*g]}function n(){l=jf(u=to(x,b,w),o);var t=o(_,v);return a=m-t[0]*g,s=y+t[1]*g,i()}function i(){return f=d=null,e}var o,a,s,u,l,c,h,p,f,d,g=150,m=480,y=250,_=0,v=0,x=0,b=0,w=0,E=null,I=ad,S=null,C=$f,T=.5,P=ld(r,T);return e.stream=function(t){return f&&d===t?f:f=cd(I(u,P(C(d=t))))},e.clipAngle=function(t){return arguments.length?(I=+t?sd(E=t*Af,6*Af):(E=null,ad),i()):E*Mf},e.clipExtent=function(t){return arguments.length?(C=null==t?(S=c=h=p=null,$f):so(S=+t[0][0],c=+t[0][1],h=+t[1][0],p=+t[1][1]),i()):null==S?null:[[S,c],[h,p]]},e.scale=function(t){return arguments.length?(g=+t,n()):g},e.translate=function(t){return arguments.length?(m=+t[0],y=+t[1],n()):[m,y]},e.center=function(t){return arguments.length?(_=t[0]%360*Af,v=t[1]%360*Af,n()):[_*Mf,v*Mf]},e.rotate=function(t){return arguments.length?(x=t[0]%360*Af,b=t[1]%360*Af,w=t.length>2?t[2]%360*Af:0,n()):[x*Mf,b*Mf,w*Mf]},e.precision=function(t){return arguments.length?(P=ld(r,T=t*t),i()):Ff(T)},e.fitExtent=function(t,r){return po(e,t,r)},e.fitSize=function(t,r){return function(t,e,r){return po(t,[[0,0],e],r)}(e,t,r)},function(){return o=t.apply(this,arguments),e.invert=o.invert&&function(t){return(t=l.invert((t[0]-a)/g,(s-t[1])/g))&&[t[0]*Mf,t[1]*Mf]},n()}}((function(){return t}))()}(t),a=o.center,s=o.scale,u=o.translate,l=o.clipExtent,c=null;return o.scale=function(t){return arguments.length?(s(t),e()):s()},o.translate=function(t){return arguments.length?(u(t),e()):u()},o.center=function(t){return arguments.length?(a(t),e()):a()},o.clipExtent=function(t){return arguments.length?(null==t?c=r=n=i=null:(c=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),e()):null==c?null:[[c,r],[n,i]]},e()}(go),e=t.center,r=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)};t.projection=ya,t.random=tu,t.clusters=eu,t.helpers=No,t.invariant=Ro,t.meta=zo,t.isolines=function(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.zProperty||"elevation",i=r.commonProperties||{},o=r.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!I(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var a=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.zProperty||"elevation",n=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var r={};return L(t,(function(t){var e=G(t)[1];r[e]||(r[e]=[]),r[e].push(t)})),Object.keys(r).map((function(t){return r[t].sort((function(t,e){return G(t)[0]-G(e)[0]}))})).sort((function(t,r){return e?G(t[0])[1]-G(r[0])[1]:G(r[0])[1]-G(t[0])[1]}))}(t,n),a=[],s=0;sa;)r=i[n=Math.floor((o+1)*Math.random())],i[n]=i[o],i[o]=r;return i.slice(a)}(t.features,e))},t.envelope=se,t.square=ue,t.circle=ce,t.midpoint=function(t,e){return le(t,Rt(t,e)/2,he(t,e))},t.center=pe,t.centerOfMass=function t(e,r){switch(J(e)){case"Point":return e;case"Polygon":var i=[];T(e,(function(t){i.push(t)}));var o,a,s,u,l,c,h,p,f=fe(e,r),d=f.geometry.coordinates,g=0,m=0,y=0,_=i.map((function(t){return[t[0]-d[0],t[1]-d[1]]}));for(o=0;o=0&&l<=1&&(p.onLine1=!0),c>=0&&c<=1&&(p.onLine2=!0),!(!p.onLine1||!p.onLine2)&&[p.x,p.y])}(t[r][0],t[r][1],t[r+1][0],t[r+1][1],e[o][0],e[o][1],e[o+1][0],e[o+1][1]);a&&i.features.push(n([a[0],a[1]]))}}))})),i},t.pointOnFeature=hr,t.area=fr,t.along=function(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var i;if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}if(!E(e))throw new Error("distance must be a number");for(var o=0,a=0;a=o&&a===i.length-1);a++){if(o>=e){var s=e-o;if(s){var u=he(i[a],i[a-1])-180;return le(i[a],s,u,r)}return n(i[a])}o+=Rt(i[a],i[a+1],r)}return n(i[i.length-1])},t.length=_r,t.lineSlice=function(t,e,r){var n=G(r);if("LineString"!==J(r))throw new Error("line must be a LineString");for(var i,o=tr(r,t),a=tr(r,e),u=[(i=o.properties.index<=a.properties.index?[o,a]:[a,o])[0].geometry.coordinates],l=i[0].properties.index+1;l is required");if("boolean"!=typeof r)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=kt(t));var i=[];switch(t.type){case"GeometryCollection":return z(t,(function(t){en(t,r)})),t;case"FeatureCollection":return L(t,(function(t){L(en(t,r),(function(t){i.push(t)}))})),l(i)}return en(t,r)},t.isobands=function(t,e,r){if(!I(r=r||{}))throw new Error("options is invalid");var n=r.zProperty||"elevation",i=r.commonProperties||{},a=r.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!I(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(a))throw new Error("breaksProperties is not an Array");var s=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var r=e.zProperty||"elevation",n=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var r={};return L(t,(function(t){var e=G(t)[1];r[e]||(r[e]=[]),r[e].push(t)})),Object.keys(r).map((function(t){return r[t].sort((function(t,e){return G(t)[0]-G(e)[0]}))})).sort((function(t,r){return e?G(t[0])[1]-G(r[0])[1]:G(r[0])[1]-G(t[0])[1]}))}(t,n),a=[],s=0;s0}(t,e);case"Polygon":return!yn(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Pt(e,t);case"LineString":return!yn(t,e);case"Polygon":return!function(t,e){for(var r=0;r0)for(var r=0;r0))throw new Error("Invalid maxDistance");if(!(null==n||Math.sign(n)>0))throw new Error("Invalid minPoints");t=kt(t),n=n||3;var o=new Os.DBSCAN,a=-1;return o.run(N(t),b(e,i),n,Rt).forEach((function(e){a++,e.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster=a,r.properties.dbscan="core"}))})),o.noise.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster?r.properties.dbscan="edge":r.properties.dbscan="noise"})),t},t.clustersKmeans=function(t,e){if("object"!=typeof(e=e||{}))throw new Error("options is invalid");var r=e.numberOfClusters,n=e.mutate;W(t,"Point","Input must contain Points");var i=t.features.length;(r=r||Math.round(Math.sqrt(i/2)))>i&&(r=i),!1!==n&&void 0!==n||(t=kt(t));var o=N(t),a=o.slice(0,r),s=qs(o,r,a),u={};return s.centroids.forEach((function(t,e){u[e]=t})),L(t,(function(t,e){var r=s.idxs[e];t.properties.cluster=r,t.properties.centroid=u[r]})),t},t.pointToLineDistance=lr,t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Mn(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Mn(e,"line2"))throw new Error("line2 must be a LineString");for(var r=Je(Jt(t)).features,n=Je(Jt(e)).features,i=0;i=g;){for(var N=[],z=[],R=d+w,k=0;R<=m;){var O=n([R,L]),F=function(t,e){for(var r=0;r0&&0!==e)if(e>o[o.length-1])e-=o.length;else{var n=Eo(e,o);0!==n&&(e-=n)}if(e!==+u){var h=i[e];h&&l&&(void 0!==r&&h.properties[r]!==l.properties[r]||Tn(l,h)&&function(t,e){return Qe(s(N(t)),s(N(e))).features.length>0}(l,h)&&(i[u]=bo(l,h),o.push(t.properties.origIndexPosition),o.sort((function(t,e){return t-e})),a.remove(t),i.splice(e,1),l.properties.origIndexPosition=u,a.remove(l,(function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition})),c=!0))}})),c){if(!l)continue;l.properties.origIndexPosition=u,a.insert(l),u--}}return i.forEach((function(t){delete t.properties.origIndexPosition,delete t.bbox})),n},t.hexGrid=Io,t.mask=function(t,e){var r=function(t){return o(t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(e),n=function(t){var e=[],r=[];return k(t,(function(t){var n=t.geometry.coordinates,i=n[0],a=n.slice(1);e.push(o([i])),a.forEach((function(t){r.push(o([t]))}))})),[l(e),l(r)]}(t),i=n[0],a=n[1];return function(t,e,r){var n=[];return n.push(t.geometry.coordinates[0]),k(e,(function(t){n.push(t.geometry.coordinates[0])})),k(r,(function(t){n.push(t.geometry.coordinates[0])})),o(n)}(r,i=So(i),a=So(a))},t.squareGrid=To,t.triangleGrid=Po,t.interpolate=function(t,e,r){if("object"!=typeof(r=r||{}))throw new Error("options is invalid");var n=r.gridType,i=r.property,o=r.weight;if(!t)throw new Error("points is required");if(W(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",n=n||"square",o=o||1;var a,s=q(t);switch(n){case"point":case"points":a=Ir(s,e,r);break;case"square":case"squares":a=To(s,e,r);break;case"hex":case"hexes":a=Io(s,e,r);break;case"triangle":case"triangles":a=Po(s,e,r);break;default:throw new Error("invalid gridType")}var u=[];return L(a,(function(e){var a=0,s=0;L(t,(function(t){var u,l=Rt("point"===n?e:fe(e),t,r);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===l&&(a=u);var c=1/Math.pow(l,o);s+=c,a+=c*u}));var l=kt(e);l.properties[i]=a/s,u.push(l)})),l(u)},t.pointOnSurface=hr,t.polygonToLineString=Rr,t.lineStringToPolygon=Or,t.inside=Pt,t.within=At,t.bezier=oe,t.nearest=De,t.pointOnLine=tr,t.lineDistance=_r,t.radians2degrees=v,t.degrees2radians=x,t.distanceToDegrees=y,t.distanceToRadians=m,t.radiansToDistance=g,t.bearingToAngle=_,t.convertDistance=b,t.toMercator=ir,t.toWgs84=or,t.randomPosition=hi,t.randomPoint=pi,t.randomPolygon=fi,t.randomLineString=di,t.getCluster=mi,t.clusterEach=yi,t.clusterReduce=_i,t.createBins=vi,t.applyFilter=xi,t.propertiesContainsFilter=bi,t.filterProperties=wi,t.earthRadius=Mo,t.factors=Ao,t.unitsFactors=Lo,t.areaFactors=Do,t.feature=e,t.geometry=r,t.point=n,t.points=i,t.polygon=o,t.polygons=a,t.lineString=s,t.lineStrings=u,t.featureCollection=l,t.multiLineString=c,t.multiPoint=h,t.multiPolygon=p,t.geometryCollection=f,t.round=d,t.radiansToLength=g,t.lengthToRadians=m,t.lengthToDegrees=y,t.bearingToAzimuth=_,t.radiansToDegrees=v,t.degreesToRadians=x,t.convertLength=b,t.convertArea=w,t.isNumber=E,t.isObject=I,t.validateBBox=S,t.validateId=C,t.getCoord=j,t.getCoords=G,t.containsNumber=X,t.geojsonType=Z,t.featureOf=Y,t.collectionOf=W,t.getGeom=H,t.getGeomType=K,t.getType=J,t.coordEach=T,t.coordReduce=P,t.propEach=M,t.propReduce=A,t.featureEach=L,t.featureReduce=D,t.coordAll=N,t.geomEach=z,t.geomReduce=R,t.flattenEach=k,t.flattenReduce=O,t.segmentEach=F,t.segmentReduce=B,t.lineEach=U,t.lineReduce=V,Object.defineProperty(t,"__esModule",{value:!0})}(e)},754:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,"html, body {\n height: 100%;\n padding: 0;\n margin: 0;\n}\n\n#map {\n z-index: 0;\n height: 100%;\n}\n",""]);const o=i},113:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}",""]);const o=i},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,n){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(n)for(var o=0;o(n=1))return n;for(;ro?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=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(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}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}var l=u(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function h(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(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 y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function _(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(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 b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var w={};function E(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function S(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.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 M(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 A(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,D,N,z,R=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),k=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,O=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,F={now:R,frame:function(t){var e=k(t);return{cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.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 L||(L=a.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==D&&(D=a.matchMedia("(prefers-reduced-motion: reduce)")),D.matches)}},B={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!V&&z&&(q?j(t):N=t)}},V=!1,q=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,z),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),V=!0}a.document&&((z=a.document.createElement("img")).onload=function(){N&&j(N),N=null,q=!0},z.onerror=function(){V=!0,N=null},z.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",X=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}X.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},X.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},X.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},X.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return Z(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},X.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var r=K(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(F.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!B.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||B.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function W(t){return Y.test(t)}var H=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(H);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Q(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,r=Q(B.ACCESS_TOKEN);return e=r&&r.u?a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):B.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},$.prototype.fetchEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=a.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=a.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){E("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){E("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,r,n){var i=this;if(B.EVENTS_URL){var o=K(B.EVENTS_URL);o.params.push("access_token="+(n||B.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.0",skuId:G,userId:this.anonId},s=e?p(a,e):a,u={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(B.EVENTS_URL&&n||B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||W(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=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}($),nt=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){B.EVENTS_URL&&B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||W(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Q(B.ACCESS_TOKEN),n=r?r.u:B.ACCESS_TOKEN,i=n!==this.eventData.tokenU;m(this.anonId)||(this.anonId=g(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}($)),it=nt.postTurnstileEvent.bind(nt),ot=new rt,at=ot.postMapLoadEvent.bind(ot),st=500,ut=50;function lt(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,pt=1/0;function ft(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var gt,mt,yt=function(t){function e(e,r,n){401===r&&W(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=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),_t=C()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},vt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(_t())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:_t(),signal:n.signal}),o=!1,s=!1,u=(r=i.url).indexOf("sku=")>0&&W(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,o){if(!s){if(r&&"SecurityError"!==r.message&&E(r),n&&o)return c(n);var l=Date.now();a.fetch(i).then((function(r){if(r.ok){var n=u?r.clone():null;return c(r,n,l)}return e(new yt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(lt(),tt){var n={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=T(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===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,n);lt(),tt&&tt.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return E(t.message)}))})))}}(i,n,u),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(lt(),!tt)return e(null);var r=ct(t.url);tt.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=T(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,l):l(null,null),{cancel:function(){s=!0,o||n.abort()}}}(t,e);if(C()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new a.XMLHttpRequest;for(var n in r.open(t.method||"GET",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 yt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return vt(p(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return vt(p(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";gt=[],mt=0;var Et=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),mt>=B.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}mt++;var n=!1,i=function(){if(!n)for(n=!0,mt--;gt.length&&mt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Pt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Mt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},At=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Lt(t){var e=t.value;return e?[new At(t.key,e,"constants have been deprecated as of v8")]:[]}function Dt(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 Ht=[Ot,Ft,Bt,Ut,Vt,Xt,qt,Yt(jt),Zt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Ht;r255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var c=s.substr(0,u),h=s.substr(u+1,l-(u+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),g=o(h[2]),m=g<=.5?g*(d+1):g+d-g*d,y=2*g-m;return[n(255*a(y,m,f+1/3)),n(255*a(y,m,f)),n(255*a(y,m,f-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.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+")"},te.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]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=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"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.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}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.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 ae(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 te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],n++}else o=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Yt(o,a)}else r=he[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Xt,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Ft)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Yt(Bt))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Vt)))return null;var c=n[n.length-1];c.scale=s,c.font=u,c.textColor=l}else{var h=e.parse(t[o],1,jt);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)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 fe(n)},fe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Zt?new re("",r,null,null,null):new re(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var ge={"to-boolean":Ut,"to-color":Vt,"to-number":Ft,"to-string":Bt},me=function(t,e){this.type=t,this.args=e};me.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=ge[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ee(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 Ie(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 Se(t,e){for(var r,n,i,o,a,s,u,l=!1,c=0,h=e.length;c0&&s<0||a<0&&s>0}function Pe(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}be(e,t)}function ze(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Be(t,e)&&(r=!1)})),r}ke.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ce("Input is not a number.");o=a-1}return 0}Ve.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)},Ve.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new pe(e,[t]):"coerce"===r?new me(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 o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof le)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ue)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof xe)return!1;if(e instanceof ke)return!1;var r=e instanceof me||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof le})),!!n&&Oe(e)&&Be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new _e;try{o=new le(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}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.")},Ve.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 Ve(this.registry,n,e||null,i,this.errors)},Ve.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 Rt(n,t))},Ve.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var je=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=e.parse(s,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new je(i,r,n)},je.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[qe(e,n)].evaluate(t)},je.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 Xe=Object.freeze({__proto__:null,number:Ge,color:function(t,e,r){return new te(Ge(t.r,e.r,r),Ge(t.g,e.g,r),Ge(t.b,e.b,r),Ge(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ge(t,e[n],r)}))}}),Ze=6/29*3*(6/29),Ye=Math.PI/180,We=180/Math.PI;function He(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ze+4/29}function Ke(t){return t>6/29?t*t*t:Ze*(t-4/29)}function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Qe(t.r),r=Qe(t.g),n=Qe(t.b),i=He((.4124564*e+.3575761*r+.1804375*n)/.95047),o=He((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-He((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function tr(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*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Je(3.2404542*r-1.5371385*e-.4985314*n),Je(-.969266*r+1.8760108*e+.041556*n),Je(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function er(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var rr={forward:$e,reverse:tr,interpolate:function(t,e,r){return{l:Ge(t.l,e.l,r),a:Ge(t.a,e.a,r),b:Ge(t.b,e.b,r),alpha:Ge(t.alpha,e.alpha,r)}}},nr={forward:function(t){var e=$e(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*We;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Ye,r=t.c;return tr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:er(t.h,e.h,r),c:Ge(t.c,e.c,r),l:Ge(t.l,e.l,r),alpha:Ge(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:rr,hcl:nr}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))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,Ft)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=Vt:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var g=e.parse(p,d,l);if(!g)return null;l=l||g.type,u.push([h,g])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new or(l,r,n,i,u):e.error("Type "+Wt(l)+" is not interpolatable.")},or.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 o=qe(e,n),a=or.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Xe[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?nr.reverse(nr.interpolate(nr.forward(s),nr.forward(u),a)):rr.reverse(rr.interpolate(rr.forward(s),rr.forward(u),a))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},lr.prototype.eachChild=function(t){t(this.index),t(this.input)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cr=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);return r&&n?Jt(r.type,[Ut,Bt,Ft,Ot,jt])?new cr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");return r.indexOf(e)>=0},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Ft,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);if(!r||!n)return null;if(!Jt(r.type,[Ut,Bt,Ft,Ot,jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new hr(r,n,i):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};pr.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={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,se(p)))return null}else r=se(p);if(void 0!==i[String(p)])return l.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,jt);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,o,g):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=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,jt),n=e.parse(t[2],2,Ft);if(!r||!n)return null;if(!Jt(r.type,[Yt(jt),Bt,jt]))return e.error("Expected first argument to be of type array or string, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new dr(r.type,r,n,i):null}return new dr(r.type,r,n)},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Wt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},dr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},dr.prototype.outputDefined=function(){return!1},dr.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 _r=yr("==",(function(t,e,r){return e===r}),mr),vr=yr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!mr(0,e,r,n)})),xr=yr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),wr=yr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Er=yr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Ir=function(t,e,r,n,i){this.type=Bt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Ir.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ft);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,Bt)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Bt)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Ft)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ft))?null:new Ir(r,i,o,a,s)},Ir.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))},Ir.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)},Ir.prototype.outputDefined=function(){return!1},Ir.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 Sr=function(t){this.type=Ft,this.input=t};Sr.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 "+Wt(r.type)+" instead."):new Sr(r):null},Sr.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 ce("Expected value to be of type string or array, but found "+Wt(se(e))+" instead.")},Sr.prototype.eachChild=function(t){t(this.input)},Sr.prototype.outputDefined=function(){return!1},Sr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Cr={"==":_r,"!=":vr,">":br,"<":xr,">=":Er,"<=":wr,array:pe,at:lr,boolean:pe,case:fr,coalesce:sr,collator:xe,format:fe,image:de,in:cr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Sr,let:ur,literal:le,match:pr,number:pe,"number-format":Ir,object:pe,slice:dr,step:je,string:pe,"to-boolean":me,"to-color":me,"to-number":me,"to-string":me,var:Ue,within:ke};function Tr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(r,n,i,a);if(s)throw new ce(s);return new te(r/255*a,n/255*a,i/255*a,a)}function Pr(t,e){return t in e}function Mr(t,e){var r=e[t];return void 0===r?null:r}function Ar(t){return{type:t}}function Lr(t){return{result:"success",value:t}}function Dr(t){return{result:"error",value:t}}function Nr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function zr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function kr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Or(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Fr(t){return t}function Br(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,i){return Br(typeof r===i?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==kr(r))return Br(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=qe(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==kr(r))return Br(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=qe(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=Xe[e.type]||Fr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ir[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function jr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):kr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Br(r,t.default,e.default)}ve.register(Cr,{error:[{kind:"error"},[Bt],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[Bt,[jt],function(t,e){return Wt(se(e[0].evaluate(t)))}],"to-rgba":[Yt(Ft,4),[Vt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Vt,[Ft,Ft,Ft],Tr],rgba:[Vt,[Ft,Ft,Ft,Ft],Tr],has:{type:Ut,overloads:[[[Bt],function(t,e){return Pr(e[0].evaluate(t),t.properties())}],[[Bt,qt],function(t,e){var r=e[1];return Pr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:jt,overloads:[[[Bt],function(t,e){return Mr(e[0].evaluate(t),t.properties())}],[[Bt,qt],function(t,e){var r=e[1];return Mr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[jt,[Bt],function(t,e){return Mr(e[0].evaluate(t),t.featureState||{})}],properties:[qt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[Ft,[],function(t){return t.globals.zoom}],"heatmap-density":[Ft,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ft,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ft,Ar(Ft),function(t,e){for(var r=0,n=0,i=e;n":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ut,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Yt(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Yt(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[Bt,Yt(jt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ut,[Bt,Yt(jt)],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:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Ar(Ut),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Cr}function Zr(t,e){var r=new Ve(Cr,[],e?function(t){var e={color:Vt,string:Bt,number:Ft,enum:Bt,boolean:Ut,formatted:Xt,resolvedImage:Zt};return"array"===t.type?Yt(e[t.value]||jt,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?Lr(new Gr(n,e)):Dr(r.errors)}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){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=o,this.expression.evaluate(this._evaluator)},Gr.prototype.evaluate=function(t,e,r,n,i,o){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=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Yr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Fe(e.expression)};Yr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Yr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Wr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Fe(e.expression),this.interpolationType=n};function Hr(t,e){if("error"===(t=Zr(t,e)).result)return t;var r=t.value.expression,n=Oe(r);if(!n&&!Nr(e))return Dr([new Rt("","data expressions not supported")]);var i=Be(r,["zoom"]);if(!i&&!zr(e))return Dr([new Rt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof sr)for(var n=0,i=e.args;nn.maximum?[new At(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function tn(t){var e,r,n,i=t.valueSpec,o=Nt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===kr(t.value.stops)&&"array"===kr(t.value.stops[0])&&"object"===kr(t.value.stops[0][0]),c=Jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Qr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===kr(r)&&0===r.length&&e.push(new At(t.key,r,"array must have at least one stop")),e},default:function(t){return En({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new At(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Rr(t.valueSpec)&&c.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Nr(t.valueSpec)?c.push(new At(t.key,t.value,"property functions not supported")):s&&!zr(t.valueSpec)&&c.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new At(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==kr(o))return[new At(s,o,"array expected, "+kr(o)+" found")];if(2!==o.length)return[new At(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==kr(o[0]))return[new At(s,o,"object expected, "+kr(o[0])+" found")];if(void 0===o[0].zoom)return[new At(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new At(s,o,"object stop key must have value")];if(n&&n>Nt(o[0].zoom))return[new At(s,o[0].zoom,"stop zoom values must appear in ascending order")];Nt(o[0].zoom)!==n&&(n=Nt(o[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:$r,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Xr(zt(o[1]))?e.concat([new At(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(En({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=kr(t.value),u=Nt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new At(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 At(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Nr(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"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 un(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?ln(t[1],t[2],"=="):"!="===r?pn(ln(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?ln(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(un))):"all"===r?["all"].concat(t.slice(1).map(un)):"none"===r?["all"].concat(t.slice(1).map(un).map(pn)):"in"===r?cn(t[1],t.slice(2)):"!in"===r?pn(cn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?pn(hn(t[1])):"within"!==r||t}function ln(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 cn(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(sn)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function fn(t){return nn(zt(t.value))?en(Dt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==kr(r))return[new At(n,r,"array expected, "+kr(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new At(n,r,"filter array must have at least 1 element")];switch(a=a.concat(rn({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Nt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Nt(r[1])&&a.push(new At(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new At(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=kr(r[1]))&&a.push(new At(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=c[f+0]&&n>=c[f+1])?(a[p]=!0,o.push(l[p])):a[p]=!1}}},zn.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=u;p<=c;p++)for(var f=l;f<=h;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,o,a,s))return}},zn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},zn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},zn.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 c=t[l];u[l]=On[s].shallow.indexOf(l)>=0?c:qn(c,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 jn(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||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(jn);if("object"==typeof t){var e=t.$name||"Object",r=On[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,o=Object.keys(t);i=0?s:jn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Gn=function(){this.first=!0};Gn.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=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Zn(t){for(var e=0,r=t;e=65097&&t<=65103)||Xn["CJK Compatibility Ideographs"](t)||Xn["CJK Compatibility"](t)||Xn["CJK Radicals Supplement"](t)||Xn["CJK Strokes"](t)||!(!Xn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Xn["CJK Unified Ideographs Extension A"](t)||Xn["CJK Unified Ideographs"](t)||Xn["Enclosed CJK Letters and Months"](t)||Xn["Hangul Compatibility Jamo"](t)||Xn["Hangul Jamo Extended-A"](t)||Xn["Hangul Jamo Extended-B"](t)||Xn["Hangul Jamo"](t)||Xn["Hangul Syllables"](t)||Xn.Hiragana(t)||Xn["Ideographic Description Characters"](t)||Xn.Kanbun(t)||Xn["Kangxi Radicals"](t)||Xn["Katakana Phonetic Extensions"](t)||Xn.Katakana(t)&&12540!==t||!(!Xn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Xn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Xn["Unified Canadian Aboriginal Syllabics"](t)||Xn["Unified Canadian Aboriginal Syllabics Extended"](t)||Xn["Vertical Forms"](t)||Xn["Yijing Hexagram Symbols"](t)||Xn["Yi Syllables"](t)||Xn["Yi Radicals"](t))))}function Wn(t){return!(Yn(t)||function(t){return!!(Xn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Xn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Xn["Letterlike Symbols"](t)||Xn["Number Forms"](t)||Xn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Xn["Control Pictures"](t)&&9251!==t||Xn["Optical Character Recognition"](t)||Xn["Enclosed Alphanumerics"](t)||Xn["Geometric Shapes"](t)||Xn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Xn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Xn["CJK Symbols and Punctuation"](t)||Xn.Katakana(t)||Xn["Private Use Area"](t)||Xn["CJK Compatibility Forms"](t)||Xn["Small Form Variants"](t)||Xn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Hn(t){return t>=1424&&t<=2303||Xn["Arabic Presentation Forms-A"](t)||Xn["Arabic Presentation Forms-B"](t)}function Kn(t,e){return!(!e&&Hn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Xn.Khmer(t))}function Jn(t){for(var e=0,r=t;e-1&&($n="error"),Qn&&Qn(t)};function ri(){ni.fire(new Ct("pluginStateChange",{pluginStatus:$n,pluginURL:ti}))}var ni=new Pt,ii=function(){return $n},oi=function(){if("deferred"!==$n||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$n="loading",ri(),ti&&xt({url:ti},(function(t){t?ei(t):($n="loaded",ri())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$n||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===$n},setState:function(t){$n=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=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 Gn,this.transition={})};si.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 ui=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Or(t))return new Kr(t,e);if(Xr(t)){var r=Hr(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=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ui.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var li=function(t){this.property=t,this.value=new ui(t,void 0)};li.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},li.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ci.prototype.getValue=function(t){return b(this._values[t].value.value)},ci.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].value=new ui(this._values[t].property,null===e?void 0:b(e))},ci.prototype.getTransition=function(t){return b(this._values[t].transition)},ci.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].transition=b(e)||void 0},ci.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)}(a))}return i};var pi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};pi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new gi(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(yi),vi=function(t){this.specification=t};vi.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 si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},vi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},vi.prototype.interpolate=function(t){return t};var xi=function(t){this.specification=t};xi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},xi.prototype.interpolate=function(){return!1};var bi=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 ui(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new li(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Fn("DataDrivenProperty",yi),Fn("DataConstantProperty",mi),Fn("CrossFadedDataDrivenProperty",_i),Fn("CrossFadedProperty",vi),Fn("ColorRampProperty",xi);var wi=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),r.layout&&(this._unevaluatedLayout=new fi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ci(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 gi(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(Ln,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return _(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(An,"layers."+this.id+".paint."+t,t,e,r))return!1;if(_(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"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Dn(this,t.call(Pn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Mt,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 di&&Nr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Pt),Ei={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ii=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},Si=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ci(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=Ei[t.type].BYTES_PER_ELEMENT,o=r=Ti(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ti(r,Math.max(n,e)),alignment:e}}function Ti(t,e){return Math.ceil(t/e)*e}Si.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Si.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},Si.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Si.prototype.clear=function(){this.length=0},Si.prototype.resize=function(t){this.reserve(t),this.length=t},Si.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)}},Si.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Pi=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}(Si);Pi.prototype.bytesPerElement=4,Fn("StructArrayLayout2i4",Pi);var Mi=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 o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Si);Mi.prototype.bytesPerElement=8,Fn("StructArrayLayout4i8",Mi);var Ai=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.int16[s+5]=a,t},e}(Si);Ai.prototype.bytesPerElement=12,Fn("StructArrayLayout2i4i12",Ai);var Li=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.uint8[u+7]=a,t},e}(Si);Li.prototype.bytesPerElement=8,Fn("StructArrayLayout2i4ub8",Li);var Di=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}(Si);Di.prototype.bytesPerElement=8,Fn("StructArrayLayout2f8",Di);var Ni=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,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c){var h=10*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]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=l,this.uint16[h+9]=c,t},e}(Si);Ni.prototype.bytesPerElement=20,Fn("StructArrayLayout10ui20",Ni);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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,o,a,s,u,l,c,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,l,c,h)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p){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]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,t},e}(Si);zi.prototype.bytesPerElement=24,Fn("StructArrayLayout4i4ui4i24",zi);var Ri=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}(Si);Ri.prototype.bytesPerElement=12,Fn("StructArrayLayout3f12",Ri);var ki=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}(Si);ki.prototype.bytesPerElement=4,Fn("StructArrayLayout1ul4",ki);var Oi=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,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[h+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Si);Oi.prototype.bytesPerElement=20,Fn("StructArrayLayout6i1ul2ui20",Oi);var Fi=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.int16[s+5]=a,t},e}(Si);Fi.prototype.bytesPerElement=12,Fn("StructArrayLayout2i2i2i12",Fi);var Bi=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 o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Si);Bi.prototype.bytesPerElement=16,Fn("StructArrayLayout2f1f2i16",Bi);var Ui=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 o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Si);Ui.prototype.bytesPerElement=12,Fn("StructArrayLayout2ub2f12",Ui);var Vi=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}(Si);Vi.prototype.bytesPerElement=6,Fn("StructArrayLayout3ui6",Vi);var qi=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,o,a,s,u,l,c,h,p,f,d,g,m){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m,y){var _=24*t,v=12*t,x=48*t;return this.int16[_+0]=e,this.int16[_+1]=r,this.uint16[_+2]=n,this.uint16[_+3]=i,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[_+10]=u,this.uint16[_+11]=l,this.uint16[_+12]=c,this.float32[v+7]=h,this.float32[v+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=g,this.uint32[v+10]=m,this.int16[_+22]=y,t},e}(Si);qi.prototype.bytesPerElement=48,Fn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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,o,a,s,u,l,c,h,p,f,d,g,m,y,_,v,x,b,w,E,I,S,C,T){var P=this.length;return this.resize(P+1),this.emplace(P,t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m,y,_,v,x,b,w,E,I,S,C,T)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m,y,_,v,x,b,w,E,I,S,C,T,P){var M=34*t,A=17*t;return this.int16[M+0]=e,this.int16[M+1]=r,this.int16[M+2]=n,this.int16[M+3]=i,this.int16[M+4]=o,this.int16[M+5]=a,this.int16[M+6]=s,this.int16[M+7]=u,this.uint16[M+8]=l,this.uint16[M+9]=c,this.uint16[M+10]=h,this.uint16[M+11]=p,this.uint16[M+12]=f,this.uint16[M+13]=d,this.uint16[M+14]=g,this.uint16[M+15]=m,this.uint16[M+16]=y,this.uint16[M+17]=_,this.uint16[M+18]=v,this.uint16[M+19]=x,this.uint16[M+20]=b,this.uint16[M+21]=w,this.uint16[M+22]=E,this.uint32[A+12]=I,this.float32[A+13]=S,this.float32[A+14]=C,this.float32[A+15]=T,this.float32[A+16]=P,t},e}(Si);ji.prototype.bytesPerElement=68,Fn("StructArrayLayout8i15ui1ul4f68",ji);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Si);Gi.prototype.bytesPerElement=4,Fn("StructArrayLayout1f4",Gi);var Xi=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}(Si);Xi.prototype.bytesPerElement=6,Fn("StructArrayLayout3i6",Xi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Si);Zi.prototype.bytesPerElement=8,Fn("StructArrayLayout1ul2ui8",Zi);var Yi=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}(Si);Yi.prototype.bytesPerElement=4,Fn("StructArrayLayout2ui4",Yi);var Wi=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}(Si);Wi.prototype.bytesPerElement=2,Fn("StructArrayLayout1ui2",Wi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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 o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Si);Hi.prototype.bytesPerElement=16,Fn("StructArrayLayout4f16",Hi);var Ki=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}(Ii);Ki.prototype.size=20;var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ki(this,t)},e}(Oi);Fn("CollisionBoxArray",Ji);var Qi=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}(Ii);Qi.prototype.size=48;var $i=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 Qi(this,t)},e}(qi);Fn("PlacedSymbolArray",$i);var to=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}(Ii);to.prototype.size=68;var eo=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 to(this,t)},e}(ji);Fn("SymbolInstanceArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Gi);Fn("GlyphOffsetArray",ro);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.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}(Xi);Fn("SymbolLineVertexArray",no);var io=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}(Ii);io.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(Zi);Fn("FeatureIndexArray",oo);var ao=Ci([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function uo(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&E("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.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},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>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)))*a+(((u>>>16)*a&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}})),ho=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<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,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),po=co,fo=ho;po.murmur3=co,po.murmur2=fo;var go=function(){this.ids=[],this.positions=[],this.indexed=!1};go.prototype.add=function(t,e,r,n){this.ids.push(yo(t)),this.positions.push(e,r,n)},go.prototype.getPositions=function(t){for(var e=yo(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},go.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],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;_o(e,a,s),_o(r,3*a,3*s),_o(r,3*a+1,3*s+1),_o(r,3*a+2,3*s+2)}s-na.x+1||ua.y+1)&&E("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Vo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Uo(t):[]}}function qo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var jo=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 Pi,this.indexArray=new Vi,this.segments=new so,this.programConfigurations=new Ro(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Go(t,e){for(var r=0;r1){if(Wo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Qo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function $o(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ta(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 o=I(t,e,r[0]);return o!==I(t,e,r[1])||o!==I(t,e,r[2])||o!==I(t,e,r[3])}function ea(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ra(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function na(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u=8192||c<0||c>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;qo(this.layoutVertexArray,l,c,-1,-1),qo(this.layoutVertexArray,l,c,1,-1),qo(this.layoutVertexArray,l,c,1,1),qo(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Fn("CircleBucket",jo,{omit:["layers"]});var ia=new bi({"circle-sort-key":new yi(Mt.layout_circle["circle-sort-key"])}),oa={paint:new bi({"circle-radius":new yi(Mt.paint_circle["circle-radius"]),"circle-color":new yi(Mt.paint_circle["circle-color"]),"circle-blur":new yi(Mt.paint_circle["circle-blur"]),"circle-opacity":new yi(Mt.paint_circle["circle-opacity"]),"circle-translate":new mi(Mt.paint_circle["circle-translate"]),"circle-translate-anchor":new mi(Mt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new mi(Mt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new mi(Mt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yi(Mt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yi(Mt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yi(Mt.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(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 ua(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],g=e[12],m=e[13],y=e[14],_=e[15],v=r[0],x=r[1],b=r[2],w=r[3];return t[0]=v*n+x*s+b*h+w*g,t[1]=v*i+x*u+b*p+w*m,t[2]=v*o+x*l+b*f+w*y,t[3]=v*a+x*c+b*d+w*_,t[4]=(v=r[4])*n+(x=r[5])*s+(b=r[6])*h+(w=r[7])*g,t[5]=v*i+x*u+b*p+w*m,t[6]=v*o+x*l+b*f+w*y,t[7]=v*a+x*c+b*d+w*_,t[8]=(v=r[8])*n+(x=r[9])*s+(b=r[10])*h+(w=r[11])*g,t[9]=v*i+x*u+b*p+w*m,t[10]=v*o+x*l+b*f+w*y,t[11]=v*a+x*c+b*d+w*_,t[12]=(v=r[12])*n+(x=r[13])*s+(b=r[14])*h+(w=r[15])*g,t[13]=v*i+x*u+b*p+w*m,t[14]=v*o+x*l+b*f+w*y,t[15]=v*a+x*c+b*d+w*_,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 la,ca=ua;function ha(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}la=new aa(3),aa!=Float32Array&&(la[0]=0,la[1]=0,la[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var pa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype.queryRadius=function(t){var e=t;return ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+ra(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=na(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?u:function(t,e){return t.map((function(t){return fa(t,e)}))}(u,s),p=c?l*a:l,f=0,d=n;ft.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 a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var d=r;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return La(p,f,r,n,i,l),f}function Ma(t,e,r,n,i){var o,a;if(i===$a(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Ka(o,t[o],t[o+1],a);return a&&Ga(a,a.next)&&(Ja(a),a=a.next),a}function Aa(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ga(n,n.next)&&0!==ja(n.prev,n,n.next))n=n.next;else{if(Ja(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function La(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ba(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,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,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--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Na(t,n,i,o):Da(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ja(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?La(t=za(Aa(t),e,r),e,r,n,i,o,2):2===a&&Ra(t,e,r,n,i,o):La(Aa(t),e,r,n,i,o,1);break}}}function Da(t){var e=t.prev,r=t,n=t.next;if(ja(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Va(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ja(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Na(t,e,r,n){var i=t.prev,o=t,a=t.next;if(ja(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=Ba(i.x=l&&p&&p.z<=c;){if(h!==t.prev&&h!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=l;){if(h!==t.prev&&h!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function za(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ga(i,o)&&Xa(i,n,n.next,o)&&Wa(i,o)&&Wa(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ja(n),Ja(n.next),n=t=o),n=n.next}while(n!==t);return Aa(n)}function Ra(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&qa(a,s)){var u=Ha(a,s);return a=Aa(a,a.next),u=Aa(u,u.next),La(a,e,r,n,i,o),void La(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function ka(t,e){return t.x-e.x}function Oa(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&Va(or.x||n.x===r.x&&Fa(r,n)))&&(r=n,p=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ha(e,t);Aa(e,e.next),Aa(r,r.next)}}function Fa(t,e){return ja(t.prev,t,e.prev)<0&&ja(e.next,t,t.next)<0}function Ba(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 Ua(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function qa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Xa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Wa(t,e)&&Wa(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ja(t.prev,t,e.prev)||ja(t,e.prev,e))||Ga(t,e)&&ja(t.prev,t,t.next)>0&&ja(e.prev,e,e.next)>0)}function ja(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ga(t,e){return t.x===e.x&&t.y===e.y}function Xa(t,e,r,n){var i=Ya(ja(t,e,r)),o=Ya(ja(t,e,n)),a=Ya(ja(r,n,t)),s=Ya(ja(r,n,e));return i!==o&&a!==s||!(0!==i||!Za(t,r,e))||!(0!==o||!Za(t,n,e))||!(0!==a||!Za(r,t,n))||!(0!==s||!Za(r,e,n))}function Za(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 Ya(t){return t>0?1:t<0?-1:0}function Wa(t,e){return ja(t.prev,t,t.next)<0?ja(t,e,t.next)>=0&&ja(t,t.prev,e)>=0:ja(t,e,t.prev)<0||ja(t,t.next,e)<0}function Ha(t,e){var r=new Qa(t.i,t.x,t.y),n=new Qa(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ka(t,e,r,n){var i=new Qa(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 Ja(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Qa(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 $a(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+c)),Math.min(i,Math.floor(r+(a-s)*l/a+c)),o)}var h=e[r],p=n,f=i;for(es(e,n,r),o(e[i],h)>0&&es(e,n,i);p0;)f--}0===o(e[n],h)?es(e,n,f):es(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||rs)}function es(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function rs(t,e){return te?1:0}function ns(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},Ca.default=Ta;var ss=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Pi,this.indexArray=new Vi,this.indexArray2=new Yi,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,r){this.hasPattern=os("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},fs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=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),(o+=t.readSVarint())l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},fs.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=fs.types[this.type];function c(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 vs(t,e,r){if(3===t){var n=new ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ys.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 ps(this._pbf,e,this.extent,this._keys,this._values)};var xs={VectorTile:function(t,e){this.layers=t.readFields(vs,{},e)},VectorTileFeature:ps,VectorTileLayer:ms},bs=xs.VectorTileFeature.types,ws=Math.pow(2,13);function Es(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*ws)+a,i*ws*2,o*ws*2,Math.round(s))}var Is=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 Ai,this.indexArray=new Vi,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ss(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Is.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||D.every((function(t){return t.y<0}))||D.every((function(t){return t.y>8192}))))for(var g=0,m=0;m=1){var _=d[m-1];if(!Ss(y,_)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=y.sub(_)._perp()._unit(),x=_.dist(y);g+x>32768&&(g=0),Es(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,g),Es(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,g),Es(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,0,g+=x),Es(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,1,g);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+u>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===bs[t.type]){for(var w=[],E=[],I=h.vertexLength,S=0,C=s;S=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(E&&y>l){var S=c.dist(f);if(S>2*h){var C=c.sub(c.sub(f)._mult(h/S)._round());this.updateDistance(f,C),this.addCurrentVertex(C,g,0,0,p),f=C}}var T=f&&d,P=T?r:s?"butt":n;if(T&&"round"===P&&(bi&&(P="bevel"),"bevel"===P&&(b>2&&(P="flipbevel"),b100)_=m.mult(-1);else{var M=b*g.add(m).mag()/g.sub(m).mag();_._perp()._mult(M*(I?-1:1))}this.addCurrentVertex(c,_,0,0,p),this.addCurrentVertex(c,_.mult(-1),0,0,p)}else if("bevel"===P||"fakeround"===P){var A=-Math.sqrt(b*b-1),L=I?A:0,D=I?0:A;if(f&&this.addCurrentVertex(c,g,L,D,p),"fakeround"===P)for(var N=Math.round(180*w/Math.PI/20),z=1;z2*h){var U=c.add(d.sub(c)._mult(h/B)._round());this.updateDistance(c,U),this.addCurrentVertex(U,m,0,0,p),c=U}}}}},Rs.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>zs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Rs.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(zs-1):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===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Rs.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Rs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Fn("LineBucket",Rs,{omit:["layers","patternFeatures"]});var ks=new bi({"line-cap":new mi(Mt.layout_line["line-cap"]),"line-join":new yi(Mt.layout_line["line-join"]),"line-miter-limit":new mi(Mt.layout_line["line-miter-limit"]),"line-round-limit":new mi(Mt.layout_line["line-round-limit"]),"line-sort-key":new yi(Mt.layout_line["line-sort-key"])}),Os={paint:new bi({"line-opacity":new yi(Mt.paint_line["line-opacity"]),"line-color":new yi(Mt.paint_line["line-color"]),"line-translate":new mi(Mt.paint_line["line-translate"]),"line-translate-anchor":new mi(Mt.paint_line["line-translate-anchor"]),"line-width":new yi(Mt.paint_line["line-width"]),"line-gap-width":new yi(Mt.paint_line["line-gap-width"]),"line-offset":new yi(Mt.paint_line["line-offset"]),"line-blur":new yi(Mt.paint_line["line-blur"]),"line-dasharray":new vi(Mt.paint_line["line-dasharray"]),"line-pattern":new _i(Mt.paint_line["line-pattern"]),"line-gradient":new xi(Mt.paint_line["line-gradient"])}),layout:ks},Fs=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 si(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=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(yi))(Os.paint.properties["line-width"].specification);Fs.useIntegerZoom=!0;var Bs=function(t){function e(e){t.call(this,e,Os),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof je,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Fs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Rs(t)},e.prototype.queryRadius=function(t){var e=t,r=Us(ea("line-width",this,e),ea("line-gap-width",this,e)),n=ea("line-offset",this,e);return r/2+Math.abs(n)+ra(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var u=na(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Us(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var Vs=Ci([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=Ci([{name:"a_projected_pos",components:3,type:"Float32"}],4),js=(Ci([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ci([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Gs=(Ci([{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"}]),Ci([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Xs=Ci([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Zs(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()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ci([{name:"triangle",components:3,type:"Uint16"}]),Ci([{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"}]),Ci([{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"}]),Ci([{type:"Float32",name:"offsetX"}]),Ci([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ys={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ws=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},Hs=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*g},Ks=Js;function Js(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Js.Varint=0,Js.Fixed64=1,Js.Bytes=2,Js.Fixed32=5;var Qs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $s(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function tu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function eu(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 ru(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function fu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function du(t,e,r){1===t&&r.readMessage(gu,e)}function gu(t,e,r){if(3===t){var n=r.readMessage(mu,{}),i=n.width,o=n.height,a=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new _a({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function mu(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 yu(t){for(var e=0,r=0,n=0,i=t;n=0;p--){var f=a[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=a.pop();p>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*fu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ws(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ws(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,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return tu(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return tu(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&&Qs?function(t,e,r){return Qs.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+c>r)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=c}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!==Js.Bytes)return t.push(this.readVarint(e));var r=$s(this);for(t=t||[];this.pos127;);else if(e===Js.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Js.Fixed32)this.pos+=4;else{if(e!==Js.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;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,o=0;o55295&&n<57344){if(!i){n>56319||o+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&&eu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Hs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Hs(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&&eu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cu,e)},writeBytesField:function(t,e){this.writeTag(t,Js.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Js.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Js.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var _u=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},vu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};vu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},vu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},vu.tlbr.get=function(){return this.tl.concat(this.br)},vu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(_u.prototype,vu);var xu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=yu(i),a=new va({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;va.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var h=e[c],p=n[c].paddedRect,f=p.x+1,d=p.y+1,g=h.data.width,m=h.data.height;va.copy(h.data,a,{x:0,y:0},{x:f,y:d},h.data),va.copy(h.data,a,{x:0,y:m-1},{x:f,y:d-1},{width:g,height:1}),va.copy(h.data,a,{x:0,y:0},{x:f,y:d+m},{width:g,height:1}),va.copy(h.data,a,{x:g-1,y:0},{x:f-1,y:d},{width:1,height:m}),va.copy(h.data,a,{x:0,y:0},{x:f+g,y:d},{width:1,height:m})}this.image=a,this.iconPositions=r,this.patternPositions=n};xu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new _u(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},xu.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)},xu.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]})}},Fn("ImagePosition",_u),Fn("ImageAtlas",xu);var bu={horizontal:1,vertical:2,horizontalOnly:3},wu=function(){this.scale=1,this.fontStack="",this.imageName=null};wu.forText=function(t,e){var r=new wu;return r.scale=t||1,r.fontStack=e,r},wu.forImage=function(t){var e=new wu;return e.imageName=t,e};var Eu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Iu(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g){var m,y=Eu.fromFeature(t,i);h===bu.vertical&&y.verticalizePunctuation();var _=ai.processBidirectionalText,v=ai.processStyledBidirectionalText;if(_&&1===y.sections.length){m=[];for(var x=0,b=_(y.toString(),Lu(y,l,o,e,n,f,d));x0&&F>S&&(S=F)}else{var B=r[T.fontStack],U=B&&B[M];if(U&&U.rect)D=U.rect,L=U.metrics;else{var V=e[T.fontStack],q=V&&V[M];if(!q)continue;L=q.metrics}A=24*(b-T.scale)}R?(t.verticalizable=!0,I.push({glyph:M,imageName:N,x:p,y:f+A,vertical:R,scale:T.scale,fontStack:T.fontStack,sectionIndex:P,metrics:L,rect:D}),p+=z*T.scale+l):(I.push({glyph:M,imageName:N,x:p,y:f+A,vertical:R,scale:T.scale,fontStack:T.fontStack,sectionIndex:P,metrics:L,rect:D}),p+=L.advance*T.scale+l)}0!==I.length&&(d=Math.max(p-l,d),Nu(I,0,I.length-1,m,S)),p=0;var j=o*b+S;E.lineOffset=Math.max(S,w),f+=j,g=Math.max(j,g),++y}else f+=o,++y}var G,X=f- -17,Z=Du(a),Y=Z.horizontalAlign,W=Z.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,c=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var h=0,p=t;h=0&&n>=t&&Su[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Eu.prototype.substring=function(t,e){var r=new Eu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Eu.prototype.toString=function(){return this.text},Eu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Eu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(wu.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 Su={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Cu={};function Tu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Pu(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,p=0;p-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function Vu(t){for(var e=0,r=0;rl){var d=(l-u)/f,g=Ge(h.x,p.x,d),m=Ge(h.y,p.y,d),y=new Ru(g,m,p.angleTo(h),c);return y._round(),!a||Uu(t,y,s,a,e)?y:void 0}u+=f}}function Xu(t,e,r,n,i,o,a,s,u){var l=qu(n,o,a),c=ju(n,i),h=c*a,p=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h=0&&b=0&&w=0&&f+c<=h){var E=new Ru(b,w,v,g);E._round(),i&&!Uu(e,E,a,i,o)||d.push(E)}}p+=_}return u||d.length||s||(d=t(e,p/2,n,i,o,a,s,!0,l)),d}(t,p?e/2*s%e:(c/2+2*o)*a*s%e,e,l,r,h,p,!1,u)}function Zu(t,e,r,n,o){for(var a=[],s=0;s=n&&p.x>=n||(h.x>=n?h=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=n&&(p=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round():p.y>=o&&(p=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round()),l&&h.equals(l[l.length-1])||a.push(l=[h]),l.push(p)))))}return a}function Yu(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},g=p.reduce(d,0),m=f.reduce(d,0),y=u-g,_=l-m,v=0,x=g,b=0,w=m,E=0,I=y,S=0,C=_;if(a.content&&n){var T=a.content;v=Wu(p,0,T[0]),b=Wu(f,0,T[1]),x=Wu(p,T[0],T[2]),w=Wu(f,T[1],T[3]),E=T[0]-v,S=T[1]-b,I=T[2]-T[0]-x,C=T[3]-T[1]-w}var P=function(n,o,u,l){var p=Ku(n.stretch-v,x,c,t.left),f=Ju(n.fixed-E,I,n.stretch,g),d=Ku(o.stretch-b,w,h,t.top),y=Ju(o.fixed-S,C,o.stretch,m),_=Ku(u.stretch-v,x,c,t.left),T=Ju(u.fixed-E,I,u.stretch,g),P=Ku(l.stretch-b,w,h,t.top),M=Ju(l.fixed-S,C,l.stretch,m),A=new i(p,d),L=new i(_,d),D=new i(_,P),N=new i(p,P),z=new i(f/s,y/s),R=new i(T/s,M/s),k=e*Math.PI/180;if(k){var O=Math.sin(k),F=Math.cos(k),B=[F,-O,O,F];A._matMult(B),L._matMult(B),N._matMult(B),D._matMult(B)}var U=n.stretch+n.fixed,V=o.stretch+o.fixed;return{tl:A,tr:L,bl:N,br:D,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+V,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:z,pixelOffsetBR:R,minFontScaleX:I/s/c,minFontScaleY:C/s/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var M=Hu(p,y,g),A=Hu(f,_,m),L=0;L0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var g=a.top*s-u,m=a.bottom*s+u,y=a.left*s-u,_=a.right*s+u,v=a.collisionPadding;if(v&&(y-=v[0]*s,g-=v[1]*s,_+=v[2]*s,m+=v[3]*s),c){var x=new i(y,g),b=new i(_,g),w=new i(y,m),E=new i(_,m),I=c*Math.PI/180;x._rotate(I),b._rotate(I),w._rotate(I),E._rotate(I),y=Math.min(x.x,b.x,w.x,E.x),_=Math.max(x.x,b.x,w.x,E.x),g=Math.min(x.y,b.y,w.y,E.y),m=Math.max(x.y,b.y,w.y,E.y)}t.emplaceBack(e.x,e.y,y,g,_,m,r,n,o)}this.boxEndIndex=t.length},$u=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tl),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 tl(t,e){return te?1:0}function el(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;la)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var h=Math.min(a-n,s-o),p=h/2,f=new $u([],rl);if(0===h)return new i(n,o);for(var d=n;dm.d||!m.d)&&(m=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,y)),_.max-m.d<=e||(f.push(new nl(_.p.x-(p=_.h/2),_.p.y-p,p,t)),f.push(new nl(_.p.x+p,_.p.y-p,p,t)),f.push(new nl(_.p.x-p,_.p.y+p,p,t)),f.push(new nl(_.p.x+p,_.p.y+p,p,t)),y+=4)}return r&&(console.log("num probes: "+y),console.log("best distance: "+m.d)),m.p}function rl(t,e){return e.max-t.max}function nl(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!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(r=!r),n=Math.min(n,Jo(t,l,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}$u.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$u.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}},$u.prototype.peek=function(){return this.data[0]},$u.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},$u.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var il=Number.POSITIVE_INFINITY;function ol(t,e){return e[1]!==il?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 al(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sl(t,e,r,n,o,a,s,u,l,c,h,p,f,d,g){var m=function(t,e,r,n,o,a,s,u){for(var l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=0,p=e.positionedLines;h32640&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((_=[128*d.compositeTextSizes[0].evaluate(s,{},g),128*d.compositeTextSizes[1].evaluate(s,{},g)])[0]>32640||_[1]>32640)&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,_,u,a,s,c,e,l.lineStartIndex,l.lineLength,f,g);for(var v=0,x=h;v=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],u||l){for(var h=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new si(this.zoom),g=0,m=t;g=0;for(var D=0,N=I.sections;D=0;s--)o[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},yl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},yl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},yl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},yl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},yl.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)}},Fn("SymbolBucket",yl,{omit:["layers","collisionBoxArray","features","compareText"]}),yl.MAX_GLYPHS=65535,yl.addDynamicAttributes=fl;var _l=new bi({"symbol-placement":new mi(Mt.layout_symbol["symbol-placement"]),"symbol-spacing":new mi(Mt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new mi(Mt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yi(Mt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new mi(Mt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new mi(Mt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new mi(Mt.layout_symbol["icon-ignore-placement"]),"icon-optional":new mi(Mt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new mi(Mt.layout_symbol["icon-rotation-alignment"]),"icon-size":new yi(Mt.layout_symbol["icon-size"]),"icon-text-fit":new mi(Mt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new mi(Mt.layout_symbol["icon-text-fit-padding"]),"icon-image":new yi(Mt.layout_symbol["icon-image"]),"icon-rotate":new yi(Mt.layout_symbol["icon-rotate"]),"icon-padding":new mi(Mt.layout_symbol["icon-padding"]),"icon-keep-upright":new mi(Mt.layout_symbol["icon-keep-upright"]),"icon-offset":new yi(Mt.layout_symbol["icon-offset"]),"icon-anchor":new yi(Mt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new mi(Mt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new mi(Mt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new mi(Mt.layout_symbol["text-rotation-alignment"]),"text-field":new yi(Mt.layout_symbol["text-field"]),"text-font":new yi(Mt.layout_symbol["text-font"]),"text-size":new yi(Mt.layout_symbol["text-size"]),"text-max-width":new yi(Mt.layout_symbol["text-max-width"]),"text-line-height":new mi(Mt.layout_symbol["text-line-height"]),"text-letter-spacing":new yi(Mt.layout_symbol["text-letter-spacing"]),"text-justify":new yi(Mt.layout_symbol["text-justify"]),"text-radial-offset":new yi(Mt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new mi(Mt.layout_symbol["text-variable-anchor"]),"text-anchor":new yi(Mt.layout_symbol["text-anchor"]),"text-max-angle":new mi(Mt.layout_symbol["text-max-angle"]),"text-writing-mode":new mi(Mt.layout_symbol["text-writing-mode"]),"text-rotate":new yi(Mt.layout_symbol["text-rotate"]),"text-padding":new mi(Mt.layout_symbol["text-padding"]),"text-keep-upright":new mi(Mt.layout_symbol["text-keep-upright"]),"text-transform":new yi(Mt.layout_symbol["text-transform"]),"text-offset":new yi(Mt.layout_symbol["text-offset"]),"text-allow-overlap":new mi(Mt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new mi(Mt.layout_symbol["text-ignore-placement"]),"text-optional":new mi(Mt.layout_symbol["text-optional"])}),vl={paint:new bi({"icon-opacity":new yi(Mt.paint_symbol["icon-opacity"]),"icon-color":new yi(Mt.paint_symbol["icon-color"]),"icon-halo-color":new yi(Mt.paint_symbol["icon-halo-color"]),"icon-halo-width":new yi(Mt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yi(Mt.paint_symbol["icon-halo-blur"]),"icon-translate":new mi(Mt.paint_symbol["icon-translate"]),"icon-translate-anchor":new mi(Mt.paint_symbol["icon-translate-anchor"]),"text-opacity":new yi(Mt.paint_symbol["text-opacity"]),"text-color":new yi(Mt.paint_symbol["text-color"],{runtimeType:Vt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new yi(Mt.paint_symbol["text-halo-color"]),"text-halo-width":new yi(Mt.paint_symbol["text-halo-width"]),"text-halo-blur":new yi(Mt.paint_symbol["text-halo-blur"]),"text-translate":new mi(Mt.paint_symbol["text-translate"]),"text-translate-anchor":new mi(Mt.paint_symbol["text-translate-anchor"])}),layout:_l},xl=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ot,this.defaultValue=t};xl.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},xl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},xl.prototype.outputDefined=function(){return!1},xl.prototype.serialize=function(){return null},Fn("FormatSectionOverride",xl,{omit:["defaultValue"]});var bl=function(t){function e(e){t.call(this,e,vl)}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=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},Rl.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else C()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Rl.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Rl.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(jn(e.error)):n(null,jn(e.data)))}else{var i=!1,o=M(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,o)},o)}:function(t){i=!0},s=null,u=jn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Rl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Ol=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]))};Ol.prototype.setNorthEast=function(t){return this._ne=t instanceof Fl?new Fl(t.lng,t.lat):Fl.convert(t),this},Ol.prototype.setSouthWest=function(t){return this._sw=t instanceof Fl?new Fl(t.lng,t.lat):Fl.convert(t),this},Ol.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Fl)e=t,r=t;else{if(!(t instanceof Ol))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Ol.convert(t)):this.extend(Fl.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 Fl(e.lng,e.lat),this._ne=new Fl(r.lng,r.lat)),this},Ol.prototype.getCenter=function(){return new Fl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Ol.prototype.getSouthWest=function(){return this._sw},Ol.prototype.getNorthEast=function(){return this._ne},Ol.prototype.getNorthWest=function(){return new Fl(this.getWest(),this.getNorth())},Ol.prototype.getSouthEast=function(){return new Fl(this.getEast(),this.getSouth())},Ol.prototype.getWest=function(){return this._sw.lng},Ol.prototype.getSouth=function(){return this._sw.lat},Ol.prototype.getEast=function(){return this._ne.lng},Ol.prototype.getNorth=function(){return this._ne.lat},Ol.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Ol.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Ol.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Ol.prototype.contains=function(t){var e=Fl.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},Ol.convert=function(t){return!t||t instanceof Ol?t:new Ol(t)};var Fl=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Fl.prototype.wrap=function(){return new Fl(h(this.lng,-180,180),this.lat)},Fl.prototype.toArray=function(){return[this.lng,this.lat]},Fl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Fl.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))},Fl.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 Ol(new Fl(this.lng-r,this.lat-e),new Fl(this.lng+r,this.lat+e))},Fl.convert=function(t){if(t instanceof Fl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Fl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Fl(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 Bl=2*Math.PI*6371008.8;function Ul(t){return Bl*Math.cos(t*Math.PI/180)}function Vl(t){return(180+t)/360}function ql(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jl(t,e){return t/Ul(e)}function Gl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Xl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Xl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Fl.convert(t);return new Xl(Vl(r.lng),ql(r.lat),jl(e,r.lat))},Xl.prototype.toLngLat=function(){return new Fl(360*this.x-180,Gl(this.y))},Xl.prototype.toAltitude=function(){return this.z*Ul(Gl(this.y))},Xl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Bl*(t=Gl(this.y),1/Math.cos(t*Math.PI/180));var t};var Zl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Hl(0,t,t,e,r)};Zl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Zl.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=kl(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=kl(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new Wl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Wl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Hl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Hl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Wl.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},Wl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Wl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Wl(e,this.wrap,e,r,n),new Wl(e,this.wrap,e,r+1,n),new Wl(e,this.wrap,e,r,n+1),new Wl(e,this.wrap,e,r+1,n+1)]},Wl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=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)},Kl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Kl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Kl.prototype.getPixels=function(){return new va({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kl.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,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},ec.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new xs.VectorTile(new Ks(this.rawTileData)).layers,this.sourceLayerCoder=new Jl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ec.prototype.query=function(t,e,r,n){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=an(a.filter),l=t.queryGeometry,c=t.queryPadding*s,h=nc(l),p=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),f=nc(t.cameraQueryGeometry),d=0,g=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var c=0,h=l;c=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var g=Vo(d,!0);if(!i.filter(new si(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),d))return;for(var m=this.getId(d,f),y=0;yn)i=!1;else if(e)if(this.expirationTimeut&&(t.getActor().send("enforceCacheSizeLimit",st),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Zu,t.clone=function(t){var e=new aa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Xs,t.config=B,t.create=function(){var t=new aa(16);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new aa(9);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Zr,t.createLayout=Ci,t.createStyleLayer=function(t){return"custom"===t.type?new Cl(t):new Tl[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ge,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ks(t).readFields(du,[])},t.pbf=Ks,t.performSymbolLayout=function(t,e,r,n,i,o,a){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 c=t.textSizeData,h=c.maxZoom;l.compositeTextSizes=[u["text-size"].possiblyEvaluate(new si(c.minZoom),a),u["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,f=p.maxZoom;l.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new si(p.minZoom),a),u["icon-size"].possiblyEvaluate(new si(f),a)]}l.layoutTextSize=u["text-size"].possiblyEvaluate(new si(t.zoom+1),a),l.layoutIconSize=u["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),l.textMaxSize=u["text-size"].possiblyEvaluate(new si(18));for(var d=24*s.get("text-line-height"),g="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),m=s.get("text-keep-upright"),y=s.get("text-size"),_=function(){var o=x[v],u=s.get("text-font").evaluate(o,{},a).join(","),c=y.evaluate(o,{},a),h=l.layoutTextSize.evaluate(o,{},a),p=l.layoutIconSize.evaluate(o,{},a),f={horizontal:{},vertical:void 0},_=o.text,b=[0,0];if(_){var w=_.toString(),I=24*s.get("text-letter-spacing").evaluate(o,{},a),S=function(t){for(var e=0,r=t;e=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,m,y,_,v,x,b,w,I,S){var C,T,P,M,A,L=t.addToLineVertexArray(e,r),D=0,N=0,z=0,R=0,k=-1,O=-1,F={},B=po(""),U=0,V=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(C=s.layout.get("text-offset").evaluate(x,{},I).map((function(t){return 24*t})))[0],V=C[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},I),V=il),t.allowVerticalPlacement&&n.vertical){var q=s.layout.get("text-rotate").evaluate(x,{},I)+90;M=new Qu(u,e,l,c,h,n.vertical,p,f,d,q),a&&(A=new Qu(u,e,l,c,h,a,m,y,d,q))}if(i){var j=s.layout.get("icon-rotate").evaluate(x,{}),G="none"!==s.layout.get("icon-text-fit"),X=Yu(i,j,w,G),Z=a?Yu(a,j,w,G):void 0;P=new Qu(u,e,l,c,h,i,m,y,!1,j),D=4*X.length;var Y=t.iconSizeData,W=null;"source"===Y.kind?(W=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((W=[128*b.compositeIconSizes[0].evaluate(x,{},I),128*b.compositeIconSizes[1].evaluate(x,{},I)])[0]>32640||W[1]>32640)&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,X,W,v,_,x,!1,e,L.lineStartIndex,L.lineLength,-1,I),k=t.icon.placedSymbolArray.length-1,Z&&(N=4*Z.length,t.addSymbols(t.icon,Z,W,v,_,x,bu.vertical,e,L.lineStartIndex,L.lineLength,-1,I),O=t.icon.placedSymbolArray.length-1)}for(var H in n.horizontal){var K=n.horizontal[H];if(!T){B=po(K.text);var J=s.layout.get("text-rotate").evaluate(x,{},I);T=new Qu(u,e,l,c,h,K,p,f,d,J)}var Q=1===K.positionedLines.length;if(z+=sl(t,e,K,o,s,d,x,g,L,n.vertical?bu.horizontal:bu.horizontalOnly,Q?Object.keys(n.horizontal):[H],F,k,b,I),Q)break}n.vertical&&(R+=sl(t,e,n.vertical,o,s,d,x,g,L,bu.vertical,["vertical"],F,O,b,I));var $=T?T.boxStartIndex:t.collisionBoxArray.length,tt=T?T.boxEndIndex:t.collisionBoxArray.length,et=M?M.boxStartIndex:t.collisionBoxArray.length,rt=M?M.boxEndIndex:t.collisionBoxArray.length,nt=P?P.boxStartIndex:t.collisionBoxArray.length,it=P?P.boxEndIndex:t.collisionBoxArray.length,ot=A?A.boxStartIndex:t.collisionBoxArray.length,at=A?A.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(T,st),st=ut(M,st),st=ut(P,st);var lt=(st=ut(A,st))>-1?1:0;lt&&(st*=S/24),t.glyphOffsetArray.length>=yl.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,k,O,B,$,tt,et,rt,nt,it,ot,at,l,z,R,D,N,lt,0,p,U,V,st)}(t,h,s,r,n,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,b,S,u,v,w,C,d,e,o,l,c,a)};if("line"===T)for(var L=0,D=Zu(e.geometry,0,0,8192,8192);L1){var U=Gu(B,I,r.vertical||g,n,24,_);U&&A(B,U)}}else if("Polygon"===e.type)for(var V=0,q=ns(e.geometry,0);V=P.maxzoom||"none"!==P.visibility&&(a(T,this.zoom,n),(g[P.id]=P.createBucket({index:c.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,m,this.tileID.canonical),c.bucketLayerIDs.push(T.map((function(t){return t.id}))))}}}var M=t.mapObject(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(M).length?o.send("getGlyphs",{uid:this.uid,stacks:M},(function(t,e){h||(h=t,p=e,D.call(u))})):p={};var A=Object.keys(m.iconDependencies);A.length?o.send("getImages",{icons:A,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,f=e,D.call(u))})):f={};var L=Object.keys(m.patternDependencies);function D(){if(h)return s(h);if(p&&f&&d){var e=new i(p),r=new t.ImageAtlas(f,d);for(var o in g){var u=g[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,n),t.performSymbolLayout(u,p,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,n),u.addFeatures(m,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(g).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}L.length?o.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,D.call(u))})):d={},D.call(this)};var u=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var u=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);var c={};if(a){var h=a.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,l,c))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},u.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var l=t.window.ImageBitmap,c=function(){this.loaded={}};function h(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=l&&o instanceof l?this.getImageData(o):o,s=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function P(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var p=r[2*n+a],f=i,d=o;for(A(e,r,i,n),r[2*o+a]>p&&A(e,r,i,o);fp;)d--}r[2*i+a]===p?A(e,r,i,d):A(e,r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};R.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var h=l.pop(),p=l.pop(),f=l.pop();if(p-f<=a)for(var d=f;d<=p;d++)u=e[2*d+1],(s=e[2*d])>=r&&s<=i&&u>=n&&u<=o&&c.push(t[d]);else{var g=Math.floor((f+p)/2);u=e[2*g+1],(s=e[2*g])>=r&&s<=i&&u>=n&&u<=o&&c.push(t[g]);var m=(h+1)%2;(0===h?r<=s:n<=u)&&(l.push(f),l.push(g-1),l.push(m)),(0===h?i>=s:o>=u)&&(l.push(g+1),l.push(p),l.push(m))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},R.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)D(e[2*p],e[2*p+1],r,n)<=u&&s.push(t[p]);else{var f=Math.floor((h+c)/2),d=e[2*f],g=e[2*f+1];D(d,g,r,n)<=u&&s.push(t[f]);var m=(l+1)%2;(0===l?r-i<=d:n-i<=g)&&(a.push(h),a.push(f-1),a.push(m)),(0===l?r+i>=d:n+i>=g)&&(a.push(f+1),a.push(c),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var k={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},O=function(t){this.options=G(Object.create(k),t),this.trees=new Array(this.options.maxZoom+1)};function F(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function B(t,e){var r=t.geometry.coordinates,n=r[1];return{x:q(r[0]),y:j(n),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:V(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function V(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function q(t){return t/360+.5}function j(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function G(t,e){for(var r in e)t[r]=e[r];return t}function X(t){return t.x}function Z(t){return t.y}function Y(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function W(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)H(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],c=e[r+1],h=e[n],p=e[n+1],f=r+3;fa)o=f,a=d;else if(d===a){var g=Math.abs(f-s);gi&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function $(t,e,r,n){for(var i=0;i1?1:r}function rt(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],l=0;l=r&&d=n)){var g=[];if("Point"===p||"MultiPoint"===p)nt(h,g,r,n,i);else if("LineString"===p)it(h,g,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)at(h,g,r,n,i,!1);else if("Polygon"===p)at(h,g,r,n,i,!0);else if("MultiPolygon"===p)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,r,n,i,o,a){for(var s,u,l=ot(t),c=0===i?ut:lt,h=t.start,p=0;pr&&(u=c(l,f,d,m,y,r),a&&(l.start=h+s*u)):_>n?v=r&&(u=c(l,f,d,m,y,r),x=!0),v>n&&_<=n&&(u=c(l,f,d,m,y,n),x=!0),!o&&x&&(a&&(l.end=h+s*u),e.push(l),l=ot(t)),a&&(h+=s)}var b=t.length-3;f=t[b],d=t[b+1],g=t[b+2],(_=0===i?f:d)>=r&&_<=n&&st(l,f,d,g),b=l.length-3,o&&b>=3&&(l[b]!==l[0]||l[b+1]!==l[1])&&st(l,l[0],l[1],l[2]),l.length&&e.push(l)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function gt(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(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,o=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;n=n;l--){var c=+Date.now();s=this._cluster(s,l),this.trees[l]=new R(s,X,Z,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},O.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],c=0,h=u.range(q(r),j(o),q(i),j(n));ce&&(p+=g.numPoints||1)}if(p>=o){for(var m=u.x*h,y=u.y*h,_=i&&h>1?this._map(u,!0):null,v=(s<<5)+(e+1)+this.points.length,x=0,b=c;x1)for(var I=0,S=c;I>5},O.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},O.prototype._map=function(t,e){if(t.numPoints)return e?G({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?G({},n):n},yt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},yt.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<1&&console.time("creation"),p=this.tiles[h]=dt(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,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var g,m,y,_,v,x,b=.5*u.buffer/u.extent,w=.5-b,E=.5+b,I=1+b;g=m=y=_=null,v=rt(t,c,r-b,r+E,0,p.minX,p.maxX,u),x=rt(t,c,r+w,r+I,0,p.minX,p.maxX,u),t=null,v&&(g=rt(v,c,n-b,n+E,1,p.minY,p.maxY,u),m=rt(v,c,n+w,n+I,1,p.minY,p.maxY,u),v=null),x&&(y=rt(x,c,n-b,n+E,1,p.minY,p.maxY,u),_=rt(x,c,n+w,n+I,1,p.minY,p.maxY,u),x=null),l>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(_||[],e+1,2*r+1,2*n+1)}}},yt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,c=e,h=r;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[_t(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?pt(this.tiles[s],i):null):null};var xt=function(e){function r(t,r,n,i){e.call(this,t,r,n,vt),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function y(t,e,r,n,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],v.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,a=u;i1&&(s=t[++a]);var l=Math.abs(u-s.left),c=Math.abs(u-s.right),h=Math.min(l,c),p=void 0,f=i/r*(n+1);if(s.isDash){var d=n-Math.abs(f);p=Math.sqrt(h*h+d*d)}else p=n-Math.sqrt(h*h+f*f);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},E.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l1&&(u=t[++s]);var c=Math.abs(l-u.left),h=Math.abs(l-u.right),p=Math.min(c,h);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},E.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=n&&e.x=i&&e.y0&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{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,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),D=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=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(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;ar.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(D),z=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},B.prototype.has=function(t){return t.wrapped().key in this.data},B.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},B.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},B.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},B.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},B.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},B.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},B.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=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)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(Dt(this._source.type)){for(var l={},c={},h=0,p=Object.keys(u);hthis._source.maxzoom){var m=d.children(this._source.maxzoom)[0],y=this.getTile(m);if(y&&y.hasData()){n[m.key]=m;continue}}else{var _=d.children(this._source.maxzoom);if(n[_[0].key]&&n[_[1].key]&&n[_[2].key]&&n[_[3].key])continue}for(var v=g.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(i[b.key])break;if(i[b.key]=!0,!(g=this.getTile(b))&&v&&(g=this._addTile(b)),g&&(n[b.key]=b,v=g.wasRequested(),g.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var o=0,a=e;o0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),l=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,g=0,m=l;g=0&&y[1].y+m>=0){var _=u.map((function(t){return s.getTilePoint(t)})),v=l.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:_,cameraQueryGeometry:v,scale:g})}}},v=0;v=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Lt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Dt(t){return"raster"===t||"image"===t||"video"===t}function Nt(){return new t.window.Worker(Hi.workerUrl)}At.maxOverzooming=10,At.maxUnderzooming=3;var zt="mapboxgl_preloaded_worker_pool",Rt=function(){this.active={}};Rt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[r].mult(u))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function re(e,r,n,i,o,a,s,u){var l=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,m=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,o,a,s,u,l,c,h,p,f,d){var g,m=r/24,y=e.lineOffsetX*m,_=e.lineOffsetY*m;if(e.numGlyphs>1){var v=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ne(m,u,y,_,n,h,p,e,l,a,f);if(!w)return{notEnoughRoom:!0};var E=$t(w.first.point,s).point,I=$t(w.last.point,s).point;if(i&&!n){var S=ie(e.writingMode,E,I,d);if(S)return S}g=[w.first];for(var C=e.glyphStartIndex+1;C0?A.point:ae(p,M,T,1,o),D=ie(e.writingMode,T,L,d);if(D)return D}var N=se(m*u.getoffsetX(e.glyphStartIndex),y,_,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f);if(!N)return{notEnoughRoom:!0};g=[N]}for(var z=0,R=g;z0?1:-1,g=0;i&&(d*=-1,g=Math.PI),d<0&&(g+=Math.PI);for(var m=d>0?u+s:u+s+1,y=o,_=o,v=0,x=0,b=Math.abs(f),w=[];v+x<=b;){if((m+=d)=l)return null;if(_=y,w.push(y),void 0===(y=p[m])){var E=new t.Point(c.getx(m),c.gety(m)),I=$t(E,h);if(I.signedDistanceFromCamera>0)y=p[m]=I.point;else{var S=m-d;y=ae(0===v?a:new t.Point(c.getx(S),c.gety(S)),E,_,b-v+1,h)}}v+=x,x=_.dist(y)}var C=(b-v)/x,T=y.sub(_),P=T.mult(C)._add(_);P._add(T._unit()._perp()._mult(n*d));var M=g+Math.atan2(y.y-_.y,y.x-_.x);return w.push(P),{point:P,angle:M,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},Kt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:a},Kt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!n&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?l.length>0:l},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=a.seenUids,l=this.boxCells[i];if(null!==l)for(var c=this.bboxes,h=0,p=l;h=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var g=this.circleCells[i];if(null!==g)for(var m=this.circles,y=0,_=g;y<_.length;y+=1){var v=_[y];if(!u.circle[v]){u.circle[v]=!0;var x=3*v;if(this._circleAndRectCollide(m[x],m[x+1],m[x+2],t,e,r,n)&&(!s||s(this.circleKeys[v]))){if(a.hitTest)return o.push(!0),!0;var b=m[x],w=m[x+1],E=m[x+2];o.push({key:this.circleKeys[v],x1:b-E,y1:w-E,x2:b+E,y2:w+E})}}}},Kt.prototype._queryCellCircle=function(t,e,r,n,i,o,a,s){var u=a.circle,l=a.seenUids,c=this.boxCells[i];if(null!==c)for(var h=this.bboxes,p=0,f=c;pa*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,u=Math.abs(t-(n+s));if(u>s+r)return!1;var l=(a-i)/2,c=Math.abs(e-(i+l));if(c>l+r)return!1;if(u<=s||c<=l)return!0;var h=u-s,p=c-l;return h*h+p*p<=r*r};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(t,e){for(var r=0;r=1;L--)A.push(P.path[L]);for(var D=1;D0){for(var k=A[0].clone(),O=A[0].clone(),F=1;F=S.x&&O.x<=C.x&&k.y>=S.y&&O.y<=C.y?[A]:O.xC.x||O.yC.y?[]:t.clipLine([A],S.x,S.y,C.x,C.y)}for(var B=0,U=R;B=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(g=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:m,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:g},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:y,placedGlyphBoxes:_}):void 0},be.prototype.placeLayerBucketPart=function(e,r,n){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,l=o.textLabelPlaneMatrix,c=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,f=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,g=o.collisionGroup,m=s.get("text-optional"),y=s.get("icon-optional"),_=s.get("text-allow-overlap"),v=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order"),I=_&&(v||!a.hasIconData()||y),S=v&&(_||!a.hasTextData()||m);!a.collisionArrays&&f&&a.deserializeCollisionBoxes(f);var C=function(e,o){if(!r[e.crossTileID])if(p)i.placements[e.crossTileID]=new ge(!1,!1,!1);else{var f,E=!1,C=!1,T=!0,P=null,M={box:null,offscreen:null},A={box:null,offscreen:null},L=null,D=null,N=0,z=0,R=0;o.textFeatureIndex?N=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(N=e.featureIndex),o.verticalTextFeatureIndex&&(z=o.verticalTextFeatureIndex);var k=o.textBox;if(k){var O=function(r){var n=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,n=o,e))}return n},F=function(r,n){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i0&&(B=B.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var V=function(t,r,n){for(var o=t.x2-t.x1,s=t.y2-t.y1,l=e.textBoxScale,c=w&&!v?r:null,p={box:[],offscreen:!1},f=_?2*B.length:B.length,d=0;d=B.length,e,a,n,c);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){E=!0,P=m.shift;break}}return p};F((function(){return V(k,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(M&&M.box&&M.box.length)&&e.numVerticalGlyphVertices>0&&r?V(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(E=M.box,T=M.offscreen);var q=O(M&&M.box);if(!E&&i.prevPlacement){var j=i.prevPlacement.variableOffsets[e.crossTileID];j&&(i.variableOffsets[e.crossTileID]=j,i.markUsedJustification(a,j.anchor,e,q))}}else{var G=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,_,h,u,g.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(a,r,e),i.placedOrientations[e.crossTileID]=r),n};F((function(){return G(k,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?G(r,t.WritingMode.vertical):{box:null,offscreen:null}})),O(M&&M.box&&M.box.length)}}if(E=(f=M)&&f.box&&f.box.length>0,T=f&&f.offscreen,e.useRuntimeCollisionCircles){var X=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(a.textSizeData,d,X),Y=s.get("text-padding");L=i.collisionIndex.placeCollisionCircles(_,X,a.lineVertexArray,a.glyphOffsetArray,Z,u,l,c,n,b,g.predicate,e.collisionCircleDiameter,Y),E=_||L.circles.length>0&&!L.collisionDetected,T=T&&L.offscreen}if(o.iconFeatureIndex&&(R=o.iconFeatureIndex),o.iconBox){var W=function(t){var e=w&&P?xe(t,P.x,P.y,x,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,v,h,u,g.predicate)};C=A&&A.box&&A.box.length&&o.verticalIconBox?(D=W(o.verticalIconBox)).box.length>0:(D=W(o.iconBox)).box.length>0,T=T&&D.offscreen}var H=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=y||0===e.numIconVertices;if(H||K?K?H||(C=C&&E):E=C&&E:C=E=C&&E,E&&f&&f.box&&i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),a.bucketInstanceId,A&&A.box&&z?z:N,g.ID),C&&D&&i.collisionIndex.insertCollisionBox(D.box,s.get("icon-ignore-placement"),a.bucketInstanceId,R,g.ID),L&&(E&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),a.bucketInstanceId,N,g.ID),n)){var J=a.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new me);for(var $=0;$=0;--P){var M=T[P];C(a.symbolInstances.get(M),a.collisionArrays[M])}else for(var A=e.symbolInstanceStart;A=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:n.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a0,_=i.placedOrientations[o.crossTileID],v=_===t.WritingMode.vertical,x=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(s>0||u>0){var b=Ae(m.text);d(e.text,s,v?Le:b),d(e.text,u,x?Le:b);var w=m.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||v?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var E=i.variableOffsets[o.crossTileID];E&&i.markUsedJustification(e,E.anchor,o,_);var I=i.placedOrientations[o.crossTileID];I&&(i.markUsedJustification(e,"left",o,I),i.markUsedOrientation(e,I,o))}if(y){var S=Ae(m.icon),C=!(p&&o.verticalPlacedIconSymbolIndex&&v);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,C?S:Le),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=m.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,C?Le:S),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var T=e.collisionArrays[n];if(T){var P=new t.Point(0,0);if(T.textBox||T.verticalTextBox){var M=!0;if(l){var A=i.variableOffsets[g];A?(P=ve(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),c&&P._rotate(h?i.transform.angle:-i.transform.angle)):M=!1}T.textBox&&we(e.textCollisionBox.collisionVertexArray,m.text.placed,!M||v,P.x,P.y),T.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,m.text.placed,!M||x,P.x,P.y)}var L=Boolean(!x&&T.verticalIconBox);T.iconBox&&we(e.iconCollisionBox.collisionVertexArray,m.icon.placed,L,p?P.x:0,p?P.y:0),T.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!L,p?P.x:0,p?P.y:0)}}},m=0;mt},be.prototype.setStale=function(){this.stale=!0};var Ee=Math.pow(2,25),Ie=Math.pow(2,24),Se=Math.pow(2,17),Ce=Math.pow(2,16),Te=Math.pow(2,9),Pe=Math.pow(2,8),Me=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,r=Math.floor(127*t.opacity);return r*Ee+e*Ie+r*Se+e*Ce+r*Te+e*Pe+r*Me+e}var Le=0,De=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=[]};De.prototype.continuePlacement=function(t,e,r,n,i){for(var o=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new De(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ne.prototype.commit=function(t){return this.placement.commit(t),this.placement};var ze=512/t.EXTENT/2,Re=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,i)}}for(var c=0;c1?"@2x":"",u=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,c())})),l=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,a||(a=t,o=e,c())}));function c(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var u=i[s],l=u.width,c=u.height,h=u.x,p=u.y,f=u.sdf,d=u.pixelRatio,g=u.stretchX,m=u.stretchY,y=u.content,_=new t.RGBAImage({width:l,height:c});t.RGBAImage.copy(e,_,{x:h,y:p},{x:0,y:0},{width:l,height:c}),r[s]={data:_,pixelRatio:d,sdf:f,stretchX:g,stretchY:m,content:y}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new At(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Be(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,u=t;s=0;f--){var d=this._order[f];if(r(d))for(var g=i.length-1;g>=0;g--){var m=i[g].feature;if(n[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;}"),$e=yr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=yr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=yr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=yr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=yr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=yr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=yr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=yr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=yr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),lr=yr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=yr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=yr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),fr=yr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),dr=yr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gr=yr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),mr=yr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var o="float"===n?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:a}}var _r=Object.freeze({__proto__:null,prelude:Xe,background:Ze,backgroundPattern:Ye,circle:We,clippingMask:He,heatmap:Ke,heatmapTexture:Je,collisionBox:Qe,collisionCircle:$e,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:ur,line:lr,lineGradient:cr,linePattern:hr,lineSDF:pr,raster:fr,symbolIcon:dr,symbolSDF:gr,symbolTextAndIcon:mr}),vr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function xr(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}br.prototype.draw=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g){var m,y=t.gl;if(!this.failedToCreate){for(var _ in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[_].set(a[_]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var v=(m={},m[y.LINES]=2,m[y.TRIANGLES]=3,m[y.LINE_STRIP]=1,m)[e],x=0,b=c.get();x0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:qr(i.paint.get("raster-hue-rotate"))};var o,a};function qr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var jr,Gr=function(t,e,r,n,i,o,a,s,u,l){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+n,u_texsize:l,u_texture:0}},Xr=function(e,r,n,i,o,a,s,u,l,c,h){var p=o.transform;return t.extend(Gr(e,r,n,i,o,a,s,u,l,c),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Zr=function(e,r,n,i,o,a,s,u,l,c){return t.extend(Xr(e,r,n,i,o,a,s,u,!0,l,!0),{u_texsize_icon:c,u_texture_icon:1})},Yr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Wr=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,h=c*(n.tileID.canonical.x+n.tileID.wrap*l),p=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Hr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,o,a,s){for(var u=e.context,l=u.gl,c=e.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d0){var b=t.create(),w=_;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),h.push({circleArray:x,circleOffset:f,transform:w,invTransform:b}),f=p+=x.length/4}v&&c.draw(u,l.LINES,St.disabled,Ct.disabled,e.colorModeForRenderPass(),Pt.disabled,Ar(_,e.transform,m),n.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,e.transform.zoom,null,null,v.collisionVertexBuffer)}}if(s&&h.length){var E=e.useProgram("collisionCircle"),I=new t.StructArrayLayout2f1f2i16;I.resize(4*p),I._trim();for(var S=0,C=0,T=h;C=0&&(g[y.associatedIconIndex]={shiftedAnchor:I,angle:S})}else le(y.numGlyphs,f)}if(h){d.clear();for(var T=e.icon.placedSymbolArray,P=0;P0){var s=t.browser.now(),u=(s-e.timeAdded)/a,l=r?(s-r.timeAdded)/a:-1,c=n.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-l,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var ln=new t.Color(1,0,0,1),cn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),fn=new t.Color(0,1,1,1);function dn(t,e,r,n){mn(t,0,e+r/2,t.transform.width,r,n)}function gn(t,e,r,n){mn(t,e-r/2,0,r,t.transform.height,n)}function mn(e,r,n,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function yn(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),u=St.disabled,l=Ct.disabled,c=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,l,c,Pt.disabled,Dr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),f=r.getTile(n).tileSize,d=512/Math.min(f,512)*(n.overscaledZ/e.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,g+" "+p+"kb"),s.draw(i,o.TRIANGLES,u,l,Tt.alphaBlended,Pt.disabled,Dr(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var _n={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=Ct.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var u=r.transform,l="map"===o,c="map"===a,h=0,p=e;h256&&this.clearStencil(),r.setColorMode(Tt.disabled),r.setDepthMode(St.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Ct({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},vn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Ct({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},vn.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var x=this.style._layers[i[this.currentLayer]],b=o[x.source],w=c[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},vn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},vn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,t,_r[t],e,Hr[t],this._showOverdrawInspector)),this.cache[r]},vn.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()},vn.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)},vn.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))},vn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var xn=function(t,e){this.points=t,this.planes=e};xn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],r,n)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new xn(o,a)};var bn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o=0;if(0===a)return 0;a!==r.length&&(n=!1)}if(n)return 2;for(var u=0;u<3;u++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;hthis.max[u]-this.min[u])return 0}return 1};var wn=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};wn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},wn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},wn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var En=function(e,r,n,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},In={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}};En.prototype.clone=function(){var t=new En(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},In.minZoom.get=function(){return this._minZoom},In.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},In.maxZoom.get=function(){return this._maxZoom},In.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},In.minPitch.get=function(){return this._minPitch},In.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},In.maxPitch.get=function(){return this._maxPitch},In.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},In.renderWorldCopies.get=function(){return this._renderWorldCopies},In.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},In.worldSize.get=function(){return this.tileSize*this.scale},In.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},In.size.get=function(){return new t.Point(this.width,this.height)},In.bearing.get=function(){return-this.angle/Math.PI*180},In.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},In.pitch.get=function(){return this._pitch/Math.PI*180},In.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},In.fov.get=function(){return this._fov/Math.PI*180},In.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())},In.zoom.get=function(){return this._zoom},In.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())},In.center.get=function(){return this._center},In.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},In.padding.get=function(){return this._edgeInsets.toJSON()},In.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},In.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},En.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},En.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},En.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)},En.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),u=Math.floor(Math.max(n.x,i.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&r.push(new t.UnwrappedTileID(l,e));return r},En.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*i.x,o*i.y,0],s=xn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var l=function(t){return{aabb:new bn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],p=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(l(-d)),c.push(l(d));for(c.push(l(0));c.length>0;){var g=c.pop(),m=g.x,y=g.y,_=g.fullyVisible;if(!_){var v=g.aabb.intersects(s);if(0===v)continue;_=2===v}var x=g.aabb.distanceX(a),b=g.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(g.zoom===p||w>3+(1<=u)h.push({tileID:new t.OverscaledTileID(g.zoom===p?f:g.zoom,g.wrap,g.zoom,m,y),distanceSq:t.sqrLen([a[0]-.5-m,a[1]-.5-y])});else for(var E=0;E<4;E++){var I=(m<<1)+E%2,S=(y<<1)+(E>>1);c.push({aabb:g.aabb.quadrant(E),zoom:g.zoom+1,x:I,y:S,wrap:g.wrap,fullyVisible:_})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},En.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},In.unmodified.get=function(){return this._unmodified},En.prototype.zoomScale=function(t){return Math.pow(2,t)},En.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},En.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},En.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},In.point.get=function(){return this.project(this.center)},En.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},En.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},En.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},En.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},En.prototype.coordinateLocation=function(t){return t.toLngLat()},En.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[1]/i,s=n[1]/o,u=r[2]/i,l=n[2]/o,c=u===l?0:(0-u)/(l-u);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/o,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},En.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},En.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},En.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},En.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])},En.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,r?this.alignedProjMatrix:this.projMatrix,u),i[n]=new Float32Array(u),i[n]},En.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},En.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-oa&&(i=a-m)}if(this.lngRange){var y=f.x,_=l.x/2;y-_u&&(n=u-_)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},En.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,l,u),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),g=a-Math.round(a)+f*h+d*p,m=s-Math.round(s)+f*p+d*h,y=new Float64Array(c);if(t.translate(y,y,[g>.5?g-1:g,m>.5?m-1:m,0]),this.alignedProjMatrix=y,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},En.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},En.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},En.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,u=e;s=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},Sn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Cn={linearity:.3,easing:t.bezier(0,0,.3,1)},Tn=t.extend({deceleration:2500,maxSpeed:1400},Cn),Pn=t.extend({deceleration:20,maxSpeed:1400},Cn),Mn=t.extend({deceleration:1e3,maxSpeed:360},Cn),An=t.extend({deceleration:1e3,maxSpeed:90},Cn),Ln=function(t){this._map=t,this.clear()};function Dn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Ln.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new zn(t.type,this._map,t))},On.prototype.dblclick=function(t){return this._firePreventable(new zn(t.type,this._map,t))},On.prototype.mouseover=function(t){this._map.fire(new zn(t.type,this._map,t))},On.prototype.mouseout=function(t){this._map.fire(new zn(t.type,this._map,t))},On.prototype.touchstart=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},On.prototype.touchmove=function(t){this._map.fire(new Rn(t.type,this._map,t))},On.prototype.touchend=function(t){this._map.fire(new Rn(t.type,this._map,t))},On.prototype.touchcancel=function(t){this._map.fire(new Rn(t.type,this._map,t))},On.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},On.prototype.isEnabled=function(){return!0},On.prototype.isActive=function(){return!1},On.prototype.enable=function(){},On.prototype.disable=function(){};var Fn=function(t){this._map=t};Fn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Fn.prototype.mousemove=function(t){this._map.fire(new zn(t.type,this._map,t))},Fn.prototype.mousedown=function(){this._delayContextMenu=!0},Fn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Fn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new zn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var Bn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Un(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Vn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var qn=function(t){this.singleTap=new Vn(t),this.numTaps=t.numTaps,this.reset()};qn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},qn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},qn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},qn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var jn=function(){this._zoomIn=new qn({numTouches:1,numTaps:2}),this._zoomOut=new qn({numTouches:2,numTaps:1}),this.reset()};jn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},jn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},jn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},jn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},jn.prototype.touchcancel=function(){this.reset()},jn.prototype.enable=function(){this._enabled=!0},jn.prototype.disable=function(){this._enabled=!1,this.reset()},jn.prototype.isEnabled=function(){return this._enabled},jn.prototype.isActive=function(){return this._active};var Gn={0:1,2:2},Xn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Xn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Xn.prototype._correctButton=function(t,e){return!1},Xn.prototype._move=function(t,e){return{}},Xn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Xn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Gn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Un(n,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var l=i[u],c=this._touches[u];c&&(o._add(l),a._add(l.sub(c)),s++,i[u]=l)}if(this._touches=i,!(sMath.abs(t.x)}var ni=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,ri(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ri(t)&&ri(e)&&o}},e}(Kn),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function ai(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active},oi.prototype.disableRotation=function(){this._rotationDisabled=!0},oi.prototype.enableRotation=function(){this._rotationDisabled=!1};var si=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.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 n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,u=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&u&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=l(h);a=t.number(u,s,p),h<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},si.prototype.reset=function(){this._active=!1};var ui=function(t,e){this._clickZoom=t,this._tapZoom=e};ui.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ui.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ui.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ui.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var li=function(){this.reset()};li.prototype.reset=function(){this._active=!1},li.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var ci=function(){this._tap=new qn({numTouches:1,numTaps:1}),this.reset()};ci.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ci.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},ci.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},ci.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},ci.prototype.touchcancel=function(){this.reset()},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var hi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};fi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},gi=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 mi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var yi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ln(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;oo?Math.min(2,b):Math.max(.5,b),w=Math.pow(m,1-e),E=i.unproject(v.add(x.mult(e*w)).mult(g));i.setLocationAtPoint(i.renderWorldCopies?E.wrap():E,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:u,f="padding"in e?e.padding:o.padding,d=o.zoomScale(c-a),g=t.Point.convert(e.offset),m=o.centerPoint.add(g),y=o.pointLocation(m),_=t.LngLat.convert(e.center||y);this._normalizeCenter(_);var v=o.project(y),x=o.project(_).sub(v),b=e.curve,w=Math.max(o.width,o.height),E=w/d,I=x.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),C=w/o.zoomScale(S-a);b=Math.sqrt(C/I*2)}var T=b*b;function P(t){var e=(E*E-w*w+(t?-1:1)*T*T*I*I)/(2*(t?E:w)*T*I);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}var L=P(0),D=function(t){return A(L)/A(L+b*t)},N=function(t){return w*((A(L)*(M(e=L+b*t)/A(e))-M(L))/T)/I;var e},z=(P(1)-L)/b;if(Math.abs(I)<1e-6||!isFinite(z)){if(Math.abs(w-E)<1e-6)return this.easeTo(e,r);var R=Ee.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==u,this._padding=!o.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var i=e*z,d=1/D(i);o.zoom=1===e?c:a+o.scaleZoom(d),n._rotating&&(o.bearing=t.number(s,h,e)),n._pitching&&(o.pitch=t.number(u,p,e)),n._padding&&(o.interpolatePadding(l,f,e),m=o.centerPoint.add(g));var y=1===e?_:o.unproject(v.add(x.mult(N(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?y.wrap():y,m),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),vi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};vi.prototype.getDefaultPosition=function(){return"bottom-right"},vi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},vi.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},vi.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},vi.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},vi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},vi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var xi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xi.prototype.getDefaultPosition=function(){return"bottom-left"},xi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},xi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var bi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.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 i=new En(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new bi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wi,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ii))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new yi(this,e),this._hash=e.hash&&new Sn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new vi({customAttribution:e.customAttribution})),this.addControl(new xi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&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")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.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")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new zn(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new zn(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new zn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var o=n[t],a=0;a180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Li.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Li.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Li.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()},Li.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Li.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)},Li.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Li.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Li.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))},Li.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))},Li.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Oi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Fi=0,Bi=!1,Ui=function(e){function n(r){e.call(this),this.options=t.extend({},Oi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Ri?n(Ri):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){n(Ri="denied"!==t.state)})):n(Ri=!!t.window.navigator.geolocation),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fi=0,Bi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Bi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new ki(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ki({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"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.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":Fi--,Bi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Fi>1?(e={maximumAge:6e5,timeout:0},Bi=!0):(e=this.options.positionOptions,Bi=!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},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Vi={maxWidth:100,unit:"metric"},qi=function(e){this.options=t.extend({},Vi,e),t.bindAll(["_onMove","setUnit"],this)};function ji(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([n,i]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var u=3.2808*s;u>5280?Gi(e,n,u/5280,t._getUIString("ScaleControl.Miles")):Gi(e,n,u,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Gi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Gi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Gi(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+n}qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._onMove=function(){ji(this._map,this._container,this.options)},qi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qi.prototype.setUnit=function(t){this.options.unit=t,ji(this._map,this._container,this.options)};var Xi=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")};Xi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Xi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Xi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Xi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Xi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Xi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Xi.prototype._isFullscreen=function(){return this._fullscreen},Xi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Xi.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 Zi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Yi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Wi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Zi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.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},n.prototype.getLngLat=function(){return this._lngLat},n.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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Di(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,l=this._container.offsetHeight;s=i.y+a.bottom.ythis._map.transform.height-l?["bottom"]:[],i.xthis._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var c=i.add(a[o]).round();r.setTransform(this._container,Ni[o]+" translate("+c.x+"px,"+c.y+"px)"),zi(this._container,o,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Yi);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),Hi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ti,NavigationControl:Ai,GeolocateControl:Ui,AttributionControl:vi,ScaleControl:qi,FullscreenControl:Xi,Popup:Wi,Marker:ki,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Ft().acquire(zt)},clearPrewarmedResources:function(){var t=kt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(zt),kt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Rt.workerCount},set workerCount(t){Rt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Hi})),r}()},379:(t,e,r)=>{"use strict";var n,i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),o=[];function a(t){for(var e=-1,r=0;r{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(379),e=r.n(t),n=r(113);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var i=r(754);e()(i.Z,{insert:"head",singleton:!1}),i.Z.locals,r(631)})()})(); \ No newline at end of file +/*! For license information please see app.js.LICENSE.txt */ +(()=>{var t={9631:(t,e,r)=>{var n=r(6158),i=r(7331);const o=new n.Map({container:"map",style:{version:8,sources:{m_mono:{type:"raster",tiles:["https://tile.mierune.co.jp/mierune_mono/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"m_mono",type:"raster",source:"m_mono",minzoom:0,maxzoom:18}]},center:[139.77,35.676],zoom:13});o.on("load",(function(){const t=i.featureCollection([i.point([139.7594,35.6865]),i.point([139.7692,35.6665]),i.point([139.7812,35.6849])]);o.addSource("FeaturesPoint",{type:"geojson",data:t}),o.addLayer({id:"FeaturesPoint",type:"circle",source:"FeaturesPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#1253A4","circle-stroke-width":5,"circle-stroke-opacity":.8,"circle-color":"#1253A4","circle-radius":5,"circle-opacity":.5}});const e=i.center(t);o.addSource("CenterPoint",{type:"geojson",data:e}),o.addLayer({id:"CenterPoint",type:"circle",source:"CenterPoint",layout:{},paint:{"circle-pitch-alignment":"map","circle-stroke-color":"#8DCF3F","circle-stroke-width":10,"circle-stroke-opacity":.8,"circle-color":"#8DCF3F","circle-radius":10,"circle-opacity":.5}})})),o.addControl(new n.NavigationControl)},9705:(t,e,r)=>{"use strict";var n=r(1540);function i(t){var e=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]{"use strict";function r(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function n(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(t[0])||!f(t[1]))throw new Error("coordinates must contain numbers");return r({type:"Point",coordinates:t},e,n)}function i(t,e,n){void 0===n&&(n={});for(var i=0,o=t;i=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return p(h(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=p,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),r)},e.convertArea=function(t,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[r];if(!i)throw new Error("invalid original units");var o=e.areaFactors[n];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=f,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!f(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},1540:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4102);function i(t,e,r){if(null!==t)for(var n,o,a,s,u,l,c,h,p=0,f=0,d=t.type,g="FeatureCollection"===d,y="Feature"===d,m=g?t.features.length:1,v=0;vl||f>c||d>h)return u=i,l=r,c=f,h=d,void(a=0);var g=n.lineString([u,i],t.properties);if(!1===e(g,r,o,d,a))return!1;a++,u=i}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,r,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s{"use strict";r.r(e),r.d(e,{along:()=>rr,angle:()=>Qo,applyFilter:()=>ba,area:()=>Qe,areaFactors:()=>p,bbox:()=>ht,bboxClip:()=>Zr,bboxPolygon:()=>be,bearing:()=>Ce,bearingToAngle:()=>A,bearingToAzimuth:()=>A,bezier:()=>ve,bezierSpline:()=>ve,booleanClockwise:()=>an,booleanContains:()=>ki,booleanCrosses:()=>Bi,booleanDisjoint:()=>Li,booleanEqual:()=>qi,booleanIntersects:()=>ji,booleanOverlap:()=>Vi,booleanParallel:()=>Ki,booleanPointInPolygon:()=>Et,booleanPointOnLine:()=>sr,booleanWithin:()=>cr,buffer:()=>Js,center:()=>Me,centerMean:()=>Yo,centerMedian:()=>Ho,centerOfMass:()=>Ae,centroid:()=>Te,circle:()=>Se,cleanCoords:()=>ue,clone:()=>Dt,clusterEach:()=>va,clusterReduce:()=>_a,clusters:()=>u,clustersDbscan:()=>Xi,clustersKmeans:()=>Yi,collect:()=>ne,collectionOf:()=>G,combine:()=>Le,concave:()=>ee,containsNumber:()=>V,convertArea:()=>N,convertDistance:()=>R,convertLength:()=>R,convex:()=>wt,coordAll:()=>$,coordEach:()=>Y,coordReduce:()=>W,createBins:()=>xa,degrees2radians:()=>k,degreesToRadians:()=>k,destination:()=>Ie,difference:()=>Sa,dissolve:()=>eu,distance:()=>Ct,distanceToDegrees:()=>T,distanceToRadians:()=>M,distanceWeight:()=>na,earthRadius:()=>l,ellipse:()=>Zo,envelope:()=>we,explode:()=>ke,factors:()=>c,feature:()=>f,featureCollection:()=>b,featureEach:()=>J,featureOf:()=>j,featureReduce:()=>Q,filterProperties:()=>Ea,findPoint:()=>lt,findSegment:()=>ut,flatten:()=>fr,flattenEach:()=>rt,flattenReduce:()=>nt,flip:()=>ie,geojsonType:()=>q,geomEach:()=>tt,geomReduce:()=>et,geometry:()=>d,geometryCollection:()=>S,getCluster:()=>ma,getCoord:()=>B,getCoords:()=>U,getGeom:()=>X,getType:()=>Z,greatCircle:()=>Tr,helpers:()=>n,hexGrid:()=>iu,inside:()=>Et,interpolate:()=>cu,intersect:()=>$s,invariant:()=>i,isNumber:()=>D,isObject:()=>O,isobands:()=>pi,isolines:()=>xt,kinks:()=>We,length:()=>nr,lengthToDegrees:()=>T,lengthToRadians:()=>M,lineArc:()=>Dr,lineChunk:()=>dr,lineDistance:()=>nr,lineEach:()=>at,lineIntersect:()=>Ue,lineOffset:()=>xi,lineOverlap:()=>Kr,lineReduce:()=>st,lineSegment:()=>ze,lineSlice:()=>ir,lineSliceAlong:()=>or,lineSplit:()=>Nr,lineString:()=>_,lineStringToPolygon:()=>qr,lineStrings:()=>x,lineToPolygon:()=>qr,mask:()=>su,meta:()=>o,midpoint:()=>Pe,moranIndex:()=>ia,multiLineString:()=>w,multiPoint:()=>E,multiPolygon:()=>I,nearest:()=>Oe,nearestPoint:()=>Oe,nearestPointOnLine:()=>Ve,nearestPointToLine:()=>Ze,planepoint:()=>Ye,point:()=>g,pointGrid:()=>hr,pointOnFeature:()=>Ke,pointOnLine:()=>Ve,pointOnSurface:()=>Ke,pointToLineDistance:()=>Xe,points:()=>y,pointsWithinPolygon:()=>St,polygon:()=>m,polygonSmooth:()=>ea,polygonTangents:()=>on,polygonToLine:()=>zr,polygonToLineString:()=>zr,polygonize:()=>Pi,polygons:()=>v,projection:()=>a,propEach:()=>H,propReduce:()=>K,propertiesContainsFilter:()=>wa,radians2degrees:()=>L,radiansToDegrees:()=>L,radiansToDistance:()=>P,radiansToLength:()=>P,random:()=>s,randomLineString:()=>da,randomPoint:()=>pa,randomPolygon:()=>fa,randomPosition:()=>ha,rewind:()=>cn,rhumbBearing:()=>tn,rhumbDestination:()=>en,rhumbDistance:()=>qe,round:()=>C,sample:()=>xe,sector:()=>Qr,segmentEach:()=>it,segmentReduce:()=>ot,shortestPath:()=>no,simplify:()=>ye,square:()=>Ee,squareGrid:()=>uu,standardDeviationalEllipse:()=>Jo,tag:()=>_e,tesselate:()=>De,tin:()=>Pt,toMercator:()=>aa,toWgs84:()=>sa,transformRotate:()=>fi,transformScale:()=>gi,transformTranslate:()=>yi,triangleGrid:()=>lu,truncate:()=>pr,union:()=>Qs,unitsFactors:()=>h,unkinkPolygon:()=>wr,validateBBox:()=>z,validateId:()=>F,voronoi:()=>Go,within:()=>St});var n={};r.r(n),r.d(n,{areaFactors:()=>p,bearingToAzimuth:()=>A,convertArea:()=>N,convertLength:()=>R,degreesToRadians:()=>k,earthRadius:()=>l,factors:()=>c,feature:()=>f,featureCollection:()=>b,geometry:()=>d,geometryCollection:()=>S,isNumber:()=>D,isObject:()=>O,lengthToDegrees:()=>T,lengthToRadians:()=>M,lineString:()=>_,lineStrings:()=>x,multiLineString:()=>w,multiPoint:()=>E,multiPolygon:()=>I,point:()=>g,points:()=>y,polygon:()=>m,polygons:()=>v,radiansToDegrees:()=>L,radiansToLength:()=>P,round:()=>C,unitsFactors:()=>h,validateBBox:()=>z,validateId:()=>F});var i={};r.r(i),r.d(i,{collectionOf:()=>G,containsNumber:()=>V,featureOf:()=>j,geojsonType:()=>q,getCoord:()=>B,getCoords:()=>U,getGeom:()=>X,getType:()=>Z});var o={};r.r(o),r.d(o,{coordAll:()=>$,coordEach:()=>Y,coordReduce:()=>W,featureEach:()=>J,featureReduce:()=>Q,findPoint:()=>lt,findSegment:()=>ut,flattenEach:()=>rt,flattenReduce:()=>nt,geomEach:()=>tt,geomReduce:()=>et,lineEach:()=>at,lineReduce:()=>st,propEach:()=>H,propReduce:()=>K,segmentEach:()=>it,segmentReduce:()=>ot});var a={};r.r(a),r.d(a,{toMercator:()=>aa,toWgs84:()=>sa});var s={};r.r(s),r.d(s,{randomLineString:()=>da,randomPoint:()=>pa,randomPolygon:()=>fa,randomPosition:()=>ha});var u={};r.r(u),r.d(u,{applyFilter:()=>ba,clusterEach:()=>va,clusterReduce:()=>_a,createBins:()=>xa,filterProperties:()=>Ea,getCluster:()=>ma,propertiesContainsFilter:()=>wa});var l=6371008.8,c={centimeters:100*l,centimetres:100*l,degrees:l/111325,feet:3.28084*l,inches:39.37*l,kilometers:l/1e3,kilometres:l/1e3,meters:l,metres:l,miles:l/1609.344,millimeters:1e3*l,millimetres:1e3*l,nauticalmiles:l/1852,radians:1,yards:l/1.0936},h={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/l,yards:1/1.0936},p={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function f(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function d(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return g(e).geometry;case"LineString":return _(e).geometry;case"Polygon":return m(e).geometry;case"MultiPoint":return E(e).geometry;case"MultiLineString":return w(e).geometry;case"MultiPolygon":return I(e).geometry;default:throw new Error(t+" is invalid")}}function g(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!D(t[0])||!D(t[1]))throw new Error("coordinates must contain numbers");return f({type:"Point",coordinates:t},e,r)}function y(t,e,r){return void 0===r&&(r={}),b(t.map((function(t){return g(t,e)})),r)}function m(t,e,r){void 0===r&&(r={});for(var n=0,i=t;n=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function P(t,e){void 0===e&&(e="kilometers");var r=c[e];if(!r)throw new Error(e+" units is invalid");return t*r}function M(t,e){void 0===e&&(e="kilometers");var r=c[e];if(!r)throw new Error(e+" units is invalid");return t/r}function T(t,e){return L(M(t,e))}function A(t){var e=t%360;return e<0&&(e+=360),e}function L(t){return t%(2*Math.PI)*180/Math.PI}function k(t){return t%360*Math.PI/180}function R(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return P(M(t,e),r)}function N(t,e,r){if(void 0===e&&(e="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=p[e];if(!n)throw new Error("invalid original units");var i=p[r];if(!i)throw new Error("invalid final units");return t/n*i}function D(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function O(t){return!!t&&t.constructor===Object}function z(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!D(t))throw new Error("bbox must only contain numbers")}))}function F(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function B(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function U(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function V(t){if(t.length>1&&D(t[0])&&D(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return V(t[0]);throw new Error("coordinates must only contain numbers")}function q(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)}function j(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)}function G(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0,i=t.features;ns||p>u||f>l)return a=o,s=r,u=p,l=f,void(i=0);var d=_([a,o],t.properties);if(!1===e(d,r,n,f,i))return!1;i++,a=o}))&&void 0}}}))}function ot(t,e,r){var n=r,i=!1;return it(t,(function(t,o,a,s,u){n=!1===i&&void 0===r?t:e(n,t,o,a,s,u),i=!0})),n}function at(t,e){if(!t)throw new Error("geojson is required");rt(t,(function(t,r,n){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,r,n,0,0))return!1;break;case"Polygon":for(var a=0;at[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=e?8:0,s|=l>=e?4:0,s|=c>=e?2:0;var p,f,d,g,y=!1;if(5==(s|=h>=e?1:0)||10===s){var m=(u+l+c+h)/4;5===s&&m=0&&g>=0&&g=0;c--)if(Math.abs(u[c][0][0]-o)<=1e-7&&Math.abs(u[c][0][1]-a)<=1e-7){for(var h=n.path.length-2;h>=0;--h)u[c].unshift(n.path[h]);i=!0;break}i||(u[l++]=n.path)}var p}))})),u);return"function"==typeof dt.successCallback&&dt.successCallback(c),c}function yt(t,e,r){return(t-e)/(r-e)}function mt(t){return 0===t.cval||15===t.cval}function vt(t){mt(t)||5===t.cval||10===t.cval||(t.cval=15)}function _t(t,e){return"top"===e?[t.top,1]:"bottom"===e?[t.bottom,0]:"right"===e?[1,t.right]:"left"===e?[0,t.left]:void 0}const xt=function(t,e,r){if(!O(r=r||{}))throw new Error("options is invalid");var n=r.zProperty||"elevation",i=r.commonProperties||{},o=r.breaksProperties||[];if(G(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!O(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var a=function(t,e){if(!O(e=e||{}))throw new Error("options is invalid");var r=e.zProperty||"elevation",n=e.flip,i=e.flags;G(t,"Point","input must contain Points");for(var o=function(t,e){var r={};return J(t,(function(t){var e=U(t)[1];r[e]||(r[e]=[]),r[e].push(t)})),Object.keys(r).map((function(t){return r[t].sort((function(t,e){return U(t)[0]-U(e)[0]}))})).sort((function(t,r){return e?U(t[0])[1]-U(r[0])[1]:U(r[0])[1]-U(t[0])[1]}))}(t,n),a=[],s=0;s3?m([n]):null}function Et(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=B(t),i=X(e),o=i.type,a=e.bbox,s=i.coordinates;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(n,a))return!1;"Polygon"===o&&(s=[s]);for(var u=!1,l=0;lt[1]!=l>t[1]&&t[0]<(u-a)*(t[1]-s)/(l-s)+a&&(n=!n)}return n}const St=function(t,e){var r=[];return J(t,(function(t){var n=!1;tt(e,(function(e){Et(t,e)&&(n=!0)})),n&&r.push(t)})),b(r)},Ct=function(t,e,r){void 0===r&&(r={});var n=B(t),i=B(e),o=k(i[1]-n[1]),a=k(i[0]-n[0]),s=k(n[1]),u=k(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(u);return P(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),r.units)};function Pt(t,e){var r=!1;return b(function(t){if(t.length<3)return[];t.sort(Tt);for(var e,r,n,i,o,a,s=t.length-1,u=t[s].x,l=t[0].x,c=t[s].y,h=c;s--;)t[s].yh&&(h=t[s].y);var p,f=l-u,d=h-c,g=f>d?f:d,y=.5*(l+u),m=.5*(h+c),v=[new Mt({__sentinel:!0,x:y-20*g,y:m-g},{__sentinel:!0,x:y,y:m+20*g},{__sentinel:!0,x:y+20*g,y:m-g})],_=[],x=[];for(s=t.length;s--;){for(x.length=0,p=v.length;p--;)(f=t[s].x-v[p].x)>0&&f*f>v[p].r?(_.push(v[p]),v.splice(p,1)):f*f+(d=t[s].y-v[p].y)*d>v[p].r||(x.push(v[p].a,v[p].b,v[p].b,v[p].c,v[p].c,v[p].a),v.splice(p,1));for(At(x),p=x.length;p;)r=x[--p],e=x[--p],n=t[s],i=r.x-e.x,o=r.y-e.y,a=2*(i*(n.y-r.y)-o*(n.x-r.x)),Math.abs(a)>1e-12&&v.push(new Mt(e,r,n))}for(Array.prototype.push.apply(_,v),s=_.length;s--;)(_[s].a.__sentinel||_[s].b.__sentinel||_[s].c.__sentinel)&&_.splice(s,1);return _}(t.features.map((function(t){var n={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?n.z=t.properties[e]:3===t.geometry.coordinates.length&&(r=!0,n.z=t.geometry.coordinates[2]),n}))).map((function(t){var e=[t.a.x,t.a.y],n=[t.b.x,t.b.y],i=[t.c.x,t.c.y],o={};return r?(e.push(t.a.z),n.push(t.b.z),i.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},m([[e,n,i,e]],o)})))}var Mt=function(t,e,r){this.a=t,this.b=e,this.c=r;var n,i,o=e.x-t.x,a=e.y-t.y,s=r.x-t.x,u=r.y-t.y,l=o*(t.x+e.x)+a*(t.y+e.y),c=s*(t.x+r.x)+u*(t.y+r.y),h=2*(o*(r.y-e.y)-a*(r.x-e.x));this.x=(u*l-a*c)/h,this.y=(o*c-s*l)/h,n=this.x-t.x,i=this.y-t.y,this.r=n*n+i*i};function Tt(t,e){return e.x-t.x}function At(t){var e,r,n,i,o,a=t.length;t:for(;a;)for(r=t[--a],e=t[--a],n=a;n;)if(o=t[--n],e===(i=t[--n])&&r===o||e===o&&r===i){t.splice(a,2),t.splice(n,2),a-=2;continue t}}function Lt(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=kt(t.properties),e.geometry=Rt(t.geometry),e}function kt(t){var e={};return t?(Object.keys(t).forEach((function(r){var n=t[r];"object"==typeof n?null===n?e[r]=null:Array.isArray(n)?e[r]=n.map((function(t){return t})):e[r]=kt(n):e[r]=n})),e):e}function Rt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Rt(t)})),e):(e.coordinates=Nt(t.coordinates),e)}function Nt(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return Nt(t)}))}const Dt=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Lt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return Lt(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Rt(t);default:throw new Error("unknown GeoJSON type")}};function Ot(t){return t[0].toString()+","+t[1].toString()}function zt(t){return t}function Ft(t,e){var r=function(t){if(null==t)return zt;var e,r,n=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=r=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*n+o,c[1]=(r+=t[1])*i+a;u1)for(var o,s,u=1,l=a(i[0]);ul&&(s=i[0],i[0]=i[u],i[u]=s,l=o);return i}))}}function Ut(t,e,r,n,i,o){3===arguments.length&&(n=o=Array,i=null);for(var a=new n(t=1<=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=n,s[l]=o,o}function h(n,o){for(var l=e(n)&u,c=a[l],h=0;c!=i;){if(r(c,n))return s[l];if(++h>=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=n,s[l]=o,o}function p(n,o){for(var l=e(n)&u,c=a[l],h=0;c!=i;){if(r(c,n))return s[l];if(++h>=t)break;c=a[l=l+1&u]}return o}function f(){for(var t=[],e=0,r=a.length;e>7^Gt[2]^Gt[3])}function Zt(t,e,r,n){Yt(t,e,r),Yt(t,e,e+n),Yt(t,e+n,r)}function Yt(t,e,r){for(var n,i=e+(r---e>>1);en&&(n=o),ai&&(i=a)}function u(t){t.forEach(s)}function l(t){t.forEach(u)}for(var c in t)o(t[c]);return n>=e&&i>=r?[e,r,n,i]:void 0}(t=function(t){var e,r,n={};for(e in t)n[e]=null==(r=t[e])?{type:null}:("FeatureCollection"===r.type?Wt:"Feature"===r.type?Ht:Kt)(r);return n}(t)),n=e>0&&r&&function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=o-n?(r-1)/(o-n):1,u=a-i?(r-1)/(a-i):1;function l(t){return[Math.round((t[0]-n)*s),Math.round((t[1]-i)*u)]}function c(t,e){for(var r,o,a,l,c,h=-1,p=0,f=t.length,d=new Array(f);++h=0){var o=h[r];i===e&&o===n||i===n&&o===e||(++f,p[r]=1)}else c[r]=e,h[r]=n}}function b(t){return Xt(o[t])}function w(t,e){return Vt(o[t],o[e])}l=c=h=null;var E,I=function(t,e,r,n,i){3===arguments.length&&(n=Array,i=null);for(var o=new n(t=1<=t)throw new Error("full hashset");u=o[s=s+1&a]}return o[s]=n,!0}function l(n){for(var s=e(n)&a,u=o[s],l=0;u!=i;){if(r(u,n))return!0;if(++l>=t)break;u=o[s=s+1&a]}return!1}function c(){for(var t=[],e=0,r=o.length;e2&&se(r[i-3],r[i-1],r[i-2])&&r.splice(r.length-2,1))}if(r.push(e[e.length-1]),i=r.length,ae(e[0],e[e.length-1])&&i<4)throw new Error("invalid polygon");return se(r[i-3],r[i-1],r[i-2])&&r.splice(r.length-2,1),r}function ae(t,e){return t[0]===e[0]&&t[1]===e[1]}function se(t,e,r){var n=r[0],i=r[1],o=t[0],a=t[1],s=e[0],u=e[1],l=s-o,c=u-a;return 0==(n-o)*c-(i-a)*l&&(Math.abs(l)>=Math.abs(c)?l>0?o<=n&&n<=s:s<=n&&n<=o:c>0?a<=i&&i<=u:u<=i&&i<=a)}const ue=function(t,e){void 0===e&&(e={});var r="object"==typeof e?e.mutate:e;if(!t)throw new Error("geojson is required");var n=Z(t),i=[];switch(n){case"LineString":i=oe(t);break;case"MultiLineString":case"Polygon":U(t).forEach((function(t){i.push(oe(t))}));break;case"MultiPolygon":U(t).forEach((function(t){var e=[];t.forEach((function(t){e.push(oe(t))})),i.push(e)}));break;case"Point":return t;case"MultiPoint":var o={};U(t).forEach((function(t){var e=t.join("-");o.hasOwnProperty(e)||(i.push(t),o[e]=!0)}));break;default:throw new Error(n+" geometry not supported")}return t.coordinates?!0===r?(t.coordinates=i,t):{type:n,coordinates:i}:!0===r?(t.geometry.coordinates=i,t):f({type:n,coordinates:i},t.properties,{bbox:t.bbox,id:t.id})};function le(t,e,r){var n=e.x,i=e.y,o=r.x-n,a=r.y-i;if(0!==o||0!==a){var s=((t.x-n)*o+(t.y-i)*a)/(o*o+a*a);s>1?(n=r.x,i=r.y):s>0&&(n+=o*s,i+=a*s)}return(o=t.x-n)*o+(a=t.y-i)*a}function ce(t,e,r,n,i){for(var o,a=n,s=e+1;sa&&(o=s,a=u)}a>n&&(o-e>1&&ce(t,e,o,n,i),i.push(t[o]),r-o>1&&ce(t,o,r,n,i))}function he(t,e){var r=t.length-1,n=[t[0]];return ce(t,0,r,e,n),n.push(t[r]),n}function pe(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return he(t=r?t:function(t,e){for(var r,n,i,o,a,s=t[0],u=[s],l=1,c=t.length;le&&(u.push(r),s=r);return s!==r&&u.push(r),u}(t,n),n)}function fe(t,e,r){return pe(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,r).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function de(t,e,r){return t.map((function(t){var n=t.map((function(t){return{x:t[0],y:t[1]}}));if(n.length<4)throw new Error("invalid polygon");for(var i=pe(n,e,r).map((function(t){return[t.x,t.y]}));!ge(i);)i=pe(n,e-=.01*e,r).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function ge(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}const ye=function(t,e){if(!O(e=e||{}))throw new Error("options is invalid");var r=void 0!==e.tolerance?e.tolerance:1,n=e.highQuality||!1,i=e.mutate||!1;if(!t)throw new Error("geojson is required");if(r&&r<0)throw new Error("invalid tolerance");return!0!==i&&(t=Dt(t)),tt(t,(function(t){!function(t,e,r){var n=t.type;if("Point"===n||"MultiPoint"===n)return t;ue(t,!0);var i=t.coordinates;switch(n){case"LineString":t.coordinates=fe(i,e,r);break;case"MultiLineString":t.coordinates=i.map((function(t){return fe(t,e,r)}));break;case"Polygon":t.coordinates=de(i,e,r);break;case"MultiPolygon":t.coordinates=i.map((function(t){return de(t,e,r)}))}}(t,r,n)})),t},me=function(){function t(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;et&&(e.push(n),r=i)}return e},t.prototype.vector=function(t){var e=this.pos(t+10),r=this.pos(t-10);return{angle:180*Math.atan2(e.y-r.y,e.x-r.x)/3.14,speed:Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y)+(r.z-e.z)*(r.z-e.z))}},t.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var r=e/this.duration;if(r>=1)return this.points[this.length-1];var n=Math.floor((this.points.length-1)*r);return function(t,e,r,n,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+n.x*o[1]+r.x*o[2]+e.x*o[3],y:i.y*o[0]+n.y*o[1]+r.y*o[2]+e.y*o[3],z:i.z*o[0]+n.z*o[1]+r.z*o[2]+e.z*o[3]}}((this.length-1)*r-n,this.points[n],this.controls[n][1],this.controls[n+1][0],this.points[n+1])},t}(),ve=function(t,e){void 0===e&&(e={});for(var r=e.resolution||1e4,n=e.sharpness||.85,i=[],o=X(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),a=new me({duration:r,points:o,sharpness:n}),s=0;sa;)r=i[n=Math.floor((o+1)*Math.random())],i[n]=i[o],i[o]=r;return i.slice(a)}(t.features,e))};function be(t,e){void 0===e&&(e={});var r=Number(t[0]),n=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[r,n];return m([[a,[i,n],[i,o],[r,o],a]],e.properties,{bbox:t,id:e.id})}const we=function(t){return be(ht(t))},Ee=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];if(Ct(t.slice(0,2),[n,r])>=Ct(t.slice(0,2),[e,i])){var o=(r+i)/2;return[e,o-(n-e)/2,n,o+(n-e)/2]}var a=(e+n)/2;return[a-(i-r)/2,r,a+(i-r)/2,i]};function Ie(t,e,r,n){void 0===n&&(n={});var i=B(t),o=k(i[0]),a=k(i[1]),s=k(r),u=M(e,n.units),l=Math.asin(Math.sin(a)*Math.cos(u)+Math.cos(a)*Math.sin(u)*Math.cos(s));return g([L(o+Math.atan2(Math.sin(s)*Math.sin(u)*Math.cos(a),Math.cos(u)-Math.sin(a)*Math.sin(l))),L(l)],n.properties)}const Se=function(t,e,r){void 0===r&&(r={});for(var n=r.steps||64,i=r.properties?r.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],a=0;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}(t),r=Re(e.vertices,e.holes,2),n=[],i=[];r.forEach((function(t,n){var o=r[n];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var o=0;oi?r:i,n>o?n:o]}(t,n),r.push(i),n})),r})(r,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),b(e)};var Fe=r(1787);function Be(t,e){var r=U(t),n=U(e);if(2!==r.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==n.length)throw new Error(" line2 must only contain 2 coordinates");var i=r[0][0],o=r[0][1],a=r[1][0],s=r[1][1],u=n[0][0],l=n[0][1],c=n[1][0],h=n[1][1],p=(h-l)*(a-i)-(c-u)*(s-o);if(0===p)return null;var f=((c-u)*(o-l)-(h-l)*(i-u))/p,d=((a-i)*(o-l)-(s-o)*(i-u))/p;return f>=0&&f<=1&&d>=0&&d<=1?g([i+f*(a-i),o+f*(s-o)]):null}const Ue=function(t,e){var r={},n=[];if("LineString"===t.type&&(t=f(t)),"LineString"===e.type&&(e=f(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var i=Be(t,e);return i&&n.push(i),b(n)}var o=Fe();return o.load(ze(e)),J(ze(t),(function(t){J(o.search(t),(function(e){var i=Be(t,e);if(i){var o=U(i).join(",");r[o]||(r[o]=!0,n.push(i))}}))})),b(n)},Ve=function(t,e,r){void 0===r&&(r={});var n=g([1/0,1/0],{dist:1/0}),i=0;return rt(t,(function(t){for(var o=U(t),a=0;a0&&((y=d.features[0]).properties.dist=Ct(e,y,r),y.properties.location=i+Ct(s,y,r)),s.properties.dist180?-360:n[0]-i[0]>180?360:0,R(function(t,e,r){var n=r=void 0===r?l:Number(r),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,a=o-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?a/u:Math.cos(i);return Math.sqrt(a*a+c*c*s*s)*n}(n,i),"meters",r.units)};function je(t,e){return t[0]*e[0]+t[1]*e[1]}function Ge(t,e,r){return"planar"===r.method?qe(t,e,r):Ct(t,e,r)}const Xe=function(t,e,r){if(void 0===r&&(r={}),r.method||(r.method="geodesic"),r.units||(r.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=g(t):"Point"===t.type?t=f(t):j(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=_(e):"LineString"===e.type?e=f(e):j(e,"LineString","line");var n=1/0,i=t.geometry.coordinates;return it(e,(function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],a=function(t,e,r,n){var i=[r[0]-e[0],r[1]-e[1]],o=je([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return Ge(t,e,{method:n.method,units:"degrees"});var a=je(i,i);if(a<=o)return Ge(t,r,{method:n.method,units:"degrees"});var s=o/a;return Ge(t,[e[0]+s*i[0],e[1]+s*i[1]],{method:n.method,units:"degrees"})}(i,e,o,r);a=0&&y<=1&&(_.onLine1=!0),m>=0&&m<=1&&(_.onLine2=!0),!(!_.onLine1||!_.onLine2)&&[_.x,_.y]));o&&n.features.push(g([o[0],o[1]]))}var a,s,u,l,c,h,p,f,d,y,m,v,_}))})),n}function He(t,e,r,n,i,o){return Math.sqrt((i-r)*(i-r)+(o-n)*(o-n))===Math.sqrt((t-r)*(t-r)+(e-n)*(e-n))+Math.sqrt((i-t)*(i-t)+(o-e)*(o-e))}const Ke=function(t){for(var e=function(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?b([f(t)]):b([t]):t}(t),r=Me(e),n=!1,i=0;!n&&i0){e+=Math.abs(tr(t[0]));for(var r=1;r2){for(a=0;a=i&&o===n.length-1);o++){if(i>=e){var a=e-i;if(a){var s=Ce(n[o],n[o-1])-180;return Ie(n[o],a,s,r)}return g(n[o])}i+=Ct(n[o],n[o+1],r)}return g(n[n.length-1])}function nr(t,e){return void 0===e&&(e={}),ot(t,(function(t,r){var n=r.geometry.coordinates;return t+Ct(n[0],n[1],e)}),0)}const ir=function(t,e,r){var n=U(r);if("LineString"!==Z(r))throw new Error("line must be a LineString");for(var i,o=Ve(r,t),a=Ve(r,e),s=[(i=o.properties.index<=a.properties.index?[o,a]:[a,o])[0].geometry.coordinates],u=i[0].properties.index+1;u=c&&h===i.length-1);h++){if(c>e&&0===o.length){if(!(a=e-c))return o.push(i[h]),_(o);s=Ce(i[h],i[h-1])-180,u=Ie(i[h],a,s,n),o.push(u.geometry.coordinates)}if(c>=r)return(a=r-c)?(s=Ce(i[h],i[h-1])-180,u=Ie(i[h],a,s,n),o.push(u.geometry.coordinates),_(o)):(o.push(i[h]),_(o));if(c>=e&&o.push(i[h]),h===i.length-1)return _(o);c+=Ct(i[h],i[h+1],n)}if(c=Math.abs(h)?c>0?a0?s=Math.abs(h)?c>0?a<=i&&i0?s<=o&&o=Math.abs(h)?c>0?a0?s=Math.abs(h)?c>0?a<=i&&i<=u:u<=i&&i<=a:h>0?s<=o&&o<=l:l<=o&&o<=s)}const sr=function(t,e,r){void 0===r&&(r={});for(var n=B(t),i=U(e),o=0;oe[0]||t[2]e[1]||t[3] is required");if("number"!=typeof r)throw new Error(" must be a number");if("number"!=typeof n)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,r);return Y(t,(function(t){!function(t,e,r){t.length>r&&t.splice(r,t.length);for(var n=0;n=0==e}function _r(t){for(var e=0,r=0;r=1||u<=0||l>=1||l<=0))){var g=d,y=!o[g];y&&(o[g]=!0),e?i.push(e(d,t,r,c,h,u,a,s,p,f,l,y)):i.push(d)}}function g(t,e){var r,i,o,a,s=n[t][e],u=n[t][e+1];return s[0]h[e.isect].coord?-1:1})),u=[];w.length>0;){var P=w.pop(),M=P.isect,T=P.parent,A=P.winding,L=u.length,k=[h[M].coord],R=M;if(h[M].ringAndEdge1Walkable)var N=h[M].ringAndEdge1,D=h[M].nxtIsectAlongRingAndEdge1;else N=h[M].ringAndEdge2,D=h[M].nxtIsectAlongRingAndEdge2;for(;!xr(h[M].coord,h[D].coord);){k.push(h[D].coord);var O=void 0;for(n=0;n1)for(e=0;ep&&(g>c&&dc&&gu&&(u=y)}var m=[];if(s&&u0&&Math.abs(x-r[_-1][0])>p){var b=parseFloat(r[_-1][0]),w=parseFloat(r[_-1][1]),E=parseFloat(r[_][0]),I=parseFloat(r[_][1]);if(b>-180&&b-180&&r[_-1][0]c&&b<180&&-180===E&&_+1c&&r[_-1][0]<180){v.push([180,r[_][1]]),_++,v.push([r[_][0],r[_][1]]);continue}if(bc){var S=b;b=E,E=S;var C=w;w=I,I=C}if(b>c&&E=180&&bc?180:-180,M]),(v=[]).push([r[_-1][0]>c?-180:180,M]),m.push(v)}else v=[],m.push(v);v.push([x,r[_][1]])}else v.push([r[_][0],r[_][1]])}}else{var T=[];m.push(T);for(var A=0;A1&&r.push(_(l)),b(r)}function kr(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var r,n=1/0;return J(e,(function(e){var i=Ve(e,t).properties.dist;ic&&p.push(Ie(t,e,c,i).geometry.coordinates),_(p,u)}function Or(t){var e=t%360;return e<0&&(e+=360),e}function zr(t,e){void 0===e&&(e={});var r=X(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),r.type){case"Polygon":return Fr(r,e);case"MultiPolygon":return function(t,e){void 0===e&&(e={});var r=X(t).coordinates,n=e.properties?e.properties:"Feature"===t.type?t.properties:{},i=[];return r.forEach((function(t){i.push(Br(t,n))})),b(i)}(r,e);default:throw new Error("invalid poly")}}function Fr(t,e){return void 0===e&&(e={}),Br(X(t).coordinates,e.properties?e.properties:"Feature"===t.type?t.properties:{})}function Br(t,e){return t.length>1?w(t,e):_(t[0],e)}function Ur(t,e,r,n){e=e||("Feature"===t.type?t.properties:{});var i=X(t),o=i.coordinates,a=i.type;if(!o.length)throw new Error("line must contain coordinates");switch(a){case"LineString":return r&&(o=Vr(o)),m([o],e);case"MultiLineString":var s=[],u=0;return o.forEach((function(t){if(r&&(t=Vr(t)),n){var e=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.abs(e-n)*Math.abs(r-i)}(ht(_(t)));e>u?(s.unshift(t),u=e):s.push(t)}else s.push(t)})),m(s,e);default:throw new Error("geometry type "+a+" is not supported")}}function Vr(t){var e=t[0],r=e[0],n=e[1],i=t[t.length-1],o=i[0],a=i[1];return r===o&&n===a||t.push(e),t}const qr=function(t,e){void 0===e&&(e={});var r=e.properties,n=e.autoComplete,i=e.orderCoords,o=e.mutate;switch(n=void 0===n||n,i=void 0===i||i,(o=void 0!==o&&o)||(t=Dt(t)),t.type){case"FeatureCollection":var a=[];return t.features.forEach((function(t){a.push(U(Ur(t,{},n,i)))})),I(a,r);default:return Ur(t,r,n,i)}};function jr(t,e){var r,n,i,o,a,s,u;for(n=1;n<=8;n*=2){for(r=[],o=!(Xr(i=t[t.length-1],e)&n),a=0;ae[2]&&(r|=2),t[1]e[3]&&(r|=8),r}function Zr(t,e){var r=X(t),n=r.type,i="Feature"===t.type?t.properties:{},o=r.coordinates;switch(n){case"LineString":case"MultiLineString":var a=[];return"LineString"===n&&(o=[o]),o.forEach((function(t){!function(t,e,r){var n,i,o,a,s,u=t.length,l=Xr(t[0],e),c=[];for(r||(r=[]),n=1;n0&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),o.length>=4&&r.push(o))}return r}var Wr=r(251);function Hr(t,e){var r=U(e),n=U(t),i=n[0],o=n[n.length-1],a=t.geometry.coordinates;return Wr(r[0],i)?a.unshift(r[1]):Wr(r[0],o)?a.push(r[1]):Wr(r[1],i)?a.unshift(r[0]):Wr(r[1],o)&&a.push(r[0]),t}const Kr=function(t,e,r){if(void 0===r&&(r={}),!O(r=r||{}))throw new Error("options is invalid");var n,i=r.tolerance||0,o=[],a=Fe(),s=ze(t);return a.load(s),it(e,(function(t){var e=!1;J(a.search(t),(function(r){if(!1===e){var o=U(t).sort(),a=U(r).sort();Wr(o,a)||(0===i?sr(o[0],r)&&sr(o[1],r):Ve(r,o[0]).properties.dist<=i&&Ve(r,o[1]).properties.dist<=i)?(e=!0,n=n?Hr(n,t):t):(0===i?sr(a[0],t)&&sr(a[1],t):Ve(t,a[0]).properties.dist<=i&&Ve(t,a[1]).properties.dist<=i)&&(n=n?Hr(n,r):r)}})),!1===e&&n&&(o.push(n),n=void 0)})),n&&o.push(n),b(o)};function Jr(t){var e=t%360;return e<0&&(e+=360),e}const Qr=function(t,e,r,n,i){if(!O(i=i||{}))throw new Error("options is invalid");var o=i.properties;if(!t)throw new Error("center is required");if(null==r)throw new Error("bearing1 is required");if(null==n)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");if(Jr(r)===Jr(n))return Se(t,e,i);var a=U(t),s=Dr(t,e,r,n,i),u=[[a]];return Y(s,(function(t){u[0].push(t)})),u[0].push(a),m(u,o)};function $r(t,e){var r=k(t[1]),n=k(e[1]),i=k(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(r/2+Math.PI/4));return(L(Math.atan2(i,o))+360)%360}const tn=function(t,e,r){var n;return void 0===r&&(r={}),(n=r.final?$r(B(e),B(t)):$r(B(t),B(e)))>180?-(360-n):n},en=function(t,e,r,n){void 0===n&&(n={});var i=e<0,o=R(Math.abs(e),n.units,"meters");i&&(o=-Math.abs(o));var a=B(t),s=function(t,e,r,n){var i=e/(n=void 0===n?l:Number(n)),o=t[0]*Math.PI/180,a=k(t[1]),s=k(r),u=i*Math.cos(s),c=a+u;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var h=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),p=Math.abs(h)>1e-11?u/h:Math.cos(a);return[(180*(o+i*Math.sin(s)/p)/Math.PI+540)%360-180,180*c/Math.PI]}(a,o,r);return s[0]+=s[0]-a[0]>180?-360:a[0]-s[0]>180?360:0,g(s,n.properties)};function rn(t,e,r,n,i,o){for(var a=0;a0?nn(e,s,i)<0||(i=s):r>0&&n<=0&&(nn(e,s,o)>0||(o=s)),r=n}return[i,o]}function nn(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(r[0]-t[0])*(e[1]-t[1])}const on=function(t,e){var r,n,i,o,a=U(t),s=U(e),u=ht(e),l=0,c=null;switch(a[0]>u[0]&&a[0]u[1]&&a[1]0}function sn(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return tt(t,(function(t){sn(t,e)})),t;case"LineString":return un(U(t),e),t;case"Polygon":return ln(U(t),e),t;case"MultiLineString":return U(t).forEach((function(t){un(t,e)})),t;case"MultiPolygon":return U(t).forEach((function(t){ln(t,e)})),t;case"Point":case"MultiPoint":return t}}function un(t,e){an(t)===e&&t.reverse()}function ln(t,e){an(t[0])!==e&&t[0].reverse();for(var r=1;r is required");if("boolean"!=typeof r)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=Dt(t));var i=[];switch(t.type){case"GeometryCollection":return tt(t,(function(t){sn(t,r)})),t;case"FeatureCollection":return J(t,(function(t){J(sn(t,r),(function(t){i.push(t)}))})),b(i)}return sn(t,r)};var hn={successCallback:null,verbose:!1,polygons:!1},pn={};function fn(t,e,r,n){n=n||{};for(var i=Object.keys(hn),o=0;oa?128:64,l|=ha?32:16,l|=pa?8:4;var d=+(l|=fa?2:1),g=0;if(17===l||18===l||33===l||34===l||38===l||68===l||72===l||98===l||102===l||132===l||136===l||137===l||152===l||153===l){var y=(c+h+p+f)/4;g=y>a?2:y0?(l=156,g=4):l=152:33===l?g>0?(l=139,g=4):l=137:72===l?g>0?(l=99,g=4):l=98:132===l&&(g>0?(l=39,g=4):l=38)}if(0!=l&&170!=l){var m,v,_,x,b,w,E,I;m=v=_=x=b=w=E=I=.5;var S=[];1===l?(_=1-ni(e,p,f),I=1-ni(e,c,f),S.push(Jn[l])):169===l?(_=ni(a,f,p),I=ni(a,f,c),S.push(Jn[l])):4===l?(w=1-ni(e,h,p),x=ni(e,f,p),S.push(Hn[l])):166===l?(w=ni(a,p,h),x=1-ni(a,p,f),S.push(Hn[l])):16===l?(b=ni(e,p,h),v=ni(e,c,h),S.push(Wn[l])):154===l?(b=1-ni(a,h,p),v=1-ni(a,h,c),S.push(Wn[l])):64===l?(E=ni(e,f,c),m=1-ni(e,h,c),S.push($n[l])):106===l?(E=1-ni(a,c,f),m=ni(a,c,h),S.push($n[l])):168===l?(x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),S.push(Kn[l]),S.push(Jn[l])):2===l?(x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),S.push(Kn[l]),S.push(Jn[l])):162===l?(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),S.push(Kn[l]),S.push(Jn[l])):8===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),S.push(Wn[l]),S.push(Hn[l])):138===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Wn[l]),S.push(Hn[l])):32===l?(b=ni(a,p,h),w=ni(e,p,h),m=ni(e,c,h),v=ni(a,c,h),S.push(Wn[l]),S.push(Hn[l])):42===l?(I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h),S.push(Qn[l]),S.push($n[l])):128===l&&(I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Qn[l]),S.push($n[l])),5===l?(w=1-ni(e,h,p),I=1-ni(e,c,f),S.push(Hn[l])):165===l?(w=ni(a,p,h),I=ni(a,f,c),S.push(Hn[l])):20===l?(x=ni(e,f,p),v=ni(e,c,h),S.push(Kn[l])):150===l?(x=1-ni(a,p,f),v=1-ni(a,h,c),S.push(Kn[l])):80===l?(b=ni(e,p,h),E=ni(e,f,c),S.push(Wn[l])):90===l?(b=1-ni(a,h,p),E=1-ni(a,c,f),S.push(Wn[l])):65===l?(_=1-ni(e,p,f),m=1-ni(e,h,c),S.push(Jn[l])):105===l?(_=ni(a,f,p),m=ni(a,c,h),S.push(Jn[l])):160===l?(b=ni(a,p,h),w=ni(e,p,h),I=ni(e,f,c),E=ni(a,f,c),S.push(Wn[l]),S.push(Hn[l])):10===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),I=1-ni(a,c,f),E=1-ni(e,c,f),S.push(Wn[l]),S.push(Hn[l])):130===l?(x=1-ni(e,p,f),_=1-ni(a,p,f),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Kn[l]),S.push(Jn[l])):40===l?(x=ni(a,f,p),_=ni(e,f,p),m=ni(e,c,h),v=ni(a,c,h),S.push(Kn[l]),S.push(Jn[l])):101===l?(w=ni(a,p,h),m=ni(a,c,h),S.push(Hn[l])):69===l?(w=1-ni(e,h,p),m=1-ni(e,h,c),S.push(Hn[l])):149===l?(I=ni(a,f,c),v=1-ni(a,h,c),S.push(Qn[l])):21===l?(I=1-ni(e,c,f),v=ni(e,c,h),S.push(Qn[l])):86===l?(x=1-ni(a,p,f),E=1-ni(a,c,f),S.push(Kn[l])):84===l?(x=ni(e,f,p),E=ni(e,f,c),S.push(Kn[l])):89===l?(b=1-ni(a,h,p),_=ni(a,f,p),S.push(Jn[l])):81===l?(b=ni(e,p,h),_=1-ni(e,p,f),S.push(Jn[l])):96===l?(b=ni(a,p,h),w=ni(e,p,h),E=ni(e,f,c),m=ni(a,c,h),S.push(Wn[l]),S.push(Hn[l])):74===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),E=1-ni(a,c,f),m=1-ni(e,h,c),S.push(Wn[l]),S.push(Hn[l])):24===l?(b=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),v=ni(e,c,h),S.push(Wn[l]),S.push(Jn[l])):146===l?(b=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),v=1-ni(a,h,c),S.push(Wn[l]),S.push(Jn[l])):6===l?(w=1-ni(e,h,p),x=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),S.push(Hn[l]),S.push(Kn[l])):164===l?(w=ni(a,p,h),x=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),S.push(Hn[l]),S.push(Kn[l])):129===l?(_=1-ni(e,p,f),I=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Jn[l]),S.push(Qn[l])):41===l?(_=ni(a,f,p),I=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h),S.push(Jn[l]),S.push(Qn[l])):66===l?(x=1-ni(e,p,f),_=1-ni(a,p,f),E=1-ni(a,c,f),m=1-ni(e,h,c),S.push(Kn[l]),S.push(Jn[l])):104===l?(x=ni(a,f,p),_=ni(e,f,p),E=ni(e,f,c),m=ni(a,c,h),S.push(Jn[l]),S.push(ti[l])):144===l?(b=ni(e,p,h),I=ni(e,f,c),E=ni(a,f,c),v=1-ni(a,h,c),S.push(Wn[l]),S.push($n[l])):26===l?(b=1-ni(a,h,p),I=1-ni(a,c,f),E=1-ni(e,c,f),v=ni(e,c,h),S.push(Wn[l]),S.push($n[l])):36===l?(w=ni(a,p,h),x=ni(e,f,p),m=ni(e,c,h),v=ni(a,c,h),S.push(Hn[l]),S.push(Kn[l])):134===l?(w=1-ni(e,h,p),x=1-ni(a,p,f),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Hn[l]),S.push(Kn[l])):9===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),_=ni(a,f,p),I=1-ni(e,c,f),S.push(Wn[l]),S.push(Hn[l])):161===l?(b=ni(a,p,h),w=ni(e,p,h),_=1-ni(e,p,f),I=ni(a,f,c),S.push(Wn[l]),S.push(Hn[l])):37===l?(w=ni(a,p,h),I=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h),S.push(Hn[l]),S.push(Qn[l])):133===l?(w=1-ni(e,h,p),I=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c),S.push(Hn[l]),S.push(Qn[l])):148===l?(x=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),v=1-ni(a,h,c),S.push(Kn[l]),S.push($n[l])):22===l?(x=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),v=ni(e,c,h),S.push(Kn[l]),S.push($n[l])):82===l?(b=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),E=1-ni(a,c,f),S.push(Wn[l]),S.push(Jn[l])):88===l?(b=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),E=ni(e,f,c),S.push(Wn[l]),S.push(Jn[l])):73===l?(b=1-ni(e,h,p),w=1-ni(a,h,p),_=ni(a,f,p),m=1-ni(e,h,c),S.push(Wn[l]),S.push(Hn[l])):97===l?(b=ni(a,p,h),w=ni(e,p,h),_=1-ni(e,p,f),m=ni(a,c,h),S.push(Wn[l]),S.push(Hn[l])):145===l?(b=ni(e,p,h),_=1-ni(e,p,f),I=ni(a,f,c),v=1-ni(a,h,c),S.push(Wn[l]),S.push(Qn[l])):25===l?(b=1-ni(a,h,p),_=ni(a,f,p),I=1-ni(e,c,f),v=ni(e,c,h),S.push(Wn[l]),S.push(Qn[l])):70===l?(w=1-ni(e,h,p),x=1-ni(a,p,f),E=1-ni(a,c,f),m=1-ni(e,h,c),S.push(Hn[l]),S.push(Kn[l])):100===l?(w=ni(a,p,h),x=ni(e,f,p),E=ni(e,f,c),m=ni(a,c,h),S.push(Hn[l]),S.push(Kn[l])):34===l?(0===g?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)):(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)),S.push(Wn[l]),S.push(Hn[l]),S.push(Qn[l]),S.push($n[l])):35===l?(4===g?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)):(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)),S.push(Wn[l]),S.push(Hn[l]),S.push(Jn[l]),S.push($n[l])):136===l?(0===g?(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)):(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)),S.push(Wn[l]),S.push(Hn[l]),S.push(Qn[l]),S.push($n[l])):153===l?(0===g?(b=ni(e,p,h),_=1-ni(e,p,f),I=1-ni(e,c,f),v=ni(e,c,h)):(b=1-ni(a,h,p),_=ni(a,f,p),I=ni(a,f,c),v=1-ni(a,h,c)),S.push(Wn[l]),S.push(Jn[l])):102===l?(0===g?(w=1-ni(e,h,p),x=ni(e,f,p),E=ni(e,f,c),m=1-ni(e,h,c)):(w=ni(a,p,h),x=1-ni(a,p,f),E=1-ni(a,c,f),m=ni(a,c,h)),S.push(Hn[l]),S.push($n[l])):155===l?(4===g?(b=ni(e,p,h),_=1-ni(e,p,f),I=1-ni(e,c,f),v=ni(e,c,h)):(b=1-ni(a,h,p),_=ni(a,f,p),I=ni(a,f,c),v=1-ni(a,h,c)),S.push(Wn[l]),S.push(Qn[l])):103===l?(4===g?(w=1-ni(e,h,p),x=ni(e,f,p),E=ni(e,f,c),m=1-ni(e,h,c)):(w=ni(a,p,h),x=1-ni(a,p,f),E=1-ni(a,c,f),m=ni(a,c,h)),S.push(Hn[l]),S.push(Kn[l])):152===l?(0===g?(b=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),v=ni(e,c,h)):(b=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),v=1-ni(a,h,c)),S.push(Wn[l]),S.push(Kn[l]),S.push(Jn[l])):156===l?(4===g?(b=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),v=ni(e,c,h)):(b=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),v=1-ni(a,h,c)),S.push(Wn[l]),S.push(Jn[l]),S.push($n[l])):137===l?(0===g?(b=ni(a,p,h),w=ni(e,p,h),_=1-ni(e,p,f),I=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)):(b=1-ni(e,h,p),w=1-ni(a,h,p),_=ni(a,f,p),I=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)),S.push(Wn[l]),S.push(Hn[l]),S.push(Jn[l])):139===l?(4===g?(b=ni(a,p,h),w=ni(e,p,h),_=1-ni(e,p,f),I=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)):(b=1-ni(e,h,p),w=1-ni(a,h,p),_=ni(a,f,p),I=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)),S.push(Wn[l]),S.push(Hn[l]),S.push(Qn[l])):98===l?(0===g?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),E=ni(e,f,c),m=1-ni(e,h,c)):(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),E=1-ni(a,c,f),m=ni(a,c,h)),S.push(Wn[l]),S.push(Hn[l]),S.push($n[l])):99===l?(4===g?(b=1-ni(e,h,p),w=1-ni(a,h,p),x=ni(a,f,p),_=ni(e,f,p),E=ni(e,f,c),m=1-ni(e,h,c)):(b=ni(a,p,h),w=ni(e,p,h),x=1-ni(e,p,f),_=1-ni(a,p,f),E=1-ni(a,c,f),m=ni(a,c,h)),S.push(Wn[l]),S.push(Hn[l]),S.push(Jn[l])):38===l?(0===g?(w=1-ni(e,h,p),x=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)):(w=ni(a,p,h),x=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)),S.push(Hn[l]),S.push(Qn[l]),S.push($n[l])):39===l?(4===g?(w=1-ni(e,h,p),x=ni(e,f,p),I=ni(e,f,c),E=ni(a,f,c),m=1-ni(a,h,c),v=1-ni(e,h,c)):(w=ni(a,p,h),x=1-ni(a,p,f),I=1-ni(a,c,f),E=1-ni(e,c,f),m=ni(e,c,h),v=ni(a,c,h)),S.push(Hn[l]),S.push(Kn[l]),S.push($n[l])):85===l&&(b=1,w=0,x=1,_=0,I=0,E=1,m=0,v=1),(m<0||m>1||v<0||v>1||b<0||b>1||x<0||x>1||I<0||I>1||E<0||E>1)&&console.log("MarchingSquaresJS-isoBands: "+l+" "+d+" "+c+","+h+","+p+","+f+" "+g+" "+m+" "+v+" "+b+" "+w+" "+x+" "+_+" "+I+" "+E),o.cells[s][u]={cval:l,cval_real:d,flipped:g,topleft:m,topright:v,righttop:b,rightbottom:w,bottomright:x,bottomleft:_,leftbottom:I,lefttop:E,edges:S}}}}}return o}(t,e,r);return pn.polygons?(pn.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],r=0;return t.cells.forEach((function(t,n){t.forEach((function(t,i){if(void 0!==t){var o=ri[t.cval](t);"object"==typeof o&&ii(o)?"object"==typeof o[0]&&ii(o[0])?"object"==typeof o[0][0]&&ii(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=n})),e[r++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=n})),e[r++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),e}(l)):(pn.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],r=t.rows,n=t.cols,i=[],o=0;o0){var s=ai(t.cells[o][a]),u=null,l=a,c=o;null!==s&&i.push([s.p[0]+l,s.p[1]+c]);do{if(null===(u=si(t.cells[c][l],s.x,s.y,s.o)))break;if(i.push([u.p[0]+l,u.p[1]+c]),l+=u.x,s=u,(c+=u.y)<0||c>=r||l<0||l>=n||void 0===t.cells[c][l]){var h=oi(t,l-=u.x,c-=u.y,u.x,u.y,u.o);if(null===h)break;h.path.forEach((function(t){i.push(t)})),l=h.i,c=h.j,s=h}}while(void 0!==t.cells[c][l]&&t.cells[c][l].edges.length>0);e.push(i),i=[],t.cells[o][a].edges.length>0&&a--}return e}(l)),"function"==typeof pn.successCallback&&pn.successCallback(u),u}var dn=64,gn=16,yn=[],mn=[],vn=[],_n=[],xn=[],bn=[],wn=[],En=[],In=[],Sn=[],Cn=[],Pn=[],Mn=[],Tn=[],An=[],Ln=[],kn=[],Rn=[],Nn=[],Dn=[],On=[],zn=[],Fn=[],Bn=[];wn[85]=Sn[85]=-1,En[85]=Cn[85]=0,In[85]=Pn[85]=1,Nn[85]=zn[85]=1,Dn[85]=Fn[85]=0,On[85]=Bn[85]=1,yn[85]=_n[85]=0,mn[85]=xn[85]=-1,vn[85]=An[85]=0,Ln[85]=Mn[85]=0,kn[85]=Tn[85]=1,bn[85]=Rn[85]=1,zn[1]=zn[169]=0,Fn[1]=Fn[169]=-1,Bn[1]=Bn[169]=0,Mn[1]=Mn[169]=-1,Tn[1]=Tn[169]=0,An[1]=An[169]=0,Sn[4]=Sn[166]=0,Cn[4]=Cn[166]=-1,Pn[4]=Pn[166]=1,Ln[4]=Ln[166]=1,kn[4]=kn[166]=0,Rn[4]=Rn[166]=0,wn[16]=wn[154]=0,En[16]=En[154]=1,In[16]=In[154]=1,_n[16]=_n[154]=1,xn[16]=xn[154]=0,bn[16]=bn[154]=1,Nn[64]=Nn[106]=0,Dn[64]=Dn[106]=1,On[64]=On[106]=0,yn[64]=yn[106]=-1,mn[64]=mn[106]=0,vn[64]=vn[106]=1,Nn[2]=Nn[168]=0,Dn[2]=Dn[168]=-1,On[2]=On[168]=1,zn[2]=zn[168]=0,Fn[2]=Fn[168]=-1,Bn[2]=Bn[168]=0,Mn[2]=Mn[168]=-1,Tn[2]=Tn[168]=0,An[2]=An[168]=0,Ln[2]=Ln[168]=-1,kn[2]=kn[168]=0,Rn[2]=Rn[168]=1,wn[8]=wn[162]=0,En[8]=En[162]=-1,In[8]=In[162]=0,Sn[8]=Sn[162]=0,Cn[8]=Cn[162]=-1,Pn[8]=Pn[162]=1,Mn[8]=Mn[162]=1,Tn[8]=Tn[162]=0,An[8]=An[162]=1,Ln[8]=Ln[162]=1,kn[8]=kn[162]=0,Rn[8]=Rn[162]=0,wn[32]=wn[138]=0,En[32]=En[138]=1,In[32]=In[138]=1,Sn[32]=Sn[138]=0,Cn[32]=Cn[138]=1,Pn[32]=Pn[138]=0,yn[32]=yn[138]=1,mn[32]=mn[138]=0,vn[32]=vn[138]=0,_n[32]=_n[138]=1,xn[32]=xn[138]=0,bn[32]=bn[138]=1,zn[128]=zn[42]=0,Fn[128]=Fn[42]=1,Bn[128]=Bn[42]=1,Nn[128]=Nn[42]=0,Dn[128]=Dn[42]=1,On[128]=On[42]=0,yn[128]=yn[42]=-1,mn[128]=mn[42]=0,vn[128]=vn[42]=1,_n[128]=_n[42]=-1,xn[128]=xn[42]=0,bn[128]=bn[42]=0,Sn[5]=Sn[165]=-1,Cn[5]=Cn[165]=0,Pn[5]=Pn[165]=0,zn[5]=zn[165]=1,Fn[5]=Fn[165]=0,Bn[5]=Bn[165]=0,Ln[20]=Ln[150]=0,kn[20]=kn[150]=1,Rn[20]=Rn[150]=1,_n[20]=_n[150]=0,xn[20]=xn[150]=-1,bn[20]=bn[150]=1,wn[80]=wn[90]=-1,En[80]=En[90]=0,In[80]=In[90]=1,Nn[80]=Nn[90]=1,Dn[80]=Dn[90]=0,On[80]=On[90]=1,Mn[65]=Mn[105]=0,Tn[65]=Tn[105]=1,An[65]=An[105]=0,yn[65]=yn[105]=0,mn[65]=mn[105]=-1,vn[65]=vn[105]=0,wn[160]=wn[10]=-1,En[160]=En[10]=0,In[160]=In[10]=1,Sn[160]=Sn[10]=-1,Cn[160]=Cn[10]=0,Pn[160]=Pn[10]=0,zn[160]=zn[10]=1,Fn[160]=Fn[10]=0,Bn[160]=Bn[10]=0,Nn[160]=Nn[10]=1,Dn[160]=Dn[10]=0,On[160]=On[10]=1,Ln[130]=Ln[40]=0,kn[130]=kn[40]=1,Rn[130]=Rn[40]=1,Mn[130]=Mn[40]=0,Tn[130]=Tn[40]=1,An[130]=An[40]=0,yn[130]=yn[40]=0,mn[130]=mn[40]=-1,vn[130]=vn[40]=0,_n[130]=_n[40]=0,xn[130]=xn[40]=-1,bn[130]=bn[40]=1,Sn[37]=Sn[133]=0,Cn[37]=Cn[133]=1,Pn[37]=Pn[133]=1,zn[37]=zn[133]=0,Fn[37]=Fn[133]=1,Bn[37]=Bn[133]=0,yn[37]=yn[133]=-1,mn[37]=mn[133]=0,vn[37]=vn[133]=0,_n[37]=_n[133]=1,xn[37]=xn[133]=0,bn[37]=bn[133]=0,Ln[148]=Ln[22]=-1,kn[148]=kn[22]=0,Rn[148]=Rn[22]=0,zn[148]=zn[22]=0,Fn[148]=Fn[22]=-1,Bn[148]=Bn[22]=1,Nn[148]=Nn[22]=0,Dn[148]=Dn[22]=1,On[148]=On[22]=1,_n[148]=_n[22]=-1,xn[148]=xn[22]=0,bn[148]=bn[22]=1,wn[82]=wn[88]=0,En[82]=En[88]=-1,In[82]=In[88]=1,Ln[82]=Ln[88]=1,kn[82]=kn[88]=0,Rn[82]=Rn[88]=1,Mn[82]=Mn[88]=-1,Tn[82]=Tn[88]=0,An[82]=An[88]=1,Nn[82]=Nn[88]=0,Dn[82]=Dn[88]=-1,On[82]=On[88]=0,wn[73]=wn[97]=0,En[73]=En[97]=1,In[73]=In[97]=0,Sn[73]=Sn[97]=0,Cn[73]=Cn[97]=-1,Pn[73]=Pn[97]=0,Mn[73]=Mn[97]=1,Tn[73]=Tn[97]=0,An[73]=An[97]=0,yn[73]=yn[97]=1,mn[73]=mn[97]=0,vn[73]=vn[97]=1,wn[145]=wn[25]=0,En[145]=En[25]=-1,In[145]=In[25]=0,Mn[145]=Mn[25]=1,Tn[145]=Tn[25]=0,An[145]=An[25]=1,zn[145]=zn[25]=0,Fn[145]=Fn[25]=1,Bn[145]=Bn[25]=1,_n[145]=_n[25]=-1,xn[145]=xn[25]=0,bn[145]=bn[25]=0,Sn[70]=Sn[100]=0,Cn[70]=Cn[100]=1,Pn[70]=Pn[100]=0,Ln[70]=Ln[100]=-1,kn[70]=kn[100]=0,Rn[70]=Rn[100]=1,Nn[70]=Nn[100]=0,Dn[70]=Dn[100]=-1,On[70]=On[100]=1,yn[70]=yn[100]=1,mn[70]=mn[100]=0,vn[70]=vn[100]=0,Sn[101]=Sn[69]=0,Cn[101]=Cn[69]=1,Pn[101]=Pn[69]=0,yn[101]=yn[69]=1,mn[101]=mn[69]=0,vn[101]=vn[69]=0,zn[149]=zn[21]=0,Fn[149]=Fn[21]=1,Bn[149]=Bn[21]=1,_n[149]=_n[21]=-1,xn[149]=xn[21]=0,bn[149]=bn[21]=0,Ln[86]=Ln[84]=-1,kn[86]=kn[84]=0,Rn[86]=Rn[84]=1,Nn[86]=Nn[84]=0,Dn[86]=Dn[84]=-1,On[86]=On[84]=1,wn[89]=wn[81]=0,En[89]=En[81]=-1,In[89]=In[81]=0,Mn[89]=Mn[81]=1,Tn[89]=Tn[81]=0,An[89]=An[81]=1,wn[96]=wn[74]=0,En[96]=En[74]=1,In[96]=In[74]=0,Sn[96]=Sn[74]=-1,Cn[96]=Cn[74]=0,Pn[96]=Pn[74]=1,Nn[96]=Nn[74]=1,Dn[96]=Dn[74]=0,On[96]=On[74]=0,yn[96]=yn[74]=1,mn[96]=mn[74]=0,vn[96]=vn[74]=1,wn[24]=wn[146]=0,En[24]=En[146]=-1,In[24]=In[146]=1,Ln[24]=Ln[146]=1,kn[24]=kn[146]=0,Rn[24]=Rn[146]=1,Mn[24]=Mn[146]=0,Tn[24]=Tn[146]=1,An[24]=An[146]=1,_n[24]=_n[146]=0,xn[24]=xn[146]=-1,bn[24]=bn[146]=0,Sn[6]=Sn[164]=-1,Cn[6]=Cn[164]=0,Pn[6]=Pn[164]=1,Ln[6]=Ln[164]=-1,kn[6]=kn[164]=0,Rn[6]=Rn[164]=0,zn[6]=zn[164]=0,Fn[6]=Fn[164]=-1,Bn[6]=Bn[164]=1,Nn[6]=Nn[164]=1,Dn[6]=Dn[164]=0,On[6]=On[164]=0,Mn[129]=Mn[41]=0,Tn[129]=Tn[41]=1,An[129]=An[41]=1,zn[129]=zn[41]=0,Fn[129]=Fn[41]=1,Bn[129]=Bn[41]=0,yn[129]=yn[41]=-1,mn[129]=mn[41]=0,vn[129]=vn[41]=0,_n[129]=_n[41]=0,xn[129]=xn[41]=-1,bn[129]=bn[41]=0,Ln[66]=Ln[104]=0,kn[66]=kn[104]=1,Rn[66]=Rn[104]=0,Mn[66]=Mn[104]=-1,Tn[66]=Tn[104]=0,An[66]=An[104]=1,Nn[66]=Nn[104]=0,Dn[66]=Dn[104]=-1,On[66]=On[104]=0,yn[66]=yn[104]=0,mn[66]=mn[104]=-1,vn[66]=vn[104]=1,wn[144]=wn[26]=-1,En[144]=En[26]=0,In[144]=In[26]=0,zn[144]=zn[26]=1,Fn[144]=Fn[26]=0,Bn[144]=Bn[26]=1,Nn[144]=Nn[26]=0,Dn[144]=Dn[26]=1,On[144]=On[26]=1,_n[144]=_n[26]=-1,xn[144]=xn[26]=0,bn[144]=bn[26]=1,Sn[36]=Sn[134]=0,Cn[36]=Cn[134]=1,Pn[36]=Pn[134]=1,Ln[36]=Ln[134]=0,kn[36]=kn[134]=1,Rn[36]=Rn[134]=0,yn[36]=yn[134]=0,mn[36]=mn[134]=-1,vn[36]=vn[134]=1,_n[36]=_n[134]=1,xn[36]=xn[134]=0,bn[36]=bn[134]=0,wn[9]=wn[161]=-1,En[9]=En[161]=0,In[9]=In[161]=0,Sn[9]=Sn[161]=0,Cn[9]=Cn[161]=-1,Pn[9]=Pn[161]=0,Mn[9]=Mn[161]=1,Tn[9]=Tn[161]=0,An[9]=An[161]=0,zn[9]=zn[161]=1,Fn[9]=Fn[161]=0,Bn[9]=Bn[161]=1,wn[136]=0,En[136]=1,In[136]=1,Sn[136]=0,Cn[136]=1,Pn[136]=0,Ln[136]=-1,kn[136]=0,Rn[136]=1,Mn[136]=-1,Tn[136]=0,An[136]=0,zn[136]=0,Fn[136]=-1,Bn[136]=0,Nn[136]=0,Dn[136]=-1,On[136]=1,yn[136]=1,mn[136]=0,vn[136]=0,_n[136]=1,xn[136]=0,bn[136]=1,wn[34]=0,En[34]=-1,In[34]=0,Sn[34]=0,Cn[34]=-1,Pn[34]=1,Ln[34]=1,kn[34]=0,Rn[34]=0,Mn[34]=1,Tn[34]=0,An[34]=1,zn[34]=0,Fn[34]=1,Bn[34]=1,Nn[34]=0,Dn[34]=1,On[34]=0,yn[34]=-1,mn[34]=0,vn[34]=1,_n[34]=-1,xn[34]=0,bn[34]=0,wn[35]=0,En[35]=1,In[35]=1,Sn[35]=0,Cn[35]=-1,Pn[35]=1,Ln[35]=1,kn[35]=0,Rn[35]=0,Mn[35]=-1,Tn[35]=0,An[35]=0,zn[35]=0,Fn[35]=-1,Bn[35]=0,Nn[35]=0,Dn[35]=1,On[35]=0,yn[35]=-1,mn[35]=0,vn[35]=1,_n[35]=1,xn[35]=0,bn[35]=1,wn[153]=0,En[153]=1,In[153]=1,Mn[153]=-1,Tn[153]=0,An[153]=0,zn[153]=0,Fn[153]=-1,Bn[153]=0,_n[153]=1,xn[153]=0,bn[153]=1,Sn[102]=0,Cn[102]=-1,Pn[102]=1,Ln[102]=1,kn[102]=0,Rn[102]=0,Nn[102]=0,Dn[102]=1,On[102]=0,yn[102]=-1,mn[102]=0,vn[102]=1,wn[155]=0,En[155]=-1,In[155]=0,Mn[155]=1,Tn[155]=0,An[155]=1,zn[155]=0,Fn[155]=1,Bn[155]=1,_n[155]=-1,xn[155]=0,bn[155]=0,Sn[103]=0,Cn[103]=1,Pn[103]=0,Ln[103]=-1,kn[103]=0,Rn[103]=1,Nn[103]=0,Dn[103]=-1,On[103]=1,yn[103]=1,mn[103]=0,vn[103]=0,wn[152]=0,En[152]=1,In[152]=1,Ln[152]=-1,kn[152]=0,Rn[152]=1,Mn[152]=-1,Tn[152]=0,An[152]=0,zn[152]=0,Fn[152]=-1,Bn[152]=0,Nn[152]=0,Dn[152]=-1,On[152]=1,_n[152]=1,xn[152]=0,bn[152]=1,wn[156]=0,En[156]=-1,In[156]=1,Ln[156]=1,kn[156]=0,Rn[156]=1,Mn[156]=-1,Tn[156]=0,An[156]=0,zn[156]=0,Fn[156]=-1,Bn[156]=0,Nn[156]=0,Dn[156]=1,On[156]=1,_n[156]=-1,xn[156]=0,bn[156]=1,wn[137]=0,En[137]=1,In[137]=1,Sn[137]=0,Cn[137]=1,Pn[137]=0,Mn[137]=-1,Tn[137]=0,An[137]=0,zn[137]=0,Fn[137]=-1,Bn[137]=0,yn[137]=1,mn[137]=0,vn[137]=0,_n[137]=1,xn[137]=0,bn[137]=1,wn[139]=0,En[139]=1,In[139]=1,Sn[139]=0,Cn[139]=-1,Pn[139]=0,Mn[139]=1,Tn[139]=0,An[139]=0,zn[139]=0,Fn[139]=1,Bn[139]=0,yn[139]=-1,mn[139]=0,vn[139]=0,_n[139]=1,xn[139]=0,bn[139]=1,wn[98]=0,En[98]=-1,In[98]=0,Sn[98]=0,Cn[98]=-1,Pn[98]=1,Ln[98]=1,kn[98]=0,Rn[98]=0,Mn[98]=1,Tn[98]=0,An[98]=1,Nn[98]=0,Dn[98]=1,On[98]=0,yn[98]=-1,mn[98]=0,vn[98]=1,wn[99]=0,En[99]=1,In[99]=0,Sn[99]=0,Cn[99]=-1,Pn[99]=1,Ln[99]=1,kn[99]=0,Rn[99]=0,Mn[99]=-1,Tn[99]=0,An[99]=1,Nn[99]=0,Dn[99]=-1,On[99]=0,yn[99]=1,mn[99]=0,vn[99]=1,Sn[38]=0,Cn[38]=-1,Pn[38]=1,Ln[38]=1,kn[38]=0,Rn[38]=0,zn[38]=0,Fn[38]=1,Bn[38]=1,Nn[38]=0,Dn[38]=1,On[38]=0,yn[38]=-1,mn[38]=0,vn[38]=1,_n[38]=-1,xn[38]=0,bn[38]=0,Sn[39]=0,Cn[39]=1,Pn[39]=1,Ln[39]=-1,kn[39]=0,Rn[39]=0,zn[39]=0,Fn[39]=-1,Bn[39]=1,Nn[39]=0,Dn[39]=1,On[39]=0,yn[39]=-1,mn[39]=0,vn[39]=1,_n[39]=1,xn[39]=0,bn[39]=0;var Un=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Vn=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},qn=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},jn=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},Gn=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},Xn=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},Zn=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},Yn=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Wn=[],Hn=[],Kn=[],Jn=[],Qn=[],$n=[],ti=[],ei=[];Jn[1]=Qn[1]=18,Jn[169]=Qn[169]=18,Kn[4]=Hn[4]=12,Kn[166]=Hn[166]=12,Wn[16]=ei[16]=4,Wn[154]=ei[154]=4,$n[64]=ti[64]=22,$n[106]=ti[106]=22,Kn[2]=$n[2]=17,Jn[2]=Qn[2]=18,Kn[168]=$n[168]=17,Jn[168]=Qn[168]=18,Wn[8]=Jn[8]=9,Hn[8]=Kn[8]=12,Wn[162]=Jn[162]=9,Hn[162]=Kn[162]=12,Wn[32]=ei[32]=4,Hn[32]=ti[32]=1,Wn[138]=ei[138]=4,Hn[138]=ti[138]=1,Qn[128]=ei[128]=21,$n[128]=ti[128]=22,Qn[42]=ei[42]=21,$n[42]=ti[42]=22,Hn[5]=Qn[5]=14,Hn[165]=Qn[165]=14,Kn[20]=ei[20]=6,Kn[150]=ei[150]=6,Wn[80]=$n[80]=11,Wn[90]=$n[90]=11,Jn[65]=ti[65]=3,Jn[105]=ti[105]=3,Wn[160]=$n[160]=11,Hn[160]=Qn[160]=14,Wn[10]=$n[10]=11,Hn[10]=Qn[10]=14,Kn[130]=ei[130]=6,Jn[130]=ti[130]=3,Kn[40]=ei[40]=6,Jn[40]=ti[40]=3,Hn[101]=ti[101]=1,Hn[69]=ti[69]=1,Qn[149]=ei[149]=21,Qn[21]=ei[21]=21,Kn[86]=$n[86]=17,Kn[84]=$n[84]=17,Wn[89]=Jn[89]=9,Wn[81]=Jn[81]=9,Wn[96]=ti[96]=0,Hn[96]=$n[96]=15,Wn[74]=ti[74]=0,Hn[74]=$n[74]=15,Wn[24]=Kn[24]=8,Jn[24]=ei[24]=7,Wn[146]=Kn[146]=8,Jn[146]=ei[146]=7,Hn[6]=$n[6]=15,Kn[6]=Qn[6]=16,Hn[164]=$n[164]=15,Kn[164]=Qn[164]=16,Jn[129]=ei[129]=7,Qn[129]=ti[129]=20,Jn[41]=ei[41]=7,Qn[41]=ti[41]=20,Kn[66]=ti[66]=2,Jn[66]=$n[66]=19,Kn[104]=ti[104]=2,Jn[104]=$n[104]=19,Wn[144]=Qn[144]=10,$n[144]=ei[144]=23,Wn[26]=Qn[26]=10,$n[26]=ei[26]=23,Hn[36]=ei[36]=5,Kn[36]=ti[36]=2,Hn[134]=ei[134]=5,Kn[134]=ti[134]=2,Wn[9]=Qn[9]=10,Hn[9]=Jn[9]=13,Wn[161]=Qn[161]=10,Hn[161]=Jn[161]=13,Hn[37]=ei[37]=5,Qn[37]=ti[37]=20,Hn[133]=ei[133]=5,Qn[133]=ti[133]=20,Kn[148]=Qn[148]=16,$n[148]=ei[148]=23,Kn[22]=Qn[22]=16,$n[22]=ei[22]=23,Wn[82]=Kn[82]=8,Jn[82]=$n[82]=19,Wn[88]=Kn[88]=8,Jn[88]=$n[88]=19,Wn[73]=ti[73]=0,Hn[73]=Jn[73]=13,Wn[97]=ti[97]=0,Hn[97]=Jn[97]=13,Wn[145]=Jn[145]=9,Qn[145]=ei[145]=21,Wn[25]=Jn[25]=9,Qn[25]=ei[25]=21,Hn[70]=ti[70]=1,Kn[70]=$n[70]=17,Hn[100]=ti[100]=1,Kn[100]=$n[100]=17,Wn[34]=Jn[34]=9,Hn[34]=Kn[34]=12,Qn[34]=ei[34]=21,$n[34]=ti[34]=22,Wn[136]=ei[136]=4,Hn[136]=ti[136]=1,Kn[136]=$n[136]=17,Jn[136]=Qn[136]=18,Wn[35]=ei[35]=4,Hn[35]=Kn[35]=12,Jn[35]=Qn[35]=18,$n[35]=ti[35]=22,Wn[153]=ei[153]=4,Jn[153]=Qn[153]=18,Hn[102]=Kn[102]=12,$n[102]=ti[102]=22,Wn[155]=Jn[155]=9,Qn[155]=ei[155]=23,Hn[103]=ti[103]=1,Kn[103]=$n[103]=17,Wn[152]=ei[152]=4,Kn[152]=$n[152]=17,Jn[152]=Qn[152]=18,Wn[156]=Kn[156]=8,Jn[156]=Qn[156]=18,$n[156]=ei[156]=23,Wn[137]=ei[137]=4,Hn[137]=ti[137]=1,Jn[137]=Qn[137]=18,Wn[139]=ei[139]=4,Hn[139]=Jn[139]=13,Qn[139]=ti[139]=20,Wn[98]=Jn[98]=9,Hn[98]=Kn[98]=12,$n[98]=ti[98]=22,Wn[99]=ti[99]=0,Hn[99]=Kn[99]=12,Jn[99]=$n[99]=19,Hn[38]=Kn[38]=12,Qn[38]=ei[38]=21,$n[38]=ti[38]=22,Hn[39]=ei[39]=5,Kn[39]=Qn[39]=16,$n[39]=ti[39]=22;var ri=[];function ni(t,e,r){return(t-e)/(r-e)}function ii(t){return t.constructor.toString().indexOf("Array")>-1}function oi(t,e,r,n,i,o){for(var a=t.cells[r][e],s=a.cval_real,u=e+n,l=r+i,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=i,u-=n,s=(a=t.cells[l][u]).cval_real,-1===i)if(0===o)if(1&s)c.push([u,l]),n=-1,i=0,o=0;else{if(!(4&s)){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u+1,l]),n=1,i=0,o=0}else{if(!(1&s)){if(4&s){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u+a.bottomleft,l]),n=0,i=1,o=0,h=!0;break}c.push([u,l]),n=-1,i=0,o=0}else if(1===i)if(0===o){if(!(s&gn)){if(s&dn){c.push([u+a.topleft,l+1]),n=0,i=-1,o=0,h=!0;break}c.push([u+a.topright,l+1]),n=0,i=-1,o=1,h=!0;break}c.push([u+1,l+1]),n=1,i=0,o=1}else c.push([u+1,l+1]),n=1,i=0,o=1;else if(-1===n)if(0===o){if(!(s&dn)){if(1&s){c.push([u,l+a.leftbottom]),n=1,i=0,o=0,h=!0;break}c.push([u,l+a.lefttop]),n=1,i=0,o=1,h=!0;break}c.push([u,l+1]),n=0,i=1,o=0}else{if(!(s&dn)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),n=0,i=1,o=0}else{if(1!==n){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(4&s)){c.push([u+1,l+a.rightbottom]),n=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}else{if(!(4&s)){if(s&gn){c.push([u+1,l+a.righttop]),n=-1,i=0,o=1;break}c.push([u+1,l+a.rightbottom]),n=-1,i=0,o=0,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}}else if(s=(a=t.cells[l][u]).cval_real,-1===n)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])n=0,i=-1,o=1;else{if(!(1&s)){c.push([u+a.bottomright,l]),n=0,i=1,o=1,h=!0;break}c.push([u,l])}else{if(!(s&dn)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===n){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])n=0,i=1,o=0;else{if(!(s&gn)){c.push([u+a.topleft,l+1]),n=0,i=-1,o=0,h=!0;break}c.push([u+1,l+1]),n=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])n=1,i=0,o=1;else{if(!(4&s)){c.push([u+1,l+a.righttop]),n=-1,i=0,o=1,h=!0;break}c.push([u+1,l]),n=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])n=-1,i=0,o=0;else{if(!(s&dn)){c.push([u,l+a.leftbottom]),n=1,i=0,o=0,h=!0;break}c.push([u,l+1]),n=0,i=1,o=0}}if(l+=i,(u+=n)===e&&l===r)break}return{path:c,i:u,j:l,x:n,y:i,o}}function ai(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],r=t.cval_real;switch(e){case 0:return r&gn?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return 4&r?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return 1&r?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return r&gn?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return 4&r?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return 1&r?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return 1&r?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return 1&r?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return r&dn?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return 1&r?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return 1&r?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return r&dn?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return 4&r?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return r&dn?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return 1&r?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return r&dn?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return r&dn?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return r&gn?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return r&dn?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return r&gn?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function si(t,e,r,n){var i,o,a,s,u,l=t.cval;switch(e){case-1:switch(n){case 0:i=Hn[l],a=Sn[l],s=Cn[l],u=Pn[l];break;default:i=Wn[l],a=wn[l],s=En[l],u=In[l]}break;case 1:switch(n){case 0:i=Qn[l],a=zn[l],s=Fn[l],u=Bn[l];break;default:i=$n[l],a=Nn[l],s=Dn[l],u=On[l]}break;default:switch(r){case-1:switch(n){case 0:i=ti[l],a=yn[l],s=mn[l],u=vn[l];break;default:i=ei[l],a=_n[l],s=xn[l],u=bn[l]}break;case 1:switch(n){case 0:i=Jn[l],a=Mn[l],s=Tn[l],u=An[l];break;default:i=Kn[l],a=Ln[l],s=kn[l],u=Rn[l]}}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var r=e+1;r0){var s=n[e-1],u=!function(t,e){return 0===vi(mi(t),mi(e))}(l=r,c=s)&&function(t,e){var r,n,i=t[0],o=mi(t),a=e[0],s=mi(e),u=vi(o,s);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}(vi((n=i,[(r=a)[0]-n[0],r[1]-n[1]]),s)/u,o))}(l,c);!1!==u&&(s[1]=u,r[0]=u),a.push(s[0]),e===o.length-2&&(a.push(r[0]),a.push(r[1]))}2===o.length&&(a.push(r[0]),a.push(r[1]))}var l,c,h,p,f,d,g,y})),_(a,t.properties)}const xi=function(t,e,r){if(!O(r=r||{}))throw new Error("options is invalid");var n=r.units;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");var i=Z(t),o=t.properties;switch(i){case"LineString":return _i(t,e,n);case"MultiLineString":var a=[];return rt(t,(function(t){a.push(_i(t,e,n).geometry.coordinates)})),w(a,o);default:throw new Error("geometry "+i+" is not supported")}};function bi(t,e,r){var n,i=e[0]-t[0],o=e[1]-t[1],a=r[0]-e[0];return((n=i*(r[1]-e[1])-a*o)>0)-(n<0)||+n}function wi(t,e){return e.geometry.coordinates[0].every((function(e){return Et(g(e),t)}))}const Ei=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,r){var n=e.to,i=r.to;if(n.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(n.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(n.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return n.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?n.coordinates[1]-i.coordinates[1]:i.coordinates[1]-n.coordinates[1];var o=bi(t.coordinates,n.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(n.coordinates[0]-t.coordinates[0],2)+Math.pow(n.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),Ii=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return _([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return bi(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),Si=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return t.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,r,n){return r.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=n),e}),0),r=(0===e?this.length:e)-1,n=(e+1)%this.length,i=bi(this.edges[r].from.coordinates,this.edges[e].from.coordinates,this.edges[n].from.coordinates);return 0===i?this.edges[r].from.coordinates[0]>this.edges[n].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return E(this.edges.map((function(t){return t.from.coordinates})))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=m([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=we(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var r,n,i=t.getEnvelope();return e.forEach((function(e){var o,a,s,u,l,c,h=e.getEnvelope();if(n&&(r=n.getEnvelope()),a=i,s=(o=h).geometry.coordinates.map((function(t){return t[0]})),u=o.geometry.coordinates.map((function(t){return t[1]})),l=a.geometry.coordinates.map((function(t){return t[0]})),c=a.geometry.coordinates.map((function(t){return t[1]})),(Math.max(null,s)!==Math.max(null,l)||Math.max(null,u)!==Math.max(null,c)||Math.min(null,s)!==Math.min(null,l)||Math.min(null,u)!==Math.min(null,c))&&wi(h,i)){var p=t.map((function(t){return t.from.coordinates})).find((function(t){return!e.some((function(e){return r=t,n=e.from.coordinates,r[0]===n[0]&&r[1]===n[1];var r,n}))}));p&&e.inside(g(p))&&(n&&!wi(r,h)||(n=e))}})),n},t.prototype.inside=function(t){return Et(t,this.toPolygon())},t}(),Ci=function(){function t(){this.edges=[],this.nodes={}}return t.fromGeoJson=function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(e);var r=new t;return rt(e,(function(t){j(t,"LineString","Graph::fromGeoJson"),W(t,(function(t,e){if(t){var n=r.getNode(t),i=r.getNode(e);r.addEdge(n,i)}return e}))})),r},t.prototype.getNode=function(t){var e=Ei.buildId(t),r=this.nodes[e];return r||(r=this.nodes[e]=new Ei(t)),r},t.prototype.addEdge=function(t,e){var r=new Ii(t,e),n=r.getSymetric();this.edges.push(r),this.edges.push(n)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var r=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),r.forEach((function(t){return e._removeIfDangle(t)}))}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},t.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,r){t.getOuterEdge((0===r?t.getOuterEdges().length:r)-1).symetric.next=e}))},t.prototype._computeNextCCWEdges=function(t,e){for(var r,n,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var a=i[o],s=a.symetric,u=void 0,l=void 0;a.label===e&&(u=a),s.label===e&&(l=s),u&&l&&(l&&(n=l),u&&(n&&(n.next=u,n=void 0),r||(r=u)))}n&&(n.next=r)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(r){if(!(r.label>=0)){t.push(r);var n=r;do{n.label=e,n=n.next}while(!r.isEqual(n));e++}})),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(r){t._computeNextCCWEdges(r,e.label)}))}));var e=[];return this.edges.forEach((function(r){r.ring||e.push(t._findEdgeRing(r))})),e},t.prototype._findIntersectionNodes=function(t){var e=[],r=t,n=function(){var n=0;r.from.getOuterEdges().forEach((function(e){e.label===t.label&&++n})),n>1&&e.push(r.from),r=r.next};do{n()}while(!t.isEqual(r));return e},t.prototype._findEdgeRing=function(t){var e=t,r=new Si;do{r.push(e),e.ring=r,e=e.next}while(!t.isEqual(e));return r},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()},t}();function Pi(t){var e=Ci.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var r=[],n=[];return e.getEdgeRings().filter((function(t){return t.isValid()})).forEach((function(t){t.isHole()?r.push(t):n.push(t)})),r.forEach((function(t){Si.findEdgeRingContaining(t,n)&&n.push(t)})),b(n.map((function(t){return t.toPolygon()})))}function Mi(t,e){for(var r=0;r0}function Ai(t,e,r){var n=r[0]-t[0],i=r[1]-t[1],o=e[0]-t[0],a=e[1]-t[1];return 0==n*a-i*o&&(Math.abs(o)>=Math.abs(a)?o>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:a>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1])}const Li=function(t,e){var r=!0;return rt(t,(function(t){rt(e,(function(e){if(!1===r)return!1;r=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return r=t.coordinates,n=e.coordinates,!(r[0]===n[0]&&r[1]===n[1]);case"LineString":return!Mi(e,t);case"Polygon":return!Et(t,e)}break;case"LineString":switch(e.type){case"Point":return!Mi(t,e);case"LineString":return!(Ue(t,e).features.length>0);case"Polygon":return!Ti(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Et(e,t);case"LineString":return!Ti(t,e);case"Polygon":return!function(t,e){for(var r=0,n=t.coordinates[0];r0}(e,t)}}var r,n;return!1}(t.geometry,e.geometry)}))})),r};function ki(t,e){var r=X(t),n=X(e),i=r.type,o=n.type,a=r.coordinates,s=n.coordinates;switch(i){case"Point":switch(o){case"Point":return Ni(a,s);default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"Point":return function(t,e){var r,n=!1;for(r=0;re[0]||t[2]e[1]||t[3]0}function zi(t,e){for(var r=!1,n=!1,i=t.coordinates[0].length,o=0;o=Math.abs(s)?a>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:s>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1]:Math.abs(a)>=Math.abs(s)?a>0?t[0]0?t[1]0)for(var r=0;r0}const qi=function(t,e){return X(t).type===X(e).type&&new Ui({precision:6}).compare(ue(t),ue(e))};function ji(t,e){var r=!1;return rt(t,(function(t){rt(e,(function(e){if(!0===r)return!0;r=!Li(t.geometry,e.geometry)}))})),r}var Gi=r(2606);const Xi=function(t,e,r){void 0===r&&(r={}),!0!==r.mutate&&(t=Dt(t)),r.minPoints=r.minPoints||3;var n=new Gi.DBSCAN,i=n.run($(t),R(e,r.units),r.minPoints,Ct),o=-1;return i.forEach((function(e){o++,e.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster=o,r.properties.dbscan="core"}))})),n.noise.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster?r.properties.dbscan="edge":r.properties.dbscan="noise"})),t};var Zi=r(1160);const Yi=function(t,e){void 0===e&&(e={});var r=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(r/2)),e.numberOfClusters>r&&(e.numberOfClusters=r),!0!==e.mutate&&(t=Dt(t));var n=$(t),i=n.slice(0,e.numberOfClusters),o=Zi(n,e.numberOfClusters,i),a={};return o.centroids.forEach((function(t,e){a[e]=t})),J(t,(function(t,e){var r=o.idxs[e];t.properties.cluster=r,t.properties.centroid=a[r]})),t};function Wi(t,e){return A(tn(t[0],t[1]))===A(tn(e[0],e[1]))}function Hi(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}const Ki=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Hi(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Hi(e,"line2"))throw new Error("line2 must be a LineString");for(var r=ze(ue(t)).features,n=ze(ue(e)).features,i=0;i0;){var u=a.pop();if(u===r)return Ji(u);u.closed=!0;for(var l=t.neighbors(u),c=0,h=l.length;c0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),r=this.content.pop();e!==this.content.length-1&&(this.content[e]=r,this.scoreFunction(r)0;){var r=(t+1>>1)-1,n=this.content[r];if(!(this.scoreFunction(e)=h;){for(var R=[],N=[],z=c+I,F=0;z<=p;){var U=g([z,L]),V=ro(U,o);R.push(V?0:1),N.push(z+"|"+L);var q=Ct(U,t);!V&&q0)){if(o/=p,p<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=n-u,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o0)){if(o/=f,f<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=i-l,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o0||h<1)||(c>0&&(t[0]=[u+c*p,l+c*f]),h<1&&(t[1]=[u+h*p,l+h*f]),!0)}}}}}function vo(t,e,r,n,i){var o=t[1];if(o)return!0;var a,s,u=t[0],l=t.left,c=t.right,h=l[0],p=l[1],f=c[0],d=c[1],g=(h+f)/2,y=(p+d)/2;if(d===p){if(g=n)return;if(h>f){if(u){if(u[1]>=i)return}else u=[g,r];o=[g,i]}else{if(u){if(u[1]1)if(h>f){if(u){if(u[1]>=i)return}else u=[(r-s)/a,r];o=[(i-s)/a,i]}else{if(u){if(u[1]=n)return}else u=[e,a*e+s];o=[n,a*n+s]}else{if(u){if(u[0]=-Uo)){var f=u*u+l*l,d=c*c+h*h,g=(h*f-l*d)/p,y=(u*d-c*f)/p,m=Eo.pop()||new Io;m.arc=t,m.site=i,m.x=g+a,m.y=(m.cy=y+s)+Math.sqrt(g*g+y*y),t.circle=m;for(var v=null,_=zo._;_;)if(m.y<_.y||m.y===_.y&&m.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}zo.insert(v,m),v||(wo=m)}}}}function Co(t){var e=t.circle;e&&(e.P||(wo=e.N),zo.remove(e),Eo.push(e),uo(e),t.circle=null)}var Po=[];function Mo(){uo(this),this.edge=this.site=this.circle=null}function To(t){var e=Po.pop()||new Mo;return e.site=t,e}function Ao(t){Co(t),Do.remove(t),Po.push(t),uo(t)}function Lo(t){var e=t.circle,r=e.x,n=e.cy,i=[r,n],o=t.P,a=t.N,s=[t];Ao(t);for(var u=o;u.circle&&Math.abs(r-u.circle.x)Bo)s=s.L;else{if(!((i=o-No(s,a))>Bo)){n>-Bo?(e=s.P,r=s):i>-Bo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}!function(t){Oo[t.index]={site:t,halfedges:[]}}(t);var u=To(t);if(Do.insert(e,u),e||r){if(e===r)return Co(e),r=To(e.site),Do.insert(u,r),u.edge=r.edge=fo(e.site,u.site),So(e),void So(r);if(r){Co(e),Co(r);var l=e.site,c=l[0],h=l[1],p=t[0]-c,f=t[1]-h,d=r.site,g=d[0]-c,y=d[1]-h,m=2*(p*y-f*g),v=p*p+f*f,_=g*g+y*y,x=[(y*v-f*_)/m+c,(p*_-g*v)/m+h];yo(r.edge,l,d,x),u.edge=fo(l,t,null,x),r.edge=fo(t,d,null,x),So(e),So(r)}else u.edge=fo(e.site,u.site)}}function Ro(t,e){var r=t.site,n=r[0],i=r[1],o=i-e;if(!o)return n;var a=t.P;if(!a)return-1/0;var s=(r=a.site)[0],u=r[1],l=u-e;if(!l)return s;var c=s-n,h=1/o-1/l,p=c/l;return h?(-p+Math.sqrt(p*p-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+n:(n+s)/2}function No(t,e){var r=t.N;if(r)return Ro(r,e);var n=t.site;return n[1]===e?n[0]:1/0}var Do,Oo,zo,Fo,Bo=1e-6,Uo=1e-12;function Vo(t,e){return e[1]-t[1]||e[0]-t[0]}function qo(t,e){var r,n,i,o=t.sort(Vo).pop();for(Fo=[],Oo=new Array(t.length),Do=new po,zo=new po;;)if(i=wo,o&&(!i||o[1]Bo||Math.abs(i[0][1]-i[1][1])>Bo)||delete Fo[o]}(a,s,u,l),function(t,e,r,n){var i,o,a,s,u,l,c,h,p,f,d,g,y=Oo.length,m=!0;for(i=0;iBo||Math.abs(g-p)>Bo)&&(u.splice(s,0,Fo.push(go(a,f,Math.abs(d-t)Bo?[t,Math.abs(h-t)Bo?[Math.abs(p-n)Bo?[r,Math.abs(h-r)Bo?[Math.abs(p-e)=s)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[n=a],a=null,i.halfedges.forEach((function(r){var n=o.edges[r],s=n.left;if(s!==i.site&&s||(s=n.right)){var u=t-s[0],l=e-s[1],h=u*u+l*l;h=-270&&(d=-d),f<-180&&f>=-360&&(g=-g),"degrees"===o){var y=d*Math.cos(c)+g*Math.sin(c),v=g*Math.cos(c)-d*Math.sin(c);d=y,g=v}h.push([d+l[0],g+l[1]])}return h.push(h[0]),"degrees"===o?m([h],u):fi(m([h],u),a,{pivot:s})},Yo=function(t,e){void 0===e&&(e={});var r=0,n=0,i=0;return tt(t,(function(t,o,a){var s=a[e.weight];if(!D(s=null==s?1:s))throw new Error("weight value must be a number for feature index "+o);(s=Number(s))>0&&Y(t,(function(t){r+=t[0]*s,n+=t[1]*s,i+=s}))})),g([r/i,n/i],e.properties,e)};function Wo(t,e,r,n){var i=r.properties.tolerance||.001,o=0,a=0,s=0,u=0;if(J(r,(function(e){var r=e.properties.weight,n=null==r?1:r;if(!D(n=Number(n)))throw new Error("weight value must be a number");if(n>0){u+=1;var i=n*Ct(e,t);0===i&&(i=1);var l=n/i;o+=e.geometry.coordinates[0]*l,a+=e.geometry.coordinates[1]*l,s+=l}})),u<1)throw new Error("no features to measure");var l=o/s,c=a/s;return 1===u||0===n||Math.abs(l-e[0])r&&(r=u,n=o,e.push([]));var l=o-n,c=t.coordinates[u][l+1],h=i[0],p=i[1],f=c[0],d=c[1];e[u].push([.75*h+.25*f,.75*p+.25*d]),e[u].push([.25*h+.75*f,.25*p+.75*d])}),!0),e.forEach((function(t){t.push(t[0])}))}function ta(t,e){var r=0,n=0,i=0;Y(t,(function(o,a,s,u,l){u>i&&(i=u,n=a,e.push([[]])),l>r&&(r=l,n=a,e[u].push([]));var c=a-n,h=t.coordinates[u][l][c+1],p=o[0],f=o[1],d=h[0],g=h[1];e[u][l].push([.75*p+.25*d,.75*f+.25*g]),e[u][l].push([.25*p+.75*d,.25*f+.75*g])}),!0),e.forEach((function(t){t.forEach((function(t){t.push(t[0])}))}))}const ea=function(t,e){var r=[],n=e.iterations||1;if(!t)throw new Error("inputPolys is required");return tt(t,(function(t,e,i){var o,a,s;switch(t.type){case"Polygon":o=[[]];for(var u=0;u0&&(a=m(o).geometry),$o(a,s),o=s.slice(0);r.push(m(o,i));break;case"MultiPolygon":o=[[[]]];for(var l=0;l0&&(a=I(o).geometry),ta(a,s),o=s.slice(0);r.push(I(o,i));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}})),b(r)};function ra(t,e,r){void 0===r&&(r=2);var n=B(t),i=B(e),o=n[0]-i[0],a=n[1]-i[1];return 1===r?Math.abs(o)+Math.abs(a):Math.pow(Math.pow(o,r)+Math.pow(a,r),1/r)}function na(t,e){var r=(e=e||{}).threshold||1e4,n=e.p||2,i=e.binary||!1,o=e.alpha||-1,a=e.standardization||!1,s=[];J(t,(function(t){s.push(Te(t))}));for(var u=[],l=0;l0?1:0))*r,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*r))];return o[0]>i&&(o[0]=i),o[0]<-i&&(o[0]=-i),o[1]>i&&(o[1]=i),o[1]<-i&&(o[1]=-i),o}function ca(t){var e=180/Math.PI,r=6378137;return[t[0]*e/r,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/r)))*e]}function ha(t){return Array.isArray(t)?ya(t):t&&t.bbox?ya(t.bbox):[360*ga(),180*ga()]}function pa(t,e){void 0===e&&(e={}),null==t&&(t=1);for(var r=[],n=0;n0?t+r[e-1]:t})),o.forEach((function(t){t=2*t*Math.PI/o[o.length-1];var r=Math.random();i.push([r*(e.max_radial_length||10)*Math.sin(t),r*(e.max_radial_length||10)*Math.cos(t)])})),i[i.length-1]=i[0],i=i.map((n=ha(e.bbox),function(t){return[t[0]+n[0],t[1]+n[1]]})),r.push(m([i]))},i=0;i1?0:t<-1?ka:Math.acos(t)}function Xa(t){return t>1?Ra:t<-1?-Ra:Math.asin(t)}function Za(){}function Ya(t,e){t&&Ja.hasOwnProperty(t.type)&&Ja[t.type](t,e)}var Wa,Ha,Ka={Feature:function(t,e){Ya(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nka?t-Da:t<-ka?t+Da:t,e]}function ls(t){return function(e,r){return[(e+=t)>ka?e-Da:e<-ka?e+Da:e,r]}}function cs(t){var e=ls(t);return e.invert=ls(-t),e}function hs(t,e){var r=Va(t),n=qa(t),i=Va(e),o=qa(e);function a(t,e){var a=Va(e),s=Va(t)*a,u=qa(t)*a,l=qa(e),c=l*r+s*n;return[Ua(u*i-c*o,s*r-l*n),Xa(c*i+u*o)]}return a.invert=function(t,e){var a=Va(e),s=Va(t)*a,u=qa(t)*a,l=qa(e),c=l*i-u*o;return[Ua(u*i+l*o,s*r+c*n),Xa(c*r-s*n)]},a}function ps(t,e){(e=es(e))[0]-=t,as(e);var r=Ga(-e[1]);return((-e[2]<0?-r:r)+Da-La)%Da}function fs(){var t,e=[];return{point:function(e,r){t.push([e,r])},lineStart:function(){e.push(t=[])},lineEnd:Za,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}function ds(t,e){return Fa(t[0]-e[0])=0;--o)i.point((c=l[o])[0],c[1]);else n(p.x,p.p.x,-1,i);p=p.p}l=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}}function ms(t){if(e=t.length){for(var e,r,n=0,i=t[0];++ne?1:t>=e?0:NaN}Pa(),Pa(),Pa(),us.invert=us,1===(Wa=vs).length&&(Ha=Wa,Wa=function(t,e){return vs(Ha(t),e)});var _s=Array.prototype;function xs(t){for(var e,r,n,i=t.length,o=-1,a=0;++o=0;)for(e=(n=t[i]).length;--e>=0;)r[--a]=n[e];return r}_s.slice,_s.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var bs=1e9,ws=-bs;function Es(t,e,r,n){function i(i,o){return t<=i&&i<=r&&e<=o&&o<=n}function o(i,o,s,l){var c=0,h=0;if(null==i||(c=a(i,s))!==(h=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+s+4)%4)!==h);else l.point(o[0],o[1])}function a(n,i){return Fa(n[0]-t)0?0:3:Fa(n[0]-r)0?2:1:Fa(n[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(a){var u,l,c,h,p,f,d,g,y,m,v,_=a,x=fs(),b={point:w,lineStart:function(){b.point=E,l&&l.push(c=[]),m=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(E(h,p),f&&y&&x.rejoin(),u.push(x.result())),b.point=w,y&&_.lineEnd()},polygonStart:function(){_=x,u=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,r=0,i=l.length;rn&&(p-o)*(n-a)>(f-a)*(t-o)&&++e:f<=n&&(p-o)*(n-a)<(f-a)*(t-o)&&--e;return e}(),r=v&&e,i=(u=xs(u)).length;(r||i)&&(a.polygonStart(),r&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&ys(u,s,e,o,a),a.polygonEnd()),_=a,u=l=c=null}};function w(t,e){i(t,e)&&_.point(t,e)}function E(o,a){var s=i(o,a);if(l&&c.push([o,a]),m)h=o,p=a,f=s,m=!1,s&&(_.lineStart(),_.point(o,a));else if(s&&y)_.point(o,a);else{var u=[d=Math.max(ws,Math.min(bs,d)),g=Math.max(ws,Math.min(bs,g))],x=[o=Math.max(ws,Math.min(bs,o)),a=Math.max(ws,Math.min(bs,a))];!function(t,e,r,n,i,o){var a,s=t[0],u=t[1],l=0,c=1,h=e[0]-s,p=e[1]-u;if(a=r-s,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=p,p<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,p||!(a<0)){if(a/=p,p<0){if(a>c)return;a>l&&(l=a)}else if(p>0){if(a0&&(t[0]=s+l*h,t[1]=u+l*p),c<1&&(e[0]=s+c*h,e[1]=u+c*p),!0}}}}}(u,x,t,e,r,n)?s&&(_.lineStart(),_.point(o,a),v=!1):(y||(_.lineStart(),_.point(u[0],u[1])),_.point(x[0],x[1]),s||_.lineEnd(),v=!1)}d=o,g=a,y=s}return b}}var Is=Pa();Pa(),Pa(),Pa();var Ss=1/0,Cs=Ss,Ps=-Ss,Ms=Ps;const Ts={point:function(t,e){tPs&&(Ps=t),eMs&&(Ms=e)},lineStart:Za,lineEnd:Za,polygonStart:Za,polygonEnd:Za,result:function(){var t=[[Ss,Cs],[Ps,Ms]];return Ps=Ms=-(Cs=Ss=1/0),t}};function As(t,e,r,n){return function(i,o){var a,s,u,l=e(o),c=i.invert(n[0],n[1]),h=fs(),p=e(h),f=!1,d={point:g,lineStart:m,lineEnd:v,polygonStart:function(){d.point=_,d.lineStart=x,d.lineEnd=b,s=[],a=[]},polygonEnd:function(){d.point=g,d.lineStart=m,d.lineEnd=v,s=xs(s);var t=function(t,e){var r=e[0],n=e[1],i=[qa(r),-Va(r),0],o=0,a=0;Is.reset();for(var s=0,u=t.length;s=0?1:-1,I=E*w,S=I>ka,C=d*x;if(Is.add(Ua(C*E*qa(I),g*b+C*Va(I))),o+=S?w+E*Da:w,S^p>=r^v>=r){var P=ns(es(h),es(m));as(P);var M=ns(i,P);as(M);var T=(S^w>=0?-1:1)*Xa(M[2]);(n>T||n===T&&(P[0]||P[1]))&&(a+=S^w>=0?1:-1)}}return(o<-1e-6||o0){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t1&&2&i&&l.push(l.pop().concat(l.shift())),s.push(l.filter(Ls))}return d}}function Ls(t){return t.length>1}function ks(t,e){return((t=t.x)[0]<0?t[1]-Ra-La:Ra-t[1])-((e=e.x)[0]<0?e[1]-Ra-La:Ra-e[1])}Pa();const Rs=As((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?ka:-ka,u=Fa(o-r);Fa(u-ka)0?Ra:-Ra),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),e=0):i!==s&&u>=ka&&(Fa(r-i)La?Ba((qa(e)*(o=Va(n))*qa(r)-qa(n)*(i=Va(e))*qa(t))/(i*o*a)):(e+n)/2}(r,n,o,a),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=o,n=a),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*Ra,n.point(-ka,i),n.point(0,i),n.point(ka,i),n.point(ka,0),n.point(ka,-i),n.point(0,-i),n.point(-ka,-i),n.point(-ka,0),n.point(-ka,i);else if(Fa(t[0]-e[0])>La){var o=t[0]0,i=Fa(r)>La;function o(t,e){return Va(t)*Va(e)>r}function a(t,e,n){var i=[1,0,0],o=ns(es(t),es(e)),a=rs(o,o),s=o[0],u=a-s*s;if(!u)return!n&&t;var l=r*a/u,c=-r*s/u,h=ns(i,o),p=os(i,l);is(p,os(o,c));var f=h,d=rs(p,f),g=rs(f,f),y=d*d-g*(rs(p,p)-1);if(!(y<0)){var m=ja(y),v=os(f,(-d-m)/g);if(is(v,p),v=ts(v),!n)return v;var _,x=t[0],b=e[0],w=t[1],E=e[1];b0^v[1]<(Fa(v[0]-x)ka^(x<=v[0]&&v[0]<=b)){var C=os(f,(-d+m)/g);return is(C,p),[v,ts(C)]}}}function s(e,r){var i=n?t:ka-t,o=0;return e<-i?o|=1:e>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}return As(o,(function(t){var e,r,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,p){var f,d=[h,p],g=o(h,p),y=n?g?0:s(h,p):g?s(h+(h<0?ka:-ka),p):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(f=a(e,d))||ds(e,f)||ds(d,f))&&(d[0]+=La,d[1]+=La,g=o(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),f=a(d,e),t.point(f[0],f[1])):(f=a(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(i&&e&&n^g){var m;y&r||!(m=a(d,e,!0))||(c=0,n?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&ds(e,d)||t.point(d[0],d[1]),e=d,u=g,r=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(r,n,i,o){!function(t,e,r,n,i,o){if(r){var a=Va(e),s=qa(e),u=n*r;null==i?(i=e+n*Da,o=e-u/2):(i=ps(a,i),o=ps(a,o),(n>0?io)&&(i+=n*Da));for(var l,c=i;n>0?c>o:c4*e&&g--){var x=a+p,b=s+f,w=u+d,E=ja(x*x+b*b+w*w),I=Xa(w/=E),S=Fa(Fa(w)-1)e||Fa((m*T+v*A)/_-.5)>.3||a*p+s*f+u*d2?t[2]%360*za:0,M()):[y*Oa,m*Oa,v*Oa]},S.precision=function(t){return arguments.length?(I=Us(P,E=t*t),T()):ja(E)},S.fitExtent=function(t,e){return Fs(S,t,e)},S.fitSize=function(t,e){return function(t,e,r){return Fs(t,[[0,0],e],r)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&C,M()}}((function(){return t}))()}function js(t){return function(e,r){var n=Va(e),i=Va(r),o=t(n*i);return[o*i*qa(e),o*qa(r)]}}function Gs(t){return function(e,r){var n=ja(e*e+r*r),i=t(n),o=qa(i),a=Va(i);return[Ua(e*o,n*a),Xa(n&&r*o/n)]}}js((function(t){return ja(2/(1+t))})).invert=Gs((function(t){return 2*Xa(t/2)}));var Xs=js((function(t){return(t=Ga(t))&&t/qa(t)}));function Zs(t,e){return[t,e]}function Ys(t,e,r,n){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var a=[];return tt(t,(function(t){var i=Ys(t,e,r,n);i&&a.push(i)})),b(a)}var s=function(t){var e=Me(t).geometry.coordinates,r=[-e[0],-e[1]];return qs(Xs).scale(79.4188).clipAngle(179.999).rotate(r).scale(l)}(o),u={type:o.type,coordinates:Hs(o.coordinates,s)},c=(new Ca.GeoJSONReader).read(u),h=P(M(e,r),"meters"),p=Ca.BufferOp.bufferOp(c,h,n);if(!Ws((p=(new Ca.GeoJSONWriter).write(p)).coordinates))return f({type:p.type,coordinates:Ks(p.coordinates,s)},i)}function Ws(t){return Array.isArray(t[0])?Ws(t[0]):isNaN(t[0])}function Hs(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return Hs(t,e)}))}function Ks(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Ks(t,e)}))}Xs.invert=Gs((function(t){return t})),Zs.invert=Zs,Gs(Ba),Gs(Xa),Gs((function(t){return 2*Ba(t)}));const Js=function(t,e,r){var n=(r=r||{}).units||"kilometers",i=r.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof r)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return tt(t,(function(t){var r=Ys(t,e,n,i);r&&o.push(r)})),b(o);case"FeatureCollection":return J(t,(function(t){var r=Ys(t,e,n,i);r&&J(r,(function(t){t&&o.push(t)}))})),b(o)}return Ys(t,e,n,i)},Qs=function(t,e,r){void 0===r&&(r={});var n=X(t),i=X(e),o=Ia.union(n.coordinates,i.coordinates);return 0===o.length?null:1===o.length?m(o[0],r.properties):I(o,r.properties)};function $s(t,e,r){void 0===r&&(r={});var n=X(t),i=X(e),o=Ia.intersection(n.coordinates,i.coordinates);return 0===o.length?null:1===o.length?m(o[0],r.properties):I(o,r.properties)}function tu(t,e){return function(t,e,r){var n,i;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach((function(e,r){var o=function(t,e){return t-e}(e,t);o>=0&&(void 0===i||o0&&0!==h)if(h>o[o.length-1])h-=o.length;else{var p=tu(h,o);0!==p&&(h-=p)}if(h!==+s){var f=i[h];f&&u&&(void 0!==r&&f.properties[r]!==u.properties[r]||Vi(u,f)&&(e=f,n=_($(u)),c=_($(e)),Ue(n,c).features.length>0)&&(i[s]=Qs(u,f),o.push(t.properties.origIndexPosition),o.sort((function(t,e){return t-e})),a.remove(t),i.splice(h,1),u.properties.origIndexPosition=s,a.remove(u,(function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition})),l=!0))}})),l){if(!u)continue;u.properties.origIndexPosition=s,a.insert(u),s--}}return i.forEach((function(t){delete t.properties.origIndexPosition,delete t.bbox})),n};function ru(t,e,r,n,i,o){for(var a=[],s=0;s<6;s++){var u=t[0]+e*i[s],l=t[1]+r*o[s];a.push([u,l])}return a.push(a[0].slice()),m([a],n)}function nu(t,e,r,n,i,o){for(var a=[],s=0;s<6;s++){var u=[];u.push(t),u.push([t[0]+e*i[s],t[1]+r*o[s]]),u.push([t[0]+e*i[(s+1)%6],t[1]+r*o[(s+1)%6]]),u.push(t),a.push(m([u],n))}return a}const iu=function(t,e,r){void 0===r&&(r={});var n=JSON.stringify(r.properties||{}),i=t[0],o=t[1],a=t[2],s=t[3],u=(o+s)/2,l=(i+a)/2,c=2*e/Ct([i,u],[a,u],r)*(a-i),h=2*e/Ct([l,o],[l,s],r)*(s-o),p=c/2,f=2*p,d=Math.sqrt(3)/2*h,g=a-i,y=s-o,m=3/4*f,v=d,_=(g-f)/(f-p/2),x=Math.floor(_),w=(x*m-p/2-g)/2-p/2+m/2,E=Math.floor((y-d)/d),I=(y-E*d)/2,S=E*d-y>d/2;S&&(I-=d/4);for(var C=[],P=[],M=0;M<6;M++){var T=2*Math.PI/6*M;C.push(Math.cos(T)),P.push(Math.sin(T))}for(var A=[],L=0;L<=x;L++)for(var k=0;k<=E;k++){var R=L%2==1;if(!(0===k&&R||0===k&&S)){var N=L*m+i-w,D=k*v+o+I;if(R&&(D-=d/2),!0===r.triangles)nu([N,D],c/2,h/2,JSON.parse(n),C,P).forEach((function(t){r.mask?$s(r.mask,t)&&A.push(t):A.push(t)}));else{var O=ru([N,D],c/2,h/2,JSON.parse(n),C,P);r.mask?$s(r.mask,O)&&A.push(O):A.push(O)}}}return b(A)};function ou(t){if(t.features.length<=1)return t;var e=function(t){var e=re(),r=[];return rt(t,(function(t,e){var n=ht(t);r.push({minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],geojson:t,index:e})})),e.load(r),e}(t),r=[],n={};return rt(t,(function(t,i){if(n[i])return!0;for(e.remove({index:i},au),n[i]=!0;;){var o=ht(t),a=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(a.length>0)for(var s=a.map((function(t){return n[t.index]=!0,e.remove({index:t.index},au),t.geojson})),u=0,l=s.length;u{"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){var e=s(n,a,arguments);if(u&&l){var r=u(e,"length");r.configurable&&l(e,"length",{value:1+c(0,t.length-(arguments.length-1))})}return e};var h=function(){return s(n,o,arguments)};l?l(t.exports,"apply",{value:h}):t.exports.apply=h},2273:(t,e,r)=>{"use strict";var n=r(1662),i=r(3842),o=r(6960);const a=r(8639).orient2d;function s(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;var i=function(t){for(var e=t[0],r=t[0],n=t[0],i=t[0],a=0;an[0]&&(n=s),s[1]i[1]&&(i=s)}var u=[e,r,n,i],l=u.slice();for(a=0;a=2&&f(e[e.length-2],e[e.length-1],t[r])<=0;)e.pop();e.push(t[r])}for(var n=[],i=t.length-1;i>=0;i--){for(;n.length>=2&&f(n[n.length-2],n[n.length-1],t[i])<=0;)n.pop();n.push(t[i])}return n.pop(),e.pop(),e.concat(n)}(l)}(t),a=new n(16);a.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},a.compareMinX=function(t,e){return t[0]-e[0]},a.compareMinY=function(t,e){return t[1]-e[1]},a.load(t);for(var s,l=[],c=0;ca||u.push({node:d,dist:g})}for(;u.length&&!u.peek().node.children;){var y=u.pop(),v=y.node,_=m(v,e,r),x=m(v,n,o);if(y.dist<_&&y.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function p(t,e,r){for(var n,i,o,a,s=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),l=Math.max(t[0],e[0]),c=Math.max(t[1],e[1]),h=r.search({minX:s,minY:u,maxX:l,maxY:c}),p=0;p0!=f(n,i,a)>0&&f(o,a,n)>0!=f(o,a,i)>0)return!1;return!0}function f(t,e,r){return a(t[0],t[1],e[0],e[1],r[0],r[1])}function d(t){var e=t.p,r=t.next.p;return t.minX=Math.min(e[0],r[0]),t.minY=Math.min(e[1],r[1]),t.maxX=Math.max(e[0],r[0]),t.maxY=Math.max(e[1],r[1]),t}function g(t,e){var r={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function y(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function m(t,e,r){var n=e[0],i=e[1],o=r[0]-n,a=r[1]-i;if(0!==o||0!==a){var s=((t[0]-n)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(n=r[0],i=r[1]):s>0&&(n+=o*s,i+=a*s)}return(o=t[0]-n)*o+(a=t[1]-i)*a}function v(t,e,r,n,i,o,a,s){var u,l,c,h,p=r-t,f=n-e,d=a-i,g=s-o,y=t-i,m=e-o,v=p*p+f*f,_=p*d+f*g,x=d*d+g*g,b=p*y+f*m,w=d*y+g*m,E=v*x-_*_,I=E,S=E;0===E?(l=0,I=1,h=w,S=x):(h=v*w-_*b,(l=_*w-x*b)<0?(l=0,h=w,S=x):l>I&&(l=I,h=w+_,S=x)),h<0?(h=0,-b<0?l=0:-b>v?l=I:(l=-b,I=v)):h>S&&(h=S,-b+_<0?l=0:-b+_>v?l=I:(l=-b+_,I=v));var C=(1-(c=0===h?0:h/S))*i+c*a-((1-(u=0===l?0:l/I))*t+u*r),P=(1-c)*o+c*s-((1-u)*e+u*n);return C*C+P*P}function _(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}t.exports=s,t.exports.default=s},1662:function(t){t.exports=function(){"use strict";function t(t,n,i,o,a){!function t(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(r,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var p=r[n],f=i,d=o;for(e(r,i,n),a(r[o],p)>0&&e(r,i,o);f0;)d--}0===a(r[i],p)?e(r,i,d):e(r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(t,n,i||0,o||t.length-1,a||r)}function e(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function r(t,e){return te?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,r,n,i,o){for(var a=[r,n];a.length;)if(!((n=a.pop())-(r=a.pop())<=i)){var s=r+Math.ceil((n-r)/i/2)*i;t(e,s,r,n,o),a.push(r,s,s,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,r=[];if(!f(t,e))return r;for(var n=this.toBBox,i=[];e;){for(var o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)},n.prototype._split=function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var a=this._chooseSplitIndex(r,i,n),s=d(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,o(r,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},n.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,r){for(var n,i,o,s,u,l,h,p=1/0,f=1/0,d=e;d<=r-e;d++){var g=a(t,0,d,this.toBBox),y=a(t,d,r,this.toBBox),m=(i=g,o=y,void 0,void 0,void 0,void 0,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,h-u)),v=c(g)+c(y);m=e;f--){var d=t.children[f];s(u,t.leaf?i(d):d),l+=h(u)}return l},n.prototype._adjustParentBBoxes=function(t,e,r){for(var n=r;n>=0;n--)s(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},n}()},8754:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(3645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,"html,\nbody {\n height: 100%;\n padding: 0;\n margin: 0;\n}\n\n#map {\n z-index: 0;\n height: 100%;\n}\n",""]);const o=i},7113:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(3645),i=r.n(n)()((function(t){return t[1]}));i.push([t.id,".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}",""]);const o=i},3645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=t(e);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r,n){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(n)for(var o=0;o{var n=r(2215),i=r(2584),o=r(609),a=r(8420),s=r(2847),u=r(8923),l=Date.prototype.getTime;function c(t){return null==t}function h(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}t.exports=function t(e,r,p){var f=p||{};return!!(f.strict?o(e,r):e===r)||(!e||!r||"object"!=typeof e&&"object"!=typeof r?f.strict?o(e,r):e==r:function(e,r,o){var p,f;if(typeof e!=typeof r)return!1;if(c(e)||c(r))return!1;if(e.prototype!==r.prototype)return!1;if(i(e)!==i(r))return!1;var d=a(e),g=a(r);if(d!==g)return!1;if(d||g)return e.source===r.source&&s(e)===s(r);if(u(e)&&u(r))return l.call(e)===l.call(r);var y=h(e),m=h(r);if(y!==m)return!1;if(y||m){if(e.length!==r.length)return!1;for(p=0;p=0;p--)if(v[p]!=_[p])return!1;for(p=v.length-1;p>=0;p--)if(!t(e[f=v[p]],r[f],o))return!1;return!0}(e,r,f))}},4289:(t,e,r)=>{"use strict";var n=r(2215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=s&&function(){var t={};try{for(var e in s(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(u?s(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},c=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s{function e(t,e,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,r,n)}e.prototype.run=function(t,e,r,n){this._init(t,e,r,n);for(var i=0;i=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],r=0;r{function e(t,e,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,r)}e.prototype.init=function(t,e,r){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==r&&(this.distance=r)},e.prototype.run=function(t,e){this.init(t,e);for(var r=this.dataset.length,n=0;n0){for(u=0;u=0);return t},e.prototype.assign=function(){for(var t,e=!1,r=this.dataset.length,n=0;n{if(t.exports)var n=r(7985);function i(t,e,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,r,n)}i.prototype.run=function(t,e,r,i){this._init(t,e,r,i);for(var o=0,a=this.dataset.length;o=this.minPts)return r},i.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var r=[],n=0,i=this.dataset.length;n{function e(t,e,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,r)}e.prototype.insert=function(t,e){for(var r=this._queue.length,n=r;n--;){var i=this._priorities[n];"desc"===this._sorting?e>i&&(r=n):e{t.exports&&(t.exports={DBSCAN:r(8317),KMEANS:r(3781),OPTICS:r(3763),PriorityQueue:r(7985)})},9187:t=>{"use strict";function e(t,e,o){o=o||2;var a,s,u,h,p,d,g,y=e&&e.length,m=y?e[0]*o:t.length,v=r(t,0,m,o,!0),_=[];if(!v||v.next===v.prev)return _;if(y&&(v=function(t,e,i,o){var a,s,u,h=[];for(a=0,s=e.length;a80*o){a=u=t[0],s=h=t[1];for(var x=o;xu&&(u=p),d>h&&(h=d);g=0!==(g=Math.max(u-a,h-s))?1/g:0}return i(v,_,o,a,s,g),_}function r(t,e,r,n,i){var o,a;if(i===C(t,e,r,n)>0)for(o=e;o=e;o-=n)a=E(o,t[o],t[o+1],a);return a&&m(a,a.next)&&(I(a),a=a.next),a}function n(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!m(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(I(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function i(t,e,r,l,c,h,f){if(t){!f&&h&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=p(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,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,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--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,l,c,h);for(var d,g,y=t;t.prev!==t.next;)if(d=t.prev,g=t.next,h?a(t,l,c,h):o(t))e.push(d.i/r),e.push(t.i/r),e.push(g.i/r),I(t),t=g.next,y=g.next;else if((t=g)===y){f?1===f?i(t=s(n(t),e,r),e,r,l,c,h,2):2===f&&u(t,e,r,l,c,h):i(n(t),e,r,l,c,h,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(d(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&y(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(t,e,r,n){var i=t.prev,o=t,a=t.next;if(y(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=p(s,u,e,r,n),f=p(l,c,e,r,n),g=t.prevZ,m=t.nextZ;g&&g.z>=h&&m&&m.z<=f;){if(g!==t.prev&&g!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,m!==t.prev&&m!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;g&&g.z>=h;){if(g!==t.prev&&g!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;m&&m.z<=f;){if(m!==t.prev&&m!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function s(t,e,r){var i=t;do{var o=i.prev,a=i.next.next;!m(o,a)&&v(o,i,i.next,a)&&b(o,a)&&b(a,o)&&(e.push(o.i/r),e.push(i.i/r),e.push(a.i/r),I(i),I(i.next),i=t=a),i=i.next}while(i!==t);return n(i)}function u(t,e,r,o,a,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var c=w(u,l);return u=n(u,u.next),c=n(c,c.next),i(u,e,r,o,a,s),void i(c,e,r,o,a,s)}l=l.next}u=u.next}while(u!==t)}function l(t,e){return t.x-e.x}function c(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&d(or.x||n.x===r.x&&h(r,n)))&&(r=n,f=u)),n=n.next}while(n!==l);return r}(t,e)){var r=w(e,t);n(e,e.next),n(r,r.next)}}function h(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(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 f(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function g(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&&v(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||m(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,r,n){var i=x(y(t,e,r)),o=x(y(t,e,n)),a=x(y(r,n,t)),s=x(y(r,n,e));return i!==o&&a!==s||!(0!==i||!_(t,r,e))||!(0!==o||!_(t,n,e))||!(0!==a||!_(r,t,n))||!(0!==s||!_(r,e,n))}function _(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 x(t){return t>0?1:t<0?-1:0}function b(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function w(t,e){var r=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function E(t,e,r,n){var i=new S(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 I(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 S(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 C(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var a,s=r.call(arguments,1),u=function(){if(this instanceof a){var e=o.apply(this,s.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,s.concat(r.call(arguments)))},l=Math.max(0,o.length-s.length),c=[],h=0;h{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},9657:(t,e,r)=>{var n=r(251),i=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:s};function o(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function a(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function s(t,e){return n(t,e,{strict:!0})}i.prototype.compare=function(t,e){if(t.type!==e.type||!a(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var r=this,n=o(t),i=o(e);return n.every((function(t){return this.some((function(e){return r.compare(t,e)}))}),i)}}return!1},i.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var r=0;r=0&&(r=[].concat(t.slice(n,t.length),t.slice(1,n+1))),r},i.prototype.comparePath=function(t,e){var r=this;return t.every((function(t,e){return r.compareCoord(t,this[e])}),e)},i.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length),i=this;return r.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),n)}return!1},i.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},i.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},i.prototype.removePseudo=function(t){return t},t.exports=i},1787:(t,e,r)=>{var n=r(5510),i=r(4102),o=r(1540),a=r(9705).Z,s=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function l(t){var e=n(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),n.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})),n.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),n.prototype.remove.call(this,t,e)},e.clear=function(){return n.prototype.clear.call(this)},e.search=function(t){var e=n.prototype.search.call(this,this.toBBox(t));return u(e)},e.collides=function(t){return n.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=n.prototype.all.call(this);return u(t)},e.toJSON=function(){return n.prototype.toJSON.call(this)},e.fromJSON=function(t){return n.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=l,t.exports.default=l},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var l=function(){throw new a},c=u?function(){try{return l}catch(t){try{return u(arguments,"callee").get}catch(t){return l}}}():l,h=r(1405)(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d="undefined"==typeof Uint8Array?n:p(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function t(e){var r;if("%AsyncFunction%"===e)r=s("async function () {}");else if("%GeneratorFunction%"===e)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=s("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=p(i.prototype))}return g[e]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=r(8612),_=r(7642),x=v.call(Function.call,Array.prototype.concat),b=v.call(Function.apply,Array.prototype.splice),w=v.call(Function.call,String.prototype.replace),E=v.call(Function.call,String.prototype.slice),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,C=function(t){var e=E(t,0,1),r=E(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return w(t,I,(function(t,e,r,i){n[n.length]=r?w(i,S,"$1"):e||t})),n},P=function(t,e){var r,n=t;if(_(m,n)&&(n="%"+(r=m[n])[0]+"%"),_(g,n)){var o=g[n];if(o===f&&(o=y(n)),void 0===o&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');var r=C(t),n=r.length>0?r[0]:"",o=P("%"+n+"%",e),s=o.name,l=o.value,c=!1,h=o.alias;h&&(n=h[0],b(r,x([0,1],h)));for(var p=1,f=!0;p=r.length){var v=u(l,d);l=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[d]}else f=_(l,d),l=l[d];f&&!c&&(g[s]=l)}}return l}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},2584:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},8923:t=>{"use strict";var e=Date.prototype.getDay,r=Object.prototype.toString,n="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(n?function(t){try{return e.call(t),!0}catch(t){return!1}}(t):"[object Date]"===r.call(t))}},8420:(t,e,r)=>{"use strict";var n,i,o,a,s=r(1924),u=r(1405)()&&"symbol"==typeof Symbol.toStringTag;if(u){n=s("Object.prototype.hasOwnProperty"),i=s("RegExp.prototype.exec"),o={};var l=function(){throw o};a={toString:l,valueOf:l},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=l)}var c=s("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=u?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{i(t,a)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===c(t)}},6158:function(t){t.exports=function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),r=i(a),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=i;else t=i}return n(0,(function(t){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,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)(n=1))return n;for(;ro?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=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(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}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}var l=u(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function h(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(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 y(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 m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function v(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(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 b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?_(t,b):t}var w={};function E(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function S(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var M=null;function T(t){if(null==M){var e=t.navigator?t.navigator.userAgent:null;M=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return M}function A(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,k,R,N,D=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),O=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,z=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,F={now:D,frame:function(t){var e=O(t);return{cancel:function(){return z(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.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 L||(L=a.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==k&&(k=a.matchMedia("(prefers-reduced-motion: reduce)")),k.matches)}},B={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!V&&N&&(q?j(t):R=t)}},V=!1,q=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,N),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),V=!0}a.document&&((N=a.document.createElement("img")).onload=function(){R&&j(R),R=null,q=!0},N.onerror=function(){V=!0,R=null},N.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",X=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function Z(t){return 0===t.indexOf("mapbox:")}X.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},X.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},X.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},X.prototype.normalizeStyleURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeGlyphsURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeSourceURL=function(t,e){if(!Z(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},X.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return Z(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},X.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!Z(t))return t;var r=K(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(F.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!B.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||B.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function W(t){return Y.test(t)}var H=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(H);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Q(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,r=Q(B.ACCESS_TOKEN);return e=r&&r.u?a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):B.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},$.prototype.fetchEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=a.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=a.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){E("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){E("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,r,n){var i=this;if(B.EVENTS_URL){var o=K(B.EVENTS_URL);o.params.push("access_token="+(n||B.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.0",skuId:G,userId:this.anonId},s=e?p(a,e):a,u={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(B.EVENTS_URL&&n||B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||W(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(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}($),nt=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){B.EVENTS_URL&&B.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return Z(t)||W(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Q(B.ACCESS_TOKEN),n=r?r.u:B.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}($)),it=nt.postTurnstileEvent.bind(nt),ot=new rt,at=ot.postMapLoadEvent.bind(ot),st=500,ut=50;function lt(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,pt=1/0;function ft(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var gt,yt,mt=function(t){function e(e,r,n){401===r&&W(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=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),vt=C()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},_t=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(vt())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:vt(),signal:n.signal}),o=!1,s=!1,u=(r=i.url).indexOf("sku=")>0&&W(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,o){if(!s){if(r&&"SecurityError"!==r.message&&E(r),n&&o)return c(n);var l=Date.now();a.fetch(i).then((function(r){if(r.ok){var n=u?r.clone():null;return c(r,n,l)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(lt(),tt){var n={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=P(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===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,n);lt(),tt&&tt.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return E(t.message)}))})))}}(i,n,u),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(lt(),!tt)return e(null);var r=ct(t.url);tt.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=P(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,l):l(null,null),{cancel:function(){s=!0,o||n.abort()}}}(t,e);if(C()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new a.XMLHttpRequest;for(var n in r.open(t.method||"GET",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 mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return _t(p(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return _t(p(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";gt=[],yt=0;var Et=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),yt>=B.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}yt++;var n=!1,i=function(){if(!n)for(n=!0,yt--;gt.length&&yt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Mt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Tt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},At=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Lt(t){var e=t.value;return e?[new At(t.key,e,"constants have been deprecated as of v8")]:[]}function kt(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 Ht=[zt,Ft,Bt,Ut,Vt,Xt,qt,Yt(jt),Zt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Ht;r255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var c=s.substr(0,u),h=s.substr(u+1,l-(u+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),g=o(h[2]),y=g<=.5?g*(d+1):g+d-g*d,m=2*g-y;return[n(255*a(m,y,f+1/3)),n(255*a(m,y,f)),n(255*a(m,y,f-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.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+")"},te.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]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=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"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.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}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.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 ae(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 te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],n++}else o=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Yt(o,a)}else r=he[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Xt,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Ft)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Yt(Bt))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Vt)))return null;var c=n[n.length-1];c.scale=s,c.font=u,c.textColor=l}else{var h=e.parse(t[o],1,jt);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)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 fe(n)},fe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Zt?new re("",r,null,null,null):new re(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var ge={"to-boolean":Ut,"to-color":Vt,"to-number":Ft,"to-string":Bt},ye=function(t,e){this.type=t,this.args=e};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=ge[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ee(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 Ie(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 Se(t,e){for(var r,n,i,o,a,s,u,l=!1,c=0,h=e.length;c0&&s<0||a<0&&s>0}function Me(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}be(e,t)}function Ne(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Be(t,e)&&(r=!1)})),r}Oe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ce("Input is not a number.");o=a-1}return 0}Ve.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)},Ve.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new pe(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var 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 o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof le)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ue)return t(e.boundExpression);if(e instanceof _e&&"error"===e.name)return!1;if(e instanceof xe)return!1;if(e instanceof Oe)return!1;var r=e instanceof ye||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof le})),!!n&&ze(e)&&Be(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new ve;try{o=new le(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}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.")},Ve.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 Ve(this.registry,n,e||null,i,this.errors)},Ve.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 Dt(n,t))},Ve.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var je=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=e.parse(s,l,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new je(i,r,n)},je.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[qe(e,n)].evaluate(t)},je.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 Xe=Object.freeze({__proto__:null,number:Ge,color:function(t,e,r){return new te(Ge(t.r,e.r,r),Ge(t.g,e.g,r),Ge(t.b,e.b,r),Ge(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ge(t,e[n],r)}))}}),Ze=6/29*3*(6/29),Ye=Math.PI/180,We=180/Math.PI;function He(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ze+4/29}function Ke(t){return t>6/29?t*t*t:Ze*(t-4/29)}function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Qe(t.r),r=Qe(t.g),n=Qe(t.b),i=He((.4124564*e+.3575761*r+.1804375*n)/.95047),o=He((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-He((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function tr(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*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Je(3.2404542*r-1.5371385*e-.4985314*n),Je(-.969266*r+1.8760108*e+.041556*n),Je(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function er(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var rr={forward:$e,reverse:tr,interpolate:function(t,e,r){return{l:Ge(t.l,e.l,r),a:Ge(t.a,e.a,r),b:Ge(t.b,e.b,r),alpha:Ge(t.alpha,e.alpha,r)}}},nr={forward:function(t){var e=$e(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*We;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Ye,r=t.c;return tr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:er(t.h,e.h,r),c:Ge(t.c,e.c,r),l:Ge(t.l,e.l,r),alpha:Ge(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:rr,hcl:nr}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))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,Ft)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=Vt:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var g=e.parse(p,d,l);if(!g)return null;l=l||g.type,u.push([h,g])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new or(l,r,n,i,u):e.error("Type "+Wt(l)+" is not interpolatable.")},or.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 o=qe(e,n),a=or.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Xe[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?nr.reverse(nr.interpolate(nr.forward(s),nr.forward(u),a)):rr.reverse(rr.interpolate(rr.forward(s),rr.forward(u),a))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},lr.prototype.eachChild=function(t){t(this.index),t(this.input)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cr=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);return r&&n?Jt(r.type,[Ut,Bt,Ft,zt,jt])?new cr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");return r.indexOf(e)>=0},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Ft,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);if(!r||!n)return null;if(!Jt(r.type,[Ut,Bt,Ft,zt,jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new hr(r,n,i):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Qt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(se(e))+" instead.");if(!Qt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};pr.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={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,se(p)))return null}else r=se(p);if(void 0!==i[String(p)])return l.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,jt);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,o,g):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=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,jt),n=e.parse(t[2],2,Ft);if(!r||!n)return null;if(!Jt(r.type,[Yt(jt),Bt,jt]))return e.error("Expected first argument to be of type array or string, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new dr(r.type,r,n,i):null}return new dr(r.type,r,n)},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Qt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Wt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},dr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},dr.prototype.outputDefined=function(){return!1},dr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var vr=mr("==",(function(t,e,r){return e===r}),yr),_r=mr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!yr(0,e,r,n)})),xr=mr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),wr=mr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Er=mr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Ir=function(t,e,r,n,i){this.type=Bt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Ir.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ft);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,Bt)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Bt)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Ft)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Ft))?null:new Ir(r,i,o,a,s)},Ir.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))},Ir.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)},Ir.prototype.outputDefined=function(){return!1},Ir.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 Sr=function(t){this.type=Ft,this.input=t};Sr.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 "+Wt(r.type)+" instead."):new Sr(r):null},Sr.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 ce("Expected value to be of type string or array, but found "+Wt(se(e))+" instead.")},Sr.prototype.eachChild=function(t){t(this.input)},Sr.prototype.outputDefined=function(){return!1},Sr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Cr={"==":vr,"!=":_r,">":br,"<":xr,">=":Er,"<=":wr,array:pe,at:lr,boolean:pe,case:fr,coalesce:sr,collator:xe,format:fe,image:de,in:cr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Sr,let:ur,literal:le,match:pr,number:pe,"number-format":Ir,object:pe,slice:dr,step:je,string:pe,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:Ue,within:Oe};function Pr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(r,n,i,a);if(s)throw new ce(s);return new te(r/255*a,n/255*a,i/255*a,a)}function Mr(t,e){return t in e}function Tr(t,e){var r=e[t];return void 0===r?null:r}function Ar(t){return{type:t}}function Lr(t){return{result:"success",value:t}}function kr(t){return{result:"error",value:t}}function Rr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Nr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Dr(t){return!!t.expression&&t.expression.interpolated}function Or(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function zr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Fr(t){return t}function Br(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ur(t,e,r,n,i){return Br(typeof r===i?n[r]:void 0,t.default,e.default)}function Vr(t,e,r){if("number"!==Or(r))return Br(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=qe(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Or(r))return Br(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=qe(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=Xe[e.type]||Fr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ir[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function jr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):Or(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Br(r,t.default,e.default)}_e.register(Cr,{error:[{kind:"error"},[Bt],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[Bt,[jt],function(t,e){return Wt(se(e[0].evaluate(t)))}],"to-rgba":[Yt(Ft,4),[Vt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Vt,[Ft,Ft,Ft],Pr],rgba:[Vt,[Ft,Ft,Ft,Ft],Pr],has:{type:Ut,overloads:[[[Bt],function(t,e){return Mr(e[0].evaluate(t),t.properties())}],[[Bt,qt],function(t,e){var r=e[1];return Mr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:jt,overloads:[[[Bt],function(t,e){return Tr(e[0].evaluate(t),t.properties())}],[[Bt,qt],function(t,e){var r=e[1];return Tr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[jt,[Bt],function(t,e){return Tr(e[0].evaluate(t),t.featureState||{})}],properties:[qt,[],function(t){return t.properties()}],"geometry-type":[Bt,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[Ft,[],function(t){return t.globals.zoom}],"heatmap-density":[Ft,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ft,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ft,Ar(Ft),function(t,e){for(var r=0,n=0,i=e;n":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ut,[Bt,jt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Ut,[jt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ut,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Yt(Bt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Yt(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[Bt,Yt(jt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ut,[Bt,Yt(jt)],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:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Ar(Ut),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Cr}function Zr(t,e){var r=new Ve(Cr,[],e?function(t){var e={color:Vt,string:Bt,number:Ft,enum:Bt,boolean:Ut,formatted:Xt,resolvedImage:Zt};return"array"===t.type?Yt(e[t.value]||jt,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?Lr(new Gr(n,e)):kr(r.errors)}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){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=o,this.expression.evaluate(this._evaluator)},Gr.prototype.evaluate=function(t,e,r,n,i,o){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=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Yr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Fe(e.expression)};Yr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Yr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Wr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Fe(e.expression),this.interpolationType=n};function Hr(t,e){if("error"===(t=Zr(t,e)).result)return t;var r=t.value.expression,n=ze(r);if(!n&&!Rr(e))return kr([new Dt("","data expressions not supported")]);var i=Be(r,["zoom"]);if(!i&&!Nr(e))return kr([new Dt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof sr)for(var n=0,i=e.args;nn.maximum?[new At(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function tn(t){var e,r,n,i=t.valueSpec,o=Rt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Or(t.value.stops)&&"array"===Or(t.value.stops[0])&&"object"===Or(t.value.stops[0][0]),c=Jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Qr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Or(r)&&0===r.length&&e.push(new At(t.key,r,"array must have at least one stop")),e},default:function(t){return En({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new At(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Dr(t.valueSpec)&&c.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Rr(t.valueSpec)?c.push(new At(t.key,t.value,"property functions not supported")):s&&!Nr(t.valueSpec)&&c.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new At(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==Or(o))return[new At(s,o,"array expected, "+Or(o)+" found")];if(2!==o.length)return[new At(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Or(o[0]))return[new At(s,o,"object expected, "+Or(o[0])+" found")];if(void 0===o[0].zoom)return[new At(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new At(s,o,"object stop key must have value")];if(n&&n>Rt(o[0].zoom))return[new At(s,o[0].zoom,"stop zoom values must appear in ascending order")];Rt(o[0].zoom)!==n&&(n=Rt(o[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:$r,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Xr(Nt(o[1]))?e.concat([new At(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(En({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=Or(t.value),u=Rt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new At(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 At(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Rr(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"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 un(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?ln(t[1],t[2],"=="):"!="===r?pn(ln(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?ln(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(un))):"all"===r?["all"].concat(t.slice(1).map(un)):"none"===r?["all"].concat(t.slice(1).map(un).map(pn)):"in"===r?cn(t[1],t.slice(2)):"!in"===r?pn(cn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?pn(hn(t[1])):"within"!==r||t}function ln(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 cn(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(sn)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function fn(t){return nn(Nt(t.value))?en(kt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Or(r))return[new At(n,r,"array expected, "+Or(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new At(n,r,"filter array must have at least 1 element")];switch(a=a.concat(rn({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Rt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Rt(r[1])&&a.push(new At(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new At(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Or(r[1]))&&a.push(new At(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=c[f+0]&&n>=c[f+1])?(a[p]=!0,o.push(l[p])):a[p]=!1}}},Nn.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=u;p<=c;p++)for(var f=l;f<=h;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,o,a,s))return}},Nn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Nn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Nn.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 c=t[l];u[l]=zn[s].shallow.indexOf(l)>=0?c:qn(c,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 jn(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||Un(t)||Vn(t)||ArrayBuffer.isView(t)||t instanceof Dn)return t;if(Array.isArray(t))return t.map(jn);if("object"==typeof t){var e=t.$name||"Object",r=zn[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,o=Object.keys(t);i=0?s:jn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Gn=function(){this.first=!0};Gn.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=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Zn(t){for(var e=0,r=t;e=65097&&t<=65103)||Xn["CJK Compatibility Ideographs"](t)||Xn["CJK Compatibility"](t)||Xn["CJK Radicals Supplement"](t)||Xn["CJK Strokes"](t)||!(!Xn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Xn["CJK Unified Ideographs Extension A"](t)||Xn["CJK Unified Ideographs"](t)||Xn["Enclosed CJK Letters and Months"](t)||Xn["Hangul Compatibility Jamo"](t)||Xn["Hangul Jamo Extended-A"](t)||Xn["Hangul Jamo Extended-B"](t)||Xn["Hangul Jamo"](t)||Xn["Hangul Syllables"](t)||Xn.Hiragana(t)||Xn["Ideographic Description Characters"](t)||Xn.Kanbun(t)||Xn["Kangxi Radicals"](t)||Xn["Katakana Phonetic Extensions"](t)||Xn.Katakana(t)&&12540!==t||!(!Xn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Xn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Xn["Unified Canadian Aboriginal Syllabics"](t)||Xn["Unified Canadian Aboriginal Syllabics Extended"](t)||Xn["Vertical Forms"](t)||Xn["Yijing Hexagram Symbols"](t)||Xn["Yi Syllables"](t)||Xn["Yi Radicals"](t))))}function Wn(t){return!(Yn(t)||function(t){return!!(Xn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Xn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Xn["Letterlike Symbols"](t)||Xn["Number Forms"](t)||Xn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Xn["Control Pictures"](t)&&9251!==t||Xn["Optical Character Recognition"](t)||Xn["Enclosed Alphanumerics"](t)||Xn["Geometric Shapes"](t)||Xn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Xn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Xn["CJK Symbols and Punctuation"](t)||Xn.Katakana(t)||Xn["Private Use Area"](t)||Xn["CJK Compatibility Forms"](t)||Xn["Small Form Variants"](t)||Xn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Hn(t){return t>=1424&&t<=2303||Xn["Arabic Presentation Forms-A"](t)||Xn["Arabic Presentation Forms-B"](t)}function Kn(t,e){return!(!e&&Hn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Xn.Khmer(t))}function Jn(t){for(var e=0,r=t;e-1&&($n="error"),Qn&&Qn(t)};function ri(){ni.fire(new Ct("pluginStateChange",{pluginStatus:$n,pluginURL:ti}))}var ni=new Mt,ii=function(){return $n},oi=function(){if("deferred"!==$n||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$n="loading",ri(),ti&&xt({url:ti},(function(t){t?ei(t):($n="loaded",ri())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$n||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===$n},setState:function(t){$n=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=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 Gn,this.transition={})};si.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 ui=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(zr(t))return new Kr(t,e);if(Xr(t)){var r=Hr(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=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ui.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var li=function(t){this.property=t,this.value=new ui(t,void 0)};li.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},li.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ci.prototype.getValue=function(t){return b(this._values[t].value.value)},ci.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].value=new ui(this._values[t].property,null===e?void 0:b(e))},ci.prototype.getTransition=function(t){return b(this._values[t].transition)},ci.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].transition=b(e)||void 0},ci.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)}(a))}return i};var pi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};pi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new gi(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(mi),_i=function(t){this.specification=t};_i.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 si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},_i.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},_i.prototype.interpolate=function(t){return t};var xi=function(t){this.specification=t};xi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},xi.prototype.interpolate=function(){return!1};var bi=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 ui(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new li(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Fn("DataDrivenProperty",mi),Fn("DataConstantProperty",yi),Fn("CrossFadedDataDrivenProperty",vi),Fn("CrossFadedProperty",_i),Fn("ColorRampProperty",xi);var wi=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),r.layout&&(this._unevaluatedLayout=new fi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ci(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 gi(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(Ln,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(An,"layers."+this.id+".paint."+t,t,e,r))return!1;if(v(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"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&kn(this,t.call(Mn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Tt,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 di&&Rr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Mt),Ei={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ii=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},Si=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ci(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=Ei[t.type].BYTES_PER_ELEMENT,o=r=Pi(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Pi(r,Math.max(n,e)),alignment:e}}function Pi(t,e){return Math.ceil(t/e)*e}Si.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Si.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},Si.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Si.prototype.clear=function(){this.length=0},Si.prototype.resize=function(t){this.reserve(t),this.length=t},Si.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)}},Si.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Mi=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}(Si);Mi.prototype.bytesPerElement=4,Fn("StructArrayLayout2i4",Mi);var Ti=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 o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Si);Ti.prototype.bytesPerElement=8,Fn("StructArrayLayout4i8",Ti);var Ai=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.int16[s+5]=a,t},e}(Si);Ai.prototype.bytesPerElement=12,Fn("StructArrayLayout2i4i12",Ai);var Li=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.uint8[u+7]=a,t},e}(Si);Li.prototype.bytesPerElement=8,Fn("StructArrayLayout2i4ub8",Li);var ki=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}(Si);ki.prototype.bytesPerElement=8,Fn("StructArrayLayout2f8",ki);var Ri=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,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c){var h=10*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]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=l,this.uint16[h+9]=c,t},e}(Si);Ri.prototype.bytesPerElement=20,Fn("StructArrayLayout10ui20",Ri);var Ni=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,o,a,s,u,l,c,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,l,c,h)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p){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]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,t},e}(Si);Ni.prototype.bytesPerElement=24,Fn("StructArrayLayout4i4ui4i24",Ni);var Di=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}(Si);Di.prototype.bytesPerElement=12,Fn("StructArrayLayout3f12",Di);var Oi=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}(Si);Oi.prototype.bytesPerElement=4,Fn("StructArrayLayout1ul4",Oi);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[h+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Si);zi.prototype.bytesPerElement=20,Fn("StructArrayLayout6i1ul2ui20",zi);var Fi=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,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){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]=o,this.int16[s+5]=a,t},e}(Si);Fi.prototype.bytesPerElement=12,Fn("StructArrayLayout2i2i2i12",Fi);var Bi=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 o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Si);Bi.prototype.bytesPerElement=16,Fn("StructArrayLayout2f1f2i16",Bi);var Ui=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 o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Si);Ui.prototype.bytesPerElement=12,Fn("StructArrayLayout2ub2f12",Ui);var Vi=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}(Si);Vi.prototype.bytesPerElement=6,Fn("StructArrayLayout3ui6",Vi);var qi=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,o,a,s,u,l,c,h,p,f,d,g,y){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y,m){var v=24*t,_=12*t,x=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[_+2]=o,this.uint32[_+3]=a,this.uint32[_+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=l,this.uint16[v+12]=c,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=g,this.uint32[_+10]=y,this.int16[v+22]=m,t},e}(Si);qi.prototype.bytesPerElement=48,Fn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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,o,a,s,u,l,c,h,p,f,d,g,y,m,v,_,x,b,w,E,I,S,C,P){var M=this.length;return this.resize(M+1),this.emplace(M,t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y,m,v,_,x,b,w,E,I,S,C,P)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y,m,v,_,x,b,w,E,I,S,C,P,M){var T=34*t,A=17*t;return this.int16[T+0]=e,this.int16[T+1]=r,this.int16[T+2]=n,this.int16[T+3]=i,this.int16[T+4]=o,this.int16[T+5]=a,this.int16[T+6]=s,this.int16[T+7]=u,this.uint16[T+8]=l,this.uint16[T+9]=c,this.uint16[T+10]=h,this.uint16[T+11]=p,this.uint16[T+12]=f,this.uint16[T+13]=d,this.uint16[T+14]=g,this.uint16[T+15]=y,this.uint16[T+16]=m,this.uint16[T+17]=v,this.uint16[T+18]=_,this.uint16[T+19]=x,this.uint16[T+20]=b,this.uint16[T+21]=w,this.uint16[T+22]=E,this.uint32[A+12]=I,this.float32[A+13]=S,this.float32[A+14]=C,this.float32[A+15]=P,this.float32[A+16]=M,t},e}(Si);ji.prototype.bytesPerElement=68,Fn("StructArrayLayout8i15ui1ul4f68",ji);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Si);Gi.prototype.bytesPerElement=4,Fn("StructArrayLayout1f4",Gi);var Xi=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}(Si);Xi.prototype.bytesPerElement=6,Fn("StructArrayLayout3i6",Xi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Si);Zi.prototype.bytesPerElement=8,Fn("StructArrayLayout1ul2ui8",Zi);var Yi=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}(Si);Yi.prototype.bytesPerElement=4,Fn("StructArrayLayout2ui4",Yi);var Wi=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}(Si);Wi.prototype.bytesPerElement=2,Fn("StructArrayLayout1ui2",Wi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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 o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Si);Hi.prototype.bytesPerElement=16,Fn("StructArrayLayout4f16",Hi);var Ki=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}(Ii);Ki.prototype.size=20;var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ki(this,t)},e}(zi);Fn("CollisionBoxArray",Ji);var Qi=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}(Ii);Qi.prototype.size=48;var $i=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 Qi(this,t)},e}(qi);Fn("PlacedSymbolArray",$i);var to=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}(Ii);to.prototype.size=68;var eo=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 to(this,t)},e}(ji);Fn("SymbolInstanceArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Gi);Fn("GlyphOffsetArray",ro);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.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}(Xi);Fn("SymbolLineVertexArray",no);var io=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}(Ii);io.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(Zi);Fn("FeatureIndexArray",oo);var ao=Ci([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function uo(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&E("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.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},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>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)))*a+(((u>>>16)*a&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}})),ho=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<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,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),po=co,fo=ho;po.murmur3=co,po.murmur2=fo;var go=function(){this.ids=[],this.positions=[],this.indexed=!1};go.prototype.add=function(t,e,r,n){this.ids.push(mo(t)),this.positions.push(e,r,n)},go.prototype.getPositions=function(t){for(var e=mo(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},go.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],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;vo(e,a,s),vo(r,3*a,3*s),vo(r,3*a+1,3*s+1),vo(r,3*a+2,3*s+2)}s-na.x+1||ua.y+1)&&E("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Vo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Uo(t):[]}}function qo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var jo=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 Mi,this.indexArray=new Vi,this.segments=new so,this.programConfigurations=new Do(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Go(t,e){for(var r=0;r1){if(Wo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Qo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function $o(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ta(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 o=I(t,e,r[0]);return o!==I(t,e,r[1])||o!==I(t,e,r[2])||o!==I(t,e,r[3])}function ea(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ra(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function na(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u=8192||c<0||c>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;qo(this.layoutVertexArray,l,c,-1,-1),qo(this.layoutVertexArray,l,c,1,-1),qo(this.layoutVertexArray,l,c,1,1),qo(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Fn("CircleBucket",jo,{omit:["layers"]});var ia=new bi({"circle-sort-key":new mi(Tt.layout_circle["circle-sort-key"])}),oa={paint:new bi({"circle-radius":new mi(Tt.paint_circle["circle-radius"]),"circle-color":new mi(Tt.paint_circle["circle-color"]),"circle-blur":new mi(Tt.paint_circle["circle-blur"]),"circle-opacity":new mi(Tt.paint_circle["circle-opacity"]),"circle-translate":new yi(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new yi(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new yi(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new yi(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mi(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mi(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mi(Tt.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(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 ua(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],g=e[12],y=e[13],m=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*h+w*g,t[1]=_*i+x*u+b*p+w*y,t[2]=_*o+x*l+b*f+w*m,t[3]=_*a+x*c+b*d+w*v,t[4]=(_=r[4])*n+(x=r[5])*s+(b=r[6])*h+(w=r[7])*g,t[5]=_*i+x*u+b*p+w*y,t[6]=_*o+x*l+b*f+w*m,t[7]=_*a+x*c+b*d+w*v,t[8]=(_=r[8])*n+(x=r[9])*s+(b=r[10])*h+(w=r[11])*g,t[9]=_*i+x*u+b*p+w*y,t[10]=_*o+x*l+b*f+w*m,t[11]=_*a+x*c+b*d+w*v,t[12]=(_=r[12])*n+(x=r[13])*s+(b=r[14])*h+(w=r[15])*g,t[13]=_*i+x*u+b*p+w*y,t[14]=_*o+x*l+b*f+w*m,t[15]=_*a+x*c+b*d+w*v,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 la,ca=ua;function ha(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}la=new aa(3),aa!=Float32Array&&(la[0]=0,la[1]=0,la[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var pa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype.queryRadius=function(t){var e=t;return ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+ra(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=na(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?u:function(t,e){return t.map((function(t){return fa(t,e)}))}(u,s),p=c?l*a:l,f=0,d=n;ft.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 a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var d=r;do&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return La(p,f,r,n,i,l),f}function Ta(t,e,r,n,i){var o,a;if(i===$a(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Ka(o,t[o],t[o+1],a);return a&&Ga(a,a.next)&&(Ja(a),a=a.next),a}function Aa(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ga(n,n.next)&&0!==ja(n.prev,n,n.next))n=n.next;else{if(Ja(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function La(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ba(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,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,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--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Ra(t,n,i,o):ka(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ja(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?La(t=Na(Aa(t),e,r),e,r,n,i,o,2):2===a&&Da(t,e,r,n,i,o):La(Aa(t),e,r,n,i,o,1);break}}}function ka(t){var e=t.prev,r=t,n=t.next;if(ja(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Va(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ja(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ra(t,e,r,n){var i=t.prev,o=t,a=t.next;if(ja(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=Ba(i.x=l&&p&&p.z<=c;){if(h!==t.prev&&h!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=l;){if(h!==t.prev&&h!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&Va(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Na(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ga(i,o)&&Xa(i,n,n.next,o)&&Wa(i,o)&&Wa(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ja(n),Ja(n.next),n=t=o),n=n.next}while(n!==t);return Aa(n)}function Da(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&qa(a,s)){var u=Ha(a,s);return a=Aa(a,a.next),u=Aa(u,u.next),La(a,e,r,n,i,o),void La(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Oa(t,e){return t.x-e.x}function za(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&i!==n.x&&Va(or.x||n.x===r.x&&Fa(r,n)))&&(r=n,p=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ha(e,t);Aa(e,e.next),Aa(r,r.next)}}function Fa(t,e){return ja(t.prev,t,e.prev)<0&&ja(e.next,t,t.next)<0}function Ba(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 Ua(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function qa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Xa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Wa(t,e)&&Wa(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ja(t.prev,t,e.prev)||ja(t,e.prev,e))||Ga(t,e)&&ja(t.prev,t,t.next)>0&&ja(e.prev,e,e.next)>0)}function ja(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ga(t,e){return t.x===e.x&&t.y===e.y}function Xa(t,e,r,n){var i=Ya(ja(t,e,r)),o=Ya(ja(t,e,n)),a=Ya(ja(r,n,t)),s=Ya(ja(r,n,e));return i!==o&&a!==s||!(0!==i||!Za(t,r,e))||!(0!==o||!Za(t,n,e))||!(0!==a||!Za(r,t,n))||!(0!==s||!Za(r,e,n))}function Za(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 Ya(t){return t>0?1:t<0?-1:0}function Wa(t,e){return ja(t.prev,t,t.next)<0?ja(t,e,t.next)>=0&&ja(t,t.prev,e)>=0:ja(t,e,t.prev)<0||ja(t,t.next,e)<0}function Ha(t,e){var r=new Qa(t.i,t.x,t.y),n=new Qa(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ka(t,e,r,n){var i=new Qa(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 Ja(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Qa(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 $a(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+c)),Math.min(i,Math.floor(r+(a-s)*l/a+c)),o)}var h=e[r],p=n,f=i;for(es(e,n,r),o(e[i],h)>0&&es(e,n,i);p0;)f--}0===o(e[n],h)?es(e,n,f):es(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||rs)}function es(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function rs(t,e){return te?1:0}function ns(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},Ca.default=Pa;var ss=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Mi,this.indexArray=new Vi,this.indexArray2=new Yi,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,r){this.hasPattern=os("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},fs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=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),(o+=t.readSVarint())l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},fs.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=fs.types[this.type];function c(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 _s(t,e,r){if(3===t){var n=new ys(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ms.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 ps(this._pbf,e,this.extent,this._keys,this._values)};var xs={VectorTile:function(t,e){this.layers=t.readFields(_s,{},e)},VectorTileFeature:ps,VectorTileLayer:ys},bs=xs.VectorTileFeature.types,ws=Math.pow(2,13);function Es(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*ws)+a,i*ws*2,o*ws*2,Math.round(s))}var Is=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 Ai,this.indexArray=new Vi,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ss(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Is.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||k.every((function(t){return t.y<0}))||k.every((function(t){return t.y>8192}))))for(var g=0,y=0;y=1){var v=d[y-1];if(!Ss(m,v)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=m.sub(v)._perp()._unit(),x=v.dist(m);g+x>32768&&(g=0),Es(this.layoutVertexArray,m.x,m.y,_.x,_.y,0,0,g),Es(this.layoutVertexArray,m.x,m.y,_.x,_.y,0,1,g),Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,g+=x),Es(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,g);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+u>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===bs[t.type]){for(var w=[],E=[],I=h.vertexLength,S=0,C=s;S=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(E&&m>l){var S=c.dist(f);if(S>2*h){var C=c.sub(c.sub(f)._mult(h/S)._round());this.updateDistance(f,C),this.addCurrentVertex(C,g,0,0,p),f=C}}var P=f&&d,M=P?r:s?"butt":n;if(P&&"round"===M&&(bi&&(M="bevel"),"bevel"===M&&(b>2&&(M="flipbevel"),b100)v=y.mult(-1);else{var T=b*g.add(y).mag()/g.sub(y).mag();v._perp()._mult(T*(I?-1:1))}this.addCurrentVertex(c,v,0,0,p),this.addCurrentVertex(c,v.mult(-1),0,0,p)}else if("bevel"===M||"fakeround"===M){var A=-Math.sqrt(b*b-1),L=I?A:0,k=I?0:A;if(f&&this.addCurrentVertex(c,g,L,k,p),"fakeround"===M)for(var R=Math.round(180*w/Math.PI/20),N=1;N2*h){var U=c.add(d.sub(c)._mult(h/B)._round());this.updateDistance(c,U),this.addCurrentVertex(U,y,0,0,p),c=U}}}}},Ds.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>Ns/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Ds.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Ns-1):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===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Ds.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ds.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Fn("LineBucket",Ds,{omit:["layers","patternFeatures"]});var Os=new bi({"line-cap":new yi(Tt.layout_line["line-cap"]),"line-join":new mi(Tt.layout_line["line-join"]),"line-miter-limit":new yi(Tt.layout_line["line-miter-limit"]),"line-round-limit":new yi(Tt.layout_line["line-round-limit"]),"line-sort-key":new mi(Tt.layout_line["line-sort-key"])}),zs={paint:new bi({"line-opacity":new mi(Tt.paint_line["line-opacity"]),"line-color":new mi(Tt.paint_line["line-color"]),"line-translate":new yi(Tt.paint_line["line-translate"]),"line-translate-anchor":new yi(Tt.paint_line["line-translate-anchor"]),"line-width":new mi(Tt.paint_line["line-width"]),"line-gap-width":new mi(Tt.paint_line["line-gap-width"]),"line-offset":new mi(Tt.paint_line["line-offset"]),"line-blur":new mi(Tt.paint_line["line-blur"]),"line-dasharray":new _i(Tt.paint_line["line-dasharray"]),"line-pattern":new vi(Tt.paint_line["line-pattern"]),"line-gradient":new xi(Tt.paint_line["line-gradient"])}),layout:Os},Fs=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 si(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=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(mi))(zs.paint.properties["line-width"].specification);Fs.useIntegerZoom=!0;var Bs=function(t){function e(e){t.call(this,e,zs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof je,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Fs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ds(t)},e.prototype.queryRadius=function(t){var e=t,r=Us(ea("line-width",this,e),ea("line-gap-width",this,e)),n=ea("line-offset",this,e);return r/2+Math.abs(n)+ra(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var u=na(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Us(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var Vs=Ci([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=Ci([{name:"a_projected_pos",components:3,type:"Float32"}],4),js=(Ci([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ci([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Gs=(Ci([{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"}]),Ci([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Xs=Ci([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Zs(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()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ci([{name:"triangle",components:3,type:"Uint16"}]),Ci([{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"}]),Ci([{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"}]),Ci([{type:"Float32",name:"offsetX"}]),Ci([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ys={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ws=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},Hs=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*g},Ks=Js;function Js(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Js.Varint=0,Js.Fixed64=1,Js.Bytes=2,Js.Fixed32=5;var Qs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $s(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function tu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function eu(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 ru(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function fu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function du(t,e,r){1===t&&r.readMessage(gu,e)}function gu(t,e,r){if(3===t){var n=r.readMessage(yu,{}),i=n.width,o=n.height,a=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new va({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function yu(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 mu(t){for(var e=0,r=0,n=0,i=t;n=0;p--){var f=a[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=a.pop();p>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*fu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ws(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ws(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,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return tu(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return tu(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&&Qs?function(t,e,r){return Qs.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+c>r)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=c}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!==Js.Bytes)return t.push(this.readVarint(e));var r=$s(this);for(t=t||[];this.pos127;);else if(e===Js.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Js.Fixed32)this.pos+=4;else{if(e!==Js.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;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,o=0;o55295&&n<57344){if(!i){n>56319||o+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&&eu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Hs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Hs(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&&eu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cu,e)},writeBytesField:function(t,e){this.writeTag(t,Js.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Js.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Js.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var vu=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},_u={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};_u.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},_u.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},_u.tlbr.get=function(){return this.tl.concat(this.br)},_u.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(vu.prototype,_u);var xu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=mu(i),a=new _a({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;_a.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var h=e[c],p=n[c].paddedRect,f=p.x+1,d=p.y+1,g=h.data.width,y=h.data.height;_a.copy(h.data,a,{x:0,y:0},{x:f,y:d},h.data),_a.copy(h.data,a,{x:0,y:y-1},{x:f,y:d-1},{width:g,height:1}),_a.copy(h.data,a,{x:0,y:0},{x:f,y:d+y},{width:g,height:1}),_a.copy(h.data,a,{x:g-1,y:0},{x:f-1,y:d},{width:1,height:y}),_a.copy(h.data,a,{x:0,y:0},{x:f+g,y:d},{width:1,height:y})}this.image=a,this.iconPositions=r,this.patternPositions=n};xu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new vu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},xu.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)},xu.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]})}},Fn("ImagePosition",vu),Fn("ImageAtlas",xu);var bu={horizontal:1,vertical:2,horizontalOnly:3},wu=function(){this.scale=1,this.fontStack="",this.imageName=null};wu.forText=function(t,e){var r=new wu;return r.scale=t||1,r.fontStack=e,r},wu.forImage=function(t){var e=new wu;return e.imageName=t,e};var Eu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Iu(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g){var y,m=Eu.fromFeature(t,i);h===bu.vertical&&m.verticalizePunctuation();var v=ai.processBidirectionalText,_=ai.processStyledBidirectionalText;if(v&&1===m.sections.length){y=[];for(var x=0,b=v(m.toString(),Lu(m,l,o,e,n,f,d));x0&&F>S&&(S=F)}else{var B=r[P.fontStack],U=B&&B[T];if(U&&U.rect)k=U.rect,L=U.metrics;else{var V=e[P.fontStack],q=V&&V[T];if(!q)continue;L=q.metrics}A=24*(b-P.scale)}D?(t.verticalizable=!0,I.push({glyph:T,imageName:R,x:p,y:f+A,vertical:D,scale:P.scale,fontStack:P.fontStack,sectionIndex:M,metrics:L,rect:k}),p+=N*P.scale+l):(I.push({glyph:T,imageName:R,x:p,y:f+A,vertical:D,scale:P.scale,fontStack:P.fontStack,sectionIndex:M,metrics:L,rect:k}),p+=L.advance*P.scale+l)}0!==I.length&&(d=Math.max(p-l,d),Ru(I,0,I.length-1,y,S)),p=0;var j=o*b+S;E.lineOffset=Math.max(S,w),f+=j,g=Math.max(j,g),++m}else f+=o,++m}var G,X=f- -17,Z=ku(a),Y=Z.horizontalAlign,W=Z.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,c=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var h=0,p=t;h=0&&n>=t&&Su[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Eu.prototype.substring=function(t,e){var r=new Eu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Eu.prototype.toString=function(){return this.text},Eu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Eu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(wu.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 Su={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Cu={};function Pu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Mu(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,p=0;p-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function Vu(t){for(var e=0,r=0;rl){var d=(l-u)/f,g=Ge(h.x,p.x,d),y=Ge(h.y,p.y,d),m=new Du(g,y,p.angleTo(h),c);return m._round(),!a||Uu(t,m,s,a,e)?m:void 0}u+=f}}function Xu(t,e,r,n,i,o,a,s,u){var l=qu(n,o,a),c=ju(n,i),h=c*a,p=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h=0&&b=0&&w=0&&f+c<=h){var E=new Du(b,w,_,g);E._round(),i&&!Uu(e,E,a,i,o)||d.push(E)}}p+=v}return u||d.length||s||(d=t(e,p/2,n,i,o,a,s,!0,l)),d}(t,p?e/2*s%e:(c/2+2*o)*a*s%e,e,l,r,h,p,!1,u)}function Zu(t,e,r,n,o){for(var a=[],s=0;s=n&&p.x>=n||(h.x>=n?h=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=n&&(p=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round():p.y>=o&&(p=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round()),l&&h.equals(l[l.length-1])||a.push(l=[h]),l.push(p)))))}return a}function Yu(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},g=p.reduce(d,0),y=f.reduce(d,0),m=u-g,v=l-y,_=0,x=g,b=0,w=y,E=0,I=m,S=0,C=v;if(a.content&&n){var P=a.content;_=Wu(p,0,P[0]),b=Wu(f,0,P[1]),x=Wu(p,P[0],P[2]),w=Wu(f,P[1],P[3]),E=P[0]-_,S=P[1]-b,I=P[2]-P[0]-x,C=P[3]-P[1]-w}var M=function(n,o,u,l){var p=Ku(n.stretch-_,x,c,t.left),f=Ju(n.fixed-E,I,n.stretch,g),d=Ku(o.stretch-b,w,h,t.top),m=Ju(o.fixed-S,C,o.stretch,y),v=Ku(u.stretch-_,x,c,t.left),P=Ju(u.fixed-E,I,u.stretch,g),M=Ku(l.stretch-b,w,h,t.top),T=Ju(l.fixed-S,C,l.stretch,y),A=new i(p,d),L=new i(v,d),k=new i(v,M),R=new i(p,M),N=new i(f/s,m/s),D=new i(P/s,T/s),O=e*Math.PI/180;if(O){var z=Math.sin(O),F=Math.cos(O),B=[F,-z,z,F];A._matMult(B),L._matMult(B),R._matMult(B),k._matMult(B)}var U=n.stretch+n.fixed,V=o.stretch+o.fixed;return{tl:A,tr:L,bl:R,br:k,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+V,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:N,pixelOffsetBR:D,minFontScaleX:I/s/c,minFontScaleY:C/s/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var T=Hu(p,m,g),A=Hu(f,v,y),L=0;L0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var g=a.top*s-u,y=a.bottom*s+u,m=a.left*s-u,v=a.right*s+u,_=a.collisionPadding;if(_&&(m-=_[0]*s,g-=_[1]*s,v+=_[2]*s,y+=_[3]*s),c){var x=new i(m,g),b=new i(v,g),w=new i(m,y),E=new i(v,y),I=c*Math.PI/180;x._rotate(I),b._rotate(I),w._rotate(I),E._rotate(I),m=Math.min(x.x,b.x,w.x,E.x),v=Math.max(x.x,b.x,w.x,E.x),g=Math.min(x.y,b.y,w.y,E.y),y=Math.max(x.y,b.y,w.y,E.y)}t.emplaceBack(e.x,e.y,m,g,v,y,r,n,o)}this.boxEndIndex=t.length},$u=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tl),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 tl(t,e){return te?1:0}function el(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;la)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var h=Math.min(a-n,s-o),p=h/2,f=new $u([],rl);if(0===h)return new i(n,o);for(var d=n;dy.d||!y.d)&&(y=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,m)),v.max-y.d<=e||(f.push(new nl(v.p.x-(p=v.h/2),v.p.y-p,p,t)),f.push(new nl(v.p.x+p,v.p.y-p,p,t)),f.push(new nl(v.p.x-p,v.p.y+p,p,t)),f.push(new nl(v.p.x+p,v.p.y+p,p,t)),m+=4)}return r&&(console.log("num probes: "+m),console.log("best distance: "+y.d)),y.p}function rl(t,e){return e.max-t.max}function nl(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!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(r=!r),n=Math.min(n,Jo(t,l,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}$u.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$u.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}},$u.prototype.peek=function(){return this.data[0]},$u.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},$u.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var il=Number.POSITIVE_INFINITY;function ol(t,e){return e[1]!==il?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 al(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sl(t,e,r,n,o,a,s,u,l,c,h,p,f,d,g){var y=function(t,e,r,n,o,a,s,u){for(var l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=0,p=e.positionedLines;h32640&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===m.kind&&((v=[128*d.compositeTextSizes[0].evaluate(s,{},g),128*d.compositeTextSizes[1].evaluate(s,{},g)])[0]>32640||v[1]>32640)&&E(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,v,u,a,s,c,e,l.lineStartIndex,l.lineLength,f,g);for(var _=0,x=h;_=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],u||l){for(var h=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new si(this.zoom),g=0,y=t;g=0;for(var k=0,R=I.sections;k=0;s--)o[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},ml.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ml.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ml.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ml.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ml.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)}},Fn("SymbolBucket",ml,{omit:["layers","collisionBoxArray","features","compareText"]}),ml.MAX_GLYPHS=65535,ml.addDynamicAttributes=fl;var vl=new bi({"symbol-placement":new yi(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new yi(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new yi(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mi(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new yi(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new yi(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new yi(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new yi(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new yi(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new mi(Tt.layout_symbol["icon-size"]),"icon-text-fit":new yi(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new yi(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new mi(Tt.layout_symbol["icon-image"]),"icon-rotate":new mi(Tt.layout_symbol["icon-rotate"]),"icon-padding":new yi(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new yi(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new mi(Tt.layout_symbol["icon-offset"]),"icon-anchor":new mi(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new yi(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new yi(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new yi(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new mi(Tt.layout_symbol["text-field"]),"text-font":new mi(Tt.layout_symbol["text-font"]),"text-size":new mi(Tt.layout_symbol["text-size"]),"text-max-width":new mi(Tt.layout_symbol["text-max-width"]),"text-line-height":new yi(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new mi(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new mi(Tt.layout_symbol["text-justify"]),"text-radial-offset":new mi(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new yi(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new mi(Tt.layout_symbol["text-anchor"]),"text-max-angle":new yi(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new yi(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new mi(Tt.layout_symbol["text-rotate"]),"text-padding":new yi(Tt.layout_symbol["text-padding"]),"text-keep-upright":new yi(Tt.layout_symbol["text-keep-upright"]),"text-transform":new mi(Tt.layout_symbol["text-transform"]),"text-offset":new mi(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new yi(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new yi(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new yi(Tt.layout_symbol["text-optional"])}),_l={paint:new bi({"icon-opacity":new mi(Tt.paint_symbol["icon-opacity"]),"icon-color":new mi(Tt.paint_symbol["icon-color"]),"icon-halo-color":new mi(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new mi(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mi(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new yi(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new yi(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new mi(Tt.paint_symbol["text-opacity"]),"text-color":new mi(Tt.paint_symbol["text-color"],{runtimeType:Vt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new mi(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new mi(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new mi(Tt.paint_symbol["text-halo-blur"]),"text-translate":new yi(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new yi(Tt.paint_symbol["text-translate-anchor"])}),layout:vl},xl=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:zt,this.defaultValue=t};xl.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},xl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},xl.prototype.outputDefined=function(){return!1},xl.prototype.serialize=function(){return null},Fn("FormatSectionOverride",xl,{omit:["defaultValue"]});var bl=function(t){function e(e){t.call(this,e,_l)}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=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},Dl.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else C()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Dl.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Dl.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(jn(e.error)):n(null,jn(e.data)))}else{var i=!1,o=T(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,o)},o)}:function(t){i=!0},s=null,u=jn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Dl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var zl=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]))};zl.prototype.setNorthEast=function(t){return this._ne=t instanceof Fl?new Fl(t.lng,t.lat):Fl.convert(t),this},zl.prototype.setSouthWest=function(t){return this._sw=t instanceof Fl?new Fl(t.lng,t.lat):Fl.convert(t),this},zl.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Fl)e=t,r=t;else{if(!(t instanceof zl))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(zl.convert(t)):this.extend(Fl.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 Fl(e.lng,e.lat),this._ne=new Fl(r.lng,r.lat)),this},zl.prototype.getCenter=function(){return new Fl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},zl.prototype.getSouthWest=function(){return this._sw},zl.prototype.getNorthEast=function(){return this._ne},zl.prototype.getNorthWest=function(){return new Fl(this.getWest(),this.getNorth())},zl.prototype.getSouthEast=function(){return new Fl(this.getEast(),this.getSouth())},zl.prototype.getWest=function(){return this._sw.lng},zl.prototype.getSouth=function(){return this._sw.lat},zl.prototype.getEast=function(){return this._ne.lng},zl.prototype.getNorth=function(){return this._ne.lat},zl.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},zl.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},zl.prototype.isEmpty=function(){return!(this._sw&&this._ne)},zl.prototype.contains=function(t){var e=Fl.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},zl.convert=function(t){return!t||t instanceof zl?t:new zl(t)};var Fl=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Fl.prototype.wrap=function(){return new Fl(h(this.lng,-180,180),this.lat)},Fl.prototype.toArray=function(){return[this.lng,this.lat]},Fl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Fl.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))},Fl.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 zl(new Fl(this.lng-r,this.lat-e),new Fl(this.lng+r,this.lat+e))},Fl.convert=function(t){if(t instanceof Fl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Fl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Fl(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 Bl=2*Math.PI*6371008.8;function Ul(t){return Bl*Math.cos(t*Math.PI/180)}function Vl(t){return(180+t)/360}function ql(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jl(t,e){return t/Ul(e)}function Gl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Xl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Xl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Fl.convert(t);return new Xl(Vl(r.lng),ql(r.lat),jl(e,r.lat))},Xl.prototype.toLngLat=function(){return new Fl(360*this.x-180,Gl(this.y))},Xl.prototype.toAltitude=function(){return this.z*Ul(Gl(this.y))},Xl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Bl*(t=Gl(this.y),1/Math.cos(t*Math.PI/180));var t};var Zl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Hl(0,t,t,e,r)};Zl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Zl.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=Ol(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=Ol(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new Wl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Wl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Wl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Hl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Hl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Wl.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},Wl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Wl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Wl(e,this.wrap,e,r,n),new Wl(e,this.wrap,e,r+1,n),new Wl(e,this.wrap,e,r,n+1),new Wl(e,this.wrap,e,r+1,n+1)]},Wl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=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)},Kl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Kl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Kl.prototype.getPixels=function(){return new _a({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kl.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,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},ec.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new xs.VectorTile(new Ks(this.rawTileData)).layers,this.sourceLayerCoder=new Jl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ec.prototype.query=function(t,e,r,n){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=an(a.filter),l=t.queryGeometry,c=t.queryPadding*s,h=nc(l),p=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),f=nc(t.cameraQueryGeometry),d=0,g=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var c=0,h=l;c=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var g=Vo(d,!0);if(!i.filter(new si(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),d))return;for(var y=this.getId(d,f),m=0;mn)i=!1;else if(e)if(this.expirationTimeut&&(t.getActor().send("enforceCacheSizeLimit",st),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Zu,t.clone=function(t){var e=new aa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Xs,t.config=B,t.create=function(){var t=new aa(16);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new aa(9);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Zr,t.createLayout=Ci,t.createStyleLayer=function(t){return"custom"===t.type?new Cl(t):new Pl[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ge,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ks(t).readFields(du,[])},t.pbf=Ks,t.performSymbolLayout=function(t,e,r,n,i,o,a){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 c=t.textSizeData,h=c.maxZoom;l.compositeTextSizes=[u["text-size"].possiblyEvaluate(new si(c.minZoom),a),u["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,f=p.maxZoom;l.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new si(p.minZoom),a),u["icon-size"].possiblyEvaluate(new si(f),a)]}l.layoutTextSize=u["text-size"].possiblyEvaluate(new si(t.zoom+1),a),l.layoutIconSize=u["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),l.textMaxSize=u["text-size"].possiblyEvaluate(new si(18));for(var d=24*s.get("text-line-height"),g="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),y=s.get("text-keep-upright"),m=s.get("text-size"),v=function(){var o=x[_],u=s.get("text-font").evaluate(o,{},a).join(","),c=m.evaluate(o,{},a),h=l.layoutTextSize.evaluate(o,{},a),p=l.layoutIconSize.evaluate(o,{},a),f={horizontal:{},vertical:void 0},v=o.text,b=[0,0];if(v){var w=v.toString(),I=24*s.get("text-letter-spacing").evaluate(o,{},a),S=function(t){for(var e=0,r=t;e=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g,y,m,v,_,x,b,w,I,S){var C,P,M,T,A,L=t.addToLineVertexArray(e,r),k=0,R=0,N=0,D=0,O=-1,z=-1,F={},B=po(""),U=0,V=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(C=s.layout.get("text-offset").evaluate(x,{},I).map((function(t){return 24*t})))[0],V=C[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},I),V=il),t.allowVerticalPlacement&&n.vertical){var q=s.layout.get("text-rotate").evaluate(x,{},I)+90;T=new Qu(u,e,l,c,h,n.vertical,p,f,d,q),a&&(A=new Qu(u,e,l,c,h,a,y,m,d,q))}if(i){var j=s.layout.get("icon-rotate").evaluate(x,{}),G="none"!==s.layout.get("icon-text-fit"),X=Yu(i,j,w,G),Z=a?Yu(a,j,w,G):void 0;M=new Qu(u,e,l,c,h,i,y,m,!1,j),k=4*X.length;var Y=t.iconSizeData,W=null;"source"===Y.kind?(W=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((W=[128*b.compositeIconSizes[0].evaluate(x,{},I),128*b.compositeIconSizes[1].evaluate(x,{},I)])[0]>32640||W[1]>32640)&&E(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,X,W,_,v,x,!1,e,L.lineStartIndex,L.lineLength,-1,I),O=t.icon.placedSymbolArray.length-1,Z&&(R=4*Z.length,t.addSymbols(t.icon,Z,W,_,v,x,bu.vertical,e,L.lineStartIndex,L.lineLength,-1,I),z=t.icon.placedSymbolArray.length-1)}for(var H in n.horizontal){var K=n.horizontal[H];if(!P){B=po(K.text);var J=s.layout.get("text-rotate").evaluate(x,{},I);P=new Qu(u,e,l,c,h,K,p,f,d,J)}var Q=1===K.positionedLines.length;if(N+=sl(t,e,K,o,s,d,x,g,L,n.vertical?bu.horizontal:bu.horizontalOnly,Q?Object.keys(n.horizontal):[H],F,O,b,I),Q)break}n.vertical&&(D+=sl(t,e,n.vertical,o,s,d,x,g,L,bu.vertical,["vertical"],F,z,b,I));var $=P?P.boxStartIndex:t.collisionBoxArray.length,tt=P?P.boxEndIndex:t.collisionBoxArray.length,et=T?T.boxStartIndex:t.collisionBoxArray.length,rt=T?T.boxEndIndex:t.collisionBoxArray.length,nt=M?M.boxStartIndex:t.collisionBoxArray.length,it=M?M.boxEndIndex:t.collisionBoxArray.length,ot=A?A.boxStartIndex:t.collisionBoxArray.length,at=A?A.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(P,st),st=ut(T,st),st=ut(M,st);var lt=(st=ut(A,st))>-1?1:0;lt&&(st*=S/24),t.glyphOffsetArray.length>=ml.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,O,z,B,$,tt,et,rt,nt,it,ot,at,l,N,D,k,R,lt,0,p,U,V,st)}(t,h,s,r,n,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,S,u,_,w,C,d,e,o,l,c,a)};if("line"===P)for(var L=0,k=Zu(e.geometry,0,0,8192,8192);L1){var U=Gu(B,I,r.vertical||g,n,24,v);U&&A(B,U)}}else if("Polygon"===e.type)for(var V=0,q=ns(e.geometry,0);V=M.maxzoom||"none"!==M.visibility&&(a(P,this.zoom,n),(g[M.id]=M.createBucket({index:c.bucketLayerIDs.length,layers:P,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,y,this.tileID.canonical),c.bucketLayerIDs.push(P.map((function(t){return t.id}))))}}}var T=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(T).length?o.send("getGlyphs",{uid:this.uid,stacks:T},(function(t,e){h||(h=t,p=e,k.call(u))})):p={};var A=Object.keys(y.iconDependencies);A.length?o.send("getImages",{icons:A,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,f=e,k.call(u))})):f={};var L=Object.keys(y.patternDependencies);function k(){if(h)return s(h);if(p&&f&&d){var e=new i(p),r=new t.ImageAtlas(f,d);for(var o in g){var u=g[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,n),t.performSymbolLayout(u,p,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,n),u.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(g).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}L.length?o.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,k.call(u))})):d={},k.call(this)};var u=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var u=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);var c={};if(a){var h=a.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,l,c))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},u.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var l=t.window.ImageBitmap,c=function(){this.loaded={}};function h(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=l&&o instanceof l?this.getImageData(o):o,s=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function M(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var p=r[2*n+a],f=i,d=o;for(A(e,r,i,n),r[2*o+a]>p&&A(e,r,i,o);fp;)d--}r[2*i+a]===p?A(e,r,i,d):A(e,r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};D.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var h=l.pop(),p=l.pop(),f=l.pop();if(p-f<=a)for(var d=f;d<=p;d++)u=e[2*d+1],(s=e[2*d])>=r&&s<=i&&u>=n&&u<=o&&c.push(t[d]);else{var g=Math.floor((f+p)/2);u=e[2*g+1],(s=e[2*g])>=r&&s<=i&&u>=n&&u<=o&&c.push(t[g]);var y=(h+1)%2;(0===h?r<=s:n<=u)&&(l.push(f),l.push(g-1),l.push(y)),(0===h?i>=s:o>=u)&&(l.push(g+1),l.push(p),l.push(y))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},D.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)k(e[2*p],e[2*p+1],r,n)<=u&&s.push(t[p]);else{var f=Math.floor((h+c)/2),d=e[2*f],g=e[2*f+1];k(d,g,r,n)<=u&&s.push(t[f]);var y=(l+1)%2;(0===l?r-i<=d:n-i<=g)&&(a.push(h),a.push(f-1),a.push(y)),(0===l?r+i>=d:n+i>=g)&&(a.push(f+1),a.push(c),a.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var O={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},z=function(t){this.options=G(Object.create(O),t),this.trees=new Array(this.options.maxZoom+1)};function F(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function B(t,e){var r=t.geometry.coordinates,n=r[1];return{x:q(r[0]),y:j(n),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:V(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function V(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function q(t){return t/360+.5}function j(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function G(t,e){for(var r in e)t[r]=e[r];return t}function X(t){return t.x}function Z(t){return t.y}function Y(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function W(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)H(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],c=e[r+1],h=e[n],p=e[n+1],f=r+3;fa)o=f,a=d;else if(d===a){var g=Math.abs(f-s);gi&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function $(t,e,r,n){for(var i=0;i1?1:r}function rt(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],l=0;l=r&&d=n)){var g=[];if("Point"===p||"MultiPoint"===p)nt(h,g,r,n,i);else if("LineString"===p)it(h,g,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)at(h,g,r,n,i,!1);else if("Polygon"===p)at(h,g,r,n,i,!0);else if("MultiPolygon"===p)for(var y=0;y=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,r,n,i,o,a){for(var s,u,l=ot(t),c=0===i?ut:lt,h=t.start,p=0;pr&&(u=c(l,f,d,y,m,r),a&&(l.start=h+s*u)):v>n?_=r&&(u=c(l,f,d,y,m,r),x=!0),_>n&&v<=n&&(u=c(l,f,d,y,m,n),x=!0),!o&&x&&(a&&(l.end=h+s*u),e.push(l),l=ot(t)),a&&(h+=s)}var b=t.length-3;f=t[b],d=t[b+1],g=t[b+2],(v=0===i?f:d)>=r&&v<=n&&st(l,f,d,g),b=l.length-3,o&&b>=3&&(l[b]!==l[0]||l[b+1]!==l[1])&&st(l,l[0],l[1],l[2]),l.length&&e.push(l)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function gt(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(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,o=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;n=n;l--){var c=+Date.now();s=this._cluster(s,l),this.trees[l]=new D(s,X,Z,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},z.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],c=0,h=u.range(q(r),j(o),q(i),j(n));ce&&(p+=g.numPoints||1)}if(p>=o){for(var y=u.x*h,m=u.y*h,v=i&&h>1?this._map(u,!0):null,_=(s<<5)+(e+1)+this.points.length,x=0,b=c;x1)for(var I=0,S=c;I>5},z.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},z.prototype._map=function(t,e){if(t.numPoints)return e?G({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?G({},n):n},mt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},mt.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<1&&console.time("creation"),p=this.tiles[h]=dt(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,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<1&&console.time("clipping");var g,y,m,v,_,x,b=.5*u.buffer/u.extent,w=.5-b,E=.5+b,I=1+b;g=y=m=v=null,_=rt(t,c,r-b,r+E,0,p.minX,p.maxX,u),x=rt(t,c,r+w,r+I,0,p.minX,p.maxX,u),t=null,_&&(g=rt(_,c,n-b,n+E,1,p.minY,p.maxY,u),y=rt(_,c,n+w,n+I,1,p.minY,p.maxY,u),_=null),x&&(m=rt(x,c,n-b,n+E,1,p.minY,p.maxY,u),v=rt(x,c,n+w,n+I,1,p.minY,p.maxY,u),x=null),l>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(y||[],e+1,2*r,2*n+1),s.push(m||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},mt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,c=e,h=r;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[vt(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?pt(this.tiles[s],i):null):null};var xt=function(e){function r(t,r,n,i){e.call(this,t,r,n,_t),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function m(t,e,r,n,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,a=u;i1&&(s=t[++a]);var l=Math.abs(u-s.left),c=Math.abs(u-s.right),h=Math.min(l,c),p=void 0,f=i/r*(n+1);if(s.isDash){var d=n-Math.abs(f);p=Math.sqrt(h*h+d*d)}else p=n-Math.sqrt(h*h+f*f);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},E.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l1&&(u=t[++s]);var c=Math.abs(l-u.left),h=Math.abs(l-u.right),p=Math.min(c,h);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},E.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=n&&e.x=i&&e.y0&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{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,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),k=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=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(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;ar.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(k),N=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},B.prototype.has=function(t){return t.wrapped().key in this.data},B.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},B.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},B.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},B.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},B.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},B.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},B.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=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)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(kt(this._source.type)){for(var l={},c={},h=0,p=Object.keys(u);hthis._source.maxzoom){var y=d.children(this._source.maxzoom)[0],m=this.getTile(y);if(m&&m.hasData()){n[y.key]=y;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var _=g.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(i[b.key])break;if(i[b.key]=!0,!(g=this.getTile(b))&&_&&(g=this._addTile(b)),g&&(n[b.key]=b,_=g.wasRequested(),g.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var o=0,a=e;o0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),l=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,g=0,y=l;g=0&&m[1].y+y>=0){var v=u.map((function(t){return s.getTilePoint(t)})),_=l.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:g})}}},_=0;_=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Lt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function kt(t){return"raster"===t||"image"===t||"video"===t}function Rt(){return new t.window.Worker(Hi.workerUrl)}At.maxOverzooming=10,At.maxUnderzooming=3;var Nt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[r].mult(u))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function re(e,r,n,i,o,a,s,u){var l=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,y=!1,m=0;mMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,o,a,s,u,l,c,h,p,f,d){var g,y=r/24,m=e.lineOffsetX*y,v=e.lineOffsetY*y;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ne(y,u,m,v,n,h,p,e,l,a,f);if(!w)return{notEnoughRoom:!0};var E=$t(w.first.point,s).point,I=$t(w.last.point,s).point;if(i&&!n){var S=ie(e.writingMode,E,I,d);if(S)return S}g=[w.first];for(var C=e.glyphStartIndex+1;C<_-1;C++)g.push(se(y*u.getoffsetX(C),m,v,n,h,p,e.segment,x,b,l,a,f));g.push(w.last)}else{if(i&&!n){var P=$t(p,o).point,M=e.lineStartIndex+e.segment+1,T=new t.Point(l.getx(M),l.gety(M)),A=$t(T,o),L=A.signedDistanceFromCamera>0?A.point:ae(p,T,P,1,o),k=ie(e.writingMode,P,L,d);if(k)return k}var R=se(y*u.getoffsetX(e.glyphStartIndex),m,v,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f);if(!R)return{notEnoughRoom:!0};g=[R]}for(var N=0,D=g;N0?1:-1,g=0;i&&(d*=-1,g=Math.PI),d<0&&(g+=Math.PI);for(var y=d>0?u+s:u+s+1,m=o,v=o,_=0,x=0,b=Math.abs(f),w=[];_+x<=b;){if((y+=d)=l)return null;if(v=m,w.push(m),void 0===(m=p[y])){var E=new t.Point(c.getx(y),c.gety(y)),I=$t(E,h);if(I.signedDistanceFromCamera>0)m=p[y]=I.point;else{var S=y-d;m=ae(0===_?a:new t.Point(c.getx(S),c.gety(S)),E,v,b-_+1,h)}}_+=x,x=v.dist(m)}var C=(b-_)/x,P=m.sub(v),M=P.mult(C)._add(v);M._add(P._unit()._perp()._mult(n*d));var T=g+Math.atan2(m.y-v.y,m.x-v.x);return w.push(M),{point:M,angle:T,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},Kt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:a},Kt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!n&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?l.length>0:l},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=a.seenUids,l=this.boxCells[i];if(null!==l)for(var c=this.bboxes,h=0,p=l;h=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var g=this.circleCells[i];if(null!==g)for(var y=this.circles,m=0,v=g;ma*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,u=Math.abs(t-(n+s));if(u>s+r)return!1;var l=(a-i)/2,c=Math.abs(e-(i+l));if(c>l+r)return!1;if(u<=s||c<=l)return!0;var h=u-s,p=c-l;return h*h+p*p<=r*r};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(t,e){for(var r=0;r=1;L--)A.push(M.path[L]);for(var k=1;k0){for(var O=A[0].clone(),z=A[0].clone(),F=1;F=S.x&&z.x<=C.x&&O.y>=S.y&&z.y<=C.y?[A]:z.xC.x||z.yC.y?[]:t.clipLine([A],S.x,S.y,C.x,C.y)}for(var B=0,U=D;B=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(g=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:y,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:g},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:m,placedGlyphBoxes:v}):void 0},be.prototype.placeLayerBucketPart=function(e,r,n){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,l=o.textLabelPlaneMatrix,c=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,f=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,g=o.collisionGroup,y=s.get("text-optional"),m=s.get("icon-optional"),v=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order"),I=v&&(_||!a.hasIconData()||m),S=_&&(v||!a.hasTextData()||y);!a.collisionArrays&&f&&a.deserializeCollisionBoxes(f);var C=function(e,o){if(!r[e.crossTileID])if(p)i.placements[e.crossTileID]=new ge(!1,!1,!1);else{var f,E=!1,C=!1,P=!0,M=null,T={box:null,offscreen:null},A={box:null,offscreen:null},L=null,k=null,R=0,N=0,D=0;o.textFeatureIndex?R=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(R=e.featureIndex),o.verticalTextFeatureIndex&&(N=o.verticalTextFeatureIndex);var O=o.textBox;if(O){var z=function(r){var n=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,n=o,e))}return n},F=function(r,n){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i0&&(B=B.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var V=function(t,r,n){for(var o=t.x2-t.x1,s=t.y2-t.y1,l=e.textBoxScale,c=w&&!_?r:null,p={box:[],offscreen:!1},f=v?2*B.length:B.length,d=0;d=B.length,e,a,n,c);if(y&&(p=y.placedGlyphBoxes)&&p.box&&p.box.length){E=!0,M=y.shift;break}}return p};F((function(){return V(O,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(T&&T.box&&T.box.length)&&e.numVerticalGlyphVertices>0&&r?V(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),T&&(E=T.box,P=T.offscreen);var q=z(T&&T.box);if(!E&&i.prevPlacement){var j=i.prevPlacement.variableOffsets[e.crossTileID];j&&(i.variableOffsets[e.crossTileID]=j,i.markUsedJustification(a,j.anchor,e,q))}}else{var G=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,u,g.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(a,r,e),i.placedOrientations[e.crossTileID]=r),n};F((function(){return G(O,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?G(r,t.WritingMode.vertical):{box:null,offscreen:null}})),z(T&&T.box&&T.box.length)}}if(E=(f=T)&&f.box&&f.box.length>0,P=f&&f.offscreen,e.useRuntimeCollisionCircles){var X=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),Z=t.evaluateSizeForFeature(a.textSizeData,d,X),Y=s.get("text-padding");L=i.collisionIndex.placeCollisionCircles(v,X,a.lineVertexArray,a.glyphOffsetArray,Z,u,l,c,n,b,g.predicate,e.collisionCircleDiameter,Y),E=v||L.circles.length>0&&!L.collisionDetected,P=P&&L.offscreen}if(o.iconFeatureIndex&&(D=o.iconFeatureIndex),o.iconBox){var W=function(t){var e=w&&M?xe(t,M.x,M.y,x,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,_,h,u,g.predicate)};C=A&&A.box&&A.box.length&&o.verticalIconBox?(k=W(o.verticalIconBox)).box.length>0:(k=W(o.iconBox)).box.length>0,P=P&&k.offscreen}var H=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=m||0===e.numIconVertices;if(H||K?K?H||(C=C&&E):E=C&&E:C=E=C&&E,E&&f&&f.box&&i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),a.bucketInstanceId,A&&A.box&&N?N:R,g.ID),C&&k&&i.collisionIndex.insertCollisionBox(k.box,s.get("icon-ignore-placement"),a.bucketInstanceId,D,g.ID),L&&(E&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),a.bucketInstanceId,R,g.ID),n)){var J=a.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new ye);for(var $=0;$=0;--M){var T=P[M];C(a.symbolInstances.get(T),a.collisionArrays[T])}else for(var A=e.symbolInstanceStart;A=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:n.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a0,v=i.placedOrientations[o.crossTileID],_=v===t.WritingMode.vertical,x=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||u>0){var b=Ae(y.text);d(e.text,s,_?Le:b),d(e.text,u,x?Le:b);var w=y.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||_?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var E=i.variableOffsets[o.crossTileID];E&&i.markUsedJustification(e,E.anchor,o,v);var I=i.placedOrientations[o.crossTileID];I&&(i.markUsedJustification(e,"left",o,I),i.markUsedOrientation(e,I,o))}if(m){var S=Ae(y.icon),C=!(p&&o.verticalPlacedIconSymbolIndex&&_);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,C?S:Le),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=y.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,C?Le:S),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var P=e.collisionArrays[n];if(P){var M=new t.Point(0,0);if(P.textBox||P.verticalTextBox){var T=!0;if(l){var A=i.variableOffsets[g];A?(M=_e(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),c&&M._rotate(h?i.transform.angle:-i.transform.angle)):T=!1}P.textBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!T||_,M.x,M.y),P.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!T||x,M.x,M.y)}var L=Boolean(!x&&P.verticalIconBox);P.iconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,L,p?M.x:0,p?M.y:0),P.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!L,p?M.x:0,p?M.y:0)}}},y=0;yt},be.prototype.setStale=function(){this.stale=!0};var Ee=Math.pow(2,25),Ie=Math.pow(2,24),Se=Math.pow(2,17),Ce=Math.pow(2,16),Pe=Math.pow(2,9),Me=Math.pow(2,8),Te=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,r=Math.floor(127*t.opacity);return r*Ee+e*Ie+r*Se+e*Ce+r*Pe+e*Me+r*Te+e}var Le=0,ke=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=[]};ke.prototype.continuePlacement=function(t,e,r,n,i){for(var o=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new ke(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Re.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Ne=512/t.EXTENT/2,De=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,i)}}for(var c=0;c1?"@2x":"",u=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,c())})),l=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,a||(a=t,o=e,c())}));function c(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var u=i[s],l=u.width,c=u.height,h=u.x,p=u.y,f=u.sdf,d=u.pixelRatio,g=u.stretchX,y=u.stretchY,m=u.content,v=new t.RGBAImage({width:l,height:c});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:l,height:c}),r[s]={data:v,pixelRatio:d,sdf:f,stretchX:g,stretchY:y,content:m}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new At(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Be(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,u=t;s=0;f--){var d=this._order[f];if(r(d))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.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;}"),$e=mr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=mr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=mr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=mr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=mr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=mr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=mr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=mr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=mr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ur=mr("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;}"),lr=mr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=mr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=mr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=mr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),fr=mr("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;}"),dr=mr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gr=mr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),yr=mr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function mr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var o="float"===n?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:a}}var vr=Object.freeze({__proto__:null,prelude:Xe,background:Ze,backgroundPattern:Ye,circle:We,clippingMask:He,heatmap:Ke,heatmapTexture:Je,collisionBox:Qe,collisionCircle:$e,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:ur,line:lr,lineGradient:cr,linePattern:hr,lineSDF:pr,raster:fr,symbolIcon:dr,symbolSDF:gr,symbolTextAndIcon:yr}),_r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function xr(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}br.prototype.draw=function(t,e,r,n,i,o,a,s,u,l,c,h,p,f,d,g){var y,m=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var _=(y={},y[m.LINES]=2,y[m.TRIANGLES]=3,y[m.LINE_STRIP]=1,y)[e],x=0,b=c.get();x0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:qr(i.paint.get("raster-hue-rotate"))};var o,a};function qr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var jr,Gr=function(t,e,r,n,i,o,a,s,u,l){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+n,u_texsize:l,u_texture:0}},Xr=function(e,r,n,i,o,a,s,u,l,c,h){var p=o.transform;return t.extend(Gr(e,r,n,i,o,a,s,u,l,c),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Zr=function(e,r,n,i,o,a,s,u,l,c){return t.extend(Xr(e,r,n,i,o,a,s,u,!0,l,!0),{u_texsize_icon:c,u_texture_icon:1})},Yr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Wr=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,h=c*(n.tileID.canonical.x+n.tileID.wrap*l),p=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Hr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,o,a,s){for(var u=e.context,l=u.gl,c=e.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d0){var b=t.create(),w=v;t.mul(b,m.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,m.placementViewportMatrix),h.push({circleArray:x,circleOffset:f,transform:w,invTransform:b}),f=p+=x.length/4}_&&c.draw(u,l.LINES,St.disabled,Ct.disabled,e.colorModeForRenderPass(),Mt.disabled,Ar(v,e.transform,y),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&h.length){var E=e.useProgram("collisionCircle"),I=new t.StructArrayLayout2f1f2i16;I.resize(4*p),I._trim();for(var S=0,C=0,P=h;C=0&&(g[m.associatedIconIndex]={shiftedAnchor:I,angle:S})}else le(m.numGlyphs,f)}if(h){d.clear();for(var P=e.icon.placedSymbolArray,M=0;M0){var s=t.browser.now(),u=(s-e.timeAdded)/a,l=r?(s-r.timeAdded)/a:-1,c=n.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-l,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var ln=new t.Color(1,0,0,1),cn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),fn=new t.Color(0,1,1,1);function dn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function gn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function mn(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),u=St.disabled,l=Ct.disabled,c=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,l,c,Mt.disabled,kr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),f=r.getTile(n).tileSize,d=512/Math.min(f,512)*(n.overscaledZ/e.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,g+" "+p+"kb"),s.draw(i,o.TRIANGLES,u,l,Pt.alphaBlended,Mt.disabled,kr(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var vn={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=Ct.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var u=r.transform,l="map"===o,c="map"===a,h=0,p=e;h256&&this.clearStencil(),r.setColorMode(Pt.disabled),r.setDepthMode(St.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Ct({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Ct({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var x=this.style._layers[i[this.currentLayer]],b=o[x.source],w=c[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,t,vr[t],e,Hr[t],this._showOverdrawInspector)),this.cache[r]},_n.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()},_n.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)},_n.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))},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var xn=function(t,e){this.points=t,this.planes=e};xn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],r,n)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new xn(o,a)};var bn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o=0;if(0===a)return 0;a!==r.length&&(n=!1)}if(n)return 2;for(var u=0;u<3;u++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;hthis.max[u]-this.min[u])return 0}return 1};var wn=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};wn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},wn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},wn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var En=function(e,r,n,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},In={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}};En.prototype.clone=function(){var t=new En(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},In.minZoom.get=function(){return this._minZoom},In.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},In.maxZoom.get=function(){return this._maxZoom},In.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},In.minPitch.get=function(){return this._minPitch},In.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},In.maxPitch.get=function(){return this._maxPitch},In.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},In.renderWorldCopies.get=function(){return this._renderWorldCopies},In.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},In.worldSize.get=function(){return this.tileSize*this.scale},In.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},In.size.get=function(){return new t.Point(this.width,this.height)},In.bearing.get=function(){return-this.angle/Math.PI*180},In.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},In.pitch.get=function(){return this._pitch/Math.PI*180},In.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},In.fov.get=function(){return this._fov/Math.PI*180},In.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())},In.zoom.get=function(){return this._zoom},In.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())},In.center.get=function(){return this._center},In.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},In.padding.get=function(){return this._edgeInsets.toJSON()},In.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},In.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},En.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},En.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},En.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)},En.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),u=Math.floor(Math.max(n.x,i.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&r.push(new t.UnwrappedTileID(l,e));return r},En.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*i.x,o*i.y,0],s=xn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var l=function(t){return{aabb:new bn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],p=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(l(-d)),c.push(l(d));for(c.push(l(0));c.length>0;){var g=c.pop(),y=g.x,m=g.y,v=g.fullyVisible;if(!v){var _=g.aabb.intersects(s);if(0===_)continue;v=2===_}var x=g.aabb.distanceX(a),b=g.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(g.zoom===p||w>3+(1<=u)h.push({tileID:new t.OverscaledTileID(g.zoom===p?f:g.zoom,g.wrap,g.zoom,y,m),distanceSq:t.sqrLen([a[0]-.5-y,a[1]-.5-m])});else for(var E=0;E<4;E++){var I=(y<<1)+E%2,S=(m<<1)+(E>>1);c.push({aabb:g.aabb.quadrant(E),zoom:g.zoom+1,x:I,y:S,wrap:g.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},En.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},In.unmodified.get=function(){return this._unmodified},En.prototype.zoomScale=function(t){return Math.pow(2,t)},En.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},En.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},En.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},In.point.get=function(){return this.project(this.center)},En.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},En.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},En.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},En.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},En.prototype.coordinateLocation=function(t){return t.toLngLat()},En.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[1]/i,s=n[1]/o,u=r[2]/i,l=n[2]/o,c=u===l?0:(0-u)/(l-u);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/o,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},En.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},En.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},En.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},En.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])},En.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,r?this.alignedProjMatrix:this.projMatrix,u),i[n]=new Float32Array(u),i[n]},En.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},En.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-oa&&(i=a-y)}if(this.lngRange){var m=f.x,v=l.x/2;m-vu&&(n=u-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},En.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,l,u),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),g=a-Math.round(a)+f*h+d*p,y=s-Math.round(s)+f*p+d*h,m=new Float64Array(c);if(t.translate(m,m,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=m,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},En.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},En.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},En.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,u=e;s=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},Sn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Cn={linearity:.3,easing:t.bezier(0,0,.3,1)},Pn=t.extend({deceleration:2500,maxSpeed:1400},Cn),Mn=t.extend({deceleration:20,maxSpeed:1400},Cn),Tn=t.extend({deceleration:1e3,maxSpeed:360},Cn),An=t.extend({deceleration:1e3,maxSpeed:90},Cn),Ln=function(t){this._map=t,this.clear()};function kn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Ln.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Nn(t.type,this._map,t))},zn.prototype.dblclick=function(t){return this._firePreventable(new Nn(t.type,this._map,t))},zn.prototype.mouseover=function(t){this._map.fire(new Nn(t.type,this._map,t))},zn.prototype.mouseout=function(t){this._map.fire(new Nn(t.type,this._map,t))},zn.prototype.touchstart=function(t){return this._firePreventable(new Dn(t.type,this._map,t))},zn.prototype.touchmove=function(t){this._map.fire(new Dn(t.type,this._map,t))},zn.prototype.touchend=function(t){this._map.fire(new Dn(t.type,this._map,t))},zn.prototype.touchcancel=function(t){this._map.fire(new Dn(t.type,this._map,t))},zn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},zn.prototype.isEnabled=function(){return!0},zn.prototype.isActive=function(){return!1},zn.prototype.enable=function(){},zn.prototype.disable=function(){};var Fn=function(t){this._map=t};Fn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Fn.prototype.mousemove=function(t){this._map.fire(new Nn(t.type,this._map,t))},Fn.prototype.mousedown=function(){this._delayContextMenu=!0},Fn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Nn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Fn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Nn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var Bn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Un(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Vn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var qn=function(t){this.singleTap=new Vn(t),this.numTaps=t.numTaps,this.reset()};qn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},qn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},qn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},qn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var jn=function(){this._zoomIn=new qn({numTouches:1,numTaps:2}),this._zoomOut=new qn({numTouches:2,numTaps:1}),this.reset()};jn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},jn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},jn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},jn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},jn.prototype.touchcancel=function(){this.reset()},jn.prototype.enable=function(){this._enabled=!0},jn.prototype.disable=function(){this._enabled=!1,this.reset()},jn.prototype.isEnabled=function(){return this._enabled},jn.prototype.isActive=function(){return this._active};var Gn={0:1,2:2},Xn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Xn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Xn.prototype._correctButton=function(t,e){return!1},Xn.prototype._move=function(t,e){return{}},Xn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Xn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Gn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Un(n,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var l=i[u],c=this._touches[u];c&&(o._add(l),a._add(l.sub(c)),s++,i[u]=l)}if(this._touches=i,!(sMath.abs(t.x)}var ni=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,ri(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ri(t)&&ri(e)&&o}},e}(Kn),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function ai(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active},oi.prototype.disableRotation=function(){this._rotationDisabled=!0},oi.prototype.enableRotation=function(){this._rotationDisabled=!1};var si=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.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 n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,u=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&u&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=l(h);a=t.number(u,s,p),h<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},si.prototype.reset=function(){this._active=!1};var ui=function(t,e){this._clickZoom=t,this._tapZoom=e};ui.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ui.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ui.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ui.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var li=function(){this.reset()};li.prototype.reset=function(){this._active=!1},li.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var ci=function(){this._tap=new qn({numTouches:1,numTaps:1}),this.reset()};ci.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ci.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},ci.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},ci.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},ci.prototype.touchcancel=function(){this.reset()},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var hi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};fi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},gi=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 yi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var mi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ln(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;oo?Math.min(2,b):Math.max(.5,b),w=Math.pow(y,1-e),E=i.unproject(_.add(x.mult(e*w)).mult(g));i.setLocationAtPoint(i.renderWorldCopies?E.wrap():E,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:u,f="padding"in e?e.padding:o.padding,d=o.zoomScale(c-a),g=t.Point.convert(e.offset),y=o.centerPoint.add(g),m=o.pointLocation(y),v=t.LngLat.convert(e.center||m);this._normalizeCenter(v);var _=o.project(m),x=o.project(v).sub(_),b=e.curve,w=Math.max(o.width,o.height),E=w/d,I=x.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),C=w/o.zoomScale(S-a);b=Math.sqrt(C/I*2)}var P=b*b;function M(t){var e=(E*E-w*w+(t?-1:1)*P*P*I*I)/(2*(t?E:w)*P*I);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}var L=M(0),k=function(t){return A(L)/A(L+b*t)},R=function(t){return w*((A(L)*(T(e=L+b*t)/A(e))-T(L))/P)/I;var e},N=(M(1)-L)/b;if(Math.abs(I)<1e-6||!isFinite(N)){if(Math.abs(w-E)<1e-6)return this.easeTo(e,r);var D=Ee.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==u,this._padding=!o.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var i=e*N,d=1/k(i);o.zoom=1===e?c:a+o.scaleZoom(d),n._rotating&&(o.bearing=t.number(s,h,e)),n._pitching&&(o.pitch=t.number(u,p,e)),n._padding&&(o.interpolatePadding(l,f,e),y=o.centerPoint.add(g));var m=1===e?v:o.unproject(_.add(x.mult(R(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?m.wrap():m,y),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),_i=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};_i.prototype.getDefaultPosition=function(){return"bottom-right"},_i.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_i.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},_i.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},_i.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},_i.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_i.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var xi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xi.prototype.getDefaultPosition=function(){return"bottom-left"},xi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},xi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var bi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.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 i=new En(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new bi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wi,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ii))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new mi(this,e),this._hash=e.hash&&new Sn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new _i({customAttribution:e.customAttribution})),this.addControl(new xi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&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")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.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")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new Nn(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new Nn(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new Nn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var o=n[t],a=0;a180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Li.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Li.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Li.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()},Li.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Li.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)},Li.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Li.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Li.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))},Li.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))},Li.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),zi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Fi=0,Bi=!1,Ui=function(e){function n(r){e.call(this),this.options=t.extend({},zi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Di?n(Di):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){n(Di="denied"!==t.state)})):n(Di=!!t.window.navigator.geolocation),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fi=0,Bi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Bi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Oi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Oi({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"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.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":Fi--,Bi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Fi>1?(e={maximumAge:6e5,timeout:0},Bi=!0):(e=this.options.positionOptions,Bi=!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},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Vi={maxWidth:100,unit:"metric"},qi=function(e){this.options=t.extend({},Vi,e),t.bindAll(["_onMove","setUnit"],this)};function ji(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([n,i]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var u=3.2808*s;u>5280?Gi(e,n,u/5280,t._getUIString("ScaleControl.Miles")):Gi(e,n,u,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Gi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Gi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Gi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Gi(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+n}qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._onMove=function(){ji(this._map,this._container,this.options)},qi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qi.prototype.setUnit=function(t){this.options.unit=t,ji(this._map,this._container,this.options)};var Xi=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")};Xi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Xi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Xi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Xi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Xi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Xi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Xi.prototype._isFullscreen=function(){return this._fullscreen},Xi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Xi.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 Zi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Yi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Wi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Zi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.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},n.prototype.getLngLat=function(){return this._lngLat},n.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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ki(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,l=this._container.offsetHeight;s=i.y+a.bottom.ythis._map.transform.height-l?["bottom"]:[],i.xthis._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var c=i.add(a[o]).round();r.setTransform(this._container,Ri[o]+" translate("+c.x+"px,"+c.y+"px)"),Ni(this._container,o,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Yi);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),Hi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Pi,NavigationControl:Ai,GeolocateControl:Ui,AttributionControl:_i,ScaleControl:qi,FullscreenControl:Xi,Popup:Wi,Marker:Oi,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Ft().acquire(Nt)},clearPrewarmedResources:function(){var t=Ot;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Nt),Ot=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Hi})),r}()},7418:t=>{"use strict";var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,o){for(var a,s,u=i(t),l=1;l{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},609:(t,e,r)=>{"use strict";var n=r(4289),i=r(5559),o=r(4244),a=r(5624),s=r(2281),u=i(a(),Object);n(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},5624:(t,e,r)=>{"use strict";var n=r(4244);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:(t,e,r)=>{"use strict";var n=r(5624),i=r(4289);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8987:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(1414),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),l=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=a(t),s=e&&"[object String]"===o.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=l&&r;if(s&&t.length>0&&!i.call(t,0))for(var g=0;g0)for(var y=0;y{"use strict";var n=Array.prototype.slice,i=r(1414),o=Object.keys,a=o?function(t){return o(t)}:r(8987),s=Object.keys;a.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return i(t)?s(n.call(t)):s(t)}):Object.keys=a,Object.keys||a},t.exports=a},1414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6960:t=>{t.exports=function(t,e){for(var r=t[0],n=t[1],i=!1,o=0,a=e.length-1;on!=c>n&&r<(l-s)*(n-u)/(c-u)+s&&(i=!i)}return i}},2676:function(t){t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;re?1:t0))break;if(null===e.right)break;if(r(t,e.right.key)>0&&(u=e.right,e.right=u.left,u.left=e,null===(e=u).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,a.left=e.right,e.left=i.right,e.right=i.left,e}function a(t,e,r,i){var a=new n(t,e);if(null===r)return a.left=a.right=null,a;var s=i(t,(r=o(t,r,i)).key);return s<0?(a.left=r.left,a.right=r,r.left=null):s>=0&&(a.right=r.right,a.left=r,r.right=null),a}function s(t,e,r){var n=null,i=null;if(e){var a=r((e=o(t,e,r)).key,t);0===a?(n=e.left,i=e.right):a<0?(i=e.right,e.right=null,n=e):(n=e.left,e.left=null,i=e)}return{left:n,right:i}}function u(t,e,r,n,i){if(t){n(e+(r?"└── ":"├── ")+i(t)+"\n");var o=e+(r?" ":"│ ");t.left&&u(t.left,o,!1,n,i),t.right&&u(t.right,o,!0,n,i)}}var l=function(){function t(t){void 0===t&&(t=i),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=a(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var r=new n(t,e);null===this._root&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,a=o(t,this._root,i),s=i(t,a.key);return 0===s?this._root=a:(s<0?(r.left=a.left,r.right=a,a.left=null):s>0&&(r.right=a.right,r.left=a,a.right=null),this._size++,this._root=r),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,r){var n;return null===e?null:0===r(t,(e=o(t,e,r)).key)?(null===e.left?n=e.right:(n=o(t,e.left,r)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=o(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var n=r(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=o(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var n=r(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var r=this._root,n=[],i=!1;!i;)null!==r?(n.push(r),r=r.left):0!==n.length?(r=n.pop(),t.call(e,r),r=r.right):i=!0;return this},t.prototype.range=function(t,e,r,n){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,e)>0)break;if(o(a.key,t)>=0&&r.call(n,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var r=e.key;return t.push(r)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var r=e.data;return t.push(r)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,r=!1,n=0,i=[];!r;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),n===t)return e;n++,e=e.right}else r=!0;return null},t.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var n=this._comparator;e;){var i=n(t.key,e.key);if(0===i)break;i<0?(r=e,e=e.left):e=e.right}return r},t.prototype.prev=function(t){var e=this._root,r=null;if(null!==t.left){for(r=t.left;r.right;)r=r.right;return r}for(var n=this._comparator;e;){var i=n(t.key,e.key);if(0===i)break;i<0?e=e.left:(r=e,e=e.right)}return r},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,r=[],i=!1,o=new n(null,null),a=o;!i;)e?(r.push(e),e=e.left):r.length>0?e=(e=a=a.next=r.pop()).right:i=!0;return a.next=null,o.next}(this._root)},t.prototype.load=function(t,e,r){void 0===e&&(e=[]),void 0===r&&(r=!1);var i=t.length,o=this._comparator;if(r&&p(t,e,0,i-1,o),null===this._root)this._root=c(t,e,0,i),this._size=i;else{var a=function(t,e,r){for(var i=new n(null,null),o=i,a=t,s=e;null!==a&&null!==s;)r(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),i.next}(this.toList(),function(t,e){for(var r=new n(null,null),i=r,o=0;o0){var a=r+Math.floor(o/2),s=t[a],u=e[a],l=new n(s,u);return l.left=c(t,e,r,a),l.right=c(t,e,a+1,i),l}return null}function h(t,e,r){var n=r-e;if(n>0){var i=e+Math.floor(n/2),o=h(t,e,i),a=t.head;return a.left=o,t.head=t.head.next,a.right=h(t,i+1,r),a}return null}function p(t,e,r,n,i){if(!(r>=n)){for(var o=t[r+n>>1],a=r-1,s=n+1;;){do{a++}while(i(t[a],o)<0);do{s--}while(i(t[s],o)>0);if(a>=s)break;var u=t[a];t[a]=t[s],t[s]=u,u=e[a],e[a]=e[s],e[s]=u}p(t,e,r,s,i),p(t,e,s+1,n,i)}}var f=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},d=function(t,e){if(e.ur.xe.x?1:t.ye.y?1:0}}]),r(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,r=0,n=e.length;r=0&&u>=0?al?-1:0:o<0&&u<0?al?1:0:uo?1:0}}}]),e}(),T=0,A=function(){function e(r,n,i,o){t(this,e),this.id=++T,this.leftSE=r,r.segment=this,r.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=r,this.rings=i,this.windings=o}return r(e,null,[{key:"compare",value:function(t,e){var r=t.leftSE.point.x,n=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(oa&&s>u)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(r>n){if(as&&a>l)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(as)return 1;if(io){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(i!==o){var y=u-a,m=i-r,v=l-s,_=o-n;if(y>m&&v<_)return 1;if(y_)return-1}return i>o?1:il?1:t.ide.id?1:0}}]),r(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,r=this.rightSE.point,n=this.vector();if(e.x===r.x)return t.x===e.x?0:t.x0&&s.swapEvents(),M.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),r}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,r=this.windings.length;e0){var o=r;r=n,n=o}if(r.prev===n){var a=r;r=n,n=a}for(var s=0,u=n.rings.length;s0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=r,o=t,a=-1}return new e(new M(i,!0),new M(o,!1),[n],[a])}}]),e}(),L=function(){function e(r,n,i){if(t(this,e),!Array.isArray(r)||0===r.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=i,this.segments=[],"number"!=typeof r[0][0]||"number"!=typeof r[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=x.round(r[0][0],r[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,u=r.length;sthis.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),a=l)}o.x===a.x&&o.y===a.y||this.segments.push(A.fromRing(a,o,this))}return r(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,r=this.segments.length;ethis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=n}return r(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,r=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=n}return r(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,r=this.polys.length;e0&&(t=n)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),e}(),D=function(){function e(r){t(this,e),this.exteriorRing=r,r.poly=this,this.interiorRings=[]}return r(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,r=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:A.compare;t(this,e),this.queue=r,this.tree=new l(n),this.segments=[]}return r(e,[{key:"process",value:function(t){var e=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),r;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=n,o=n,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(t.isLeft){var u=null;if(a){var l=a.getIntersection(e);if(null!==l&&(e.isAnEndpoint(l)||(u=l),!a.isAnEndpoint(l)))for(var c=this._splitSafely(a,l),h=0,p=c.length;h0?(this.tree.remove(e),r.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var w=a.getIntersection(s);if(null!==w){if(!a.isAnEndpoint(w))for(var E=this._splitSafely(a,w),I=0,S=E.length;IF)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new z(g),E=g.size,I=g.pop();I;){var S=I.key;if(g.size===E){var C=S.segment;throw new Error("Unable to pop() ".concat(S.isLeft?"left":"right"," SweepEvent ")+"[".concat(S.point.x,", ").concat(S.point.y,"] from segment #").concat(C.id," ")+"[".concat(C.leftSE.point.x,", ").concat(C.leftSE.point.y,"] -> ")+"[".concat(C.rightSE.point.x,", ").concat(C.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(g.size>F)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>B)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var P=w.process(S),T=0,A=P.length;T1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n{"use strict";t.exports=i,t.exports.default=i;var n=r(4291);function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,r,i,o){for(var a,s=[e,r];s.length;)(r=s.pop())-(e=s.pop())<=i||(a=e+Math.ceil((r-e)/i/2)*i,n(t,a,e,r,o),s.push(e,a,a,r))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!d(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),s=g(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,a(r,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,u,l,c,p,f,d,g,y,m,v;for(l=c=1/0,n=e;n<=r-e;n++)f=i=s(t,0,n,this.toBBox),d=o=s(t,n,r,this.toBBox),void 0,void 0,void 0,void 0,g=Math.max(f.minX,d.minX),y=Math.max(f.minY,d.minY),m=Math.min(f.maxX,d.maxX),v=Math.min(f.maxY,d.maxY),a=Math.max(0,m-g)*Math.max(0,v-y),u=h(i)+h(o),a=e;i--)o=t.children[i],u(c,t.leaf?a(o):o),h+=p(c);return h},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)u(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():a(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},4291:function(t){t.exports=function(){"use strict";function t(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(r,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var p=r[n],f=i,d=o;for(e(r,i,n),a(r[o],p)>0&&e(r,i,o);f0;)d--}0===a(r[i],p)?e(r,i,d):e(r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}function e(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function r(t,e){return te?1:0}return function(e,n,i,o,a){t(e,n,i||0,o||e.length-1,a||r)}}()},3697:t=>{"use strict";var e=Object,r=TypeError;t.exports=function(){if(null!=this&&this!==e(this))throw new r("RegExp.prototype.flags getter called on non-object");var t="";return this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.sticky&&(t+="y"),t}},2847:(t,e,r)=>{"use strict";var n=r(4289),i=r(5559),o=r(3697),a=r(1721),s=r(2753),u=i(o);n(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},1721:(t,e,r)=>{"use strict";var n=r(3697),i=r(4289).supportsDescriptors,o=Object.getOwnPropertyDescriptor,a=TypeError;t.exports=function(){if(!i)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof/a/.dotAll)return t.get}return n}},2753:(t,e,r)=>{"use strict";var n=r(4289).supportsDescriptors,i=r(1721),o=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,l=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=i(),e=u(l),r=o(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},8639:function(t,e){!function(t){"use strict";const e=134217729;function r(t,e,r,n,i){let o,a,s,u,l=e[0],c=n[0],h=0,p=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=n[++p]);let f=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=e[++h]):(s=o-((a=c+o)-c),c=n[++p]),o=a,0!==s&&(i[f++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=e[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=n[++p]),o=a,0!==s&&(i[f++]=s);for(;h0!=d>0)return g;const y=Math.abs(f+d);return Math.abs(g)>=33306690738754716e-32*y?g:-function(t,n,l,c,h,p,f){let d,g,y,m,v,_,x,b,w,E,I,S,C,P,M,T,A,L;const k=t-h,R=l-h,N=n-p,D=c-p;v=(M=(b=k-(x=(_=e*k)-(_-k)))*(E=D-(w=(_=e*D)-(_-D)))-((P=k*D)-x*w-b*w-x*E))-(I=M-(A=(b=N-(x=(_=e*N)-(_-N)))*(E=R-(w=(_=e*R)-(_-R)))-((T=N*R)-x*w-b*w-x*E))),i[0]=M-(I+v)+(v-A),v=(C=P-((S=P+I)-(v=S-P))+(I-v))-(I=C-T),i[1]=C-(I+v)+(v-T),v=(L=S+I)-S,i[2]=S-(L-v)+(I-v),i[3]=L;let O=function(t,e){let r=e[0];for(let t=1;t<4;t++)r+=e[t];return r}(0,i),z=22204460492503146e-32*f;if(O>=z||-O>=z)return O;if(d=t-(k+(v=t-k))+(v-h),y=l-(R+(v=l-R))+(v-h),g=n-(N+(v=n-N))+(v-p),m=c-(D+(v=c-D))+(v-p),0===d&&0===g&&0===y&&0===m)return O;if(z=11093356479670487e-47*f+33306690738754706e-32*Math.abs(O),(O+=k*m+D*d-(N*y+R*g))>=z||-O>=z)return O;v=(M=(b=d-(x=(_=e*d)-(_-d)))*(E=D-(w=(_=e*D)-(_-D)))-((P=d*D)-x*w-b*w-x*E))-(I=M-(A=(b=g-(x=(_=e*g)-(_-g)))*(E=R-(w=(_=e*R)-(_-R)))-((T=g*R)-x*w-b*w-x*E))),u[0]=M-(I+v)+(v-A),v=(C=P-((S=P+I)-(v=S-P))+(I-v))-(I=C-T),u[1]=C-(I+v)+(v-T),v=(L=S+I)-S,u[2]=S-(L-v)+(I-v),u[3]=L;const F=r(4,i,4,u,o);v=(M=(b=k-(x=(_=e*k)-(_-k)))*(E=m-(w=(_=e*m)-(_-m)))-((P=k*m)-x*w-b*w-x*E))-(I=M-(A=(b=N-(x=(_=e*N)-(_-N)))*(E=y-(w=(_=e*y)-(_-y)))-((T=N*y)-x*w-b*w-x*E))),u[0]=M-(I+v)+(v-A),v=(C=P-((S=P+I)-(v=S-P))+(I-v))-(I=C-T),u[1]=C-(I+v)+(v-T),v=(L=S+I)-S,u[2]=S-(L-v)+(I-v),u[3]=L;const B=r(F,o,4,u,a);v=(M=(b=d-(x=(_=e*d)-(_-d)))*(E=m-(w=(_=e*m)-(_-m)))-((P=d*m)-x*w-b*w-x*E))-(I=M-(A=(b=g-(x=(_=e*g)-(_-g)))*(E=y-(w=(_=e*y)-(_-y)))-((T=g*y)-x*w-b*w-x*E))),u[0]=M-(I+v)+(v-A),v=(C=P-((S=P+I)-(v=S-P))+(I-v))-(I=C-T),u[1]=C-(I+v)+(v-T),v=(L=S+I)-S,u[2]=S-(L-v)+(I-v),u[3]=L;const U=r(B,a,4,u,s);return s[U-1]}(t,n,l,c,h,p,y)},t.orient2dfast=function(t,e,r,n,i,o){return(e-o)*(r-i)-(t-i)*(n-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},5697:t=>{"use strict";t.exports={eudist:function(t,e,r){for(var n=t.length,i=0,o=0;o{"use strict";var n=r(5697),i=n.eudist,o=n.dist;t.exports={kmrand:function(t,e){for(var r={},n=[],i=e<<2,o=t.length,a=t[0].length>0;n.length0;){var s=t[Math.floor(Math.random()*o)],u=a?s.join("_"):""+s;r[u]||(r[u]=!0,n.push(s))}if(n.length0,u=t[Math.floor(Math.random()*a)];for(s&&u.join("_"),n.push(u);n.length{"use strict";var n=r(5697),i=r(7035),o=n.eudist,a=(n.mandist,n.dist,i.kmrand),s=i.kmpp;function u(t,e,r){r=r||[];for(var n=0;n0,m=[];if(r)i="kmrand"==r?a(t,e):"kmpp"==r?s(t,e):r;else for(var v={};i.length{"use strict";var n,i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),o=[];function a(t){for(var e=-1,r=0;r{"use strict";r.r(e),r.d(e,{default:()=>n});class n{constructor(t=[],e=i){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t=0)break;e[t]=o,t=n}e[t]=i}}function i(t,e){return te?1:0}},675:function(t,e){!function(t){"use strict";function e(){}function r(t){this.message=t||""}function n(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function a(t){return null===t?Nt:t.color}function s(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function l(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function p(){}function f(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}function d(){}function g(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),r=Math.max(Math.min(e.length,9007199254740991),0)||0,n=1 in arguments&&parseInt(Number(arguments[1]),10)||0;n=n<0?Math.max(r+n,0):Math.min(n,r);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:r;for(i=i<0?Math.max(r+arguments[2],0):Math.min(i,r);ne.x?1:this.ye.y?1:0},I.prototype.clone=function(){},I.prototype.copy=function(){return new I(this)},I.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},I.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+r*r+n*n)},I.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},I.prototype.hashCode=function(){var t=17;return 37*(t=37*t+I.hashCode(this.x))+I.hashCode(this.y)},I.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},I.prototype.interfaces_=function(){return[b,w,e]},I.prototype.getClass=function(){return I},I.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=_.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},S.DimensionalComparator.get=function(){return C},S.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},S.NULL_ORDINATE.get=function(){return _.NaN},S.X.get=function(){return 0},S.Y.get=function(){return 1},S.Z.get=function(){return 2},Object.defineProperties(I,S);var C=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new v("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};C.prototype.compare=function(t,e){var r=t,n=e,i=C.compare(r.x,n.x);if(0!==i)return i;var o=C.compare(r.y,n.y);return 0!==o?o:this._dimensionsToTest<=2?0:C.compare(r.z,n.z)},C.prototype.interfaces_=function(){return[E]},C.prototype.getClass=function(){return C},C.compare=function(t,e){return te?1:_.isNaN(t)?_.isNaN(e)?0:-1:_.isNaN(e)?1:0};var P=function(){};P.prototype.create=function(){},P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P};var M=function(){},T={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.toLocationSymbol=function(t){switch(t){case M.EXTERIOR:return"e";case M.BOUNDARY:return"b";case M.INTERIOR:return"i";case M.NONE:return"-"}throw new v("Unknown location value: "+t)},T.INTERIOR.get=function(){return 0},T.BOUNDARY.get=function(){return 1},T.EXTERIOR.get=function(){return 2},T.NONE.get=function(){return-1},Object.defineProperties(M,T);var A=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},L=function(){},k={LOG_10:{configurable:!0}};L.prototype.interfaces_=function(){return[]},L.prototype.getClass=function(){return L},L.log10=function(t){var e=Math.log(t);return _.isInfinite(e)||_.isNaN(e)?e:e/L.LOG_10},L.min=function(t,e,r,n){var i=t;return er?r:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var n=arguments[0],i=arguments[1],o=arguments[2];return no?o:n}},L.wrap=function(t,e){return t<0?e- -t%e:t%e},L.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],r=arguments[0];return t>r&&(r=t),e>r&&(r=e),r}if(4===arguments.length){var n=arguments[1],i=arguments[2],o=arguments[3],a=arguments[0];return n>a&&(a=n),i>a&&(a=i),o>a&&(a=o),a}},L.average=function(t,e){return(t+e)/2},k.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(L,k);var R=function(t){this.str=t};R.prototype.append=function(t){this.str+=t},R.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},R.prototype.toString=function(t){return this.str};var N=function(t){this.value=t};N.prototype.intValue=function(){return this.value},N.prototype.compareTo=function(t){return this.valuet?1:0},N.isNaN=function(t){return Number.isNaN(t)};var D=function(){};D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()};var O=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var r=arguments[0];this.init(r)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n,i)}},z={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};O.prototype.le=function(t){return(this._hi9?(c=!0,h="9"):h="0"+l,a.append(h),r=r.subtract(O.valueOf(l)).multiply(O.TEN),c&&r.selfAdd(O.TEN);var p=!0,f=O.magnitude(r._hi);if(f<0&&Math.abs(f)>=s-u&&(p=!1),!p)break}return e[0]=n,a.toString()},O.prototype.sqr=function(){return this.multiply(this)},O.prototype.doubleValue=function(){return this._hi+this._lo},O.prototype.subtract=function(){if(arguments[0]instanceof O){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},O.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},O.prototype.isZero=function(){return 0===this._hi&&0===this._lo},O.prototype.selfSubtract=function(){if(arguments[0]instanceof O){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},O.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},O.prototype.min=function(t){return this.le(t)?this:t},O.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,l=null,c=null,h=null;return u=this._hi/r,h=(i=(l=O.SPLIT*u)-(i=l-u))*(a=(h=O.SPLIT*r)-(a=h-r))-(c=u*r)+i*(s=r-a)+(o=u-i)*a+o*s,h=u+(l=(this._hi-c-h+this._lo-u*n)/r),this._hi=h,this._lo=u-h+l,this}},O.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},O.prototype.divide=function(){if(arguments[0]instanceof O){var t=arguments[0],e=null,r=null,n=null,i=null,o=null,a=null,s=null,u=null;return r=(o=this._hi/t._hi)-(e=(a=O.SPLIT*o)-(e=a-o)),u=e*(n=(u=O.SPLIT*t._hi)-(n=u-t._hi))-(s=o*t._hi)+e*(i=t._hi-n)+r*n+r*i,a=(this._hi-s-u+this._lo-o*t._lo)/t._hi,new O(u=o+a,o-u+a)}if("number"==typeof arguments[0]){var l=arguments[0];return _.isNaN(l)?O.createNaN():O.copy(this).selfDivide(l,0)}},O.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},O.prototype.pow=function(t){if(0===t)return O.valueOf(1);var e=new O(this),r=O.valueOf(1),n=Math.abs(t);if(n>1)for(;n>0;)n%2==1&&r.selfMultiply(e),(n/=2)>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},O.prototype.ceil=function(){if(this.isNaN())return O.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new O(t,e)},O.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},O.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},O.prototype.setValue=function(){if(arguments[0]instanceof O){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},O.prototype.max=function(t){return this.ge(t)?this:t},O.prototype.sqrt=function(){if(this.isZero())return O.valueOf(0);if(this.isNegative())return O.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=O.valueOf(e),n=this.subtract(r.sqr())._hi*(.5*t);return r.add(n)},O.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],r=null,n=null,i=null,o=null,a=null,s=null;return o=(i=this._hi+e)-(a=i-this._hi),n=(s=(o=e-a+(this._hi-o))+this._lo)+(i-(r=i+s)),this._hi=r+n,this._lo=n+(r-this._hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],c=null,h=null,p=null,f=null,d=null,g=null,y=null;f=this._hi+u,h=this._lo+l,d=f-(g=f-this._hi),p=h-(y=h-this._lo);var m=(c=f+(g=(d=u-g+(this._hi-d))+h))+(g=(p=l-y+(this._lo-p))+(g+(f-c))),v=g+(c-m);return this._hi=m,this._lo=v,this}},O.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,l=null;i=(u=O.SPLIT*this._hi)-this._hi,l=O.SPLIT*r,i=u-i,o=this._hi-i,a=l-r;var c=(u=this._hi*r)+(l=i*(a=l-a)-u+i*(s=r-a)+o*a+o*s+(this._hi*n+this._lo*r)),h=l+(i=u-c);return this._hi=c,this._lo=h,this}},O.prototype.selfSqr=function(){return this.selfMultiply(this)},O.prototype.floor=function(){if(this.isNaN())return O.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new O(t,e)},O.prototype.negate=function(){return this.isNaN()?this:new O(-this._hi,-this._lo)},O.prototype.clone=function(){},O.prototype.multiply=function(){if(arguments[0]instanceof O){var t=arguments[0];return t.isNaN()?O.createNaN():O.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return _.isNaN(e)?O.createNaN():O.copy(this).selfMultiply(e,0)}},O.prototype.isNaN=function(){return _.isNaN(this._hi)},O.prototype.intValue=function(){return Math.trunc(this._hi)},O.prototype.toString=function(){var t=O.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},O.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),n=e[0]+1,i=r;if("."===r.charAt(0))i="0"+r;else if(n<0)i="0."+O.stringOfChar("0",-n)+r;else if(-1===r.indexOf(".")){var o=n-r.length;i=r+O.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},O.prototype.reciprocal=function(){var t,e,r,n,i=null,o=null,a=null,s=null;t=(r=1/this._hi)-(i=(a=O.SPLIT*r)-(i=a-r)),o=(s=O.SPLIT*this._hi)-this._hi;var u=r+(a=(1-(n=r*this._hi)-(s=i*(o=s-o)-n+i*(e=this._hi-o)+t*o+t*e)-r*this._lo)/this._hi);return new O(u,r-u+a)},O.prototype.toSciNotation=function(){if(this.isZero())return O.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),n=O.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===r.charAt(0))throw new Error("Found leading zero: "+r);var i="";r.length>1&&(i=r.substring(1));var o=r.charAt(0)+"."+i;return this.isNegative()?"-"+o+n:o+n},O.prototype.abs=function(){return this.isNaN()?O.NaN:this.isNegative()?this.negate():new O(this)},O.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},O.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},O.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},O.prototype.trunc=function(){return this.isNaN()?O.NaN:this.isPositive()?this.floor():this.ceil()},O.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},O.prototype.interfaces_=function(){return[e,b,w]},O.prototype.getClass=function(){return O},O.sqr=function(t){return O.valueOf(t).selfMultiply(t)},O.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return O.parse(t)}if("number"==typeof arguments[0])return new O(arguments[0])},O.sqrt=function(t){return O.valueOf(t).sqrt()},O.parse=function(t){for(var e=0,r=t.length;D.isWhitespace(t.charAt(e));)e++;var n=!1;if(e=r);){var l=t.charAt(e);if(e++,D.isDigit(l)){var c=l-"0";o.selfMultiply(O.TEN),o.selfAdd(c),a++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=N.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}s=a}}var p=o,f=a-s-u;if(0===f)p=o;else if(f>0){var d=O.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=O.TEN.pow(-f);p=o.multiply(g)}return n?p.negate():p},O.createNaN=function(){return new O(_.NaN,_.NaN)},O.copy=function(t){return new O(t)},O.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),n=Math.trunc(Math.floor(r));return 10*Math.pow(10,n)<=e&&(n+=1),n},O.stringOfChar=function(t,e){for(var r=new R,n=0;n0){if(o<=0)return F.signum(a);n=i+o}else{if(!(i<0))return F.signum(a);if(o>=0)return F.signum(a);n=-i-o}var s=F.DP_SAFE_EPSILON*n;return a>=s||-a>=s?F.signum(a):2},F.signum=function(t){return t>0?1:t<0?-1:0},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(F,B);var U=function(){},V={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};V.X.get=function(){return 0},V.Y.get=function(){return 1},V.Z.get=function(){return 2},V.M.get=function(){return 3},U.prototype.setOrdinate=function(t,e,r){},U.prototype.size=function(){},U.prototype.getOrdinate=function(t,e){},U.prototype.getCoordinate=function(){},U.prototype.getCoordinateCopy=function(t){},U.prototype.getDimension=function(){},U.prototype.getX=function(t){},U.prototype.clone=function(){},U.prototype.expandEnvelope=function(t){},U.prototype.copy=function(){},U.prototype.getY=function(t){},U.prototype.toCoordinateArray=function(){},U.prototype.interfaces_=function(){return[w]},U.prototype.getClass=function(){return U},Object.defineProperties(U,V);var q=function(){},j=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(q),G=function(){};G.arraycopy=function(t,e,r,n,i){for(var o=0,a=e;at._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,n=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&n>=this._miny&&n<=this._maxy}},Z.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Z){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||rthis._maxy||nthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=n,this._maxy=n):(rthis._maxx&&(this._maxx=r),nthis._maxy&&(this._maxy=n))}},Z.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Z.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Z.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Z.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Z.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Z.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Z.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Z.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Z){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof I){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return this.covers(r,n)}},Z.prototype.centre=function(){return this.isNull()?null:new I((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Z.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Z){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.init(r.x,n.x,r.y,n.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];it._maxx&&(e=this._minx-t._maxx);var r=0;return this._maxyt._maxy&&(r=this._miny-t._maxy),0===e?r:0===r?e:Math.sqrt(e*e+r*r)},Z.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+I.hashCode(this._minx))+I.hashCode(this._maxx))+I.hashCode(this._miny))+I.hashCode(this._maxy)},Z.prototype.interfaces_=function(){return[b,e]},Z.prototype.getClass=function(){return Z},Z.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.xe.x?t.x:e.x)&&r.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),u=Math.max(o.x,a.x),l=Math.min(n.x,i.x),c=Math.max(n.x,i.x);return!(l>u||cu||cthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},rt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},rt.prototype.setPrecisionModel=function(t){this._precisionModel=t},rt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?n:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=n>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},rt.nonRobustComputeEdgeDistance=function(t,e,r){var n=t.x-e.x,i=t.y-e.y,o=Math.sqrt(n*n+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},nt.DONT_INTERSECT.get=function(){return 0},nt.DO_INTERSECT.get=function(){return 1},nt.COLLINEAR.get=function(){return 2},nt.NO_INTERSECTION.get=function(){return 0},nt.POINT_INTERSECTION.get=function(){return 1},nt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(rt,nt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Z(this._inputLines[0][0],this._inputLines[0][1]),r=new Z(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&r.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],r=arguments[1],n=arguments[2];if(this._isProper=!1,Z.intersects(r,n,e)&&0===st.orientationIndex(r,n,e)&&0===st.orientationIndex(n,r,e))return this._isProper=!0,(e.equals(r)||e.equals(n))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,r,n,i){i.x=this.smallestInAbsValue(t.x,e.x,r.x,n.x),i.y=this.smallestInAbsValue(t.y,e.y,r.y,n.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,r.x-=i.x,r.y-=i.y,n.x-=i.x,n.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,r,n,i){var o=null;try{o=X.intersection(t,r,n,i)}catch(a){if(!(a instanceof j))throw a;o=e.nearestEndpoint(t,r,n,i)}return o},e.prototype.intersection=function(t,r,n,i){var o=this.intersectionWithNormalization(t,r,n,i);return this.isInSegmentEnvelopes(o)||(o=new I(e.nearestEndpoint(t,r,n,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,r,n){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&G.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,r,n){var i=new I(t),o=new I(e),a=new I(r),s=new I(n),u=new I;this.normalizeToEnvCentre(i,o,a,s,u);var l=this.safeHCoordinateIntersection(i,o,a,s);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,r,n,i){var o=Z.intersects(e,r,n),a=Z.intersects(e,r,i),s=Z.intersects(n,i,e),u=Z.intersects(n,i,r);return o&&a?(this._intPt[0]=n,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=e,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||a||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=n,this._intPt[1]=r,!n.equals(r)||a||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&u?(this._intPt[0]=i,this._intPt[1]=r,!i.equals(r)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,r,n,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=r.xn.x?r.x:n.x,p=r.y>n.y?r.y:n.y,f=((o>l?o:l)+(sc?a:c)+(u0&&a>0||o<0&&a<0)return t.NO_INTERSECTION;var s=st.orientationIndex(n,i,e),u=st.orientationIndex(n,i,r);return s>0&&u>0||s<0&&u<0?t.NO_INTERSECTION:0===o&&0===a&&0===s&&0===u?this.computeCollinearIntersection(e,r,n,i):(0===o||0===a||0===s||0===u?(this._isProper=!1,e.equals2D(n)||e.equals2D(i)?this._intPt[0]=e:r.equals2D(n)||r.equals2D(i)?this._intPt[0]=r:0===o?this._intPt[0]=new I(n):0===a?this._intPt[0]=new I(i):0===s?this._intPt[0]=new I(e):0===u&&(this._intPt[0]=new I(r))):(this._isProper=!0,this._intPt[0]=this.intersection(e,r,n,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,r,n){var i=t,o=st.distancePointLine(t,r,n),a=st.distancePointLine(e,r,n);return a0?r>0?-i:i:r>0?i:-i;if(0===e||0===r)return n>0?t>0?i:-i:t>0?-i:i;if(e>0?n>0?e<=n||(i=-i,o=t,t=r,r=o,o=e,e=n,n=o):e<=-n?(i=-i,r=-r,n=-n):(o=t,t=-r,r=o,o=e,e=-n,n=o):n>0?-e<=n?(i=-i,t=-t,e=-e):(o=-t,t=r,r=o,o=-e,e=n,n=o):e>=n?(t=-t,e=-e,r=-r,n=-n):(i=-i,o=-t,t=-r,r=o,o=-e,e=-n,n=o),t>0){if(!(r>0))return i;if(!(t<=r))return i}else{if(r>0)return-i;if(!(t>=r))return-i;i=-i,t=-t,r=-r}for(;;){if((n-=(a=Math.floor(r/t))*e)<0)return-i;if(n>e)return i;if(t>(r-=a*t)+r){if(en+n)return-i;r=t-r,n=e-n,i=-i}if(0===n)return 0===r?0:-i;if(0===r)return i;if((e-=(a=Math.floor(t/r))*n)<0)return i;if(e>n)return-i;if(r>(t-=a*r)+t){if(ne+e)return i;t=r-t,e=n-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var at=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};at.prototype.countSegment=function(t,e){if(t.xn&&(r=e.x,n=t.x),this._p.x>=r&&this._p.x<=n&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,s=e.y-this._p.y,u=ot.signOfDet2x2(i,o,a,s);if(0===u)return this._isPointOnSegment=!0,null;s0&&this._crossingCount++}},at.prototype.isPointInPolygon=function(){return this.getLocation()!==M.EXTERIOR},at.prototype.getLocation=function(){return this._isPointOnSegment?M.BOUNDARY:this._crossingCount%2==1?M.INTERIOR:M.EXTERIOR},at.prototype.isOnSegment=function(){return this._isPointOnSegment},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.locatePointInRing=function(){if(arguments[0]instanceof I&&A(arguments[1],U)){for(var t=arguments[1],e=new at(arguments[0]),r=new I,n=new I,i=1;i1||s<0||s>1)&&(i=!0)}}else i=!0;return i?L.min(st.distancePointLine(t,r,n),st.distancePointLine(e,r,n),st.distancePointLine(r,t,e),st.distancePointLine(n,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==M.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,n=new I;t.getCoordinate(0,n);for(var i=n.x,o=n.y,a=1;ar.y&&(r=o,n=i)}var a=n;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(r)&&a!==n);var s=n;do{s=(s+1)%e}while(t[s].equals2D(r)&&s!==n);var u=t[a],l=t[s];if(u.equals2D(r)||l.equals2D(r)||u.equals2D(l))return!1;var c=st.computeOrientation(u,r,l);return 0===c?u.x>l.x:c>0},st.locatePointInRing=function(t,e){return at.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,r){var n=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),i=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/n;return Math.abs(i)*Math.sqrt(n)},st.computeOrientation=function(t,e,r){return st.orientationIndex(t,e,r)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new v("Line array must contain at least one vertex");for(var r=t.distance(e[0]),n=0;n=1)return o.distance(s);var c=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/u;return Math.abs(c)*Math.sqrt(u)}},st.isOnLine=function(t,e){for(var r=new it,n=1;n0},mt.prototype.interfaces_=function(){return[dt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.isInBoundary=function(t){return t>1},vt.prototype.interfaces_=function(){return[dt]},vt.prototype.getClass=function(){return vt};var _t=function(){};_t.prototype.isInBoundary=function(t){return 1===t},_t.prototype.interfaces_=function(){return[dt]},_t.prototype.getClass=function(){return _t};var xt=function(){};xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){},(r.prototype=new Error).name="IndexOutOfBoundsException";var bt=function(){};bt.prototype.hasNext=function(){},bt.prototype.next=function(){},bt.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(xt);(n.prototype=new Error).name="NoSuchElementException";var Et=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,xt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var r=this.array_[t];return this.array_[t]=e,r},e.prototype.iterator=function(){return new It(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new r;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l=0;c--)this.add(s[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof I){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(hm&&(v=-1);for(var _=y;_!==m;_+=v)this.add(d[_],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new I(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,r),e}(Et),Ct=function(){},Pt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Pt.ForwardComparator.get=function(){return Mt},Pt.BidirectionalComparator.get=function(){return Tt},Pt.coordArrayType.get=function(){return new Array(0).fill(null)},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Ct.ptNotInList=function(t,e){for(var r=0;r=t?e:[]},Ct.indexOf=function(t,e){for(var r=0;r0)&&(e=t[r]);return e},Ct.extract=function(t,e,r){e=L.clamp(e,0,t.length);var n=(r=L.clamp(r,-1,t.length))-e+1;r<0&&(n=0),e>=t.length&&(n=0),rn.length)return 1;if(0===r.length)return 0;var i=Ct.compare(r,n);return Ct.isEqualReversed(r,n)?0:i},Tt.prototype.OLDcompare=function(t,e){var r=t,n=e;if(r.lengthn.length)return 1;if(0===r.length)return 0;for(var i=Ct.increasingDirection(r),o=Ct.increasingDirection(n),a=i>0?0:r.length-1,s=o>0?0:r.length-1,u=0;u0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var r,n,i=this.root_;do{if(r=i,(n=t.compareTo(i.key))<0)i=i.left;else{if(!(n>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:r,color:Nt,getValue:function(){return this.value},getKey:function(){return this.key}};return n<0?r.left=a:r.right=a,this.fixAfterInsertion(a),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===l(s(s(t)))){var e=c(s(s(t)));1===a(e)?(u(s(t),Nt),u(e,Nt),u(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateLeft(t)),u(s(t),Nt),u(s(s(t)),1),this.rotateRight(s(s(t))))}else{var r=l(s(s(t)));1===a(r)?(u(s(t),Nt),u(r,Nt),u(s(s(t)),1),t=s(s(t))):(t===l(s(t))&&(t=s(t),this.rotateRight(t)),u(s(t),Nt),u(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=Nt},h.prototype.values=function(){var t=new Et,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new kt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var r=t.parent,n=t;null!==r&&n===r.right;)n=r,r=r.parent;return r},h.prototype.size=function(){return this.size_};var Dt=function(){};Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},p.prototype=new o,(f.prototype=new p).contains=function(t){for(var e=0,r=this.array_.length;e=0;){var a=i.substring(0,o);n.add(a),o=(i=i.substring(o+r)).indexOf(e)}i.length>0&&n.add(i);for(var s=new Array(n.size()).fill(null),u=0;u0)for(var o=i;o0&&n.append(" ");for(var o=0;o0&&n.append(","),n.append(Zt.toString(t.getOrdinate(i,o)))}return n.append(")"),n.toString()}},Wt.ensureValidRing=function(t,e){var r=e.size();return 0===r?e:r<=3?Wt.createClosedRing(t,e,4):e.getOrdinate(0,U.X)===e.getOrdinate(r-1,U.X)&&e.getOrdinate(0,U.Y)===e.getOrdinate(r-1,U.Y)?e:Wt.createClosedRing(t,e,r+1)},Wt.createClosedRing=function(t,e,r){var n=t.create(r,e.getDimension()),i=e.size();Wt.copy(e,0,n,0,i);for(var o=i;o0&&Wt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Wt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,r=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.MINIMUM_VALID_SIZE.get=function(){return 4},r.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,r),e}(Ht),re=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],r=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,r)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),r=0;r0?e.createPoint(r[0]):e.createPoint():t},ae.prototype.interfaces_=function(){return[ne.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Ht?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Jt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[ne.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new R(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(e=3),e<2?new ue(t):new ue(t,e)}},ce.prototype.interfaces_=function(){return[P,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he);var pe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Et,e=this.map_.values(),r=e.next();!r.done;)t.add(r.value),r=e.next();return t},e.prototype.entrySet=function(){var t=new kt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(At),fe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ge){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var r=arguments[0];this._modelType=t.FIXED,this.setScale(r)}else if(arguments[0]instanceof t){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}},de={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fe.prototype.equals=function(t){if(!(t instanceof fe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fe.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),n=e.getMaximumSignificantDigits();return new N(r).compareTo(new N(n))},fe.prototype.getScale=function(){return this._scale},fe.prototype.isFloating=function(){return this._modelType===fe.FLOATING||this._modelType===fe.FLOATING_SINGLE},fe.prototype.getType=function(){return this._modelType},fe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fe.FLOATING?t="Floating":this._modelType===fe.FLOATING_SINGLE?t="Floating-Single":this._modelType===fe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return _.isNaN(t)||this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof I){var e=arguments[0];if(this._modelType===fe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fe.FLOATING?t=16:this._modelType===fe.FLOATING_SINGLE?t=6:this._modelType===fe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fe.prototype.setScale=function(t){this._scale=Math.abs(t)},fe.prototype.interfaces_=function(){return[e,b]},fe.prototype.getClass=function(){return fe},fe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},de.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},de.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,de);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new pe},Object.defineProperties(ge,ye),fe.Type=ge,fe.FIXED=new ge("FIXED"),fe.FLOATING=new ge("FLOATING"),fe.FLOATING_SINGLE=new ge("FLOATING SINGLE");var me=function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?A(arguments[0],P)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ve={serialVersionUID:{configurable:!0}};me.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new I(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new I(t.getMinX(),t.getMinY()),new I(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new I(t.getMinX(),t.getMinY()),new I(t.getMinX(),t.getMaxY()),new I(t.getMaxX(),t.getMaxY()),new I(t.getMaxX(),t.getMinY()),new I(t.getMinX(),t.getMinY())]),null)},me.prototype.createLineString=function(t){return t?t instanceof Array?new Ht(this.getCoordinateSequenceFactory().create(t),this):A(t,U)?new Ht(t,this):void 0:new Ht(this.getCoordinateSequenceFactory().create([]),this)},me.prototype.createMultiLineString=function(){return 0===arguments.length?new jt(null,this):1===arguments.length?new jt(arguments[0],this):void 0},me.prototype.buildGeometry=function(t){for(var e=null,r=!1,n=!1,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===e&&(e=a),a!==e&&(r=!0),o.isGeometryCollectionOrDerived()&&(n=!0)}if(null===e)return this.createGeometryCollection();if(r||n)return this.createGeometryCollection(me.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof $t)return this.createMultiPolygon(me.toPolygonArray(t));if(s instanceof Ht)return this.createMultiLineString(me.toLineStringArray(t));if(s instanceof Jt)return this.createMultiPoint(me.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},me.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},me.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(A(arguments[0],U))return new Jt(arguments[0],this)}},me.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},me.prototype.createPolygon=function(){if(0===arguments.length)return new $t(null,null,this);if(1===arguments.length){if(A(arguments[0],U)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var r=arguments[0];return this.createPolygon(r,null)}}else if(2===arguments.length)return new $t(arguments[0],arguments[1],this)},me.prototype.getSRID=function(){return this._SRID},me.prototype.createGeometryCollection=function(){return 0===arguments.length?new qt(null,this):1===arguments.length?new qt(arguments[0],this):void 0},me.prototype.createGeometry=function(t){return new ne(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},me.prototype.getPrecisionModel=function(){return this._precisionModel},me.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(A(arguments[0],U))return new ee(arguments[0],this)}},me.prototype.createMultiPolygon=function(){return 0===arguments.length?new re(null,this):1===arguments.length?new re(arguments[0],this):void 0},me.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(A(arguments[0],U)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(e.size()).fill(null),n=0;n=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e0&&this._minIndexthis._minCoord.y&&r.y>this._minCoord.y&&n===st.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Pe.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge().getCoordinates();if(e<0||e+1>=r.length)return-1;if(r[e].y===r[e+1].y)return-1;var n=Se.LEFT;return r[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=r,this._minCoord=e[r])},Pe.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Pe.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.isForward()&&this.checkForRightmostCoordinate(r)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Se.LEFT&&(this._orientedDe=this._minDe.getSym())},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe};var Me=function(t){function e(r,n){t.call(this,e.msgWithCoord(r,n)),this.pt=n?new I(n):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}($),Te=function(){this.array_=[]};Te.prototype.addLast=function(t){this.array_.push(t)},Te.prototype.removeFirst=function(){return this.array_.shift()},Te.prototype.isEmpty=function(){return 0===this.array_.length};var Ae=function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new Pe};Ae.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ae.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ae.prototype.computeNodeDepth=function(t){for(var e=null,r=t.getEdges().iterator();r.hasNext();){var n=r.next();if(n.isVisited()||n.getSym().isVisited()){e=n;break}}if(null===e)throw new Me("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ae.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Se.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ae.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ae.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Se.RIGHT)>=1&&e.getDepth(Se.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ae.prototype.computeDepths=function(t){var e=new kt,r=new Te,n=t.getNode();for(r.addLast(n),e.add(n),t.setVisited(!0);!r.isEmpty();){var i=r.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(r.addLast(s),e.add(s))}}}},Ae.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},Ae.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Z,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next().getEdge().getCoordinates(),n=0;nthis.location.length){var e=new Array(3).fill(null);e[Se.ON]=this.location[Se.ON],e[Se.LEFT]=M.NONE,e[Se.RIGHT]=M.NONE,this.location=e}for(var r=0;r1&&t.append(M.toLocationSymbol(this.location[Se.LEFT])),t.append(M.toLocationSymbol(this.location[Se.ON])),this.location.length>1&&t.append(M.toLocationSymbol(this.location[Se.RIGHT])),t.toString()},Le.prototype.setLocations=function(t,e,r){this.location[Se.ON]=t,this.location[Se.LEFT]=e,this.location[Se.RIGHT]=r},Le.prototype.get=function(t){return t1},Le.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Re.prototype.addPoints=function(t,e,r){var n=t.getCoordinates();if(e){var i=1;r&&(i=0);for(var o=i;o=0;s--)this._pts.add(n[s])}},Re.prototype.isHole=function(){return this._isHole},Re.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Re.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();)if(r.next().containsPoint(t))return!1;return!0},Re.prototype.addHole=function(t){this._holes.add(t)},Re.prototype.isShell=function(){return null===this._shell},Re.prototype.getLabel=function(){return this._label},Re.prototype.getEdges=function(){return this._edges},Re.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Re.prototype.getShell=function(){return this._shell},Re.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],r=arguments[0].getLocation(e,Se.RIGHT);if(r===M.NONE)return null;if(this._label.getLocation(e)===M.NONE)return this._label.setLocation(e,r),null}},Re.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Re.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(t)},Oe.prototype.isInResult=function(){return this._isInResult},Oe.prototype.isVisited=function(){return this._isVisited},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe};var ze=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new ke(0,M.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var r=M.NONE;if(r=this._label.getLocation(e),!t.isNull(e)){var n=t.getLocation(e);r!==M.BOUNDARY&&(r=n)}return r},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],r=arguments[1];null===this._label?this._label=new ke(e,r):this._label.setLocation(e,r)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof ke)for(var r=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(r,n);this._label.getLocation(n)===M.NONE&&this._label.setLocation(n,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=M.NONE;null!==this._label&&(e=this._label.getLocation(t));var r=null;switch(e){case M.BOUNDARY:r=M.INTERIOR;break;case M.INTERIOR:default:r=M.BOUNDARY}this._label.setLocation(t,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),Fe=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Fe.prototype.find=function(t){return this.nodeMap.get(t)},Fe.prototype.addNode=function(){if(arguments[0]instanceof I){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof ze){var r=arguments[0],n=this.nodeMap.get(r.getCoordinate());return null===n?(this.nodeMap.put(r.getCoordinate(),r),r):(n.mergeLabel(r),n)}},Fe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Fe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Fe.prototype.values=function(){return this.nodeMap.values()},Fe.prototype.getBoundaryNodes=function(t){for(var e=new Et,r=this.iterator();r.hasNext();){var n=r.next();n.getLabel().getLocation(t)===M.BOUNDARY&&e.add(n)}return e},Fe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var Be=function(){},Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.isNorthern=function(t){return t===Be.NE||t===Be.NW},Be.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Be.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var r=te?t:e)?3:r},Be.isInHalfPlane=function(t,e){return e===Be.SE?t===Be.SE||t===Be.SW:t===e||t===e+1},Be.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Be.NE:Be.SE:e>=0?Be.NW:Be.SW}if(arguments[0]instanceof I&&arguments[1]instanceof I){var r=arguments[0],n=arguments[1];if(n.x===r.x&&n.y===r.y)throw new v("Cannot compute the quadrant for two identical points "+r);return n.x>=r.x?n.y>=r.y?Be.NE:Be.SE:n.y>=r.y?Be.NW:Be.SW}},Ue.NE.get=function(){return 0},Ue.NW.get=function(){return 1},Ue.SW.get=function(){return 2},Ue.SE.get=function(){return 3},Object.defineProperties(Be,Ue);var Ve=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._edge=e,this.init(r,n),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}};Ve.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):r.addAll(a)}else n.add(o)}return n},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new Et,r=t.iterator();r.hasNext();){var n=r.next();if(n.isInResult()&&n.getLabel().isArea()&&null===n.getEdgeRing()){var i=new De(n,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next();n.isHole()&&n.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),n=r.getEnvelopeInternal(),i=r.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var u=s.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(n)&&st.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||a.contains(c))&&(o=u)}return o},Xe.prototype.findShell=function(t){for(var e=0,r=null,n=t.iterator();n.hasNext();){var i=n.next();i.isHole()||(r=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},Xe.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],r=arguments[1];Ge.linkResultDirectedEdges(r);var n=this.buildMaximalEdgeRings(e),i=new Et,o=this.buildMinimalEdgeRings(n,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var Ze=function(){};Ze.prototype.getBounds=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Ye=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ye.prototype.getItem=function(){return this._item},Ye.prototype.getBounds=function(){return this._bounds},Ye.prototype.interfaces_=function(){return[Ze,e]},Ye.prototype.getClass=function(){return Ye};var We=function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)};We.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},We.prototype.size=function(){return this._size},We.prototype.reorder=function(t){for(var e=null,r=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(r)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,r)},We.prototype.clear=function(){this._size=0,this._items.clear()},We.prototype.isEmpty=function(){return 0===this._size},We.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var He=function(){};He.prototype.visitItem=function(t){},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Ke=function(){};Ke.prototype.insert=function(t,e){},Ke.prototype.remove=function(t,e){},Ke.prototype.query=function(){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Je=function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Qe={serialVersionUID:{configurable:!0}};Je.prototype.getLevel=function(){return this._level},Je.prototype.size=function(){return this._childBoundables.size()},Je.prototype.getChildBoundables=function(){return this._childBoundables},Je.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Je.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Je.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Je.prototype.interfaces_=function(){return[Ze,e]},Je.prototype.getClass=function(){return Je},Qe.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Je,Qe);var $e=function(){};$e.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$e.min=function(t){return $e.sort(t),t.get(0)},$e.sort=function(t,e){var r=t.toArray();e?zt.sort(r,e):zt.sort(r);for(var n=t.iterator(),i=0,o=r.length;itr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(n)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new v("neither boundable is composite")},tr.prototype.isLeaves=function(){return!(tr.isComposite(this._boundable1)||tr.isComposite(this._boundable2))},tr.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},tr.prototype.expand=function(t,e,r,n){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new tr(o,e,this._itemDistance);a.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=r}},rr={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};er.prototype.getNodeCapacity=function(){return this._nodeCapacity},er.prototype.lastNode=function(t){return t.get(t.size()-1)},er.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var r=e.next();r instanceof Je?t+=this.size(r):r instanceof Ye&&(t+=1)}return t}},er.prototype.removeItem=function(t,e){for(var r=null,n=t.getChildBoundables().iterator();n.hasNext();){var i=n.next();i instanceof Ye&&i.getItem()===e&&(r=i)}return null!==r&&(t.getChildBoundables().remove(r),!0)},er.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Et:t}if(1===arguments.length){for(var e=arguments[0],r=new Et,n=e.getChildBoundables().iterator();n.hasNext();){var i=n.next();if(i instanceof Je){var o=this.itemsTree(i);null!==o&&r.add(o)}else i instanceof Ye?r.add(i.getItem()):et.shouldNeverReachHere()}return r.size()<=0?null:r}},er.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ye(t,e))},er.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];if(et.isTrue(r>-2),n.getLevel()===r)return i.add(n),null;for(var o=n.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Je?this.boundablesAtLevel(r,a,i):(et.isTrue(a instanceof Ye),-1===r&&i.add(a))}return null}},er.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var r=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,n)}else if(3===arguments.length)if(A(arguments[2],He)&&arguments[0]instanceof Object&&arguments[1]instanceof Je)for(var i=arguments[0],o=arguments[2],a=arguments[1].getChildBoundables(),s=0;st&&(t=n)}}return t+1}},er.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=new Et;r.add(this.createNode(e));var n=new Et(t);$e.sort(n,this.getComparator());for(var i=n.iterator();i.hasNext();){var o=i.next();this.lastNode(r).getChildBoundables().size()===this.getNodeCapacity()&&r.add(this.createNode(e)),this.lastNode(r).addChildBoundable(o)}return r},er.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},er.prototype.interfaces_=function(){return[e]},er.prototype.getClass=function(){return er},er.compareDoubles=function(t,e){return t>e?1:t0);for(var r=new Et,n=0;n0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],d=new Ye(arguments[0],arguments[1]),g=new tr(this.getRoot(),d,f);return this.nearestNeighbour(g)[0]}},r.prototype.interfaces_=function(){return[Ke,e]},r.prototype.getClass=function(){return r},r.centreX=function(t){return r.avg(t.getMinX(),t.getMaxX())},r.avg=function(t,e){return(t+e)/2},r.centreY=function(t){return r.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return ar},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,n){return t.compareDoubles(r.centreX(e.getBounds()),r.centreX(n.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,n){return t.compareDoubles(r.centreY(e.getBounds()),r.centreY(n.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(r,n),r}(er),ar=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var r=e.next();null===t?t=new Z(r.getBounds()):t.expandToInclude(r.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Je),sr=function(){};sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},sr.relativeSign=function(t,e){return te?1:0},sr.compare=function(t,e,r){if(e.equals2D(r))return 0;var n=sr.relativeSign(e.x,r.x),i=sr.relativeSign(e.y,r.y);switch(t){case 0:return sr.compareValue(n,i);case 1:return sr.compareValue(i,n);case 2:return sr.compareValue(i,-n);case 3:return sr.compareValue(-n,i);case 4:return sr.compareValue(-n,-i);case 5:return sr.compareValue(-i,-n);case 6:return sr.compareValue(-i,n);case 7:return sr.compareValue(n,-i)}return et.shouldNeverReachHere("invalid octant value"),0},sr.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ur=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._segString=t,this.coord=new I(e),this.segmentIndex=r,this._segmentOctant=n,this._isInterior=!e.equals2D(t.getCoordinate(r))};ur.prototype.getCoordinate=function(){return this.coord},ur.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ur.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:sr.compare(this._segmentOctant,this.coord,e.coord)},ur.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ur.prototype.isInterior=function(){return this._isInterior},ur.prototype.interfaces_=function(){return[b]},ur.prototype.getClass=function(){return ur};var lr=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};lr.prototype.getSplitCoordinates=function(){var t=new St;this.addEndpoints();for(var e=this.iterator(),r=e.next();e.hasNext();){var n=e.next();this.addEdgeCoordinates(r,n,t),r=n}return t.toCoordinateArray()},lr.prototype.addCollapsedNodes=function(){var t=new Et;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var r=e.next().intValue();this.add(this._edge.getCoordinate(r),r)}},lr.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},lr.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?r>=n?0:1:r>=n?7:6:e>=0?r>=n?3:2:r>=n?4:5}if(arguments[0]instanceof I&&arguments[1]instanceof I){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new v("Cannot compute the octant for two identical points "+i);return cr.octant(a,s)}};var hr=function(){};hr.prototype.getCoordinates=function(){},hr.prototype.size=function(){},hr.prototype.getCoordinate=function(t){},hr.prototype.isClosed=function(){},hr.prototype.setData=function(t){},hr.prototype.getData=function(){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var pr=function(){};pr.prototype.addIntersection=function(t,e){},pr.prototype.interfaces_=function(){return[hr]},pr.prototype.getClass=function(){return pr};var fr=function(){this._nodeList=new lr(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};fr.prototype.getCoordinates=function(){return this._pts},fr.prototype.size=function(){return this._pts.length},fr.prototype.getCoordinate=function(t){return this._pts[t]},fr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},fr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},fr.prototype.setData=function(t){this._data=t},fr.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:cr.octant(t,e)},fr.prototype.getData=function(){return this._data},fr.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var r=arguments[1],n=arguments[3],i=new I(arguments[0].getIntersection(n));this.addIntersection(i,r)}},fr.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},fr.prototype.getNodeList=function(){return this._nodeList},fr.prototype.addIntersectionNode=function(t,e){var r=e,n=r+1;if(n=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}if(arguments[0]instanceof I){var n=arguments[0];return st.orientationIndex(this.p0,this.p1,n)}},dr.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dr.prototype.isVertical=function(){return this.p0.x===this.p1.x},dr.prototype.equals=function(t){if(!(t instanceof dr))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dr.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dr.prototype.project=function(){if(arguments[0]instanceof I){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new I(t);var e=this.projectionFactor(t),r=new I;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof dr){var n=arguments[0],i=this.projectionFactor(n.p0),o=this.projectionFactor(n.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(n.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(n.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new dr(a,s)}},dr.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dr.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dr.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dr.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},dr.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dr.prototype.midPoint=function(){return dr.midPoint(this.p0,this.p1)},dr.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,n=e*e+r*r;return n<=0?_.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/n},dr.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var r=new Array(2).fill(null),n=_.MAX_VALUE,i=null,o=this.closestPoint(t.p0);n=o.distance(t.p0),r[0]=o,r[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||_.isNaN(e))&&(e=1),e},dr.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dr.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dr.prototype.distance=function(){if(arguments[0]instanceof dr){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof I){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},dr.prototype.pointAlong=function(t){var e=new I;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},dr.prototype.hashCode=function(){var t=_.doubleToLongBits(this.p0.x);t^=31*_.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),r=_.doubleToLongBits(this.p1.x);return r^=31*_.doubleToLongBits(this.p1.y),e^Math.trunc(r)^Math.trunc(r>>32)},dr.prototype.interfaces_=function(){return[b,e]},dr.prototype.getClass=function(){return dr},dr.midPoint=function(t,e){return new I((t.x+e.x)/2,(t.y+e.y)/2)},gr.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dr,gr);var yr=function(){this.tempEnv1=new Z,this.tempEnv2=new Z,this._overlapSeg1=new dr,this._overlapSeg2=new dr};yr.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],r=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var mr=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=n};mr.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},mr.prototype.computeSelect=function(t,e,r,n){var i=this._pts[e],o=this._pts[r];if(n.tempEnv1.init(i,o),r-e==1)return n.select(this,e),null;if(!t.intersects(n.tempEnv1))return null;var a=Math.trunc((e+r)/2);e=t.length-1)return t.length-1;for(var n=Be.quadrant(t[r],t[r+1]),i=e+1;ir.getId()&&(r.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.SegmentOverlapAction.get=function(){return wr},Object.defineProperties(e,r),e}(xr),wr=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],r=arguments[2],n=arguments[3],i=arguments[0].getContext(),o=r.getContext();this._si.processIntersections(i,e,o,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yr),Er=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.setQuadrantSegments(r),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},Ir={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Er.prototype.getEndCapStyle=function(){return this._endCapStyle},Er.prototype.isSingleSided=function(){return this._isSingleSided},Er.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Er.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Er.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Er.JOIN_ROUND&&(this._quadrantSegments=Er.DEFAULT_QUADRANT_SEGMENTS)},Er.prototype.getJoinStyle=function(){return this._joinStyle},Er.prototype.setJoinStyle=function(t){this._joinStyle=t},Er.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Er.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Er.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Er.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Er.prototype.getMitreLimit=function(){return this._mitreLimit},Er.prototype.setMitreLimit=function(t){this._mitreLimit=t},Er.prototype.setSingleSided=function(t){this._isSingleSided=t},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er},Er.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Ir.CAP_ROUND.get=function(){return 1},Ir.CAP_FLAT.get=function(){return 2},Ir.CAP_SQUARE.get=function(){return 3},Ir.JOIN_ROUND.get=function(){return 1},Ir.JOIN_MITRE.get=function(){return 2},Ir.JOIN_BEVEL.get=function(){return 3},Ir.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ir.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ir.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Er,Ir);var Sr=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},Cr={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Sr.prototype.isDeletable=function(t,e,r,n){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[r];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,n)&&this.isShallowSampled(i,o,t,r,n)},Sr.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(e),n=!1;r=0;n--)this.addPt(t[n])},Pr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=Tr.PI_TIMES_2;for(;t<=-Math.PI;)t+=Tr.PI_TIMES_2;return t},Tr.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],r=arguments[1],n=r.x-e.x,i=r.y-e.y;return Math.atan2(i,n)}},Tr.isAcute=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)>0},Tr.isObtuse=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)<0},Tr.interiorAngle=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r);return Math.abs(i-n)},Tr.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Tr.PI_TIMES_2;t>=Tr.PI_TIMES_2&&(t=0)}else{for(;t>=Tr.PI_TIMES_2;)t-=Tr.PI_TIMES_2;t<0&&(t=0)}return t},Tr.angleBetween=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r);return Tr.diff(n,i)},Tr.diff=function(t,e){var r=null;return(r=tMath.PI&&(r=2*Math.PI-r),r},Tr.toRadians=function(t){return t*Math.PI/180},Tr.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?Tr.COUNTERCLOCKWISE:r<0?Tr.CLOCKWISE:Tr.NONE},Tr.angleBetweenOriented=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r)-n;return i<=-Math.PI?i+Tr.PI_TIMES_2:i>Math.PI?i-Tr.PI_TIMES_2:i},Ar.PI_TIMES_2.get=function(){return 2*Math.PI},Ar.PI_OVER_2.get=function(){return Math.PI/2},Ar.PI_OVER_4.get=function(){return Math.PI/4},Ar.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},Ar.CLOCKWISE.get=function(){return st.CLOCKWISE},Ar.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Tr,Ar);var Lr=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new dr,this._seg1=new dr,this._offset0=new dr,this._offset1=new dr,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=r,this._li=new it,this._filletAngleQuantum=Math.PI/2/r.getQuadrantSegments(),r.getQuadrantSegments()>=8&&r.getJoinStyle()===Er.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},kr={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Lr.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=st.computeOrientation(this._s0,this._s1,this._s2),n=r===st.CLOCKWISE&&this._side===Se.LEFT||r===st.COUNTERCLOCKWISE&&this._side===Se.RIGHT;0===r?this.addCollinear(e):n?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},Lr.prototype.addLineEndCap=function(t,e){var r=new dr(t,e),n=new dr;this.computeOffsetSegment(r,Se.LEFT,this._distance,n);var i=new dr;this.computeOffsetSegment(r,Se.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Er.CAP_ROUND:this._segList.addPt(n.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Er.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(i.p1);break;case Er.CAP_SQUARE:var u=new I;u.x=Math.abs(this._distance)*Math.cos(s),u.y=Math.abs(this._distance)*Math.sin(s);var l=new I(n.p1.x+u.x,n.p1.y+u.y),c=new I(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},Lr.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Lr.prototype.addMitreJoin=function(t,e,r,n){var i=!0,o=null;try{o=X.intersection(e.p0,e.p1,r.p0,r.p1),(n<=0?1:o.distance(t)/Math.abs(n))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof j))throw t;o=new I(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,r,n,this._bufParams.getMitreLimit())},Lr.prototype.addFilletCorner=function(t,e,r,n,i){var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o),u=r.x-t.x,l=r.y-t.y,c=Math.atan2(l,u);n===st.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,n,i),this._segList.addPt(r)},Lr.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var r=new I((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var n=new I((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Lr.prototype.createCircle=function(t){var e=new I(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Lr.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Lr.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Pr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Lr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Lr.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Er.JOIN_BEVEL||this._bufParams.getJoinStyle()===Er.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,st.CLOCKWISE,this._distance))},Lr.prototype.closeRing=function(){this._segList.closeRing()},Lr.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},kr.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},kr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},kr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},kr.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Lr,kr);var Rr=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Rr.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var r=e<0,n=Math.abs(e),i=this.getSegGen(n);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,r,i);var o=i.getCoordinates();return r&&Ct.reverse(o),o},Rr.prototype.computeSingleSidedBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var i=Sr.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],Se.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{r.addSegments(t,!1);var s=Sr.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],Se.LEFT),r.addFirstSegment();for(var l=2;l<=u;l++)r.addNextSegment(s[l],!0)}r.addLastSegment(),r.closeRing()},Rr.prototype.computeRingBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);e===Se.RIGHT&&(n=-n);var i=Sr.simplify(t,n),o=i.length-1;r.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;r.addNextSegment(i[a],s)}r.closeRing()},Rr.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),n=Sr.simplify(t,r),i=n.length-1;e.initSideSegments(n[0],n[1],Se.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(n[o],!0);e.addLastSegment(),e.addLineEndCap(n[i-1],n[i]);var a=Sr.simplify(t,-r),s=a.length-1;e.initSideSegments(a[s],a[s-1],Se.LEFT);for(var u=s-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},Rr.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Er.CAP_ROUND:e.createCircle(t);break;case Er.CAP_SQUARE:e.createSquare(t)}},Rr.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var r=Math.abs(e),n=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],n);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,n)}else this.computeLineBufferCurve(t,n);return n.getCoordinates()},Rr.prototype.getBufferParameters=function(){return this._bufParams},Rr.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Rr.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return Rr.copyCoordinates(t);var n=this.getSegGen(r);return this.computeRingBufferCurve(t,e,n),n.getCoordinates()},Rr.prototype.computeOffsetCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){var i=Sr.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],Se.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{var s=Sr.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],Se.LEFT),r.addFirstSegment();for(var l=2;l<=u;l++)r.addNextSegment(s[l],!0)}r.addLastSegment()},Rr.prototype.getSegGen=function(t){return new Lr(this._precisionModel,this._bufParams,t)},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;ri.getMaxY()||this.findStabbedSegments(t,n.getDirectedEdges(),e)}return e}if(3===arguments.length)if(A(arguments[2],wt)&&arguments[0]instanceof I&&arguments[1]instanceof qe){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=a.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,o)===st.RIGHT)){var c=a.getDepth(Se.LEFT);this._seg.p0.equals(u[l])||(c=a.getDepth(Se.RIGHT));var h=new Or(this._seg,c);s.add(h)}}else if(A(arguments[2],wt)&&arguments[0]instanceof I&&A(arguments[1],wt))for(var p=arguments[0],f=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(p,g,f)}},Nr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:$e.min(e)._leftDepth},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Dr.DepthSegment.get=function(){return Or},Object.defineProperties(Nr,Dr);var Or=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dr(t),this._leftDepth=e};Or.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==r||0!=(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?r:this._upwardSeg.compareTo(e._upwardSeg)},Or.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return 0!==r?r:t.p1.compareTo(e.p1)},Or.prototype.toString=function(){return this._upwardSeg.toString()},Or.prototype.interfaces_=function(){return[b]},Or.prototype.getClass=function(){return Or};var zr=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};zr.prototype.area=function(){return zr.area(this.p0,this.p1,this.p2)},zr.prototype.signedArea=function(){return zr.signedArea(this.p0,this.p1,this.p2)},zr.prototype.interpolateZ=function(t){if(null===t)throw new v("Supplied point is null.");return zr.interpolateZ(t,this.p0,this.p1,this.p2)},zr.prototype.longestSideLength=function(){return zr.longestSideLength(this.p0,this.p1,this.p2)},zr.prototype.isAcute=function(){return zr.isAcute(this.p0,this.p1,this.p2)},zr.prototype.circumcentre=function(){return zr.circumcentre(this.p0,this.p1,this.p2)},zr.prototype.area3D=function(){return zr.area3D(this.p0,this.p1,this.p2)},zr.prototype.centroid=function(){return zr.centroid(this.p0,this.p1,this.p2)},zr.prototype.inCentre=function(){return zr.inCentre(this.p0,this.p1,this.p2)},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},zr.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},zr.det=function(t,e,r,n){return t*n-e*r},zr.interpolateZ=function(t,e,r,n){var i=e.x,o=e.y,a=r.x-i,s=n.x-i,u=r.y-o,l=n.y-o,c=a*l-s*u,h=t.x-i,p=t.y-o,f=(l*h-s*p)/c,d=(-u*h+a*p)/c;return e.z+f*(r.z-e.z)+d*(n.z-e.z)},zr.longestSideLength=function(t,e,r){var n=t.distance(e),i=e.distance(r),o=r.distance(t),a=n;return i>a&&(a=i),o>a&&(a=o),a},zr.isAcute=function(t,e,r){return!!Tr.isAcute(t,e,r)&&!!Tr.isAcute(e,r,t)&&!!Tr.isAcute(r,t,e)},zr.circumcentre=function(t,e,r){var n=r.x,i=r.y,o=t.x-n,a=t.y-i,s=e.x-n,u=e.y-i,l=2*zr.det(o,a,s,u),c=zr.det(a,o*o+a*a,u,s*s+u*u),h=zr.det(o,o*o+a*a,s,s*s+u*u);return new I(n-c/l,i+h/l)},zr.perpendicularBisector=function(t,e){var r=e.x-t.x,n=e.y-t.y,i=new X(t.x+r/2,t.y+n/2,1),o=new X(t.x-n+r/2,t.y+r+n/2,1);return new X(i,o)},zr.angleBisector=function(t,e,r){var n=e.distance(t),i=n/(n+e.distance(r)),o=r.x-t.x,a=r.y-t.y;return new I(t.x+i*o,t.y+i*a)},zr.area3D=function(t,e,r){var n=e.x-t.x,i=e.y-t.y,o=e.z-t.z,a=r.x-t.x,s=r.y-t.y,u=r.z-t.z,l=i*u-o*s,c=o*a-n*u,h=n*s-i*a,p=l*l+c*c+h*h;return Math.sqrt(p)/2},zr.centroid=function(t,e,r){var n=(t.x+e.x+r.x)/3,i=(t.y+e.y+r.y)/3;return new I(n,i)},zr.inCentre=function(t,e,r){var n=e.distance(r),i=t.distance(r),o=t.distance(e),a=n+i+o,s=(n*t.x+i*e.x+o*r.x)/a,u=(n*t.y+i*e.y+o*r.y)/a;return new I(s,u)};var Fr=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};Fr.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,M.EXTERIOR,M.INTERIOR)},Fr.prototype.addPolygon=function(t){var e=this._distance,r=Se.LEFT;this._distance<0&&(e=-this._distance,r=Se.RIGHT);var n=t.getExteriorRing(),i=Ct.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,r,M.EXTERIOR,M.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,e,Se.opposite(r),M.INTERIOR,M.EXTERIOR)}},Fr.prototype.isTriangleErodedCompletely=function(t,e){var r=new zr(t[0],t[1],t[2]),n=r.inCentre();return st.distancePointLine(n,r.p0,r.p1)=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(o=i,a=n,r=Se.opposite(r));var s=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(s,o,a)},Fr.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $t?this.addPolygon(t):t instanceof Ht?this.addLineString(t):t instanceof Jt?this.addPoint(t):(t instanceof te||t instanceof jt||t instanceof re||t instanceof qt)&&this.addCollection(t)},Fr.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(4===r.length)return this.isTriangleErodedCompletely(r,e);var n=t.getEnvelopeInternal(),i=Math.min(n.getHeight(),n.getWidth());return e<0&&2*Math.abs(e)>i},Fr.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new n;var t=this._parent.getGeometryN(this._index++);return t instanceof qt?(this._subcollectionIterator=new Ur(t),this._subcollectionIterator.next()):t},Ur.prototype.remove=function(){throw new Error(this.getClass().getName())},Ur.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Ur.prototype.interfaces_=function(){return[bt]},Ur.prototype.getClass=function(){return Ur},Ur.isAtomic=function(t){return!(t instanceof qt)};var Vr=function(){this._geom=null;var t=arguments[0];this._geom=t};Vr.prototype.locate=function(t){return Vr.locate(t,this._geom)},Vr.prototype.interfaces_=function(){return[Br]},Vr.prototype.getClass=function(){return Vr},Vr.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},Vr.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Vr.isPointInRing(t,r))return!1;for(var n=0;n=0;r--){var n=this._edgeList.get(r),i=n.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=n}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),r=t.getDepth(Se.LEFT),n=t.getDepth(Se.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),r);if(this.computeDepths(0,e,i)!==n)throw new Me("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],a=arguments[2],s=arguments[0];s=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),n){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;r=a,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;r.setNextMin(o),n=this._SCANNING_FOR_INCOMING}}n===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),r.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var r=arguments[0],n=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===r&&n++;return n}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=M.NONE,e=this.iterator();e.hasNext();){var r=e.next(),n=r.getSym();if(!r.isLineEdge()){if(r.isInResult()){t=M.INTERIOR;break}if(n.isInResult()){t=M.EXTERIOR;break}}}if(t===M.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===M.INTERIOR):(a.isInResult()&&(i=M.EXTERIOR),s.isInResult()&&(i=M.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new ke(M.NONE);for(var r=this.iterator();r.hasNext();)for(var n=r.next().getEdge().getLabel(),i=0;i<2;i++){var o=n.getLocation(i);o!==M.INTERIOR&&o!==M.BOUNDARY||this._label.setLocation(i,M.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(qr),Gr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new ze(t,new jr)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),Xr=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Xr.prototype.compareTo=function(t){var e=t;return Xr.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Xr.prototype.interfaces_=function(){return[b]},Xr.prototype.getClass=function(){return Xr},Xr.orientation=function(t){return 1===Ct.increasingDirection(t)},Xr.compareOriented=function(t,e,r,n){for(var i=e?1:-1,o=n?1:-1,a=e?t.length:-1,s=n?r.length:-1,u=e?0:t.length-1,l=n?0:r.length-1;;){var c=t[u].compareTo(r[l]);if(0!==c)return c;var h=(u+=i)===a,p=(l+=o)===s;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Zr=function(){this._edges=new Et,this._ocaMap=new h};Zr.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var n=r.getCoordinates(),i=0;i0&&t.print(","),t.print(n[i].x+" "+n[i].y);t.println(")")}t.print(") ")},Zr.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Zr.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(n);i||r--;var o=new Array(r).fill(null),a=0;o[a++]=new I(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new en(o,new ke(this.edge._label))},Kr.prototype.add=function(t,e,r){var n=new Hr(t,e,r),i=this._nodeMap.get(n);return null!==i?i:(this._nodeMap.put(n,n),n)},Kr.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr};var Jr=function(){};Jr.prototype.getChainStartIndices=function(t){var e=0,r=new Et;r.add(new N(e));do{var n=this.findChainEnd(t,e);r.add(new N(n)),e=n}while(er?e:r},Qr.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return ee&&(n=1),this._depth[t][r]=n}}},$r.prototype.getDelta=function(t){return this._depth[t][Se.RIGHT]-this._depth[t][Se.LEFT]},$r.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?M.EXTERIOR:M.INTERIOR},$r.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},$r.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var r=1;r<3;r++){var n=t.getLocation(e,r);n!==M.EXTERIOR&&n!==M.INTERIOR||(this.isNull(e,r)?this._depth[e][r]=$r.depthAtLocation(n):this._depth[e][r]+=$r.depthAtLocation(n))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===M.INTERIOR&&this._depth[i][o]++}},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.depthAtLocation=function(t){return t===M.EXTERIOR?0:t===M.INTERIOR?1:$r.NULL_VALUE},tn.NULL_VALUE.get=function(){return-1},Object.defineProperties($r,tn);var en=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kr(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new $r,this._depthDelta=0,1===arguments.length){var r=arguments[0];e.call(this,r,null)}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,ke.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;if(this.pts.length!==r.pts.length)return!1;for(var n=!0,i=!0,o=this.pts.length,a=0;a0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Qr(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Z;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;en||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(a&&s),"Found bad envelope test"),s},sn.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new I(this._maxx,this._maxy),this._corner[1]=new I(this._minx,this._maxy),this._corner[2]=new I(this._minx,this._miny),this._corner[3]=new I(this._maxx,this._miny)},sn.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sn.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sn.prototype.getCoordinate=function(){return this._originalPt},sn.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sn.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sn.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Z(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sn.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},sn.prototype.intersectsToleranceSquare=function(t,e){var r=!1,n=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||r&&n||t.equals(this._pt)||e.equals(this._pt)))))},sn.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),n=t.getCoordinate(e+1);return!!this.intersects(r,n)&&(t.addIntersection(this.getCoordinate(),e),!0)},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},un.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sn,un);var ln=function(){this.tempEnv1=new Z,this.selectedSegment=new dr};ln.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var cn=function(){this._index=null;var t=arguments[0];this._index=t},hn={HotPixelSnapAction:{configurable:!0}};cn.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2],i=e.getSafeEnvelope(),o=new pn(e,r,n);return this._index.query(i,{interfaces_:function(){return[He]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},hn.HotPixelSnapAction.get=function(){return pn},Object.defineProperties(cn,hn);var pn=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],r=arguments[0].getContext();if(null!==this._parentEdge&&r===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ln),fn=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Et};fn.prototype.processIntersections=function(t,e,r,n){if(t===r&&e===n)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Me))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var r=arguments[0],n=gn.precisionScaleFactor(this._argGeom,this._distance,r),i=new fe(n);this.bufferFixedPrecision(i)}},gn.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gn.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gn.prototype.bufferOriginalPrecision=function(){try{var t=new rn(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof $))throw t;this._saveException=t}},gn.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gn.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn},gn.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new gn(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],r=arguments[2],n=new gn(arguments[0]);return n.setQuadrantSegments(r),n.getResultGeometry(e)}if(arguments[2]instanceof Er&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var i=arguments[1];return new gn(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],a=arguments[2],s=arguments[3],u=new gn(arguments[0]);return u.setQuadrantSegments(a),u.setEndCapStyle(s),u.getResultGeometry(o)}},gn.precisionScaleFactor=function(t,e,r){var n=t.getEnvelopeInternal(),i=L.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY()))+2*(e>0?e:0),o=r-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},yn.CAP_ROUND.get=function(){return Er.CAP_ROUND},yn.CAP_BUTT.get=function(){return Er.CAP_FLAT},yn.CAP_FLAT.get=function(){return Er.CAP_FLAT},yn.CAP_SQUARE.get=function(){return Er.CAP_SQUARE},yn.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gn,yn);var mn=function(){this._pt=[new I,new I],this._distance=_.NaN,this._isNull=!0};mn.prototype.getCoordinates=function(){return this._pt},mn.prototype.getCoordinate=function(t){return this._pt[t]},mn.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var n=e.distance(r);nthis._distance&&this.initialize(e,r,n)}},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var vn=function(){};vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.computeDistance=function(){if(arguments[2]instanceof mn&&arguments[0]instanceof Ht&&arguments[1]instanceof I)for(var t=arguments[1],e=arguments[2],r=arguments[0].getCoordinates(),n=new dr,i=0;i0||this._isIn?M.INTERIOR:M.EXTERIOR)},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn};var Cn=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._component=e,this._segIndex=r,this._pt=n}},Pn={INSIDE_AREA:{configurable:!0}};Cn.prototype.isInsideArea=function(){return this._segIndex===Cn.INSIDE_AREA},Cn.prototype.getCoordinate=function(){return this._pt},Cn.prototype.getGeometryComponent=function(){return this._component},Cn.prototype.getSegmentIndex=function(){return this._segIndex},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Pn.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Cn,Pn);var Mn=function(t){this._pts=t||null};Mn.prototype.filter=function(t){t instanceof Jt&&this._pts.add(t)},Mn.prototype.interfaces_=function(){return[Ut]},Mn.prototype.getClass=function(){return Mn},Mn.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Jt?$e.singletonList(t):Mn.getPoints(t,new Et)}if(2===arguments.length){var e=arguments[0],r=arguments[1];return e instanceof Jt?r.add(e):e instanceof qt&&e.apply(new Mn(r)),r}};var Tn=function(){this._locations=null;var t=arguments[0];this._locations=t};Tn.prototype.filter=function(t){(t instanceof Jt||t instanceof Ht||t instanceof $t)&&this._locations.add(new Cn(t,0,t.getCoordinate()))},Tn.prototype.interfaces_=function(){return[Ut]},Tn.prototype.getClass=function(){return Tn},Tn.getLocations=function(t){var e=new Et;return t.apply(new Tn(e)),e};var An=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Sn,this._minDistanceLocation=null,this._minDistance=_.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=n,this._terminateDistance=i}};An.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=1-e,i=En.getPolygons(this._geom[e]);if(i.size()>0){var o=Tn.getLocations(this._geom[n]);if(this.computeContainmentDistance(o,i,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=r[0],this._minDistanceLocation[e]=r[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&A(arguments[0],wt)&&A(arguments[1],wt)){for(var a=arguments[0],s=arguments[1],u=arguments[2],l=0;lthis._minDistance)return null;for(var n=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var h=u.getCoordinates(),p=l.getCoordinates(),f=0;fthis._distance&&this.initialize(e,r,n)}},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln};var kn=function(){};kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.computeDistance=function(){if(arguments[2]instanceof Ln&&arguments[0]instanceof Ht&&arguments[1]instanceof I)for(var t=arguments[0],e=arguments[1],r=arguments[2],n=new dr,i=t.getCoordinates(),o=0;o1||t<=0)throw new v("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Rn.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Rn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Rn.prototype.computeOrientedDistance=function(t,e,r){var n=new Dn(e);if(t.apply(n),r.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var i=new On(e,this._densifyFrac);t.apply(i),r.setMaximum(i.getMaxPointDistance())}},Rn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},Rn.distance=function(){if(2===arguments.length)return new Rn(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Rn(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Nn.MaxPointDistanceFilter.get=function(){return Dn},Nn.MaxDensifiedByFractionDistanceFilter.get=function(){return On},Object.defineProperties(Rn,Nn);var Dn=function(){this._maxPtDist=new Ln,this._minPtDist=new Ln,this._euclideanDist=new kn,this._geom=null;var t=arguments[0];this._geom=t};Dn.prototype.filter=function(t){this._minPtDist.initialize(),kn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Dn.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dn.prototype.interfaces_=function(){return[ft]},Dn.prototype.getClass=function(){return Dn};var On=function(){this._maxPtDist=new Ln,this._minPtDist=new Ln,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};On.prototype.filter=function(t,e){if(0===e)return null;for(var r=t.getCoordinate(e-1),n=t.getCoordinate(e),i=(n.x-r.x)/this._numSubSegs,o=(n.y-r.y)/this._numSubSegs,a=0;ar){this._isValid=!1;var i=n.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Q.toLineString(i[0],i[1])+")"}},zn.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=zn.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),zn.VERBOSE&&G.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},zn.prototype.checkNegativeValid=function(){if(!(this._input instanceof $t||this._input instanceof re||this._input instanceof qt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},zn.prototype.getErrorIndicator=function(){return this._errorIndicator},zn.prototype.checkMinimumDistance=function(t,e,r){var n=new An(t,e,r);if(this._minDistanceFound=n.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Bn.prototype.report=function(t){if(!Bn.VERBOSE)return null;G.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Bn.prototype.getErrorMessage=function(){return this._errorMsg},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Bn.isValidMsg=function(t,e,r){var n=new Bn(t,e,r);return n.isValid()?null:n.getErrorMessage()},Bn.isValid=function(t,e,r){return!!new Bn(t,e,r).isValid()},Un.VERBOSE.get=function(){return!1},Un.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Bn,Un);var Vn=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Vn.prototype.getCoordinates=function(){return this._pts},Vn.prototype.size=function(){return this._pts.length},Vn.prototype.getCoordinate=function(t){return this._pts[t]},Vn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Vn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:cr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Vn.prototype.setData=function(t){this._data=t},Vn.prototype.getData=function(){return this._data},Vn.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},Vn.prototype.interfaces_=function(){return[hr]},Vn.prototype.getClass=function(){return Vn};var qn=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};qn.prototype.getInteriorIntersection=function(){return this._interiorIntersection},qn.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},qn.prototype.getIntersectionSegments=function(){return this._intSegments},qn.prototype.count=function(){return this._intersectionCount},qn.prototype.getIntersections=function(){return this._intersections},qn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qn.prototype.setKeepIntersections=function(t){this._keepIntersections=t},qn.prototype.processIntersections=function(t,e,r,n){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===r&&e===n)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(r,n))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},qn.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},qn.prototype.hasIntersection=function(){return null!==this._interiorIntersection},qn.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},qn.prototype.interfaces_=function(){return[Yr]},qn.prototype.getClass=function(){return qn},qn.createAllIntersectionsFinder=function(t){var e=new qn(t);return e.setFindAllIntersections(!0),e},qn.createAnyIntersectionFinder=function(t){return new qn(t)},qn.createIntersectionCounter=function(t){var e=new qn(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var jn=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};jn.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jn.prototype.getIntersections=function(){return this._segInt.getIntersections()},jn.prototype.isValid=function(){return this.execute(),this._isValid},jn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jn.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new qn(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new br;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jn.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Me(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jn.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Q.toLineString(t[0],t[1])+" and "+Q.toLineString(t[2],t[3])},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.computeIntersections=function(t){var e=new jn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Gn=function t(){this._nv=null;var e=arguments[0];this._nv=new jn(t.toSegmentStrings(e))};Gn.prototype.checkValid=function(){this._nv.checkValid()},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn},Gn.toSegmentStrings=function(t){for(var e=new Et,r=t.iterator();r.hasNext();){var n=r.next();e.add(new Vn(n.getCoordinates(),n))}return e},Gn.checkValid=function(t){new Gn(t).checkValid()};var Xn=function(t){this._mapOp=t};Xn.prototype.map=function(t){for(var e=new Et,r=0;r0&&n<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var Hn=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dr,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Ht&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],n=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=n}};Hn.prototype.snapVertices=function(t,e){for(var r=this._isClosed?t.size()-1:t.size(),n=0;n=0&&t.add(o+1,new I(i),!1)}},Hn.prototype.findSegmentIndexToSnap=function(t,e){for(var r=_.MAX_VALUE,n=-1,i=0;ie&&(e=n)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Kn.computeOverlaySnapTolerance(i),Kn.computeOverlaySnapTolerance(o))}},Kn.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Kn.SNAP_PRECISION_FACTOR},Kn.snapToSelf=function(t,e,r){return new Kn(t).snapToSelf(e,r)},Jn.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kn,Jn);var Qn=function(t){function e(e,r,n){t.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=void 0!==n&&n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var r=new Hn(t,this._snapTolerance);return r.setAllowSnappingToSourceVertices(this._isSelfSnap),r.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var r=t.toCoordinateArray(),n=this.snapLine(r,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wn),$n=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};$n.prototype.getCommon=function(){return _.longBitsToDouble(this._commonBits)},$n.prototype.add=function(t){var e=_.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=$n.signExpBits(this._commonBits),this._isFirst=!1,null):$n.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=$n.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=$n.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},$n.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=_.longBitsToDouble(t),r="0000000000000000000000000000000000000000000000000000000000000000"+_.toBinaryString(t),n=r.substring(r.length-64);return n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]"}},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.getBit=function(t,e){return 0!=(t&1<>52},$n.zeroLowerBits=function(t,e){return t&~((1<=0;n--){if($n.getBit(t,n)!==$n.getBit(e,n))return r;r++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ri},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ni(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new I(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new ni(e);return t.apply(r),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ri},ei.Translater.get=function(){return ni},Object.defineProperties(ti,ei);var ri=function(){this._commonBitsX=new $n,this._commonBitsY=new $n};ri.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ri.prototype.getCommonCoordinate=function(){return new I(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ri.prototype.interfaces_=function(){return[ft]},ri.prototype.getClass=function(){return ri};var ni=function(){this.trans=null;var t=arguments[0];this.trans=t};ni.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,n=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,n)},ni.prototype.isDone=function(){return!1},ni.prototype.isGeometryChanged=function(){return!0},ni.prototype.interfaces_=function(){return[Vt]},ni.prototype.getClass=function(){return ni};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new Kn(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=Ci.overlayOp(e[0],e[1],t);return this.prepareResult(r)},ii.prototype.checkValid=function(t){t.isValid()||G.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Kn.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Kn.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,r){return new ii(t,e).getResultGeometry(r)},ii.union=function(t,e){return ii.overlayOp(t,e,Ci.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Ci.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Ci.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Ci.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,r=!1,n=null;try{e=Ci.overlayOp(this._geom[0],this._geom[1],t),r=!0}catch(t){if(!(t instanceof $))throw t;n=t}if(!r)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof $?n:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,r){return new oi(t,e).getResultGeometry(r)},oi.union=function(t,e){return oi.overlayOp(t,e,Ci.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Ci.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Ci.DIFFERENCE)};var ai=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};ai.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var si=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],r=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=r}else if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=n,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};si.prototype.isDelete=function(){return this._eventType===si.DELETE},si.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},si.prototype.getObject=function(){return this._obj},si.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},si.prototype.getInsertEvent=function(){return this._insertEvent},si.prototype.isInsert=function(){return this._eventType===si.INSERT},si.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},si.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},si.prototype.interfaces_=function(){return[b]},si.prototype.getClass=function(){return si},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(si,ui);var li=function(){};li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var ci=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};ci.prototype.isTrivialIntersection=function(t,e,r,n){if(t===r&&1===this._li.getIntersectionNum()){if(ci.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&n===i||0===n&&e===i)return!0}}return!1},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next().getCoordinate();if(t.isIntersection(n))return!0}return!1},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.prototype.addIntersections=function(t,e,r,n){if(t===r&&e===n)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,n)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),r.addIntersections(this._li,n,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var hi=function(t){function e(){t.call(this),this.events=new Et,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$e.sort(this.events);for(var t=0;te||this._maxo?1:0},di.prototype.interfaces_=function(){return[E]},di.prototype.getClass=function(){return di};var gi=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],r=arguments[1],n=arguments[2];this._min=e,this._max=r,this._item=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;r.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),yi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,r),null!==this._node2&&this._node2.query(t,e,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),mi=function(){this._leaves=new Et,this._root=null,this._level=0};mi.prototype.buildTree=function(){$e.sort(this._leaves,new pi.NodeComparator);for(var t=this._leaves,e=null,r=new Et;;){if(this.buildLevel(t,r),1===r.size())return r.get(0);e=t,t=r,r=e}},mi.prototype.insert=function(t,e,r){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new gi(t,e,r))},mi.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(t){G.out.println(Q.toLineString(new I(t._min,this._level),new I(t._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),r=0,n=t.iterator();n.hasNext();){var i=n.next();e[r++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,r){if(this.isBoundaryNode(t,e))return null;r===M.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,r)},e.prototype.addPolygonRing=function(t,e,r){if(t.isEmpty())return null;var n=Ct.removeRepeatedPoints(t.getCoordinates());if(n.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var i=e,o=r;st.isCCW(n)&&(i=r,o=e);var a=new en(n,new ke(this._argIndex,M.BOUNDARY,i,o));this._lineEdgeMap.put(t,a),this.insertEdge(a),this.insertPoint(this._argIndex,n[0],M.BOUNDARY)},e.prototype.insertPoint=function(t,e,r){var n=this._nodes.addNode(e),i=n.getLabel();null===i?n._label=new ke(t,r):i.setLocation(t,r)},e.prototype.createEdgeSetIntersector=function(){return new hi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var r=e.next(),n=r.getLabel().getLocation(t),i=r.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,n)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof re&&(this._useBoundaryDeterminationRule=!1),e instanceof $t)this.addPolygon(e);else if(e instanceof Ht)this.addLineString(e);else if(e instanceof Jt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof jt)this.addCollection(e);else if(e instanceof re)this.addCollection(e);else{if(!(e instanceof qt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new _i(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?M.BOUNDARY:M.INTERIOR},e}(Ge),Ii=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ei(0,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=dt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,e,n),this._arg[1]=new Ei(1,r,n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,i,a),this._arg[1]=new Ei(1,o,a)}};Ii.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ii.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Si=function(){};Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.map=function(){if(arguments[0]instanceof ct&&A(arguments[1],Si.MapOp)){for(var t=arguments[0],e=arguments[1],r=new Et,n=0;n=t.size()?null:t.get(e)},Ri.union=function(t){return new Ri(t).union()},Ni.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ri,Ni);var Di=function(){};Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.UNION)},t.GeoJSONReader=Ee,t.GeoJSONWriter=Ie,t.OverlayOp=Ci,t.UnionOp=Di,t.BufferOp=gn,Object.defineProperty(t,"__esModule",{value:!0})}(e)}},e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={id:n,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t=r(3379),e=r.n(t),n=r(7113);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var i=r(8754);e()(i.Z,{insert:"head",singleton:!1}),i.Z.locals,r(9631)})()})(); \ No newline at end of file diff --git a/docs/app.js.LICENSE.txt b/docs/app.js.LICENSE.txt new file mode 100644 index 0000000..644f94c --- /dev/null +++ b/docs/app.js.LICENSE.txt @@ -0,0 +1,60 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +/*! + * @license GNU Affero General Public License. + * Copyright (c) 2015, 2015 Ronny Lorenz + * v. 1.2.0 + * https://github.com/RaumZeit/MarchingSquares.js + * + * MarchingSquaresJS is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MarchingSquaresJS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * As additional permission under GNU Affero General Public License version 3 + * section 7, third-party projects (personal or commercial) may distribute, + * include, or link against UNMODIFIED VERSIONS of MarchingSquaresJS without the + * requirement that said third-party project for that reason alone becomes + * subject to any requirement of the GNU Affero General Public License version 3. + * Any modifications to MarchingSquaresJS, however, must be shared with the public + * and made available. + * + * In summary this: + * - allows you to use MarchingSquaresJS at no cost + * - allows you to use MarchingSquaresJS for both personal and commercial purposes + * - allows you to distribute UNMODIFIED VERSIONS of MarchingSquaresJS under any + * license as long as this license notice is included + * - enables you to keep the source code of your program that uses MarchingSquaresJS + * undisclosed + * - forces you to share any modifications you have made to MarchingSquaresJS, + * e.g. bug-fixes + * + * You should have received a copy of the GNU Affero General Public License + * along with MarchingSquaresJS. If not, see . + */ + +/** + * splaytree v3.1.0 + * Fast Splay tree for Node and browser + * + * @author Alexander Milevski + * @license MIT + * @preserve + */ + +/** + * @license get-closest https://github.com/cosmosio/get-closest + * + * The MIT License (MIT) + * + * Copyright (c) 2014-2017 Olivier Scherrer + */ diff --git a/docs/index.html b/docs/index.html index 0a1148a..4693ae0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,13 +1,13 @@ - - - - - Turf.js Starter - - -
- - + + + + + Turf.js Starter + + +
+ +