@maptalks/vt 0.92.3 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @maptalks/vt v0.92.3
2
+ * @maptalks/vt v0.93.0
3
3
  * LICENSE : undefined
4
4
  * (c) 2016-2024 maptalks.org
5
5
  */
@@ -11,13 +11,13 @@ import { reshader as n, vec3 as i, mat4 as r, GroundPainter as s, createREGL as
11
11
 
12
12
  import { isFunctionDefinition as p, loadFunctionTypes as m, piecewiseConstant as y, interpolated as g } from "@maptalks/function-type";
13
13
 
14
- import { IconRequestor as v, GlyphRequestor as x, FilterUtil as b, PackUtil as A, PointPack as w, VectorPack as _, StyledPoint as S, LinePack as M, StyledVector as P, SYMBOLS_NEED_REBUILD_IN_VECTOR as T, PolygonPack as k, ArrayPool as O, StyleUtil as I, DEFAULT_TEX_WIDTH as F, SYMBOLS_NEED_REBUILD_IN_VT as C, FuncTypeUtil as E, INVALID_TEX_COORD as D, TextUtil as R } from "@maptalks/vector-packer";
14
+ import { IconRequestor as v, GlyphRequestor as x, FilterUtil as b, PackUtil as A, PointPack as w, VectorPack as _, StyledPoint as S, LinePack as M, StyledVector as P, SYMBOLS_NEED_REBUILD_IN_VECTOR as T, PolygonPack as k, ArrayPool as O, StyleUtil as I, DEFAULT_TEX_WIDTH as F, SYMBOLS_NEED_REBUILD_IN_VT as C, FuncTypeUtil as E, INVALID_TEX_COORD as D, TextUtil as N } from "@maptalks/vector-packer";
15
15
 
16
16
  export { FilterUtil, PackUtil, SYMBOLS_NEED_REBUILD_IN_VECTOR, SYMBOLS_NEED_REBUILD_IN_VT } from "@maptalks/vector-packer";
17
17
 
18
18
  import L from "color";
19
19
 
20
- import N from "fast-deep-equal";
20
+ import R from "fast-deep-equal";
21
21
 
22
22
  import { vec2 as H, vec3 as z, vec4 as V } from "gl-matrix";
23
23
 
@@ -31,20 +31,20 @@ import X from "animation-easings";
31
31
 
32
32
  import { createFilter as Y } from "@maptalks/feature-filter";
33
33
 
34
- import $ from "@maptalks/vt-plugin";
34
+ import q from "@maptalks/vt-plugin";
35
35
 
36
- const q = 'function(t){let n;const e={width:100,height:10};function r(){if(!n){const{width:t,height:r}=e;OffscreenCanvas?n=new OffscreenCanvas(t,r):(n=document.createElement("canvas"),n.width=t,n.height=r)}return n}class i{constructor(t,n={}){if(!Array.isArray(t))return void console.error("colors is not array");if(t.length<2)return void console.error("colors.length should >1");this.colors=t;let r=1/0,i=-1/0;for(let n=0,e=t.length;n<e;n++){const e=t[n][0];r=Math.min(e,r),i=Math.max(e,i)}this.min=r,this.max=i,this.valueOffset=this.max-this.min,this.options=Object.assign({},e,n),this.t()}getImageData(){return this.imgData}t(){const t=r(),{width:n,height:e}=this.options;t.width=n,t.height=e;const i=t.getContext("2d");i.clearRect(0,0,t.width,t.height);const s=i.createLinearGradient(0,0,t.width,0),{colors:o,valueOffset:a}=this;for(let t=0,n=o.length;t<n;t++){const[n,e]=o[t],r=(n-this.min)/a;s.addColorStop(r,e)}i.fillStyle=s,i.fillRect(0,0,t.width,t.height),this.imgData=i.getImageData(0,0,t.width,t.height)}getColor(t){t=Math.max(this.min,t);const n=((t=Math.min(t,this.max))-this.min)/this.valueOffset;let e=Math.round(n*this.imgData.width);e=Math.min(e,this.imgData.width-1);const r=4*e;return[this.imgData.data[r],this.imgData.data[r+1],this.imgData.data[r+2],this.imgData.data[r+3]]}}var s;function o(t,n){for(let e=0;e<t.stops.length;e++)if(n===t.stops[e][0])return t.stops[e][1];return t.default}function a(t,n){for(var e=0;e<t.stops.length&&!(n<t.stops[e][0]);e++);return t.stops[Math.max(e-1,0)][1]}function u(t,n){for(var e=void 0!==t.base?t.base:1,r=0;!(r>=t.stops.length||n<=t.stops[r][0]);)r++;return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:function t(n,e,r,i,s,o){return"function"==typeof s?function(){var a=s.apply(void 0,arguments),u=o.apply(void 0,arguments);return t(n,e,r,i,a,u)}:s.length?function(t,n,e,r,i,s){var o=[];for(let a=0;a<i.length;a++)o[a]=f(t,n,e,r,i[a],s[a]);return o}(n,e,r,i,s,o):f(n,e,r,i,s,o)}(n,e,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}"function"==typeof Map&&(s=new Map);const h={width:100,height:1};function l(t,n){const e=t.stops;if(e&&e.length>1){let t;if(s){const n=JSON.stringify(e);if(!s.has(n)){const t=new i(e,h);s.set(n,t)}t=s.get(n)}else t=new i(e,h);const[r,o,a,u]=t.getColor(n);return[r/255,o/255,a/255,u/255]}return e&&1===e.length?e[0][1]:null}function c(t,n){return function(t,n,e){return void 0!==t?t:void 0!==n?n:void 0!==e?e:null}(n,t.default)}function f(t,n,e,r,i,s){var o,a=r-e,u=t-e;return i*(1-(o=1===n?u/a:(Math.pow(n,u)-1)/(Math.pow(n,a)-1)))+s*o}function d(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function p(t){return g(t,"exponential")}function y(t){return g(t,"interval")}function m(t,n){if(!t)return null;var e=!1;if(Array.isArray(t)){var r,i=[];for(let s=0;s<t.length;s++)(r=m(t[s],n))?(i.push(r),e=!0):i.push(t[s]);return e?i:t}var s,o={__fn_types_loaded:!0},a=[];for(s in t)t.hasOwnProperty(s)&&a.push(s);const u=function(t){Object.defineProperty(o,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=p(this["_"+t])),this["__fn_"+t].apply(this,n())},set:function(n){this["_"+t]=n},configurable:!0,enumerable:!0})};for(let n=0,r=a.length;n<r;n++)d(t[s=a[n]])?(e=!0,o["_"+s]=t[s],u(s)):o[s]=t[s];return e?o:t}function g(t,n){if(!d(t))return function(){return t};let e=!0,r=!0;const i=(t=JSON.parse(JSON.stringify(t))).stops;if(i)for(let t=0;t<i.length;t++)if(d(i[t][1])){const s=g(i[t][1],n);e=e&&s.isZoomConstant,r=r&&s.isFeatureConstant,i[t]=[i[t][0],s]}const s=function t(n,e){var r,i,s;if(d(n)){var h,f=n.stops&&"object"==typeof n.stops[0][0],p=f||void 0!==n.property,y=f||!p,m=n.type||e||"exponential";if("exponential"===m)h=u;else if("interval"===m)h=a;else if("categorical"===m)h=o;else if("identity"===m)h=c;else{if("color-interpolate"!==m)throw new Error(\'Unknown function type "\'+m+\'"\');h=l}if(f){var g={},v=[];for(let t=0;t<n.stops.length;t++){var b=n.stops[t];void 0===g[b[0].zoom]&&(g[b[0].zoom]={zoom:b[0].zoom,type:n.type,property:n.property,default:n.default,stops:[]}),g[b[0].zoom].stops.push([b[0].value,b[1]])}for(let n in g)v.push([g[n].zoom,t(g[n])]);r=function(t,e){const r=u({stops:v,base:n.base},t)(t,e);return"function"==typeof r?r(t,e):r},i=!1,s=!1}else y?(r=function(t){const e=h(n,t);return"function"==typeof e?e(t):e},i=!0,s=!1):(r=function(t,e){const r=h(n,e?e[n.property]:null);return"function"==typeof r?r(t,e):r},i=!1,s=!0)}else r=function(){return n},i=!0,s=!0;return r.isZoomConstant=s,r.isFeatureConstant=i,r}(t,n);return s.isZoomConstant=e&&s.isZoomConstant,s.isFeatureConstant=r&&s.isFeatureConstant,s}let v=0;const b="function"==typeof Object.assign;function w(t,...n){if(b)return Object.assign(t,...n),t;for(let e=0;e<n.length;e++){const r=n[e];for(const n in r)t[n]=r[n]}return t}function M(t){return!k(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function x(t){return"number"==typeof t&&!isNaN(t)}function F(t){return!k(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function A(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function k(t){return null==t}function P(t){for(let n=1;n<arguments.length;n++){const e=arguments[n];if(e)for(let n=0,r=e.length;n<r;n++)t.push(e[n])}return t.length}function S(t){return d(t)&&t.property}const _="function"==typeof fetch&&"function"==typeof AbortController,O={jsonp:function(t,n){const e="_maptalks_jsonp_"+v++;t.match(/\\?/)?t+="&callback="+e:t+="?callback="+e;let r=document.createElement("script");return r.type="text/javascript",r.src=t,window[e]=function(t){n(null,t),document.getElementsByTagName("head")[0].removeChild(r),r=null,delete window[e]},document.getElementsByTagName("head")[0].appendChild(r),this},get:function(t,n,e){if(F(n)){const t=e;e=n,n=t}(n=n||{}).method&&(n.method=n.method.toUpperCase());const r="POST"===n.method;if(_){const r=new AbortController,i=n;i.signal=r.signal,i.referrerPolicy=i.referrerPolicy||"origin",i.method=i.method||"GET";const s=new Request(t,i);return n.returnJSON&&s.headers.set("Accept","application/json"),fetch(s).then(r=>{const i=this.s(r,n.returnJSON,n.responseType);i.message?(i.url=t,e(i)):i.then(t=>{"arraybuffer"===n.responseType?e(null,{data:t,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),contentType:r.headers.get("Content-Type")}):e(null,t)}).catch(n=>{n.code&&n.code===DOMException.ABORT_ERR||(console.error("Fetch error:",t,n),e(n))})}).catch(n=>{n.code&&n.code===DOMException.ABORT_ERR||(console.error("Fetch error:",t,n),e(n))}),r}{const i=O.o(e);if(i.open(n.method||"GET",t,!0),n){for(const t in n.headers)i.setRequestHeader(t,n.headers[t]);i.withCredentials="include"===n.credentials,n.responseType&&(i.responseType=n.responseType)}return i.send(r?n.body:null),i}},s:(t,n,e)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`}:"arraybuffer"===e?t.arrayBuffer():n?t.json():t.text(),u:function(t,n){return function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?n({status:200,statusText:t.statusText,message:"http status 200 returned without content."}):n(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else n(null,t.responseText);else n({status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`})}},o:function(t){let n;try{n=new XMLHttpRequest}catch(t){try{n=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{n=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return n.onreadystatechange=O.u(n,t),n},getArrayBuffer(t,n,e){if(F(n)){const t=e;e=n,n=t}return n||(n={}),n.responseType="arraybuffer",O.get(t,n,e)}};function E(t,n,e,r,i,s){let o=i-e,a=s-r;if(0!==o||0!==a){const u=((t-e)*o+(n-r)*a)/(o*o+a*a);u>1?(e=i,r=s):u>0&&(e+=o*u,r+=a*u)}return o=t-e,a=n-r,o*o+a*a}function I(t,n,e,r,i,s){const o={id:null==t?null:t,type:n,geometry:e,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};i&&(o.layer=i);return function(t,n){const e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)$(t,e,n);else if("Polygon"===r)$(t,e[0],n);else if("MultiLineString"===r)for(const r of e)$(t,r,n);else if("MultiPolygon"===r)for(const r of e)$(t,r[0],n)}(o,s?4:3),o}function $(t,n,e){for(let r=0;r<n.length;r+=e)t.minX=Math.min(t.minX,n[r]),t.minY=Math.min(t.minY,n[r+1]),t.maxX=Math.max(t.maxX,n[r]),t.maxY=Math.max(t.maxY,n[r+1])}function C(t,n,e,r){if(r.layer=n,"FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)T(t,e.features[n],r,n);else"Feature"===e.type?T(t,e,r):T(t,{geometry:e},r)}function T(t,n,e,r){if(!n.geometry)return;const i=n.geometry.coordinates,s=n.geometry.type,o=Math.pow(e.tolerance/((1<<e.maxZoom)*e.extent),2);let a=[],u=n.id;if(e.promoteId?u=n.properties[e.promoteId]:e.generateId&&(u=r||0),"Point"===s)z(i,a,e);else if("MultiPoint"===s)for(const t of i)z(t,a,e);else if("LineString"===s)D(i,a,o,!1,e);else if("MultiLineString"===s){if(e.lineMetrics){for(const r of i)a=[],D(r,a,o,!1,e),t.push(I(u,"LineString",a,n.properties,e.layer,e.hasAltitude));return}j(i,a,o,!1,e)}else if("Polygon"===s)j(i,a,o,!0,e);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(const i of n.geometry.geometries)T(t,{id:u,geometry:i,properties:n.properties},e,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of i){const n=[];j(t,n,o,!0,e),a.push(n)}}t.push(I(u,s,a,n.properties,e.layer,e.hasAltitude))}function z(t,n,e){n.push(U(t[0]),N(t[1],e.projection),0),e.hasAltitude&&(t.length>2?n.push(t[2]):n.push(0))}function D(t,n,e,r,i){let s,o,a=0;for(let e=0;e<t.length;e++){const u=U(t[e][0]),h=N(t[e][1],i.projection);n.push(u,h,0),i.hasAltitude&&(t[e].length>2?n.push(t[e][2]):n.push(0)),e>0&&(a+=r?(s*h-u*o)/2:Math.sqrt(Math.pow(u-s,2)+Math.pow(h-o,2))),s=u,o=h}const u=i.hasAltitude?4:3,h=n.length-u;n[2]=1,function t(n,e,r,i,s=3){let o=i;const a=r-e>>1;let u,h=r-e;const l=n[e],c=n[e+1],f=n[r],d=n[r+1];for(let t=e+s;t<r;t+=s){const e=E(n[t],n[t+1],l,c,f,d);if(e>o)u=t,o=e;else if(e===o){const n=Math.abs(t-a);n<h&&(u=t,h=n)}}o>i&&(u-e>s&&t(n,e,u,i,s),n[u+2]=o,r-u>s&&t(n,u,r,i,s))}(n,0,h,e,u),n[h+2]=1,n.size=Math.abs(a),n.start=0,n.end=n.size}function j(t,n,e,r,i){for(let s=0;s<t.length;s++){const o=[];D(t[s],o,e,r,i),n.push(o)}}function U(t){return t/360+.5}function N(t,n){switch(n){case"EPSG:4326":return(90-t)/360}const 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 L(t,n,e,r,i,s,o,a){if(r/=n,s>=(e/=n)&&o<r)return t;if(o<e||s>=r)return null;const u=[];for(const n of t){const t=n.geometry;let s=n.type;const o=0===i?n.minX:n.minY,h=0===i?n.maxX:n.maxY;if(o>=e&&h<r){u.push(n);continue}if(h<e||o>=r)continue;let l=[];if("Point"===s||"MultiPoint"===s)V(t,l,e,r,i,a.hasAltitude);else if("LineString"===s)R(t,l,e,r,i,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===s)W(t,l,e,r,i,!1,a.hasAltitude);else if("Polygon"===s)W(t,l,e,r,i,!0,a.hasAltitude);else if("MultiPolygon"===s)for(const n of t){const t=[];W(n,t,e,r,i,!0,a.hasAltitude),t.length&&l.push(t)}if(l.length){if(a.lineMetrics&&"LineString"===s){for(const t of l)u.push(I(n.id,s,t,n.tags,n.layer,a.hasAltitude));continue}"LineString"!==s&&"MultiLineString"!==s||(1===l.length?(s="LineString",l=l[0]):s="MultiLineString"),"Point"!==s&&"MultiPoint"!==s||(s=3===l.length?"Point":"MultiPoint"),u.push(I(n.id,s,l,n.tags,n.layer,a.hasAltitude))}}return u.length?u:null}function V(t,n,e,r,i,s){const o=s?4:3;for(let a=0;a<t.length;a+=o){const o=t[a+i];o>=e&&o<=r&&(q(n,t[a],t[a+1],t[a+2]),s&&n.push(t[a+3]))}}function R(t,n,e,r,i,s,o,a){let u=H(t);const h=0===i?G:B;let l,c,f=t.start;const d=a?4:3,p=s?t.length:t.length-d;for(let y=0;y<p;y+=d){const m=t[y],g=t[y+1],v=t[y+2];let b,w,M,x;s&&y===p-d?(b=t[0],w=t[1]):(b=t[y+d],w=t[y+d+1]),a&&(M=t[y+3],x=s&&y===p-d?t[3]:t[y+d+3]);const F=0===i?m:g,A=0===i?b:w;let k=!1;o&&(l=Math.sqrt(Math.pow(m-b,2)+Math.pow(g-w,2))),F<e?A>e&&(c=h(u,m,g,b,w,e),a&&u.push(J(M,x,c)),o&&(u.start=f+l*c)):F>r?A<r&&(c=h(u,m,g,b,w,r),a&&u.push(J(M,x,c)),o&&(u.start=f+l*c)):(q(u,m,g,v),a&&u.push(M)),A<e&&F>=e&&(c=h(u,m,g,b,w,e),a&&u.push(J(M,x,c)),k=!0),A>r&&F<=r&&(c=h(u,m,g,b,w,r),a&&u.push(J(M,x,c)),k=!0),!s&&k&&(o&&(u.end=f+l*c),n.push(u),u=H(t)),o&&(f+=l)}let y=t.length-d;if(!s){const n=t[y],s=t[y+1],o=t[y+2],h=0===i?n:s;if(h>=e&&h<=r&&q(u,n,s,o),h>=e&&h<=r&&a){const n=t[y+3];u.push(n)}}y=u.length-d,s&&y>=d&&(u[y]!==u[0]||u[y+1]!==u[1])&&(q(u,u[0],u[1],u[2]),a&&u.push(u[3])),u.length&&n.push(u)}function H(t){const n=[];return n.size=t.size,n.start=t.start,n.end=t.end,n}function W(t,n,e,r,i,s,o){for(const a of t)R(a,n,e,r,i,s,!1,o)}function q(t,n,e,r){t.push(n,e,r)}function G(t,n,e,r,i,s){const o=(s-n)/(r-n);return q(t,s,e+(i-e)*o,1),o}function B(t,n,e,r,i,s){const o=(s-e)/(i-e);return q(t,n+(r-n)*o,s,1),o}function J(t,n,e){return t+(n-t)*e}function X(t,n,e){const r=[];for(let i=0;i<t.length;i++){const s=t[i],o=s.type;let a;if("Point"===o||"MultiPoint"===o||"LineString"===o)a=Y(s.geometry,n,e);else if("MultiLineString"===o||"Polygon"===o){a=[];for(const t of s.geometry)a.push(Y(t,n,e))}else if("MultiPolygon"===o){a=[];for(const t of s.geometry){const r=[];for(const i of t)r.push(Y(i,n,e));a.push(r)}}r.push(I(s.id,o,a,s.tags,s.layer,e))}return r}function Y(t,n,e){const r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);const i=e?4:3;for(let s=0;s<t.length;s+=i)r.push(t[s]+n,t[s+1],t[s+2]),e&&r.push(t[s+3]);return r}function Z(t,n,e){if(t.transformed)return t;const r=1<<t.z,i=t.x,s=t.y,o=e?3:2;for(const a of t.features){const t=a.geometry,u=a.type;if(a.geometry=[],1===u)for(let u=0;u<t.length;u+=o)a.geometry.push(K(t[u],t[u+1],n,r,i,s)),e&&a.geometry[a.geometry.length-1].push(t[u+2]);else for(let u=0;u<t.length;u++){const h=[];for(let a=0;a<t[u].length;a+=o)h.push(K(t[u][a],t[u][a+1],n,r,i,s)),e&&h[h.length-1].push(t[u][a+2]);a.geometry.push(h)}}return t.transformed=!0,t}function K(t,n,e,r,i,s){return[Math.round(e*(t*r-i)),Math.round(e*(n*r-s))]}function Q(t,n,e,r,i){const s=n===i.maxZoom?0:i.tolerance/((1<<n)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:e,y:r,z:n,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const n of t)tt(o,n,s,i);return o}function tt(t,n,e,r){const i=n.geometry,s=n.type,o=[],a=r.hasAltitude?4:3;if(t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),"Point"===s||"MultiPoint"===s)for(let n=0;n<i.length;n+=a)o.push(i[n],i[n+1]),r.hasAltitude&&o.push(i[n+3]),t.numPoints++,t.numSimplified++;else if("LineString"===s)et(o,i,t,e,!1,!1,r);else if("MultiLineString"===s||"Polygon"===s)for(let n=0;n<i.length;n++)et(o,i[n],t,e,"Polygon"===s,0===n,r);else if("MultiPolygon"===s)for(let n=0;n<i.length;n++){const s=i[n];for(let n=0;n<s.length;n++)et(o,s[n],t,e,!0,0===n,r)}if(o.length){let e=n.tags||null;if("LineString"===s&&r.lineMetrics){e={};for(const t in n.tags)e[t]=n.tags[t];e.mapbox_clip_start=i.start/i.size,e.mapbox_clip_end=i.end/i.size}const a={geometry:o,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:e};n.layer&&(a.layer=n.layer),null!==n.id&&(a.id=n.id),t.features.push(a)}}function nt(t,n,e){return 0===t[n+2]&&t[n+3]>0&&e}function et(t,n,e,r,i,s,o){const a=r*r,{hasAltitude:u,disableFilter:h}=o,l=u?4:3;if(!h&&r>0&&n.size<(i?a:r))return void(e.numPoints+=n.length/l);const c=[];for(let t=0;t<n.length;t+=l)(0===r||n[t+2]>a||nt(n,t,u))&&(e.numSimplified++,c.push(n[t],n[t+1]),u&&c.push(n[t+3])),e.numPoints++;i&&function(t,n,e){const r=e?3:2;let i=0;for(let n=0,e=t.length,s=e-r;n<e;s=n,n+=r)i+=(t[n]-t[s])*(t[n+1]+t[s+1]);if(i>0===n){const n=r,i=r-1,s=r-2;for(let o=0,a=t.length;o<a/2;o+=r){const r=t[o],u=t[o+1];let h;e&&(h=t[o+2]),t[o]=t[a-n-o],t[o+1]=t[a-i-o],e&&(t[o+2]=t[a-s-o]),t[a-n-o]=r,t[a-i-o]=u,e&&(t[a-s-o]=h)}}}(c,s,u),t.push(c)}O.getJSON=function(t,n,e){if(F(n)){const t=e;e=n,n=t}const r=function(t,n){const r="string"==typeof n?JSON.parse(n):n||null;e(t,r)};return n&&n.jsonp?O.jsonp(t,r):((n=n||{}).returnJSON=!0,O.get(t,n,r))};const rt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,hasAltitude:!1,disableFilter:!1,debug:0};class it{constructor(t,n){const e=(n=this.options=function(t,n){for(const e in n)t[e]=n[e];return t}(Object.create(rt),n)).debug;if(e&&console.time("preprocess data"),n.maxZoom<0||n.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(n.promoteId&&n.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,n){const e=[];if(Array.isArray(t)){for(let r=0;r<t.length;r++)C(e,t[r].layer,t[r].data,n);return e}if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)T(e,t.features[r],n,r);else"Feature"===t.type?T(e,t,n):T(e,{geometry:t},n);return e}(t,n);this.tiles={},this.tileCoords=[],e&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",n.indexMaxZoom,n.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,n){const e=n.buffer/n.extent;let r=t;const i=L(t,1,-1-e,e,0,-1,2,n),s=L(t,1,1-e,2+e,0,-1,2,n);return(i||s)&&(r=L(t,1,-e,1+e,0,-1,2,n)||[],i&&(r=X(i,1,n.hasAltitude).concat(r)),s&&(r=r.concat(X(s,-1,n.hasAltitude)))),r}(r,n),r.length&&this.splitTile(r,0,0,0),e&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,n,e,r,i,s,o){const a=[t,n,e,r],u=this.options,h=u.debug;for(;a.length;){r=a.pop(),e=a.pop(),n=a.pop(),t=a.pop();const l=1<<n,c=st(n,e,r);let f=this.tiles[c];if(!f&&(h>1&&console.time("creation"),f=this.tiles[c]=Q(t,n,e,r,u),this.tileCoords.push({z:n,x:e,y:r}),h)){h>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",n,e,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));const t="z"+n;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(n===u.indexMaxZoom||f.numPoints<=u.indexMaxPoints)continue}else{if(n===u.maxZoom||n===i)continue;if(null!=i){const t=i-n;if(e!==s>>t||r!==o>>t)continue}}if(f.source=null,0===t.length)continue;h>1&&console.time("clipping");const d=.5*u.buffer/u.extent,p=.5-d,y=.5+d,m=1+d;let g=null,v=null,b=null,w=null,M=L(t,l,e-d,e+y,0,f.minX,f.maxX,u),x=L(t,l,e+p,e+m,0,f.minX,f.maxX,u);t=null,M&&(g=L(M,l,r-d,r+y,1,f.minY,f.maxY,u),v=L(M,l,r+p,r+m,1,f.minY,f.maxY,u),M=null),x&&(b=L(x,l,r-d,r+y,1,f.minY,f.maxY,u),w=L(x,l,r+p,r+m,1,f.minY,f.maxY,u),x=null),h>1&&console.timeEnd("clipping"),a.push(g||[],n+1,2*e,2*r),a.push(v||[],n+1,2*e,2*r+1),a.push(b||[],n+1,2*e+1,2*r),a.push(w||[],n+1,2*e+1,2*r+1)}}getTile(t,n,e){t=+t,n=+n,e=+e;const r=this.options,{extent:i,debug:s}=r,{hasAltitude:o,wrapX:a}=r;if(t<0||t>24)return null;if(a){const e=1<<t;n=n+e&e-1}const u=st(t,n,e);if(this.tiles[u])return Z(this.tiles[u],i,o);s>1&&console.log("drilling down to z%d-%d-%d",t,n,e);let h,l=t,c=n,f=e;for(;!h&&l>0;)l--,c>>=1,f>>=1,h=this.tiles[st(l,c,f)];return h&&h.source?(s>1&&(console.log("found parent tile z%d-%d-%d",l,c,f),console.time("drilling down")),this.splitTile(h.source,l,c,f,t,n,e),s>1&&console.timeEnd("drilling down"),this.tiles[u]?Z(this.tiles[u],i,o):null):null}}function st(t,n,e){return 32*((1<<t)*e+n)+t}function ot(t,n,e,r,i,s,o){const a=e&&Array.isArray(e[0]);for(let u=0,h=e.length;u<h;u++){t[n]=(a?e[u][0]:e[u].x)*r,t[n+1]=(a?e[u][1]:e[u].y)*r,o!==Float32Array&&(t[n]=Math.round(t[n]),t[n+1]=Math.round(t[n+1]));let l=i||0;Array.isArray(i)&&(l=i[u]),l=l?Math.round(r*l):0,t[n+2]=l,n+=3,s&&0!==u&&u!==h-1&&(t[n]=t[n-3],t[n+1]=t[n-2],t[n+2]=t[n-1],n+=3)}return t.trySetLength&&t.trySetLength(n),n}function at(t,n,e,r){const i=t[3*n],s=t[3*n+1],o=t[3*e],a=t[3*e+1];return i===o&&(i<0||i>r)||s===a&&(s<0||s>r)}var ut="undefined"!=typeof Float32Array?Float32Array:Array;function ht(){var t=new ut(3);return ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function lt(t,n,e){var r=new ut(3);return r[0]=t,r[1]=n,r[2]=e,r}function ct(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function ft(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function dt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function pt(t,n){var e=n[0],r=n[1],i=n[2],s=e*e+r*r+i*i;return s>0&&(s=1/Math.sqrt(s),t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s),t}function yt(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function mt(t,n,e){var r=n[0],i=n[1],s=n[2],o=e[0],a=e[1],u=e[2];return t[0]=i*u-s*a,t[1]=s*o-r*u,t[2]=r*a-i*o,t}var gt=function(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t};function vt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function bt(t,n,e,r,i){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t}function wt(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t[3]=n[3]/e[3],t}function Mt(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t}function xt(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function Ft(){var t=new ut(4);return ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function At(t,n){var e=n[0]+n[4]+n[8],r=void 0;if(e>0)r=Math.sqrt(e+1),t[3]=.5*r,r=.5/r,t[0]=(n[5]-n[7])*r,t[1]=(n[6]-n[2])*r,t[2]=(n[1]-n[3])*r;else{var i=0;n[4]>n[0]&&(i=1),n[8]>n[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(n[3*i+i]-n[3*s+s]-n[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(n[3*s+o]-n[3*o+s])*r,t[s]=(n[3*s+i]+n[3*i+s])*r,t[o]=(n[3*o+i]+n[3*i+o])*r}return t}!function(){var t=ht()}(),function(){var t,n=(t=new ut(4),ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var kt,Pt=Mt,St=function(t,n){var e=n[0],r=n[1],i=n[2],s=n[3],o=e*e+r*r+i*i+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=e*o,t[1]=r*o,t[2]=i*o,t[3]=s*o),t};function _t(t,n,e){return t[0]=n,t[1]=e,t}function Ot(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}ht(),lt(1,0,0),lt(0,1,0),Ft(),Ft(),kt=new ut(9),ut!=Float32Array&&(kt[1]=0,kt[2]=0,kt[3]=0,kt[5]=0,kt[6]=0,kt[7]=0),kt[0]=1,kt[4]=1,kt[8]=1;var Et=function(t){var n=t[0],e=t[1];return Math.sqrt(n*n+e*e)};!function(){var t=function(){var t=new ut(2);return ut!=Float32Array&&(t[0]=0,t[1]=0),t}()}();const It=Math.PI/180,$t=6378137*Math.PI/180;function Ct(t,n,e){if("EPSG:3857"===e)return function(t,n){const e=85.0511287798,r=n[0],i=Math.max(Math.min(e,n[1]),-e);let s;s=0===i?0:Math.log(Math.tan((90+i)*It/2))/It;return t[0]=r*$t,t[1]=s*$t,t}(t,n);if("EPSG:4326"===e||"EPSG:4490"===e||"identity"===e)return Tt(t,n);if("baidu"===e)return Tt(t,n);throw new Error("unsupported projection:"+e)}function Tt(t,n){return t[0]=n[0],t[1]=n[1],t}function zt(t,n,e,r,i,s,o,a,u,h,l,c,f,d,p){0===t?function(t,n,e,r,i,s,o,a,u,h){const l=1/(100*s[0]),c=1/(100*s[1]),f=h&&h[0]||0,d=h&&h[1]||0,p=[0,0];for(let i=t;i<n;i+=3){const t=i/3*2,n=r[i]-f,s=r[i+1]-d;e[t]=p[0]+n/o*l/a,e[t+1]=p[1]-s/o*c/u}}(n,e,r,i,0,o,a,u,h,p):1===t&&function(t,n,e,r,i,s,o,a,u,h,l){if(!t)return;let c,f,d,p;0===t[4]?(c=t[0],f=t[1],d=t[2],p=t[3]):(c=t[1],f=t[2],d=t[3],p=t[0]);const y=Ot(c,f),m=Ot(f,d),g=[],v=[],b=[];for(let t=n;t<e;t+=3){const n=t/3*2,e=(s.x/u+i[t]/o)*a,d=s.y/u*a+(l?i[t+1]:-i[t+1])/o*a;_t(g,e,d),"EPSG:4326"!==h&&"EPSG:4490"!==h||Ct(g,g,"EPSG:3857"),Dt(v,g,c,f),Dt(b,g,p,c),r[n]=Ot(c,v)/y,r[n+1]=Ot(c,b)/m}}(l,n,e,r,i,s,a,c,f,d,!!p)}function Dt(t,n,e,r){const i=e[0]-r[0],s=e[1]-r[1];let o=(n[0]-e[0])*(e[0]-r[0])+(n[1]-e[1])*(e[1]-r[1]);return o/=i*i+s*s,t[0]=e[0]+o*i,t[1]=e[1]+o*s,t}function jt(t,n,e,r,i){const s=3*n[e-1],o=3*n[e-1]+1,a=t[s],u=t[o];return h=r,l=i,c=a,f=u,Math.sqrt((c-h)*(c-h)+(f-l)*(f-l));var h,l,c,f}"undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self&&self;var Ut=Nt;function Nt(t,n){this.x=t,this.y=n}function Lt(t,n,e){e=e||{},this.w=t||64,this.h=n||64,this.autoResize=!!e.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function Vt(t,n,e){this.x=0,this.y=t,this.w=this.free=n,this.h=e}function Rt(t,n,e,r,i,s,o){this.id=t,this.x=n,this.y=e,this.w=r,this.h=i,this.maxw=s||r,this.maxh=o||i,this.refcount=0}Nt.prototype={clone:function(){return new Nt(this.x,this.y)},add:function(t){return this.clone().m(t)},sub:function(t){return this.clone().M(t)},multByPoint:function(t){return this.clone().F(t)},divByPoint:function(t){return this.clone().A(t)},mult:function(t){return this.clone().k(t)},div:function(t){return this.clone().P(t)},rotate:function(t){return this.clone().S(t)},rotateAround:function(t,n){return this.clone()._(t,n)},matMult:function(t){return this.clone().O(t)},unit:function(){return this.clone().I()},perp:function(){return this.clone().C()},round:function(){return this.clone().T()},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 n=t.x-this.x,e=t.y-this.y;return n*n+e*e},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,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},O:function(t){var n=t[0]*this.x+t[1]*this.y,e=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=e,this},m:function(t){return this.x+=t.x,this.y+=t.y,this},M:function(t){return this.x-=t.x,this.y-=t.y,this},k:function(t){return this.x*=t,this.y*=t,this},P:function(t){return this.x/=t,this.y/=t,this},F:function(t){return this.x*=t.x,this.y*=t.y,this},A:function(t){return this.x/=t.x,this.y/=t.y,this},I:function(){return this.P(this.mag()),this},C:function(){var t=this.y;return this.y=this.x,this.x=-t,this},S:function(t){var n=Math.cos(t),e=Math.sin(t),r=n*this.x-e*this.y,i=e*this.x+n*this.y;return this.x=r,this.y=i,this},_:function(t,n){var e=Math.cos(t),r=Math.sin(t),i=n.x+e*(this.x-n.x)-r*(this.y-n.y),s=n.y+r*(this.x-n.x)+e*(this.y-n.y);return this.x=i,this.y=s,this},T:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Nt.convert=function(t){return t instanceof Nt?t:Array.isArray(t)?new Nt(t[0],t[1]):t},Lt.prototype.pack=function(t,n){t=[].concat(t),n=n||{};for(var e,r,i,s,o=[],a=0;a<t.length;a++)if(e=t[a].w||t[a].width,r=t[a].h||t[a].height,i=t[a].id,e&&r){if(!(s=this.packOne(e,r,i)))continue;n.inPlace&&(t[a].x=s.x,t[a].y=s.y,t[a].id=s.id),o.push(s)}return this.shrink(),o},Lt.prototype.packOne=function(t,n,e){var r,i,s,o,a,u,h,l,c={freebin:-1,shelf:-1,waste:1/0},f=0;if("string"==typeof e||"number"==typeof e){if(r=this.getBin(e))return this.ref(r),r;"number"==typeof e&&(this.maxId=Math.max(e,this.maxId))}else e=++this.maxId;for(o=0;o<this.freebins.length;o++){if(n===(r=this.freebins[o]).maxh&&t===r.maxw)return this.allocFreebin(o,t,n,e);n>r.maxh||t>r.maxw||n<=r.maxh&&t<=r.maxw&&(s=r.maxw*r.maxh-t*n)<c.waste&&(c.waste=s,c.freebin=o)}for(o=0;o<this.shelves.length;o++)if(f+=(i=this.shelves[o]).h,!(t>i.free)){if(n===i.h)return this.allocShelf(o,t,n,e);n>i.h||n<i.h&&(s=(i.h-n)*t)<c.waste&&(c.freebin=-1,c.waste=s,c.shelf=o)}return-1!==c.freebin?this.allocFreebin(c.freebin,t,n,e):-1!==c.shelf?this.allocShelf(c.shelf,t,n,e):n<=this.h-f&&t<=this.w?(i=new Vt(f,this.w,n),this.allocShelf(this.shelves.push(i)-1,t,n,e)):this.autoResize?(a=u=this.h,((h=l=this.w)<=a||t>h)&&(l=2*Math.max(t,h)),(a<h||n>a)&&(u=2*Math.max(n,a)),this.resize(l,u),this.packOne(t,n,e)):null},Lt.prototype.allocFreebin=function(t,n,e,r){var i=this.freebins.splice(t,1)[0];return i.id=r,i.w=n,i.h=e,i.refcount=0,this.bins[r]=i,this.ref(i),i},Lt.prototype.allocShelf=function(t,n,e,r){var i=this.shelves[t].alloc(n,e,r);return this.bins[r]=i,this.ref(i),i},Lt.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,n=0,e=0;e<this.shelves.length;e++){var r=this.shelves[e];n+=r.h,t=Math.max(r.w-r.free,t)}this.resize(t,n)}},Lt.prototype.getBin=function(t){return this.bins[t]},Lt.prototype.ref=function(t){if(1==++t.refcount){var n=t.h;this.stats[n]=1+(0|this.stats[n])}return t.refcount},Lt.prototype.unref=function(t){return 0===t.refcount?0:(0==--t.refcount&&(this.stats[t.h]--,delete this.bins[t.id],this.freebins.push(t)),t.refcount)},Lt.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},Lt.prototype.resize=function(t,n){this.w=t,this.h=n;for(var e=0;e<this.shelves.length;e++)this.shelves[e].resize(t);return!0},Vt.prototype.alloc=function(t,n,e){if(t>this.free||n>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,new Rt(e,r,this.y,t,n,t,this.h)},Vt.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0};var Ht={exports:{}},Wt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},qt={exports:{}},Gt=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},Bt=Array.prototype.concat,Jt=Array.prototype.slice,Xt=qt.exports=function(t){for(var n=[],e=0,r=t.length;e<r;e++){var i=t[e];Gt(i)?n=Bt.call(n,Jt.call(i)):n.push(i)}return n};Xt.wrap=function(t){return function(){return t(Xt(arguments))}};var Yt=Wt,Zt=qt.exports,Kt=Object.hasOwnProperty,Qt=Object.create(null);for(var tn in Yt)Kt.call(Yt,tn)&&(Qt[Yt[tn]]=tn);var nn=Ht.exports={to:{},get:{}};function en(t,n,e){return Math.min(Math.max(n,t),e)}function rn(t){var n=Math.round(t).toString(16).toUpperCase();return n.length<2?"0"+n:n}nn.get=function(t){var n,e;switch(t.substring(0,3).toLowerCase()){case"hsl":n=nn.get.hsl(t),e="hsl";break;case"hwb":n=nn.get.hwb(t),e="hwb";break;default:n=nn.get.rgb(t),e="rgb"}return n?{model:e,value:n}:null},nn.get.rgb=function(t){if(!t)return null;var n,e,r,i=[0,0,0,1];if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=n[2],n=n[1],e=0;e<3;e++){var s=2*e;i[e]=parseInt(n.slice(s,s+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(n=n[1])[3],e=0;e<3;e++)i[e]=parseInt(n[e]+n[e],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(n=t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)){for(e=0;e<3;e++)i[e]=parseInt(n[e+1],0);n[4]&&(n[5]?i[3]=.01*parseFloat(n[4]):i[3]=parseFloat(n[4]))}else{if(!(n=t.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)))return(n=t.match(/^(\\w+)$/))?"transparent"===n[1]?[0,0,0,0]:Kt.call(Yt,n[1])?((i=Yt[n[1]])[3]=1,i):null:null;for(e=0;e<3;e++)i[e]=Math.round(2.55*parseFloat(n[e+1]));n[4]&&(n[5]?i[3]=.01*parseFloat(n[4]):i[3]=parseFloat(n[4]))}for(e=0;e<3;e++)i[e]=en(i[e],0,255);return i[3]=en(i[3],0,1),i},nn.get.hsl=function(t){if(!t)return null;var n=t.match(/^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);if(n){var e=parseFloat(n[4]);return[(parseFloat(n[1])%360+360)%360,en(parseFloat(n[2]),0,100),en(parseFloat(n[3]),0,100),en(isNaN(e)?1:e,0,1)]}return null},nn.get.hwb=function(t){if(!t)return null;var n=t.match(/^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);if(n){var e=parseFloat(n[4]);return[(parseFloat(n[1])%360+360)%360,en(parseFloat(n[2]),0,100),en(parseFloat(n[3]),0,100),en(isNaN(e)?1:e,0,1)]}return null},nn.to.hex=function(){var t=Zt(arguments);return"#"+rn(t[0])+rn(t[1])+rn(t[2])+(t[3]<1?rn(Math.round(255*t[3])):"")},nn.to.rgb=function(){var t=Zt(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},nn.to.rgb.percent=function(){var t=Zt(arguments),n=Math.round(t[0]/255*100),e=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+n+"%, "+e+"%, "+r+"%)":"rgba("+n+"%, "+e+"%, "+r+"%, "+t[3]+")"},nn.to.hsl=function(){var t=Zt(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},nn.to.hwb=function(){var t=Zt(arguments),n="";return t.length>=4&&1!==t[3]&&(n=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+n+")"},nn.to.keyword=function(t){return Qt[t.slice(0,3)]};var sn={exports:{}},on=Wt,an={};for(var un in on)on.hasOwnProperty(un)&&(an[on[un]]=un);var hn=sn.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var ln in hn)if(hn.hasOwnProperty(ln)){if(!("channels"in hn[ln]))throw new Error("missing channels property: "+ln);if(!("labels"in hn[ln]))throw new Error("missing channel labels property: "+ln);if(hn[ln].labels.length!==hn[ln].channels)throw new Error("channel and label counts mismatch: "+ln);var cn=hn[ln].channels,fn=hn[ln].labels;delete hn[ln].channels,delete hn[ln].labels,Object.defineProperty(hn[ln],"channels",{value:cn}),Object.defineProperty(hn[ln],"labels",{value:fn})}function dn(t,n){return Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)+Math.pow(t[2]-n[2],2)}hn.rgb.hsl=function(t){var n,e,r=t[0]/255,i=t[1]/255,s=t[2]/255,o=Math.min(r,i,s),a=Math.max(r,i,s),u=a-o;return a===o?n=0:r===a?n=(i-s)/u:i===a?n=2+(s-r)/u:s===a&&(n=4+(r-i)/u),(n=Math.min(60*n,360))<0&&(n+=360),e=(o+a)/2,[n,100*(a===o?0:e<=.5?u/(a+o):u/(2-a-o)),100*e]},hn.rgb.hsv=function(t){var n,e,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,h=Math.max(o,a,u),l=h-Math.min(o,a,u),c=function(t){return(h-t)/6/l+.5};return 0===l?i=s=0:(s=l/h,n=c(o),e=c(a),r=c(u),o===h?i=r-e:a===h?i=1/3+n-r:u===h&&(i=2/3+e-n),i<0?i+=1:i>1&&(i-=1)),[360*i,100*s,100*h]},hn.rgb.hwb=function(t){var n=t[0],e=t[1],r=t[2];return[hn.rgb.hsl(t)[0],100*(1/255*Math.min(n,Math.min(e,r))),100*(r=1-1/255*Math.max(n,Math.max(e,r)))]},hn.rgb.cmyk=function(t){var n,e=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-e-(n=Math.min(1-e,1-r,1-i)))/(1-n)||0),100*((1-r-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*n]},hn.rgb.keyword=function(t){var n=an[t];if(n)return n;var e,r=1/0;for(var i in on)if(on.hasOwnProperty(i)){var s=dn(t,on[i]);s<r&&(r=s,e=i)}return e},hn.keyword.rgb=function(t){return on[t]},hn.rgb.xyz=function(t){var n=t[0]/255,e=t[1]/255,r=t[2]/255;return[100*(.4124*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.3576*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*n+.7152*e+.0722*r),100*(.0193*n+.1192*e+.9505*r)]},hn.rgb.lab=function(t){var n=hn.rgb.xyz(t),e=n[0],r=n[1],i=n[2];return r/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},hn.hsl.rgb=function(t){var n,e,r,i,s,o=t[0]/360,a=t[1]/100,u=t[2]/100;if(0===a)return[s=255*u,s,s];n=2*u-(e=u<.5?u*(1+a):u+a-u*a),i=[0,0,0];for(var h=0;h<3;h++)(r=o+1/3*-(h-1))<0&&r++,r>1&&r--,s=6*r<1?n+6*(e-n)*r:2*r<1?e:3*r<2?n+(e-n)*(2/3-r)*6:n,i[h]=255*s;return i},hn.hsl.hsv=function(t){var n=t[0],e=t[1]/100,r=t[2]/100,i=e,s=Math.max(r,.01);return e*=(r*=2)<=1?r:2-r,i*=s<=1?s:2-s,[n,100*(0===r?2*i/(s+i):2*e/(r+e)),100*((r+e)/2)]},hn.hsv.rgb=function(t){var n=t[0]/60,e=t[1]/100,r=t[2]/100,i=Math.floor(n)%6,s=n-Math.floor(n),o=255*r*(1-e),a=255*r*(1-e*s),u=255*r*(1-e*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}},hn.hsv.hsl=function(t){var n,e,r,i=t[0],s=t[1]/100,o=t[2]/100,a=Math.max(o,.01);return r=(2-s)*o,e=s*a,[i,100*(e=(e/=(n=(2-s)*a)<=1?n:2-n)||0),100*(r/=2)]},hn.hwb.rgb=function(t){var n,e,r,i,s,o,a,u=t[0]/360,h=t[1]/100,l=t[2]/100,c=h+l;switch(c>1&&(h/=c,l/=c),r=6*u-(n=Math.floor(6*u)),0!=(1&n)&&(r=1-r),i=h+r*((e=1-l)-h),n){default:case 6:case 0:s=e,o=i,a=h;break;case 1:s=i,o=e,a=h;break;case 2:s=h,o=e,a=i;break;case 3:s=h,o=i,a=e;break;case 4:s=i,o=h,a=e;break;case 5:s=e,o=h,a=i}return[255*s,255*o,255*a]},hn.cmyk.rgb=function(t){var n=t[0]/100,e=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},hn.xyz.rgb=function(t){var n,e,r,i=t[0]/100,s=t[1]/100,o=t[2]/100;return e=-.9689*i+1.8758*s+.0415*o,r=.0557*i+-.204*s+1.057*o,n=(n=3.2406*i+-1.5372*s+-.4986*o)>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(n=Math.min(Math.max(0,n),1)),255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1))]},hn.xyz.lab=function(t){var n=t[0],e=t[1],r=t[2];return e/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116)-16,500*(n-e),200*(e-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},hn.lab.xyz=function(t){var n,e,r,i=t[0];n=t[1]/500+(e=(i+16)/116),r=e-t[2]/200;var s=Math.pow(e,3),o=Math.pow(n,3),a=Math.pow(r,3);return e=s>.008856?s:(e-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,[n*=95.047,e*=100,r*=108.883]},hn.lab.lch=function(t){var n,e=t[0],r=t[1],i=t[2];return(n=360*Math.atan2(i,r)/2/Math.PI)<0&&(n+=360),[e,Math.sqrt(r*r+i*i),n]},hn.lch.lab=function(t){var n,e=t[0],r=t[1];return n=t[2]/360*2*Math.PI,[e,r*Math.cos(n),r*Math.sin(n)]},hn.rgb.ansi16=function(t){var n=t[0],e=t[1],r=t[2],i=1 in arguments?arguments[1]:hn.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var s=30+(Math.round(r/255)<<2|Math.round(e/255)<<1|Math.round(n/255));return 2===i&&(s+=60),s},hn.hsv.ansi16=function(t){return hn.rgb.ansi16(hn.hsv.rgb(t),t[2])},hn.rgb.ansi256=function(t){var n=t[0],e=t[1],r=t[2];return n===e&&e===r?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5)},hn.ansi16.rgb=function(t){var n=t%10;if(0===n||7===n)return t>50&&(n+=3.5),[n=n/10.5*255,n,n];var e=.5*(1+~~(t>50));return[(1&n)*e*255,(n>>1&1)*e*255,(n>>2&1)*e*255]},hn.ansi256.rgb=function(t){if(t>=232){var n=10*(t-232)+8;return[n,n,n]}var e;return t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255]},hn.rgb.hex=function(t){var n=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(n.length)+n},hn.hex.rgb=function(t){var n=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];var e=n[0];3===n[0].length&&(e=e.split("").map((function(t){return t+t})).join(""));var r=parseInt(e,16);return[r>>16&255,r>>8&255,255&r]},hn.rgb.hcg=function(t){var n,e=t[0]/255,r=t[1]/255,i=t[2]/255,s=Math.max(Math.max(e,r),i),o=Math.min(Math.min(e,r),i),a=s-o;return n=a<=0?0:s===e?(r-i)/a%6:s===r?2+(i-e)/a:4+(e-r)/a+4,n/=6,[360*(n%=1),100*a,100*(a<1?o/(1-a):0)]},hn.hsl.hcg=function(t){var n=t[1]/100,e=t[2]/100,r=1,i=0;return(r=e<.5?2*n*e:2*n*(1-e))<1&&(i=(e-.5*r)/(1-r)),[t[0],100*r,100*i]},hn.hsv.hcg=function(t){var n=t[1]/100,e=t[2]/100,r=n*e,i=0;return r<1&&(i=(e-r)/(1-r)),[t[0],100*r,100*i]},hn.hcg.rgb=function(t){var n=t[0]/360,e=t[1]/100,r=t[2]/100;if(0===e)return[255*r,255*r,255*r];var i,s=[0,0,0],o=n%1*6,a=o%1,u=1-a;switch(Math.floor(o)){case 0:s[0]=1,s[1]=a,s[2]=0;break;case 1:s[0]=u,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=a;break;case 3:s[0]=0,s[1]=u,s[2]=1;break;case 4:s[0]=a,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=u}return i=(1-e)*r,[255*(e*s[0]+i),255*(e*s[1]+i),255*(e*s[2]+i)]},hn.hcg.hsv=function(t){var n=t[1]/100,e=n+t[2]/100*(1-n),r=0;return e>0&&(r=n/e),[t[0],100*r,100*e]},hn.hcg.hsl=function(t){var n=t[1]/100,e=t[2]/100*(1-n)+.5*n,r=0;return e>0&&e<.5?r=n/(2*e):e>=.5&&e<1&&(r=n/(2*(1-e))),[t[0],100*r,100*e]},hn.hcg.hwb=function(t){var n=t[1]/100,e=n+t[2]/100*(1-n);return[t[0],100*(e-n),100*(1-e)]},hn.hwb.hcg=function(t){var n=t[1]/100,e=1-t[2]/100,r=e-n,i=0;return r<1&&(i=(e-r)/(1-r)),[t[0],100*r,100*i]},hn.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},hn.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},hn.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},hn.gray.hsl=hn.gray.hsv=function(t){return[0,0,t[0]]},hn.gray.hwb=function(t){return[0,100,t[0]]},hn.gray.cmyk=function(t){return[0,0,0,t[0]]},hn.gray.lab=function(t){return[t[0],0,0]},hn.gray.hex=function(t){var n=255&Math.round(t[0]/100*255),e=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(e.length)+e},hn.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var pn=sn.exports;function yn(t){var n=function(){for(var t={},n=Object.keys(pn),e=n.length,r=0;r<e;r++)t[n[r]]={distance:-1,parent:null};return t}(),e=[t];for(n[t].distance=0;e.length;)for(var r=e.pop(),i=Object.keys(pn[r]),s=i.length,o=0;o<s;o++){var a=i[o],u=n[a];-1===u.distance&&(u.distance=n[r].distance+1,u.parent=r,e.unshift(a))}return n}function mn(t,n){return function(e){return n(t(e))}}function gn(t,n){for(var e=[n[t].parent,t],r=pn[n[t].parent][t],i=n[t].parent;n[i].parent;)e.unshift(n[i].parent),r=mn(pn[n[i].parent][i],r),i=n[i].parent;return r.conversion=e,r}var vn=sn.exports,bn=function(t){for(var n=yn(t),e={},r=Object.keys(n),i=r.length,s=0;s<i;s++){var o=r[s];null!==n[o].parent&&(e[o]=gn(o,n))}return e},wn={};Object.keys(vn).forEach((function(t){wn[t]={},Object.defineProperty(wn[t],"channels",{value:vn[t].channels}),Object.defineProperty(wn[t],"labels",{value:vn[t].labels});var n=bn(t);Object.keys(n).forEach((function(e){var r=n[e];wn[t][e]=function(t){var n=function(n){if(null==n)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var e=t(n);if("object"==typeof e)for(var r=e.length,i=0;i<r;i++)e[i]=Math.round(e[i]);return e};return"conversion"in t&&(n.conversion=t.conversion),n}(r),wn[t][e].raw=function(t){var n=function(n){return null==n?n:(arguments.length>1&&(n=Array.prototype.slice.call(arguments)),t(n))};return"conversion"in t&&(n.conversion=t.conversion),n}(r)}))}));var Mn=wn,xn=Ht.exports,Fn=Mn,An=[].slice,kn=["keyword","gray","hex"],Pn={};Object.keys(Fn).forEach((function(t){Pn[An.call(Fn[t].labels).sort().join("")]=t}));var Sn={};function _n(t,n){if(!(this instanceof _n))return new _n(t,n);if(n&&n in kn&&(n=null),n&&!(n in Fn))throw new Error("Unknown model: "+n);var e,r;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof _n)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var i=xn.get(t);if(null===i)throw new Error("Unable to parse color from string: "+t);this.model=i.model,r=Fn[this.model].channels,this.color=i.value.slice(0,r),this.valpha="number"==typeof i.value[r]?i.value[r]:1}else if(t.length){this.model=n||"rgb",r=Fn[this.model].channels;var s=An.call(t,0,r);this.color=$n(s,r),this.valpha="number"==typeof t[r]?t[r]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var o=Object.keys(t);"alpha"in t&&(o.splice(o.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var a=o.sort().join("");if(!(a in Pn))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Pn[a];var u=Fn[this.model].labels,h=[];for(e=0;e<u.length;e++)h.push(t[u[e]]);this.color=$n(h)}if(Sn[this.model])for(r=Fn[this.model].channels,e=0;e<r;e++){var l=Sn[this.model][e];l&&(this.color[e]=l(this.color[e]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function On(t,n,e){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(Sn[t]||(Sn[t]=[]))[n]=e})),t=t[0],function(r){var i;return arguments.length?(e&&(r=e(r)),(i=this[t]()).color[n]=r,i):(i=this[t]().color[n],e&&(i=e(i)),i)}}function En(t){return function(n){return Math.max(0,Math.min(t,n))}}function In(t){return Array.isArray(t)?t:[t]}function $n(t,n){for(var e=0;e<n;e++)"number"!=typeof t[e]&&(t[e]=0);return t}_n.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var n=this.model in xn.to?this:this.rgb(),e=1===(n=n.round("number"==typeof t?t:1)).valpha?n.color:n.color.concat(this.valpha);return xn.to[n.model](e)},percentString:function(t){var n=this.rgb().round("number"==typeof t?t:1),e=1===n.valpha?n.color:n.color.concat(this.valpha);return xn.to.rgb.percent(e)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},n=Fn[this.model].channels,e=Fn[this.model].labels,r=0;r<n;r++)t[e[r]]=this.color[r];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new _n(this.color.map(function(t){return function(n){return function(t,n){return Number(t.toFixed(n))}(n,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new _n(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:On("rgb",0,En(255)),green:On("rgb",1,En(255)),blue:On("rgb",2,En(255)),hue:On(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:On("hsl",1,En(100)),lightness:On("hsl",2,En(100)),saturationv:On("hsv",1,En(100)),value:On("hsv",2,En(100)),chroma:On("hcg",1,En(100)),gray:On("hcg",2,En(100)),white:On("hwb",1,En(100)),wblack:On("hwb",2,En(100)),cyan:On("cmyk",0,En(100)),magenta:On("cmyk",1,En(100)),yellow:On("cmyk",2,En(100)),black:On("cmyk",3,En(100)),x:On("xyz",0,En(100)),y:On("xyz",1,En(100)),z:On("xyz",2,En(100)),l:On("lab",0,En(100)),a:On("lab",1),b:On("lab",2),keyword:function(t){return arguments.length?new _n(t):Fn[this.model].keyword(this.color)},hex:function(t){return arguments.length?new _n(t):xn.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,n=[],e=0;e<t.length;e++){var r=t[e]/255;n[e]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*n[0]+.7152*n[1]+.0722*n[2]},contrast:function(t){var n=this.luminosity(),e=t.luminosity();return n>e?(n+.05)/(e+.05):(e+.05)/(n+.05)},level:function(t){var n=this.contrast(t);return n>=7.1?"AAA":n>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),n=0;n<3;n++)t.color[n]=255-t.color[n];return t},lighten:function(t){var n=this.hsl();return n.color[2]+=n.color[2]*t,n},darken:function(t){var n=this.hsl();return n.color[2]-=n.color[2]*t,n},saturate:function(t){var n=this.hsl();return n.color[1]+=n.color[1]*t,n},desaturate:function(t){var n=this.hsl();return n.color[1]-=n.color[1]*t,n},whiten:function(t){var n=this.hwb();return n.color[1]+=n.color[1]*t,n},blacken:function(t){var n=this.hwb();return n.color[2]+=n.color[2]*t,n},grayscale:function(){var t=this.rgb().color,n=.3*t[0]+.59*t[1]+.11*t[2];return _n.rgb(n,n,n)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var n=this.hsl(),e=n.color[0];return e=(e=(e+t)%360)<0?360+e:e,n.color[0]=e,n},mix:function(t,n){if(!t||!t.rgb)throw new Error(\'Argument to "mix" was not a Color instance, but rather an instance of \'+typeof t);var e=t.rgb(),r=this.rgb(),i=void 0===n?.5:n,s=2*i-1,o=e.alpha()-r.alpha(),a=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,u=1-a;return _n.rgb(a*e.red()+u*r.red(),a*e.green()+u*r.green(),a*e.blue()+u*r.blue(),e.alpha()*i+r.alpha()*(1-i))}},Object.keys(Fn).forEach((function(t){if(-1===kn.indexOf(t)){var n=Fn[t].channels;_n.prototype[t]=function(){if(this.model===t)return new _n(this);if(arguments.length)return new _n(arguments,t);var e="number"==typeof arguments[n]?n:this.valpha;return new _n(In(Fn[this.model][t].raw(this.color)).concat(e),t)},_n[t]=function(e){return"number"==typeof e&&(e=$n(An.call(arguments),n)),new _n(e,t)}}}));var Cn=_n;\n/*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */const Tn=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function zn(t){return new Function("f","var p = (f && f.properties || {}); return "+Dn(t))}function Dn(t){if(!t)return"true";const n=t[0];if(t.length<=1)return"any"===n?"false":"true";return`(${"=="===n?Un(t[1],t[2],"===",!1):"!="===n?Un(t[1],t[2],"!==",!1):"<"===n||">"===n||"<="===n||">="===n?Un(t[1],t[2],n,!0):"any"===n?Ln(t.slice(1),"||"):"all"===n?Ln(t.slice(1),"&&"):"none"===n?Hn(Ln(t.slice(1),"||")):"in"===n?Vn(t[1],t.slice(2)):"!in"===n?Hn(Vn(t[1],t.slice(2))):"has"===n?Rn(t[1]):"!has"===n?Hn(Rn(t[1])):"contains"===n?function(t,n,e){const r=jn(t);return void 0!==e?`(${r} + \'\').indexOf("${n}") === ${e}`:`(${r} + \'\').indexOf("${n}") >= 0`}(t[1],t[2],t[3]):"true"})`}function jn(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function Un(t,n,e,r){if("object"==typeof(i=t)&&i&&t.op)return function(t,n,e,r){const i=t.property,s=t.op;let o=jn(i);return"length"!==s?(console.error(`not support ${s} op`),"false"):(o=`((${o}+=\'\').length)`,Nn(o,i,n,e,r))}(t,n,e,r);var i;return Nn(jn(t),t,n,e,r)}function Nn(t,n,e,r,i){const s="$type"===n?Tn.indexOf(e):JSON.stringify(e);return(i?`typeof ${t}=== typeof ${s}&&`:"")+t+r+s}function Ln(t,n){return t.map(Dn).join(n)}function Vn(t,n){"$type"===t&&(n=n.map(t=>Tn.indexOf(t)));const e=JSON.stringify(n.sort(Wn)),r=jn(t);return n.length<=200?`${e}.indexOf(${r}) !== -1`:`function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${r}, ${e},0,${n.length-1})`}function Rn(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function Hn(t){return`!(${t})`}function Wn(t,n){return t<n?-1:t>n?1:0}var qn={exports:{}};qn.exports=function(){function t(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function n(t,n){return t<n?-1:t>n?1:0}return function(e,r,i,s,o){!function n(e,r,i,s,o){for(;s>i;){if(s-i>600){var a=s-i+1,u=r-i+1,h=Math.log(a),l=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*l*(a-l)/a)*(u-a/2<0?-1:1),f=Math.max(i,Math.floor(r-u*l/a+c)),d=Math.min(s,Math.floor(r+(a-u)*l/a+c));n(e,r,f,d,o)}var p=e[r],y=i,m=s;for(t(e,i,r),o(e[s],p)>0&&t(e,i,s);y<m;){for(t(e,y,m),y++,m--;o(e[y],p)<0;)y++;for(;o(e[m],p)>0;)m--}0===o(e[i],p)?t(e,i,m):(m++,t(e,m,s)),m<=r&&(i=m+1),r<=m&&(s=m-1)}}(e,r,i||0,s||e.length-1,o||n)}}();var Gn=qn.exports;class Bn{constructor(t=[],n=Jn){if(this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this.D(t)}push(t){this.data.push(t),this.length++,this.j(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],n=this.data.pop();return this.length--,this.length>0&&(this.data[0]=n,this.D(0)),t}peek(){return this.data[0]}j(t){const{data:n,compare:e}=this,r=n[t];for(;t>0;){const i=t-1>>1,s=n[i];if(e(r,s)>=0)break;n[t]=s,t=i}n[t]=r}D(t){const{data:n,compare:e}=this,r=this.length>>1,i=n[t];for(;t<r;){let r=1+(t<<1),s=n[r];const o=r+1;if(o<this.length&&e(n[o],s)<0&&(r=o,s=n[o]),e(s,i)>=0)break;n[t]=s,t=r}n[t]=i}}function Jn(t,n){return t<n?-1:t>n?1:0}\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */const Xn=[],Yn=[],Zn=[],Kn=[];function Qn(t,n,e){const r=mt(Yn,n,e);t=At(t,function(t,n,e,r,i,s,o,a,u,h){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=h,t}(Xn,e[0],e[1],e[2],...r,...n));if((t=function(t){return t[3]<0?Pt(t,t,-1):t}(t=St(t,t)))[3]<1/32767){t[3]=1/32767;const n=Math.sqrt(.9999999990686206);t[0]*=n,t[1]*=n,t[2]*=n}const i=e[3]>0?mt(Zn,e,n):mt(Zn,n,e);return yt(mt(Kn,e,n),i)<0&&Pt(t,t,-1),t}const te=[];function ne(t,n,e){const r=e||[];r.setLength&&r.setLength(t.length);const i=te;i.length<t.length/3&&(i.length=t.length/3),i.fill(0,0,t.length/3);const s=void 0===n.length?n:n.length;for(let e=0;e<s/3;e++)void 0===n.length?he(t,3*e,3*e+1,3*e+2,r,i):he(t,n[3*e],n[3*e+1],n[3*e+2],r,i);for(let t=0;t<r.length;t+=3){const n=i[t/3];0!==n?(r[t]/=n,r[t+1]/=n,r[t+2]/=n):(r[t]=0,r[t+1]=0,r[t+2]=0)}return r}const ee=[],re=[],ie=[],se=[],oe=[],ae=[],ue=[];function he(t,n,e,r,i,s){ft(se,t[3*n],t[3*n+1],t[3*n+2]),ft(oe,t[3*e],t[3*e+1],t[3*e+2]),ft(ae,t[3*r],t[3*r+1],t[3*r+2]);const o=gt(ee,ae,oe),a=gt(re,se,oe),u=mt(ie,o,a);pt(ue,u),i[3*n]=i[3*n]||0,i[3*e]=i[3*e]||0,i[3*r]=i[3*r]||0,i[3*n+1]=i[3*n+1]||0,i[3*e+1]=i[3*e+1]||0,i[3*r+1]=i[3*r+1]||0,i[3*n+2]=i[3*n+2]||0,i[3*e+2]=i[3*e+2]||0,i[3*r+2]=i[3*r+2]||0,i[3*n]+=ue[0],i[3*e]+=ue[0],i[3*r]+=ue[0],i[3*n+1]+=ue[1],i[3*e+1]+=ue[1],i[3*r+1]+=ue[1],i[3*n+2]+=ue[2],i[3*e+2]+=ue[2],i[3*r+2]+=ue[2],s[n]+=1,s[e]+=1,s[r]+=1}\n/*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */function le(t,n,e){return t[0]=n[e],t[1]=n[e+1],t[2]=n[e+2],t}function ce(t,n,e){return t[0]=n[e],t[1]=n[e+1],t}var fe={exports:{}};function de(t,n,e){e=e||2;var r,i,s,o,a,u,h,l=n&&n.length,c=l?n[0]*e:t.length,f=pe(t,0,c,e,!0),d=[];if(!f||f.next===f.prev)return d;if(l&&(f=function(t,n,e,r){var i,s,o,a,u,h=[];for(i=0,s=n.length;i<s;i++)o=n[i]*r,a=i<s-1?n[i+1]*r:t.length,(u=pe(t,o,a,r,!1))===u.next&&(u.steiner=!0),h.push(ke(u));for(h.sort(Me),i=0;i<h.length;i++)e=xe(h[i],e);return e}(t,n,f,e)),t.length>80*e){r=s=t[0],i=o=t[1];for(var p=e;p<c;p+=e)(a=t[p])<r&&(r=a),(u=t[p+1])<i&&(i=u),a>s&&(s=a),u>o&&(o=u);h=0!==(h=Math.max(s-r,o-i))?32767/h:0}return me(f,d,e,r,i,h,0),d}function pe(t,n,e,r,i){var s,o;if(i===Ue(t,n,e,r)>0)for(s=n;s<e;s+=r)o=ze(s,t[s],t[s+1],o);else for(s=e-r;s>=n;s-=r)o=ze(s,t[s],t[s+1],o);return o&&Oe(o,o.next)&&(De(o),o=o.next),o}function ye(t,n){if(!t)return t;n||(n=t);var e,r=t;do{if(e=!1,r.steiner||!Oe(r,r.next)&&0!==_e(r.prev,r,r.next))r=r.next;else{if(De(r),(r=n=r.prev)===r.next)break;e=!0}}while(e||r!==n);return n}function me(t,n,e,r,i,s,o){if(t){!o&&s&&function(t,n,e,r){var i=t;do{0===i.z&&(i.z=Ae(i.x,i.y,n,e,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var n,e,r,i,s,o,a,u,h=1;do{for(e=t,t=null,s=null,o=0;e;){for(o++,r=e,a=0,n=0;n<h&&(a++,r=r.nextZ);n++);for(u=h;a>0||u>0&&r;)0!==a&&(0===u||!r||e.z<=r.z)?(i=e,e=e.nextZ,a--):(i=r,r=r.nextZ,u--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;e=r}s.nextZ=null,h*=2}while(o>1)}(i)}(t,r,i,s);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,s?ve(t,r,i,s):ge(t))n.push(a.i/e|0),n.push(t.i/e|0),n.push(u.i/e|0),De(t),t=u.next,h=u.next;else if((t=u)===h){o?1===o?me(t=be(ye(t),n,e),n,e,r,i,s,2):2===o&&we(t,n,e,r,i,s):me(ye(t),n,e,r,i,s,1);break}}}function ge(t){var n=t.prev,e=t,r=t.next;if(_e(n,e,r)>=0)return!1;for(var i=n.x,s=e.x,o=r.x,a=n.y,u=e.y,h=r.y,l=i<s?i<o?i:o:s<o?s:o,c=a<u?a<h?a:h:u<h?u:h,f=i>s?i>o?i:o:s>o?s:o,d=a>u?a>h?a:h:u>h?u:h,p=r.next;p!==n;){if(p.x>=l&&p.x<=f&&p.y>=c&&p.y<=d&&Pe(i,a,s,u,o,h,p.x,p.y)&&_e(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function ve(t,n,e,r){var i=t.prev,s=t,o=t.next;if(_e(i,s,o)>=0)return!1;for(var a=i.x,u=s.x,h=o.x,l=i.y,c=s.y,f=o.y,d=a<u?a<h?a:h:u<h?u:h,p=l<c?l<f?l:f:c<f?c:f,y=a>u?a>h?a:h:u>h?u:h,m=l>c?l>f?l:f:c>f?c:f,g=Ae(d,p,n,e,r),v=Ae(y,m,n,e,r),b=t.prevZ,w=t.nextZ;b&&b.z>=g&&w&&w.z<=v;){if(b.x>=d&&b.x<=y&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&Pe(a,l,u,c,h,f,b.x,b.y)&&_e(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,w.x>=d&&w.x<=y&&w.y>=p&&w.y<=m&&w!==i&&w!==o&&Pe(a,l,u,c,h,f,w.x,w.y)&&_e(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=y&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&Pe(a,l,u,c,h,f,b.x,b.y)&&_e(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;w&&w.z<=v;){if(w.x>=d&&w.x<=y&&w.y>=p&&w.y<=m&&w!==i&&w!==o&&Pe(a,l,u,c,h,f,w.x,w.y)&&_e(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function be(t,n,e){var r=t;do{var i=r.prev,s=r.next.next;!Oe(i,s)&&Ee(i,r,r.next,s)&&Ce(i,s)&&Ce(s,i)&&(n.push(i.i/e|0),n.push(r.i/e|0),n.push(s.i/e|0),De(r),De(r.next),r=t=s),r=r.next}while(r!==t);return ye(r)}function we(t,n,e,r,i,s){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Se(o,a)){var u=Te(o,a);return o=ye(o,o.next),u=ye(u,u.next),me(o,n,e,r,i,s,0),void me(u,n,e,r,i,s,0)}a=a.next}o=o.next}while(o!==t)}function Me(t,n){return t.x-n.x}function xe(t,n){var e=function(t,n){var e,r=n,i=t.x,s=t.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>o&&(o=a,e=r.x<r.next.x?r:r.next,a===i))return e}r=r.next}while(r!==n);if(!e)return null;var u,h=e,l=e.x,c=e.y,f=1/0;r=e;do{i>=r.x&&r.x>=l&&i!==r.x&&Pe(s<c?i:o,s,l,c,s<c?o:i,s,r.x,r.y)&&(u=Math.abs(s-r.y)/(i-r.x),Ce(r,t)&&(u<f||u===f&&(r.x>e.x||r.x===e.x&&Fe(e,r)))&&(e=r,f=u)),r=r.next}while(r!==h);return e}(t,n);if(!e)return n;var r=Te(e,t);return ye(r,r.next),ye(e,e.next)}function Fe(t,n){return _e(t.prev,t,n.prev)<0&&_e(n.next,t,t.next)<0}function Ae(t,n,e,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-e)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-r)*i|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function ke(t){var n=t,e=t;do{(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next}while(n!==t);return e}function Pe(t,n,e,r,i,s,o,a){return(i-o)*(n-a)>=(t-o)*(s-a)&&(t-o)*(r-a)>=(e-o)*(n-a)&&(e-o)*(s-a)>=(i-o)*(r-a)}function Se(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Ee(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}(t,n)&&(Ce(t,n)&&Ce(n,t)&&function(t,n){var e=t,r=!1,i=(t.x+n.x)/2,s=(t.y+n.y)/2;do{e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next}while(e!==t);return r}(t,n)&&(_e(t.prev,t,n.prev)||_e(t,n.prev,n))||Oe(t,n)&&_e(t.prev,t,t.next)>0&&_e(n.prev,n,n.next)>0)}function _e(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Oe(t,n){return t.x===n.x&&t.y===n.y}function Ee(t,n,e,r){var i=$e(_e(t,n,e)),s=$e(_e(t,n,r)),o=$e(_e(e,r,t)),a=$e(_e(e,r,n));return i!==s&&o!==a||(!(0!==i||!Ie(t,e,n))||(!(0!==s||!Ie(t,r,n))||(!(0!==o||!Ie(e,t,r))||!(0!==a||!Ie(e,n,r)))))}function Ie(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function $e(t){return t>0?1:t<0?-1:0}function Ce(t,n){return _e(t.prev,t,t.next)<0?_e(t,n,t.next)>=0&&_e(t,t.prev,n)>=0:_e(t,n,t.prev)<0||_e(t,t.next,n)<0}function Te(t,n){var e=new je(t.i,t.x,t.y),r=new je(n.i,n.x,n.y),i=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=i,i.prev=e,r.next=e,e.prev=r,s.next=r,r.prev=s,r}function ze(t,n,e,r){var i=new je(t,n,e);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function De(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 je(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ue(t,n,e,r){for(var i=0,s=n,o=e-r;s<e;s+=r)i+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return i}fe.exports=de,fe.exports.default=de,de.deviation=function(t,n,e,r){var i=n&&n.length,s=i?n[0]*e:t.length,o=Math.abs(Ue(t,0,s,e));if(i)for(var a=0,u=n.length;a<u;a++){var h=n[a]*e,l=a<u-1?n[a+1]*e:t.length;o-=Math.abs(Ue(t,h,l,e))}var c=0;for(a=0;a<r.length;a+=3){var f=r[a]*e,d=r[a+1]*e,p=r[a+2]*e;c+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},de.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},r=0,i=0;i<t.length;i++){for(var s=0;s<t[i].length;s++)for(var o=0;o<n;o++)e.vertices.push(t[i][s][o]);i>0&&(r+=t[i-1].length,e.holes.push(r))}return e};var Ne=fe.exports;\n/*!\n * @maptalks/vector-packer v0.92.1\n * LICENSE : UNLICENSED\n * (c) 2016-2024 maptalks.com\n */const Le={Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6};function Ve(t,n={}){var e=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)Re(e,t.features[r],n,r);else Re(e,"Feature"===t.type?t:{geometry:t},n);return e}function Re(t,n,e,r){if(n.geometry&&n.geometry.geometry){var i=n.geometry.coordinates,s=n.geometry.type,o=[],a=n.id;if(e.promoteId?a=n.properties[e.promoteId]:e.generateId&&(a=r||0),"Point"===s)He(i,o);else if("MultiPoint"===s)for(var u=0;u<i.length;u++)He(i[u],o);else if("LineString"===s)qe([i],o);else if("MultiLineString"===s){if(e.lineMetrics){for(u=0;u<i.length;u++)We(i[u],o=[]),t.push(Ge(a,"LineString",o,n.properties));return}qe(i,o)}else if("Polygon"===s)qe(i,o);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(u=0;u<n.geometry.geometries.length;u++)Re(t,{id:a,geometry:n.geometry.geometries[u],properties:n.properties},e,r);return}return void console.warn(`Input data type(${s}) is not a valid GeoJSON geometry type.`)}for(u=0;u<i.length;u++){var h=[];qe(i[u],h),o.push(h)}}t.push(Ge(a,s,o,n.properties))}}function He(t,n){const e=new Ut(t[0],t[1]);e.z=100*(t[2]||0),n.push([e])}function We(t,n){for(let e=0;e<t.length;e++){const r=new Ut(t[e][0],t[e][1]);r.z=100*(t[e][2]||0),n.push(r)}}function qe(t,n,e,r){for(var i=0;i<t.length;i++){var s=[];We(t[i],s),n.push(s)}}function Ge(t,n,e,r){return{id:void 0===t?null:t,type:Le[n],geometry:e,properties:r}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */function Be(t,{width:n,height:e},r,i){if(i){if(i.length!==n*e*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*e*r);return t.width=n,t.height=e,t.data=i,t}function Je(t,{width:n,height:e},r){if(n===t.width&&e===t.height)return;const i=Be({},{width:n,height:e},r);Xe(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,e)},r),t.width=n,t.height=e,t.data=i.data}function Xe(t,n,e,r,i,s){if(0===i.width||0===i.height)return n;if(i.width>t.width||i.height>t.height||e.x>t.width-i.width||e.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>n.width||i.height>n.height||r.x>n.width-i.width||r.y>n.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const o=t.data,a=n.data;if(o===a)return n;for(let u=0;u<i.height;u++){const h=((e.y+u)*t.width+e.x)*s,l=((r.y+u)*n.width+r.x)*s;for(let t=0;t<i.width*s;t++)a[l+t]=o[h+t]}return n}class Ye{constructor(t,n){Be(this,t,1,n)}resize(t){Je(this,t,1)}clone(){return new Ye({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,e,r,i){Xe(t,n,e,r,i,1)}}class Ze{constructor(t,n){Be(this,t,4,n)}resize(t){Je(this,t,4)}clone(){return new Ze({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,e,r,i){Xe(t,n,e,r,i,4)}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */class Ke{constructor(t,n,{pixelRatio:e}){this.paddedRect=t,this.pixelRatio=e||1,this.padding=n}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.pixelRatio,(this.paddedRect.h-2*this.padding)/this.pixelRatio]}}class Qe{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,n=Object.keys(t).length,e={},r=new Lt(0,0,{autoResize:!0}),i=[],s=n>1?1:0;for(const n in t){const r=t[n],o={x:0,y:0,w:r.data.width+2*s,h:r.data.height+2*s};i.push(o),e[n]=new Ke(o,s,r)}if(r.pack(i,{inPlace:!0}),!tr(r.w)||!tr(r.h)){const t=nr(r.w),n=nr(r.h);r.resize(t,n)}const o=new Ze({width:r.w,height:r.h});for(const n in t){const r=t[n],i=e[n].paddedRect;Ze.copy(r.data,o,{x:0,y:0},{x:i.x+s,y:i.y+s},r.data)}this.image=o,this.positions=e}}function tr(t){return 0==(t&t-1)&&0!==t}function nr(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n * TODO 升级为potpack\n */class er{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,n={},e=new Lt(0,0,{autoResize:!0}),r=[];for(const e in t){const i=t[e],s=n[e]={};for(const t in i){const n=i[+t];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;const e={x:0,y:0,w:n.bitmap.width+2,h:n.bitmap.height+2};r.push(e),s[t]={rect:e,metrics:n.metrics}}}e.pack(r,{inPlace:!0});const i=new Ye({width:e.w,height:e.h});for(const e in t){const r=t[e];for(const t in r){const s=r[+t];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const o=n[e][t].rect;Ye.copy(s.bitmap,i,{x:0,y:0},{x:o.x+1,y:o.y+1},s.bitmap)}}this.image=i,this.positions=n}}function rr(t){return t<65536?Uint16Array:Uint32Array}function ir(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function sr(t){return t<256?Uint8Array:t<65536?Uint16Array:Float32Array}function or(t,n){const e=new n(t.length),r=e.length;for(let n=0;n<r;n++)e[n]=t[n];return e}function ar(t){const n=t.type,e=[];if(1===n||4===n)for(let n=0;n<t.geometry.length;n++)He(t.geometry[n],e);else if(2===n)qe(t.geometry,e);else if(3===n)qe(t.geometry,e);else if(5===n)qe(t.geometry,e);else if(6===n)for(let n=0;n<t.geometry.length;n++){const r=[];qe(t.geometry[n],r),e.push(r)}return t.geometry=e,t}function ur(t){for(let n=1;n<arguments.length;n++){const e=arguments[n];for(const n in e)t[n]=e[n]}return t}function hr(t){return null==t}function lr(t){return"number"==typeof t&&!isNaN(t)}function cr(t){return"object"==typeof t&&!!t}function fr(t){return!hr(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function dr(t){return!hr(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}const pr=Object.prototype.hasOwnProperty;function yr(t,n){return pr.call(t,n)}const mr=Math.PI/180;function gr(t){return t&&d(t)&&t.property}function vr(t){const{verticalCentimeterToPoint:n,tileRatio:e}=t;return n*e}function br(t){return"centimeter"===t||"cm"===t?1:"millimeter"===t||"mm"===t?.1:100}const wr={};function Mr(t,n){if(!Array.isArray(n)){if(n&&void 0!==n.r&&void 0!==n.g&&void 0!==n.b)return t[0]=255*n.r,t[1]=255*n.g,t[2]=255*n.b,t[3]=void 0!==n.a?255*n.a:255,t;n=wr[n]=wr[n]||Cn(n).unitArray()}for(let e=0;e<n.length;e++)t[e]=255*n[e];return 3===n.length&&(t[3]=255),t}const xr={textFill:1,textSize:1,textOpacity:1,textDx:1,textDy:1,markerWidth:1,markerHeight:1,markerOpacity:1,markerDx:1,markerDy:1,lineWidth:1,lineColor:1,lineOpacity:1,polygonFill:1,polygonOpacity:1,polygonPatternFileWidth:1,polygonPatternFileOrigin:1},Fr={textName:1,markerTextFitPadding:1,markerTextFit:1,lineGradientProperty:1};var Ar=Object.freeze({__proto__:null,now:function(){return Date.now()},extend:ur,isNil:hr,isNumber:lr,isInteger:function(t){return(0|t)===t},isObject:cr,isString:fr,isFunction:dr,hasOwn:yr,join:function(t,n){return t.join?t.join(n||","):Array.prototype.join.call(t,n||",")},toRadian:function(t){return t*mr},toDegree:function(t){return t/mr},evaluate:function(t,n,e){return dr(t)?t(void 0!==e?e:null,n):t},isFnTypeSymbol:gr,getAltitudeToLocal:vr,getTubeSizeScale:br,normalizeColor:Mr,checkIfIdentityZoomDependent:function(t,n,e){if(Array.isArray(e)||(e=Object.values(e)),!e||!e.length)return!1;if(!xr[t])return!1;for(let t=0;t<e.length;t++){const r=e[t]&&(e[t].feature||e[t]);if(!r)continue;const i=r.properties&&r.properties[n];if(i&&d(i)&&!p(i).isZoomConstant)return!0}return!1},checkIfZoomFnTypeSymbol:function(t){return!!xr[t]||!!Fr[t]}});function kr(t){let n=0;for(let e,r,i=0,s=t.length,o=s-1;i<s;o=i++)if(e=t[i],r=t[o],void 0!==e.x){if(e.z||r.z)return 1;n+=(r.x-e.x)*(e.y+r.y)}else{if(e[2]||r[2])return 1;n+=(r[0]-e[0])*(e[1]+r[1])}return n}function Pr(t,n,e,r,i){const s=t[n*r],o=t[n*r+1],a=t[e*r],u=t[e*r+1];return s===a&&(s<0||s>i)&&o!==u||o===u&&(o<0||o>i)&&s!==a}function Sr(t,n,e){let r=e;return n&&t&&(r=+t[n]),isNaN(r)&&(r=e||0),100*r}function _r(t,n,e,r,i,s,o){n||0===n||(n=1);const a=Sr(t.properties,e,r),u=a*n;let h=(s?100*s:0)||a;return i?h=Sr(t.properties,i,s):o&&(h=a-Sr(t.properties,o,s)),h*=n,{altitude:u,height:h}}function Or(t,n){return n<1/0&&(t.x<0||t.x>n||t.y<0||t.y>n)}function Er(t){return null==t}function Ir(t,n,e){if(t===e||t===n)return t;const r=e-n;return((t-n)%r+r)%r+n}function $r(t,n){if(!n)return null;const e=new Map;for(let r=0;r<n.length;r++){const i=n[r],s=t[i];let o=e.get(s);o||(o=[],e.set(s,o)),o.push(i)}return e}class Cr{constructor(t,n,e,r){this.feature=t,this.symbol=n,this.fnTypes=e,this.options=r}getPolygonResource(){let t=this.symbol.polygonPatternFile;const{polygonPatternFileFn:n}=this.fnTypes;return this.U(t,n)}getLineResource(){let t=this.symbol.linePatternFile;const{linePatternFileFn:n}=this.fnTypes;return this.U(t,n)}U(t,n){return n&&(t=n(this.options.zoom,this.feature.properties)),t}}function Tr(t,n,e,r){const i=Math.abs(r)>>15,s=i>>1,o=i%2;let a=r%Math.pow(2,15);const u=n+(s<<14)*Math.sign(n),h=e+(o<<14)*Math.sign(e);return t[0]=u,t[1]=h,a=Math.round(a),t[2]=0===a?r<0?-1:0:a,t}const zr=Math.pow(2,14),Dr=Math.pow(2,15);\n/*!\n * a compact version of mapbox-gl-style-spec\n * based on mapbox-gl-style-spec@13.28.0\n * https://github.com/mapbox/mapbox-gl-js/tree/main/src/style-spec\n * LICENSE : ISC\n */var jr,Ur,Nr="undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self?self:{},Lr={exports:{}};function Vr(t,...n){for(const e of n)for(const n in e)t[n]=e[n];return t}\n/*! https://mths.be/punycode v1.3.2 by @mathias */jr=Lr,Ur=Lr.exports,function(t){var n=Ur&&!Ur.nodeType&&Ur,e=jr&&!jr.nodeType&&jr,r="object"==typeof Nr&&Nr;r.global!==r&&r.window!==r&&r.self!==r||(t=r);var i,s,o=2147483647,a=/^xn--/,u=/[^\\x20-\\x7E]/,h=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,f=String.fromCharCode;function d(t){throw RangeError(l[t])}function p(t,n){for(var e=t.length,r=[];e--;)r[e]=n(t[e]);return r}function y(t,n){var e=t.split("@"),r="";return e.length>1&&(r=e[0]+"@",t=e[1]),r+p((t=t.replace(h,".")).split("."),n).join(".")}function m(t){for(var n,e,r=[],i=0,s=t.length;i<s;)(n=t.charCodeAt(i++))>=55296&&n<=56319&&i<s?56320==(64512&(e=t.charCodeAt(i++)))?r.push(((1023&n)<<10)+(1023&e)+65536):(r.push(n),i--):r.push(n);return r}function g(t){return p(t,(function(t){var n="";return t>65535&&(n+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),n+f(t)})).join("")}function v(t,n){return t+22+75*(t<26)-((0!=n)<<5)}function b(t,n,e){var r=0;for(t=e?c(t/700):t>>1,t+=c(t/n);t>455;r+=36)t=c(t/35);return c(r+36*t/(t+38))}function w(t){var n,e,r,i,s,a,u,h,l,f,p,y=[],m=t.length,v=0,w=128,M=72;for((e=t.lastIndexOf("-"))<0&&(e=0),r=0;r<e;++r)t.charCodeAt(r)>=128&&d("not-basic"),y.push(t.charCodeAt(r));for(i=e>0?e+1:0;i<m;){for(s=v,a=1,u=36;i>=m&&d("invalid-input"),((h=(p=t.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||h>c((o-v)/a))&&d("overflow"),v+=h*a,!(h<(l=u<=M?1:u>=M+26?26:u-M));u+=36)a>c(o/(f=36-l))&&d("overflow"),a*=f;M=b(v-s,n=y.length+1,0==s),c(v/n)>o-w&&d("overflow"),w+=c(v/n),v%=n,y.splice(v++,0,w)}return g(y)}function M(t){var n,e,r,i,s,a,u,h,l,p,y,g,w,M,x,F=[];for(g=(t=m(t)).length,n=128,e=0,s=72,a=0;a<g;++a)(y=t[a])<128&&F.push(f(y));for(r=i=F.length,i&&F.push("-");r<g;){for(u=o,a=0;a<g;++a)(y=t[a])>=n&&y<u&&(u=y);for(u-n>c((o-e)/(w=r+1))&&d("overflow"),e+=(u-n)*w,n=u,a=0;a<g;++a)if((y=t[a])<n&&++e>o&&d("overflow"),y==n){for(h=e,l=36;!(h<(p=l<=s?1:l>=s+26?26:l-s));l+=36)F.push(f(v(p+(x=h-p)%(M=36-p),0))),h=c(x/M);F.push(f(v(h,0))),s=b(e,w,r==i),e=0,++r}++e,++n}return F.join("")}if(i={version:"1.3.2",ucs2:{decode:m,encode:g},decode:w,encode:M,toASCII:function(t){return y(t,(function(t){return u.test(t)?"xn--"+M(t):t}))},toUnicode:function(t){return y(t,(function(t){return a.test(t)?w(t.slice(4).toLowerCase()):t}))}},n&&e)if(jr.exports==n)e.exports=i;else for(s in i)i.hasOwnProperty(s)&&(n[s]=i[s]);else t.punycode=i}(Nr);class Rr extends Error{constructor(t,n){super(n),this.message=n,this.key=t}}var Hr=Rr;class Wr{constructor(t,n=[]){this.parent=t,this.bindings={};for(const[t,e]of n)this.bindings[t]=e}concat(t){return new Wr(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var qr=Wr;const Gr={kind:"null"},Br={kind:"number"},Jr={kind:"string"},Xr={kind:"boolean"},Yr={kind:"color"},Zr={kind:"object"},Kr={kind:"value"},Qr={kind:"collator"},ti={kind:"formatted"},ni={kind:"resolvedImage"};function ei(t,n){return{kind:"array",itemType:t,N:n}}function ri(t){if("array"===t.kind){const n=ri(t.itemType);return"number"==typeof t.N?`array<${n}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${n}>`}return t.kind}const ii=[Gr,Br,Jr,Xr,Yr,ti,Zr,ei(Kr),ni];function si(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!si(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind)for(const t of ii)if(!si(t,n))return null}return`Expected ${ri(t)} but found ${ri(n)} instead.`}function oi(t,n){return n.some(n=>n.kind===t.kind)}function ai(t,n){return n.some(n=>"null"===n?null===t:"array"===n?Array.isArray(t):"object"===n?t&&!Array.isArray(t)&&"object"==typeof t:n===typeof t)}var ui,hi={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function li(t){return(t=Math.round(t))<0?0:t>255?255:t}function ci(t){return li("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function fi(t){return function(t){return t<0?0:t>1?1:t}("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function di(t,n,e){return e<0?e+=1:e>1&&(e-=1),6*e<1?t+(n-t)*e*6:2*e<1?n:3*e<2?t+(n-t)*(2/3-e)*6:t}try{ui={}.parseCSSColor=function(t){var n,e=t.replace(/ /g,"").toLowerCase();if(e in hi)return hi[e].slice();if("#"===e[0])return 4===e.length?(n=parseInt(e.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:7===e.length&&(n=parseInt(e.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var r=e.indexOf("("),i=e.indexOf(")");if(-1!==r&&i+1===e.length){var s=e.substr(0,r),o=e.substr(r+1,i-(r+1)).split(","),a=1;switch(s){case"rgba":if(4!==o.length)return null;a=fi(o.pop());case"rgb":return 3!==o.length?null:[ci(o[0]),ci(o[1]),ci(o[2]),a];case"hsla":if(4!==o.length)return null;a=fi(o.pop());case"hsl":if(3!==o.length)return null;var u=(parseFloat(o[0])%360+360)%360/360,h=fi(o[1]),l=fi(o[2]),c=l<=.5?l*(h+1):l+h-l*h,f=2*l-c;return[li(255*di(f,c,u+1/3)),li(255*di(f,c,u)),li(255*di(f,c,u-1/3)),a];default:return null}}return null}}catch(t){}class pi{constructor(t,n,e,r=1){this.r=t,this.g=n,this.b=e,this.a=r}static parse(t){if(!t)return;if(t instanceof pi)return t;if("string"!=typeof t)return;const n=ui(t);return n?new pi(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3]):void 0}toString(){const[t,n,e,r]=this.toArray();return`rgba(${Math.round(t)},${Math.round(n)},${Math.round(e)},${r})`}toArray(){const{r:t,g:n,b:e,a:r}=this;return 0===r?[0,0,0,0]:[255*t/r,255*n/r,255*e/r,r]}toArray01(){const{r:t,g:n,b:e,a:r}=this;return 0===r?[0,0,0,0]:[t/r,n/r,e/r,r]}toArray01PremultipliedAlpha(){const{r:t,g:n,b:e,a:r}=this;return[t,n,e,r]}}pi.black=new pi(0,0,0,1),pi.white=new pi(1,1,1,1),pi.transparent=new pi(0,0,0,0),pi.red=new pi(1,0,0,1),pi.blue=new pi(0,0,1,1);var yi=pi;class mi{constructor(t,n,e){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=e,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,n){return this.collator.compare(t,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class gi{constructor(t,n,e,r,i){this.text=t.normalize?t.normalize():t,this.image=n,this.scale=e,this.fontStack=r,this.textColor=i}}class vi{constructor(t){this.sections=t}static fromString(t){return new vi([new gi(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof vi?t:vi.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const n of this.sections){if(n.image){t.push(["image",n.image.name]);continue}t.push(n.text);const e={};n.fontStack&&(e["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(e["font-scale"]=n.scale),n.textColor&&(e["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(e)}return t}}class bi{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new bi({name:t,available:!1}):null}serialize(){return["image",this.name]}}function wi(t,n,e,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof e&&e>=0&&e<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,n,e,r].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,n,e,r]:[t,n,e]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function Mi(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 yi)return!0;if(t instanceof mi)return!0;if(t instanceof vi)return!0;if(t instanceof bi)return!0;if(Array.isArray(t)){for(const n of t)if(!Mi(n))return!1;return!0}if("object"==typeof t){for(const n in t)if(!Mi(t[n]))return!1;return!0}return!1}function xi(t){if(null===t)return Gr;if("string"==typeof t)return Jr;if("boolean"==typeof t)return Xr;if("number"==typeof t)return Br;if(t instanceof yi)return Yr;if(t instanceof mi)return Qr;if(t instanceof vi)return ti;if(t instanceof bi)return ni;if(Array.isArray(t)){const n=t.length;let e;for(const n of t){const t=xi(n);if(e){if(e===t)continue;e=Kr;break}e=t}return ei(e||Kr,n)}return Zr}function Fi(t){const n=typeof t;return null===t?"":"string"===n||"number"===n||"boolean"===n?String(t):t instanceof yi||t instanceof vi||t instanceof bi?t.toString():JSON.stringify(t)}class Ai{constructor(t,n){this.type=t,this.value=n}static parse(t,n){if(2!==t.length)return n.error(`\'literal\' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Mi(t[1]))return n.error("invalid value");const e=t[1];let r=xi(e);const i=n.expectedType;return"array"!==r.kind||0!==r.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(r=i),new Ai(r,e)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof yi?["rgba"].concat(this.value.toArray()):this.value instanceof vi?this.value.serialize():this.value}}var ki=Ai,Pi=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const Si={string:Jr,number:Br,boolean:Xr,object:Zr};class _i{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let e,r=1;const i=t[0];if("array"===i){let i,s;if(t.length>2){const e=t[1];if("string"!=typeof e||!(e in Si)||"object"===e)return n.error(\'The item type argument of "array" must be one of string, number, boolean\',1);i=Si[e],r++}else i=Kr;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return n.error(\'The length argument to "array" must be a positive integer literal\',2);s=t[2],r++}e=ei(i,s)}else e=Si[i];const s=[];for(;r<t.length;r++){const e=n.parse(t[r],r,Kr);if(!e)return null;s.push(e)}return new _i(e,s)}evaluate(t){for(let n=0;n<this.args.length;n++){const e=this.args[n].evaluate(t);if(!si(this.type,xi(e)))return e;if(n===this.args.length-1)throw new Pi(`Expected value to be of type ${ri(this.type)}, but found ${ri(xi(e))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=this.type,n=[t.kind];if("array"===t.kind){const e=t.itemType;if("string"===e.kind||"number"===e.kind||"boolean"===e.kind){n.push(e.kind);const r=t.N;("number"==typeof r||this.args.length>1)&&n.push(r)}}return n.concat(this.args.map(t=>t.serialize()))}}var Oi=_i;class Ei{constructor(t){this.type=ti,this.sections=t}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");const e=t[1];if(!Array.isArray(e)&&"object"==typeof e)return n.error("First argument must be an image or text section.");const r=[];let i=!1;for(let e=1;e<=t.length-1;++e){const s=t[e];if(i&&"object"==typeof s&&!Array.isArray(s)){i=!1;let t=null;if(s["font-scale"]&&(t=n.parse(s["font-scale"],1,Br),!t))return null;let e=null;if(s["text-font"]&&(e=n.parse(s["text-font"],1,ei(Jr)),!e))return null;let o=null;if(s["text-color"]&&(o=n.parse(s["text-color"],1,Yr),!o))return null;const a=r[r.length-1];a.scale=t,a.font=e,a.textColor=o}else{const s=n.parse(t[e],1,Kr);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return n.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");i=!0,r.push({content:s,scale:null,font:null,textColor:null})}}return new Ei(r)}evaluate(t){return new vi(this.sections.map(n=>{const e=n.content.evaluate(t);return xi(e)===ni?new gi("",e,null,null,null):new gi(Fi(e),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)}))}eachChild(t){for(const n of this.sections)t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const n of this.sections){t.push(n.content.serialize());const e={};n.scale&&(e["font-scale"]=n.scale.serialize()),n.font&&(e["text-font"]=n.font.serialize()),n.textColor&&(e["text-color"]=n.textColor.serialize()),t.push(e)}return t}}class Ii{constructor(t){this.type=ni,this.input=t}static parse(t,n){if(2!==t.length)return n.error("Expected two arguments.");const e=n.parse(t[1],1,Jr);return e?new Ii(e):n.error("No image name provided.")}evaluate(t){const n=this.input.evaluate(t),e=bi.fromString(n);return e&&t.availableImages&&(e.available=t.availableImages.indexOf(n)>-1),e}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const $i={"to-boolean":Xr,"to-color":Yr,"to-number":Br,"to-string":Jr};class Ci{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");const e=t[0];if(("to-boolean"===e||"to-string"===e)&&2!==t.length)return n.error("Expected one argument.");const r=$i[e],i=[];for(let e=1;e<t.length;e++){const r=n.parse(t[e],e,Kr);if(!r)return null;i.push(r)}return new Ci(r,i)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let n,e;for(const r of this.args){if(n=r.evaluate(t),e=null,n instanceof yi)return n;if("string"==typeof n){const e=t.parseColor(n);if(e)return e}else if(Array.isArray(n)&&(e=n.length<3||n.length>4?`Invalid rbga value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:wi(n[0],n[1],n[2],n[3]),!e))return new yi(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new Pi(e||`Could not parse color from value \'${"string"==typeof n?n:String(JSON.stringify(n))}\'`)}if("number"===this.type.kind){let n=null;for(const e of this.args){if(n=e.evaluate(t),null===n)return 0;const r=Number(n);if(!isNaN(r))return r}throw new Pi(`Could not convert ${JSON.stringify(n)} to number.`)}return"formatted"===this.type.kind?vi.fromString(Fi(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?bi.fromString(Fi(this.args[0].evaluate(t))):Fi(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Ei([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ii(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild(n=>{t.push(n.serialize())}),t}}var Ti=Ci;const zi=["Unknown","Point","LineString","Polygon"];var Di=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this.L={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?zi[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,n=this.featureDistanceData.scale,{x:e,y:r}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(e*n-t[0])+this.featureDistanceData.bearing[1]*(r*n-t[1])}return 0}parseColor(t){let n=this.L[t];return n||(n=this.L[t]=yi.parse(t)),n}};class ji{constructor(t,n,e,r){this.name=t,this.type=n,this.V=e,this.args=r}evaluate(t){return this.V(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,n){const e=t[0],r=ji.definitions[e];if(!r)return n.error(`Unknown expression "${e}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(r)?r[0]:r.type,s=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,o=s.filter(([n])=>!Array.isArray(n)||n.length===t.length-1);let a=null;for(const[r,s]of o){a=new hs(n.registry,n.path,null,n.scope);const o=[];let u=!1;for(let n=1;n<t.length;n++){const e=t[n],i=Array.isArray(r)?r[n-1]:r.type,s=a.parse(e,1+o.length,i);if(!s){u=!0;break}o.push(s)}if(!u)if(Array.isArray(r)&&r.length!==o.length)a.error(`Expected ${r.length} arguments, but found ${o.length} instead.`);else{for(let t=0;t<o.length;t++){const n=Array.isArray(r)?r[t]:r.type,e=o[t];a.concat(t+1).checkSubtype(n,e.type)}if(0===a.errors.length)return new ji(e,i,s,o)}}if(1===o.length)n.errors.push(...a.errors);else{const e=(o.length?o:s).map(([t])=>{return n=t,Array.isArray(n)?`(${n.map(ri).join(", ")})`:`(${ri(n.type)}...)`;var n}).join(" | "),r=[];for(let e=1;e<t.length;e++){const i=n.parse(t[e],1+r.length);if(!i)return null;r.push(ri(i.type))}n.error(`Expected arguments of type ${e}, but found (${r.join(", ")}) instead.`)}return null}static register(t,n){ji.definitions=n;for(const e in n)t[e]=ji}}var Ui=ji;class Ni{constructor(t,n,e){this.type=Qr,this.locale=e,this.caseSensitive=t,this.diacriticSensitive=n}static parse(t,n){if(2!==t.length)return n.error("Expected one argument.");const e=t[1];if("object"!=typeof e||Array.isArray(e))return n.error("Collator options argument must be an object.");const r=n.parse(void 0!==e["case-sensitive"]&&e["case-sensitive"],1,Xr);if(!r)return null;const i=n.parse(void 0!==e["diacritic-sensitive"]&&e["diacritic-sensitive"],1,Xr);if(!i)return null;let s=null;return e.locale&&(s=n.parse(e.locale,1,Jr),!s)?null:new Ni(r,i,s)}evaluate(t){return new mi(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function Li(t,n){t[0]=Math.min(t[0],n[0]),t[1]=Math.min(t[1],n[1]),t[2]=Math.max(t[2],n[0]),t[3]=Math.max(t[3],n[1])}function Vi(t,n){return!(t[0]<=n[0]||t[2]>=n[2]||t[1]<=n[1]||t[3]>=n[3])}function Ri(t,n){const e=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,n.z);return[Math.round(e*i*8192),Math.round(r*i*8192)]}function Hi(t,n,e){const r=t[0]-n[0],i=t[1]-n[1],s=t[0]-e[0],o=t[1]-e[1];return r*o-s*i==0&&r*s<=0&&i*o<=0}function Wi(t,n){let e=!1;for(let o=0,a=n.length;o<a;o++){const a=n[o];for(let n=0,o=a.length;n<o-1;n++){if(Hi(t,a[n],a[n+1]))return!1;(i=a[n])[1]>(r=t)[1]!=(s=a[n+1])[1]>r[1]&&r[0]<(s[0]-i[0])*(r[1]-i[1])/(s[1]-i[1])+i[0]&&(e=!e)}}var r,i,s;return e}function qi(t,n){for(let e=0;e<n.length;e++)if(Wi(t,n[e]))return!0;return!1}function Gi(t,n,e,r){const i=r[0]-e[0],s=r[1]-e[1],o=(t[0]-e[0])*s-i*(t[1]-e[1]),a=(n[0]-e[0])*s-i*(n[1]-e[1]);return o>0&&a<0||o<0&&a>0}function Bi(t,n,e){for(const h of e)for(let e=0;e<h.length-1;++e)if(void 0,void 0,0!=(a=[(o=h[e+1])[0]-(s=h[e])[0],o[1]-s[1]])[0]*(u=[(i=n)[0]-(r=t)[0],i[1]-r[1]])[1]-a[1]*u[0]&&Gi(r,i,s,o)&&Gi(s,o,r,i))return!0;var r,i,s,o,a,u;return!1}function Ji(t,n){for(let e=0;e<t.length;++e)if(!Wi(t[e],n))return!1;for(let e=0;e<t.length-1;++e)if(Bi(t[e],t[e+1],n))return!1;return!0}function Xi(t,n){for(let e=0;e<n.length;e++)if(Ji(t,n[e]))return!0;return!1}function Yi(t,n,e){const r=[];for(let i=0;i<t.length;i++){const s=[];for(let r=0;r<t[i].length;r++){const o=Ri(t[i][r],e);Li(n,o),s.push(o)}r.push(s)}return r}function Zi(t,n,e){const r=[];for(let i=0;i<t.length;i++){const s=Yi(t[i],n,e);r.push(s)}return r}function Ki(t,n,e,r){if(t[0]<e[0]||t[0]>e[2]){const n=.5*r;let i=t[0]-e[0]>n?-r:e[0]-t[0]>n?r:0;0===i&&(i=t[0]-e[2]>n?-r:e[2]-t[0]>n?r:0),t[0]+=i}Li(n,t)}function Qi(t,n,e,r){const i=8192*Math.pow(2,r.z),s=[8192*r.x,8192*r.y],o=[];if(!t)return o;for(const r of t)for(const t of r){const r=[t.x+s[0],t.y+s[1]];Ki(r,n,e,i),o.push(r)}return o}function ts(t,n,e,r){const i=8192*Math.pow(2,r.z),s=[8192*r.x,8192*r.y],o=[];if(!t)return o;for(const e of t){const t=[];for(const r of e){const e=[r.x+s[0],r.y+s[1]];Li(n,e),t.push(e)}o.push(t)}if(n[2]-n[0]<=i/2){(a=n)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of o)for(const r of t)Ki(r,n,e,i)}var a;return o}class ns{constructor(t,n){this.type=Xr,this.geojson=t,this.geometries=n}static parse(t,n){if(2!==t.length)return n.error(`\'within\' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Mi(t[1])){const n=t[1];if("FeatureCollection"===n.type)for(let t=0;t<n.features.length;++t){const e=n.features[t].geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new ns(n,n.features[t].geometry)}else if("Feature"===n.type){const t=n.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new ns(n,n.geometry)}else if("Polygon"===n.type||"MultiPolygon"===n.type)return new ns(n,n)}return n.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){const e=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===n.type){const s=Yi(n.coordinates,r,i),o=Qi(t.geometry(),e,r,i);if(!Vi(e,r))return!1;for(const t of o)if(!Wi(t,s))return!1}if("MultiPolygon"===n.type){const s=Zi(n.coordinates,r,i),o=Qi(t.geometry(),e,r,i);if(!Vi(e,r))return!1;for(const t of o)if(!qi(t,s))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){const e=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===n.type){const s=Yi(n.coordinates,r,i),o=ts(t.geometry(),e,r,i);if(!Vi(e,r))return!1;for(const t of o)if(!Ji(t,s))return!1}if("MultiPolygon"===n.type){const s=Zi(n.coordinates,r,i),o=ts(t.geometry(),e,r,i);if(!Vi(e,r))return!1;for(const t of o)if(!Xi(t,s))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var es=ns;function rs(t){if(t instanceof Ui){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof es)return!1;let n=!0;return t.eachChild(t=>{n&&!rs(t)&&(n=!1)}),n}function is(t){if(t instanceof Ui&&"feature-state"===t.name)return!1;let n=!0;return t.eachChild(t=>{n&&!is(t)&&(n=!1)}),n}function ss(t,n){if(t instanceof Ui&&n.indexOf(t.name)>=0)return!1;let e=!0;return t.eachChild(t=>{e&&!ss(t,n)&&(e=!1)}),e}class os{constructor(t,n){this.type=n.type,this.name=t,this.boundExpression=n}static parse(t,n){if(2!==t.length||"string"!=typeof t[1])return n.error("\'var\' expression requires exactly one string literal argument.");const e=t[1];return n.scope.has(e)?new os(e,n.scope.get(e)):n.error(`Unknown variable "${e}". Make sure "${e}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var as=os;class us{constructor(t,n=[],e,r=new qr,i=[]){this.registry=t,this.path=n,this.key=n.map(t=>`[${t}]`).join(""),this.scope=r,this.errors=i,this.expectedType=e}parse(t,n,e,r,i={}){return n?this.concat(n,e,r).R(t,i):this.R(t,i)}R(t,n){function e(t,n,e){return"assert"===e?new Oi(n,[t]):"coerce"===e?new Ti(n,[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", []].\');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[r];if(i){let r=i.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,i=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(t,i))return null}else r=e(r,t,n.typeAnnotation||"coerce");else r=e(r,t,n.typeAnnotation||"assert")}if(!(r instanceof ki)&&"resolvedImage"!==r.type.kind&&function t(n){if(n instanceof as)return t(n.boundExpression);if(n instanceof Ui&&"error"===n.name)return!1;if(n instanceof Ni)return!1;if(n instanceof es)return!1;const e=n instanceof Ti||n instanceof Oi;let r=!0;return n.eachChild(n=>{r=e?r&&t(n):r&&n instanceof ki}),!!r&&(rs(n)&&ss(n,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}(r)){const n=new Di;try{r=new ki(r.type,r.evaluate(n))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". 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.`)}concat(t,n,e){const r="number"==typeof t?this.path.concat(t):this.path,i=e?this.scope.concat(e):this.scope;return new us(this.registry,r,n||null,i,this.errors)}error(t,...n){const e=`${this.key}${n.map(t=>`[${t}]`).join("")}`;this.errors.push(new Hr(e,t))}checkSubtype(t,n){const e=si(t,n);return e&&this.error(e),e}}var hs=us;function ls(t,n){const e=t.length-1;let r,i,s=0,o=e,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),r=t[a],i=t[a+1],r<=n){if(a===e||n<i)return a;s=a+1}else{if(!(r>n))throw new Pi("Input is not a number.");o=a-1}return 0}class cs{constructor(t,n,e){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(const[t,n]of e)this.labels.push(t),this.outputs.push(n)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");const e=n.parse(t[1],1,Br);if(!e)return null;const r=[];let i=null;n.expectedType&&"value"!==n.expectedType.kind&&(i=n.expectedType);for(let e=1;e<t.length;e+=2){const s=1===e?-1/0:t[e],o=t[e+1],a=e,u=e+1;if("number"!=typeof s)return n.error(\'Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',a);if(r.length&&r[r.length-1][0]>=s)return n.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',a);const h=n.parse(o,u,i);if(!h)return null;i=i||h.type,r.push([s,h])}return new cs(i,e,r)}evaluate(t){const n=this.labels,e=this.outputs;if(1===n.length)return e[0].evaluate(t);const r=this.input.evaluate(t);if(r<=n[0])return e[0].evaluate(t);const i=n.length;return r>=n[i-1]?e[i-1].evaluate(t):e[ls(n,r)].evaluate(t)}eachChild(t){t(this.input);for(const n of this.outputs)t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let n=0;n<this.labels.length;n++)n>0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t}}var fs=cs,ds=ps;function ps(t,n,e,r){this.cx=3*t,this.bx=3*(e-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=e,this.p2y=r}function ys(t,n,e){return t*(1-e)+n*e}ps.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(void 0===n&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var e=t,r=0;r<8;r++){var i=this.sampleCurveX(e)-t;if(Math.abs(i)<n)return e;var s=this.sampleCurveDerivativeX(e);if(Math.abs(s)<1e-6)break;e-=i/s}var o=0,a=1;for(e=t,r=0;r<20&&(i=this.sampleCurveX(e),!(Math.abs(i-t)<n));r++)t>i?o=e:a=e,e=.5*(a-o)+o;return e},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}};var ms=Object.freeze({__proto__:null,number:ys,color:function(t,n,e){return new yi(ys(t.r,n.r,e),ys(t.g,n.g,e),ys(t.b,n.b,e),ys(t.a,n.a,e))},array:function(t,n,e){return t.map((t,r)=>ys(t,n[r],e))}});const gs=6/29*3*(6/29),vs=Math.PI/180,bs=180/Math.PI;function ws(t){return t>.008856451679035631?Math.pow(t,1/3):t/gs+4/29}function Ms(t){return t>6/29?t*t*t:gs*(t-4/29)}function xs(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Fs(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function As(t){const n=Fs(t.r),e=Fs(t.g),r=Fs(t.b),i=ws((.4124564*n+.3575761*e+.1804375*r)/.95047),s=ws((.2126729*n+.7151522*e+.072175*r)/1);return{l:116*s-16,a:500*(i-s),b:200*(s-ws((.0193339*n+.119192*e+.9503041*r)/1.08883)),alpha:t.a}}function ks(t){let n=(t.l+16)/116,e=isNaN(t.a)?n:n+t.a/500,r=isNaN(t.b)?n:n-t.b/200;return n=1*Ms(n),e=.95047*Ms(e),r=1.08883*Ms(r),new yi(xs(3.2404542*e-1.5371385*n-.4985314*r),xs(-.969266*e+1.8760108*n+.041556*r),xs(.0556434*e-.2040259*n+1.0572252*r),t.alpha)}function Ps(t,n,e){const r=n-t;return t+e*(r>180||r<-180?r-360*Math.round(r/360):r)}const Ss={forward:As,reverse:ks,interpolate:function(t,n,e){return{l:ys(t.l,n.l,e),a:ys(t.a,n.a,e),b:ys(t.b,n.b,e),alpha:ys(t.alpha,n.alpha,e)}}},_s={forward:function(t){const{l:n,a:e,b:r}=As(t),i=Math.atan2(r,e)*bs;return{h:i<0?i+360:i,c:Math.sqrt(e*e+r*r),l:n,alpha:t.a}},reverse:function(t){const n=t.h*vs,e=t.c;return ks({l:t.l,a:Math.cos(n)*e,b:Math.sin(n)*e,alpha:t.alpha})},interpolate:function(t,n,e){return{h:Ps(t.h,n.h,e),c:ys(t.c,n.c,e),l:ys(t.l,n.l,e),alpha:ys(t.alpha,n.alpha,e)}}};var Os=Object.freeze({__proto__:null,lab:Ss,hcl:_s});class Es{constructor(t,n,e,r,i){this.type=t,this.operator=n,this.interpolation=e,this.input=r,this.labels=[],this.outputs=[];for(const[t,n]of i)this.labels.push(t),this.outputs.push(n)}static interpolationFactor(t,n,e,r){let i=0;if("exponential"===t.name)i=Is(n,t.base,e,r);else if("linear"===t.name)i=Is(n,1,e,r);else if("cubic-bezier"===t.name){const s=t.controlPoints;i=new ds(s[0],s[1],s[2],s[3]).solve(Is(n,1,e,r))}return i}static parse(t,n){let[e,r,i,...s]=t;if(!Array.isArray(r)||0===r.length)return n.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return n.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return n.error("Unknown interpolation type "+String(r[0]),1,0);{const t=r.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(i=n.parse(i,2,Br),!i)return null;const o=[];let a=null;"interpolate-hcl"===e||"interpolate-lab"===e?a=Yr:n.expectedType&&"value"!==n.expectedType.kind&&(a=n.expectedType);for(let t=0;t<s.length;t+=2){const e=s[t],r=s[t+1],i=t+3,u=t+4;if("number"!=typeof e)return n.error(\'Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',i);if(o.length&&o[o.length-1][0]>=e)return n.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',i);const h=n.parse(r,u,a);if(!h)return null;a=a||h.type,o.push([e,h])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Es(a,e,r,i,o):n.error(`Type ${ri(a)} is not interpolatable.`)}evaluate(t){const n=this.labels,e=this.outputs;if(1===n.length)return e[0].evaluate(t);const r=this.input.evaluate(t);if(r<=n[0])return e[0].evaluate(t);const i=n.length;if(r>=n[i-1])return e[i-1].evaluate(t);const s=ls(n,r),o=Es.interpolationFactor(this.interpolation,r,n[s],n[s+1]),a=e[s].evaluate(t),u=e[s+1].evaluate(t);return"interpolate"===this.operator?ms[this.type.kind.toLowerCase()](a,u,o):"interpolate-hcl"===this.operator?_s.reverse(_s.interpolate(_s.forward(a),_s.forward(u),o)):Ss.reverse(Ss.interpolate(Ss.forward(a),Ss.forward(u),o))}eachChild(t){t(this.input);for(const n of this.outputs)t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const n=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)n.push(this.labels[t],this.outputs[t].serialize());return n}}function Is(t,n,e,r){const i=r-e,s=t-e;return 0===i?0:1===n?s/i:(Math.pow(n,s)-1)/(Math.pow(n,i)-1)}var $s=Es;class Cs{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expectected at least one argument.");let e=null;const r=n.expectedType;r&&"value"!==r.kind&&(e=r);const i=[];for(const r of t.slice(1)){const t=n.parse(r,1+i.length,e,void 0,{typeAnnotation:"omit"});if(!t)return null;e=e||t.type,i.push(t)}const s=r&&i.some(t=>si(r,t.type));return new Cs(s?Kr:e,i)}evaluate(t){let n,e=null,r=0;for(const i of this.args){if(r++,e=i.evaluate(t),e&&e instanceof bi&&!e.available&&(n||(n=e),e=null,r===this.args.length))return n;if(null!==e)break}return e}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(n=>{t.push(n.serialize())}),t}}var Ts=Cs;class zs{constructor(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const n of this.bindings)t(n[1]);t(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const e=[];for(let r=1;r<t.length-1;r+=2){const i=t[r];if("string"!=typeof i)return n.error(`Expected string, but found ${typeof i} instead.`,r);if(/[^a-zA-Z0-9_]/.test(i))return n.error("Variable names must contain only alphanumeric characters or \'_\'.",r);const s=n.parse(t[r+1],r+1);if(!s)return null;e.push([i,s])}const r=n.parse(t[t.length-1],t.length-1,n.expectedType,e);return r?new zs(e,r):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[n,e]of this.bindings)t.push(n,e.serialize());return t.push(this.result.serialize()),t}}var Ds=zs;class js{constructor(t,n,e){this.type=t,this.index=n,this.input=e}static parse(t,n){if(3!==t.length)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const e=n.parse(t[1],1,Br),r=n.parse(t[2],2,ei(n.expectedType||Kr));return e&&r?new js(r.type.itemType,e,r):null}evaluate(t){const n=this.index.evaluate(t),e=this.input.evaluate(t);if(n<0)throw new Pi(`Array index out of bounds: ${n} < 0.`);if(n>=e.length)throw new Pi(`Array index out of bounds: ${n} > ${e.length-1}.`);if(n!==Math.floor(n))throw new Pi(`Array index must be an integer, but found ${n} instead.`);return e[n]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Us=js;class Ns{constructor(t,n){this.type=Xr,this.needle=t,this.haystack=n}static parse(t,n){if(3!==t.length)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const e=n.parse(t[1],1,Kr),r=n.parse(t[2],2,Kr);return e&&r?oi(e.type,[Xr,Jr,Br,Gr,Kr])?new Ns(e,r):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${ri(e.type)} instead`):null}evaluate(t){const n=this.needle.evaluate(t),e=this.haystack.evaluate(t);if(null==e)return!1;if(!ai(n,["boolean","string","number","null"]))throw new Pi(`Expected first argument to be of type boolean, string, number or null, but found ${ri(xi(n))} instead.`);if(!ai(e,["string","array"]))throw new Pi(`Expected second argument to be of type array or string, but found ${ri(xi(e))} instead.`);return e.indexOf(n)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ls=Ns;class Vs{constructor(t,n,e){this.type=Br,this.needle=t,this.haystack=n,this.fromIndex=e}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const e=n.parse(t[1],1,Kr),r=n.parse(t[2],2,Kr);if(!e||!r)return null;if(!oi(e.type,[Xr,Jr,Br,Gr,Kr]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${ri(e.type)} instead`);if(4===t.length){const i=n.parse(t[3],3,Br);return i?new Vs(e,r,i):null}return new Vs(e,r)}evaluate(t){const n=this.needle.evaluate(t),e=this.haystack.evaluate(t);if(!ai(n,["boolean","string","number","null"]))throw new Pi(`Expected first argument to be of type boolean, string, number or null, but found ${ri(xi(n))} instead.`);if(!ai(e,["string","array"]))throw new Pi(`Expected second argument to be of type array or string, but found ${ri(xi(e))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(t);return e.indexOf(n,r)}return e.indexOf(n)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Rs=Vs;class Hs{constructor(t,n,e,r,i,s){this.inputType=t,this.type=n,this.input=e,this.cases=r,this.outputs=i,this.otherwise=s}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error("Expected an even number of arguments.");let e,r;n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);const i={},s=[];for(let o=2;o<t.length-1;o+=2){let a=t[o];const u=t[o+1];Array.isArray(a)||(a=[a]);const h=n.concat(o);if(0===a.length)return h.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return h.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return h.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return h.error("Numeric branch labels must be integer values.");if(e){if(h.checkSubtype(e,xi(t)))return null}else e=xi(t);if(void 0!==i[String(t)])return h.error("Branch labels must be unique.");i[String(t)]=s.length}const l=n.parse(u,o,r);if(!l)return null;r=r||l.type,s.push(l)}const o=n.parse(t[1],1,Kr);if(!o)return null;const a=n.parse(t[t.length-1],t.length-1,r);return a?"value"!==o.type.kind&&n.concat(1).checkSubtype(e,o.type)?null:new Hs(e,r,o,i,s,a):null}evaluate(t){const n=this.input.evaluate(t);return(xi(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],n=Object.keys(this.cases).sort(),e=[],r={};for(const t of n){const n=r[this.cases[t]];void 0===n?(r[this.cases[t]]=e.length,e.push([this.cases[t],[t]])):e[n][1].push(t)}const i=t=>"number"===this.inputType.kind?Number(t):t;for(const[n,r]of e)t.push(1===r.length?i(r[0]):r.map(i)),t.push(this.outputs[n].serialize());return t.push(this.otherwise.serialize()),t}}var Ws=Hs;class qs{constructor(t,n,e){this.type=t,this.branches=n,this.otherwise=e}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error("Expected an odd number of arguments.");let e;n.expectedType&&"value"!==n.expectedType.kind&&(e=n.expectedType);const r=[];for(let i=1;i<t.length-1;i+=2){const s=n.parse(t[i],i,Xr);if(!s)return null;const o=n.parse(t[i+1],i+1,e);if(!o)return null;r.push([s,o]),e=e||o.type}const i=n.parse(t[t.length-1],t.length-1,e);return i?new qs(e,r,i):null}evaluate(t){for(const[n,e]of this.branches)if(n.evaluate(t))return e.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[n,e]of this.branches)t(n),t(e);t(this.otherwise)}outputDefined(){return this.branches.every(([t,n])=>n.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(n=>{t.push(n.serialize())}),t}}var Gs=qs;class Bs{constructor(t,n,e,r){this.type=t,this.input=n,this.beginIndex=e,this.endIndex=r}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const e=n.parse(t[1],1,Kr),r=n.parse(t[2],2,Br);if(!e||!r)return null;if(!oi(e.type,[ei(Kr),Jr,Kr]))return n.error(`Expected first argument to be of type array or string, but found ${ri(e.type)} instead`);if(4===t.length){const i=n.parse(t[3],3,Br);return i?new Bs(e.type,e,r,i):null}return new Bs(e.type,e,r)}evaluate(t){const n=this.input.evaluate(t),e=this.beginIndex.evaluate(t);if(!ai(n,["string","array"]))throw new Pi(`Expected first argument to be of type array or string, but found ${ri(xi(n))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(t);return n.slice(e,r)}return n.slice(e)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Js=Bs;function Xs(t,n){return"=="===t||"!="===t?"boolean"===n.kind||"string"===n.kind||"number"===n.kind||"null"===n.kind||"value"===n.kind:"string"===n.kind||"number"===n.kind||"value"===n.kind}function Ys(t,n,e,r){return 0===r.compare(n,e)}function Zs(t,n,e){const r="=="!==t&&"!="!==t;return class i{constructor(t,n,e){this.type=Xr,this.lhs=t,this.rhs=n,this.collator=e,this.hasUntypedArgument="value"===t.type.kind||"value"===n.type.kind}static parse(t,n){if(3!==t.length&&4!==t.length)return n.error("Expected two or three arguments.");const e=t[0];let s=n.parse(t[1],1,Kr);if(!s)return null;if(!Xs(e,s.type))return n.concat(1).error(`"${e}" comparisons are not supported for type \'${ri(s.type)}\'.`);let o=n.parse(t[2],2,Kr);if(!o)return null;if(!Xs(e,o.type))return n.concat(2).error(`"${e}" comparisons are not supported for type \'${ri(o.type)}\'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return n.error(`Cannot compare types \'${ri(s.type)}\' and \'${ri(o.type)}\'.`);r&&("value"===s.type.kind&&"value"!==o.type.kind?s=new Oi(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new Oi(s.type,[o])));let a=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return n.error("Cannot use collator to compare non-string types.");if(a=n.parse(t[3],3,Qr),!a)return null}return new i(s,o,a)}evaluate(i){const s=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){const n=xi(s),e=xi(o);if(n.kind!==e.kind||"string"!==n.kind&&"number"!==n.kind)throw new Pi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${n.kind}, ${e.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const t=xi(s),e=xi(o);if("string"!==t.kind||"string"!==e.kind)return n(i,s,o)}return this.collator?e(i,s,o,this.collator.evaluate(i)):n(i,s,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const n=[t];return this.eachChild(t=>{n.push(t.serialize())}),n}}}const Ks=Zs("==",(function(t,n,e){return n===e}),Ys),Qs=Zs("!=",(function(t,n,e){return n!==e}),(function(t,n,e,r){return!Ys(0,n,e,r)})),to=Zs("<",(function(t,n,e){return n<e}),(function(t,n,e,r){return r.compare(n,e)<0})),no=Zs(">",(function(t,n,e){return n>e}),(function(t,n,e,r){return r.compare(n,e)>0})),eo=Zs("<=",(function(t,n,e){return n<=e}),(function(t,n,e,r){return r.compare(n,e)<=0})),ro=Zs(">=",(function(t,n,e){return n>=e}),(function(t,n,e,r){return r.compare(n,e)>=0}));class io{constructor(t,n,e,r,i,s){this.type=Jr,this.number=t,this.locale=n,this.currency=e,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=s}static parse(t,n){if(3!==t.length)return n.error("Expected two arguments.");const e=n.parse(t[1],1,Br);if(!e)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return n.error("NumberFormat options argument must be an object.");let i=null;if(r.locale&&(i=n.parse(r.locale,1,Jr),!i))return null;let s=null;if(r.currency&&(s=n.parse(r.currency,1,Jr),!s))return null;let o=null;if(r.unit&&(o=n.parse(r.unit,1,Jr),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=n.parse(r["min-fraction-digits"],1,Br),!a))return null;let u=null;return r["max-fraction-digits"]&&(u=n.parse(r["max-fraction-digits"],1,Br),!u)?null:new io(e,i,s,o,a,u)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.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]}}class so{constructor(t){this.type=Br,this.input=t}static parse(t,n){if(2!==t.length)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);const e=n.parse(t[1],1);return e?"array"!==e.type.kind&&"string"!==e.type.kind&&"value"!==e.type.kind?n.error(`Expected argument of type string or array, but found ${ri(e.type)} instead.`):new so(e):null}evaluate(t){const n=this.input.evaluate(t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new Pi(`Expected value to be of type string or array, but found ${ri(xi(n))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(n=>{t.push(n.serialize())}),t}}const oo={"==":Ks,"!=":Qs,">":no,"<":to,">=":ro,"<=":eo,array:Oi,at:Us,boolean:Oi,case:Gs,coalesce:Ts,collator:Ni,format:Ei,image:Ii,in:Ls,"index-of":Rs,interpolate:$s,"interpolate-hcl":$s,"interpolate-lab":$s,length:so,let:Ds,literal:ki,match:Ws,number:Oi,"number-format":io,object:Oi,slice:Js,step:fs,string:Oi,"to-boolean":Ti,"to-color":Ti,"to-number":Ti,"to-string":Ti,var:as,within:es};function ao(t,[n,e,r,i]){n=n.evaluate(t),e=e.evaluate(t),r=r.evaluate(t);const s=i?i.evaluate(t):1,o=wi(n,e,r,s);if(o)throw new Pi(o);return new yi(n/255*s,e/255*s,r/255*s,s)}function uo(t,n){return t in n}function ho(t,n){const e=n[t];return void 0===e?null:e}function lo(t){return{type:t}}Ui.register(oo,{error:[{kind:"error"},[Jr],(t,[n])=>{throw new Pi(n.evaluate(t))}],typeof:[Jr,[Kr],(t,[n])=>ri(xi(n.evaluate(t)))],"to-rgba":[ei(Br,4),[Yr],(t,[n])=>n.evaluate(t).toArray()],rgb:[Yr,[Br,Br,Br],ao],rgba:[Yr,[Br,Br,Br,Br],ao],has:{type:Xr,overloads:[[[Jr],(t,[n])=>uo(n.evaluate(t),t.properties())],[[Jr,Zr],(t,[n,e])=>uo(n.evaluate(t),e.evaluate(t))]]},get:{type:Kr,overloads:[[[Jr],(t,[n])=>ho(n.evaluate(t),t.properties())],[[Jr,Zr],(t,[n,e])=>ho(n.evaluate(t),e.evaluate(t))]]},"feature-state":[Kr,[Jr],(t,[n])=>ho(n.evaluate(t),t.featureState||{})],properties:[Zr,[],t=>t.properties()],"geometry-type":[Jr,[],t=>t.geometryType()],id:[Kr,[],t=>t.id()],zoom:[Br,[],t=>t.globals.zoom],pitch:[Br,[],t=>t.globals.pitch||0],"distance-from-center":[Br,[],t=>t.distanceFromCenter()],"heatmap-density":[Br,[],t=>t.globals.heatmapDensity||0],"line-progress":[Br,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Br,[],t=>t.globals.skyRadialProgress||0],accumulated:[Kr,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Br,lo(Br),(t,n)=>{let e=0;for(const r of n)e+=r.evaluate(t);return e}],"*":[Br,lo(Br),(t,n)=>{let e=1;for(const r of n)e*=r.evaluate(t);return e}],"-":{type:Br,overloads:[[[Br,Br],(t,[n,e])=>n.evaluate(t)-e.evaluate(t)],[[Br],(t,[n])=>-n.evaluate(t)]]},"/":[Br,[Br,Br],(t,[n,e])=>n.evaluate(t)/e.evaluate(t)],"%":[Br,[Br,Br],(t,[n,e])=>n.evaluate(t)%e.evaluate(t)],ln2:[Br,[],()=>Math.LN2],pi:[Br,[],()=>Math.PI],e:[Br,[],()=>Math.E],"^":[Br,[Br,Br],(t,[n,e])=>Math.pow(n.evaluate(t),e.evaluate(t))],sqrt:[Br,[Br],(t,[n])=>Math.sqrt(n.evaluate(t))],log10:[Br,[Br],(t,[n])=>Math.log(n.evaluate(t))/Math.LN10],ln:[Br,[Br],(t,[n])=>Math.log(n.evaluate(t))],log2:[Br,[Br],(t,[n])=>Math.log(n.evaluate(t))/Math.LN2],sin:[Br,[Br],(t,[n])=>Math.sin(n.evaluate(t))],cos:[Br,[Br],(t,[n])=>Math.cos(n.evaluate(t))],tan:[Br,[Br],(t,[n])=>Math.tan(n.evaluate(t))],asin:[Br,[Br],(t,[n])=>Math.asin(n.evaluate(t))],acos:[Br,[Br],(t,[n])=>Math.acos(n.evaluate(t))],atan:[Br,[Br],(t,[n])=>Math.atan(n.evaluate(t))],min:[Br,lo(Br),(t,n)=>Math.min(...n.map(n=>n.evaluate(t)))],max:[Br,lo(Br),(t,n)=>Math.max(...n.map(n=>n.evaluate(t)))],abs:[Br,[Br],(t,[n])=>Math.abs(n.evaluate(t))],round:[Br,[Br],(t,[n])=>{const e=n.evaluate(t);return e<0?-Math.round(-e):Math.round(e)}],floor:[Br,[Br],(t,[n])=>Math.floor(n.evaluate(t))],ceil:[Br,[Br],(t,[n])=>Math.ceil(n.evaluate(t))],"filter-==":[Xr,[Jr,Kr],(t,[n,e])=>t.properties()[n.value]===e.value],"filter-id-==":[Xr,[Kr],(t,[n])=>t.id()===n.value],"filter-type-==":[Xr,[Jr],(t,[n])=>t.geometryType()===n.value],"filter-<":[Xr,[Jr,Kr],(t,[n,e])=>{const r=t.properties()[n.value],i=e.value;return typeof r==typeof i&&r<i}],"filter-id-<":[Xr,[Kr],(t,[n])=>{const e=t.id(),r=n.value;return typeof e==typeof r&&e<r}],"filter->":[Xr,[Jr,Kr],(t,[n,e])=>{const r=t.properties()[n.value],i=e.value;return typeof r==typeof i&&r>i}],"filter-id->":[Xr,[Kr],(t,[n])=>{const e=t.id(),r=n.value;return typeof e==typeof r&&e>r}],"filter-<=":[Xr,[Jr,Kr],(t,[n,e])=>{const r=t.properties()[n.value],i=e.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[Xr,[Kr],(t,[n])=>{const e=t.id(),r=n.value;return typeof e==typeof r&&e<=r}],"filter->=":[Xr,[Jr,Kr],(t,[n,e])=>{const r=t.properties()[n.value],i=e.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[Xr,[Kr],(t,[n])=>{const e=t.id(),r=n.value;return typeof e==typeof r&&e>=r}],"filter-has":[Xr,[Kr],(t,[n])=>n.value in t.properties()],"filter-has-id":[Xr,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Xr,[ei(Jr)],(t,[n])=>n.value.indexOf(t.geometryType())>=0],"filter-id-in":[Xr,[ei(Kr)],(t,[n])=>n.value.indexOf(t.id())>=0],"filter-in-small":[Xr,[Jr,ei(Kr)],(t,[n,e])=>e.value.indexOf(t.properties()[n.value])>=0],"filter-in-large":[Xr,[Jr,ei(Kr)],(t,[n,e])=>function(t,n,e,r){for(;e<=r;){const i=e+r>>1;if(n[i]===t)return!0;n[i]>t?r=i-1:e=i+1}return!1}(t.properties()[n.value],e.value,0,e.value.length-1)],all:{type:Xr,overloads:[[[Xr,Xr],(t,[n,e])=>n.evaluate(t)&&e.evaluate(t)],[lo(Xr),(t,n)=>{for(const e of n)if(!e.evaluate(t))return!1;return!0}]]},any:{type:Xr,overloads:[[[Xr,Xr],(t,[n,e])=>n.evaluate(t)||e.evaluate(t)],[lo(Xr),(t,n)=>{for(const e of n)if(e.evaluate(t))return!0;return!1}]]},"!":[Xr,[Xr],(t,[n])=>!n.evaluate(t)],"is-supported-script":[Xr,[Jr],(t,[n])=>{const e=t.globals&&t.globals.isSupportedScript;return!e||e(n.evaluate(t))}],upcase:[Jr,[Jr],(t,[n])=>n.evaluate(t).toUpperCase()],downcase:[Jr,[Jr],(t,[n])=>n.evaluate(t).toLowerCase()],concat:[Jr,lo(Kr),(t,n)=>n.map(n=>Fi(n.evaluate(t))).join("")],"resolved-locale":[Jr,[Qr],(t,[n])=>n.evaluate(t).resolvedLocale()]});var co=oo;function fo(t){return{result:"success",value:t}}function po(t){return{result:"error",value:t}}function yo(t){return!!t.expression&&t.expression.interpolated}function mo(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function go(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function vo(t){return t}function bo(t,n,e){return void 0!==t?t:void 0!==n?n:void 0!==e?e:void 0}function wo(t,n,e,r,i){return bo(typeof e===i?r[e]:void 0,t.default,n.default)}function Mo(t,n,e){if("number"!==mo(e))return bo(t.default,n.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(e<=t.stops[0][0])return t.stops[0][1];if(e>=t.stops[r-1][0])return t.stops[r-1][1];const i=ls(t.stops.map(t=>t[0]),e);return t.stops[i][1]}function xo(t,n,e){const r=void 0!==t.base?t.base:1;if("number"!==mo(e))return bo(t.default,n.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(e<=t.stops[0][0])return t.stops[0][1];if(e>=t.stops[i-1][0])return t.stops[i-1][1];const s=ls(t.stops.map(t=>t[0]),e),o=function(t,n,e,r){const i=r-e,s=t-e;return 0===i?0:1===n?s/i:(Math.pow(n,s)-1)/(Math.pow(n,i)-1)}(e,r,t.stops[s][0],t.stops[s+1][0]),a=t.stops[s][1],u=t.stops[s+1][1];let h=ms[n.type]||vo;if(t.colorSpace&&"rgb"!==t.colorSpace){const n=Os[t.colorSpace];h=(t,e)=>n.reverse(n.interpolate(n.forward(t),n.forward(e),o))}return"function"==typeof a.evaluate?{evaluate(...t){const n=a.evaluate.apply(void 0,t),e=u.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==e)return h(n,e,o)}}:h(a,u,o)}function Fo(t,n,e){return"color"===n.type?e=yi.parse(e):"formatted"===n.type?e=vi.fromString(e.toString()):"resolvedImage"===n.type?e=bi.fromString(e.toString()):mo(e)===n.type||"enum"===n.type&&n.values[e]||(e=void 0),bo(e,t.default,n.default)}class Ao{constructor(t,n){this.expression=t,this.H={},this.W=new Di,this.q=n?function(t){return"color"===t.type&&(go(t.default)||Array.isArray(t.default))?new yi(0,0,0,0):"color"===t.type?yi.parse(t.default)||null:void 0===t.default?null:t.default}(n):null,this.G=n&&"enum"===n.type?n.values:null}evaluateWithoutErrorHandling(t,n,e,r,i,s,o,a){return this.W.globals=t,this.W.feature=n,this.W.featureState=e,this.W.canonical=r||null,this.W.availableImages=i||null,this.W.formattedSection=s,this.W.featureTileCoord=o||null,this.W.featureDistanceData=a||null,this.expression.evaluate(this.W)}evaluate(t,n,e,r,i,s,o,a){this.W.globals=t,this.W.feature=n||null,this.W.featureState=e||null,this.W.canonical=r||null,this.W.availableImages=i||null,this.W.formattedSection=s||null,this.W.featureTileCoord=o||null,this.W.featureDistanceData=a||null;try{const t=this.expression.evaluate(this.W);if(null==t||"number"==typeof t&&t!=t)return this.q;if(this.G&&!(t in this.G))throw new Pi(`Expected value to be one of ${Object.keys(this.G).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this.H[t.message]||(this.H[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this.q}}}function ko(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in co}function Po(t,n){const e=new hs(co,[],n?function(t){const n={color:Yr,string:Jr,number:Br,enum:Jr,boolean:Xr,formatted:ti,resolvedImage:ni};return"array"===t.type?ei(n[t.value]||Kr,t.length):n[t.type]}(n):void 0),r=e.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return r?fo(new Ao(r,n)):po(e.errors)}class So{constructor(t,n){this.kind=t,this.B=n,this.isStateDependent="constant"!==t&&!is(n.expression)}evaluateWithoutErrorHandling(t,n,e,r,i,s){return this.B.evaluateWithoutErrorHandling(t,n,e,r,i,s)}evaluate(t,n,e,r,i,s){return this.B.evaluate(t,n,e,r,i,s)}}class _o{constructor(t,n,e,r){this.kind=t,this.zoomStops=e,this.B=n,this.isStateDependent="camera"!==t&&!is(n.expression),this.interpolationType=r}evaluateWithoutErrorHandling(t,n,e,r,i,s){return this.B.evaluateWithoutErrorHandling(t,n,e,r,i,s)}evaluate(t,n,e,r,i,s){return this.B.evaluate(t,n,e,r,i,s)}interpolationFactor(t,n,e){return this.interpolationType?$s.interpolationFactor(this.interpolationType,t,n,e):0}}function Oo(t,n){if("error"===(t=Po(t,n)).result)return t;const e=t.value.expression,r=rs(e);if(!r&&!function(t){return"data-driven"===t["property-type"]}(n))return po([new Hr("","data expressions not supported")]);const i=ss(e,["zoom","pitch","distance-from-center"]);if(!i&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(n))return po([new Hr("","zoom expressions not supported")]);const s=function t(n){let e=null;if(n instanceof Ds)e=t(n.result);else if(n instanceof Ts){for(const r of n.args)if(e=t(r),e)break}else(n instanceof fs||n instanceof $s)&&n.input instanceof Ui&&"zoom"===n.input.name&&(e=n);return e instanceof Hr||n.eachChild(n=>{const r=t(n);r instanceof Hr?e=r:!e&&r?e=new Hr("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):e&&r&&e!==r&&(e=new Hr("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),e}(e);if(!s&&!i)return po([new Hr("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(s instanceof Hr)return po([s]);if(s instanceof $s&&!yo(n))return po([new Hr("",\'"interpolate" expressions cannot be used with this property\')]);if(!s)return fo(new So(r?"constant":"source",t.value));const o=s instanceof $s?s.interpolation:void 0;return fo(new _o(r?"camera":"composite",t.value,s.labels,o))}class Eo{constructor(t,n){this.J=t,this.X=n,Vr(this,function t(n,e){const r="color"===e.type,i=n.stops&&"object"==typeof n.stops[0][0],s=i||!(i||void 0!==n.property),o=n.type||(yo(e)?"exponential":"interval");if(r&&((n=Vr({},n)).stops&&(n.stops=n.stops.map(t=>[t[0],yi.parse(t[1])])),n.default=yi.parse(n.default?n.default:e.default)),n.colorSpace&&"rgb"!==n.colorSpace&&!Os[n.colorSpace])throw new Error("Unknown color space: "+n.colorSpace);let a,u,h;if("exponential"===o)a=xo;else if("interval"===o)a=Mo;else if("categorical"===o){a=wo,u=Object.create(null);for(const t of n.stops)u[t[0]]=t[1];h=typeof n.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=Fo}if(i){const r={},i=[];for(let t=0;t<n.stops.length;t++){const e=n.stops[t],s=e[0].zoom;void 0===r[s]&&(r[s]={zoom:s,type:n.type,property:n.property,default:n.default,stops:[]},i.push(s)),r[s].stops.push([e[0].value,e[1]])}const s=[];for(const n of i)s.push([r[n].zoom,t(r[n],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:$s.interpolationFactor.bind(void 0,o),zoomStops:s.map(t=>t[0]),evaluate:({zoom:t},r)=>xo({stops:s,base:n.base},e,t).evaluate(t,r)}}if(s){const t="exponential"===o?{name:"exponential",base:void 0!==n.base?n.base:1}:null;return{kind:"camera",interpolationType:t,interpolationFactor:$s.interpolationFactor.bind(void 0,t),zoomStops:n.stops.map(t=>t[0]),evaluate:({zoom:t})=>a(n,e,t,u,h)}}return{kind:"source",evaluate(t,r){const i=r&&r.properties?r.properties[n.property]:void 0;return void 0===i?bo(n.default,e.default):a(n,e,i,u,h)}}}(this.J,this.X))}static deserialize(t){return new Eo(t.J,t.X)}static serialize(t){return{J:t.J,X:t.X}}}function Io(t){if(Array.isArray(t))return t.map(Io);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const n={};for(const e in t)n[e]=Io(t[e]);return n}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function $o(t){if(!Array.isArray(t))return!1;if(function(t){return"pitch"===t||"distance-from-center"===t}(t[0]))return!0;for(let n=1;n<t.length;n++)if($o(t[n]))return!0;return!1}const Co=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]),To={StyleExpression:Ao,isExpression:ko,isExpressionFilter:function t(n){if(!0===n||!1===n)return!0;if(!Array.isArray(n)||0===n.length)return!1;switch(n[0]){case"has":return n.length>=2&&"$id"!==n[1]&&"$type"!==n[1];case"in":return n.length>=3&&("string"!=typeof n[1]||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==n.length||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!t(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}},createExpression:Po,createPropertyExpression:Oo,normalizePropertyExpression:function(t,n){if(go(t))return new Eo(t,n);if(ko(t)){const e=Oo(t,n);if("error"===e.result)throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));return e.value}{let e=t;return"string"==typeof t&&"color"===n.type&&(e=yi.parse(t)),{kind:"constant",evaluate:()=>e}}},ZoomConstantExpression:So,ZoomDependentExpression:_o,StylePropertyFunction:Eo},{isExpression:zo,createExpression:Do}=To,jo={};function Uo(t){if(!0===t)return function(){return!0};if(t&&t.condition){if("any"===t.type){const n=t.condition,e=[];for(let t=0;t<n.length;t++)e.push(Uo(n[t]));return(t,n)=>{for(let r=0;r<e.length;r++)if(e[r](t,n))return!0;return!1}}const n=Uo(t.condition);if(hr(t.layer))return n;const e=n=>n.layer===t.layer;return(t,r)=>e(t)&&n(t,r)}if(function t(n){if(!0===n||!1===n)return!0;if(!Array.isArray(n)||0===n.length)return!1;switch(n[0]){case"has":case"!has":return 2===n.length&&("string"==typeof n[1]||n[1].property&&n[1].op);case"in":case"!in":return n.length>=2&&("string"==typeof n[1]||n[1].property&&n[1].op);case"==":case"!=":case">":case">=":case"<":case"<=":return 3===n.length&&("string"==typeof n[1]||n[1].property&&n[1].op);case"none":case"any":case"all":for(const e of n.slice(1))if(!t(e)&&"boolean"!=typeof e)return!1;return!0;case"contains":return!0;default:return!1}}(t))return zn(t);{let n=function(t,n="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};const e=t;let r=!0;try{r=function(t){if(!$o(t))return t;let n=Io(t);return function t(n){let e=!1;const r=[];if("case"===n[0]){for(let t=1;t<n.length-1;t+=2)e=e||$o(n[t]),r.push(n[t+1]);r.push(n[n.length-1])}else if("match"===n[0]){e=e||$o(n[1]);for(let t=2;t<n.length-1;t+=2)r.push(n[t+1]);r.push(n[n.length-1])}else if("step"===n[0]){e=e||$o(n[1]);for(let t=1;t<n.length-1;t+=2)r.push(n[t+1])}e&&(n.length=0,n.push("any",...r));for(let e=1;e<n.length;e++)t(n[e])}(n),n=function t(n){if(!Array.isArray(n))return n;const e=function(t){if(Co.has(t[0]))for(let n=1;n<t.length;n++)if($o(t[n]))return!0;return t}(n);return!0===e?e:e.map(n=>t(n))}(n),n}(e)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\\nand paste the contents of this message in the report.\\nThank you!\\nFilter Expression:\\n${JSON.stringify(e,null,2)}\\n `)}const i=Po(r,null);let s=null;if("error"===i.result)throw new Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));s=(t,n,e)=>i.value.evaluate(t,n,{},e);let o=null,a=null;if(r!==e){const t=Po(e,null);if("error"===t.result)throw new Error(t.value.map(t=>`${t.key}: ${t.message}`).join(", "));o=(n,e,r,i,s)=>t.value.evaluate(n,e,{},r,void 0,void 0,i,s),a=!rs(t.value.expression)}return s=s,{filter:s,dynamicFilter:o||void 0,needGeometry:function t(n){if(!Array.isArray(n))return!1;if("within"===n[0])return!0;for(let e=1;e<n.length;e++)if(t(n[e]))return!0;return!1}(r),needFeature:!!a}}(t);return n=n&&n.filter,(t,e)=>(jo.zoom=e,n&&n(jo,t))}}const No={type:"number","property-type":"data-driven",expression:{parameters:["zoom","feature"]}};function Lo(t,n){No.type=n||"number";const e=Do(t,No);if("success"!==e.result)throw new Error(`Invalid maplibre spec expression: ${JSON.stringify(t)} (${e.value})`);return e.value}function Vo(t){return zo(t)}const Ro={lineWidth:1,lineStrokeWidth:1,lineDx:1,lineDy:1,lineOpacity:1,linePatternAnimSpeed:1,markerWidth:1,markerHeight:1,markerDx:1,markerDy:1,markerSpacing:1,markerOpacity:1,markerRotation:1,textWrapWidth:1,textSpacing:1,textSize:1,textHaloRadius:1,textHaloOpacity:1,textDx:1,textDy:1,textOpacity:1,textRotation:1,polygonOpacity:1};function Ho(t){return Ro[t]}const Wo={markerPlacement:1,markerFile:1,mergeOnProperty:1,markerTextFit:1,markerType:1,markerHorizontalAlignment:1,markerVerticalAlignment:1,markerRotationAlignment:1,markerPitchAlignment:1,markerFillPatternFile:1,markerLinePatternFile:1,textName:1,textPlacement:1,textFaceName:1,textStyle:1,textHorizontalAlignment:1,textVerticalAlignment:1,textRotationAlignment:1,textPitchAlignment:1,lineJoin:1,lineCap:1,linePatternFile:1,polygonPatternFile:1},qo={lineDasharray:1,markerLineDasharray:1,uvScale:1,uvOffset:1};function Go(t){return Wo[t]?"string":Ho(t)?"number":qo[t]?"array":"color"}var Bo=Object.freeze({__proto__:null,compileStyle:function(t=[]){return function t(n){if(!Array.isArray(n))return t([n]);const e=[];for(let t=0;t<n.length;t++){let r;r=!0===n[t].filter?function(){return!0}:Uo(n[t].filter),e.push(ur({},n[t],{filter:r}))}return e}(t=t.map(t=>{const n=ur({},t);return n.filter&&n.filter.value&&(n.filter=n.filter.value),n}))},compileFilter:Uo,createExpression:Lo,isExpression:Vo,isInterpolated:Ho,getExpressionType:Go});const Jo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;class Xo extends Array{push(...t){const n=t.length;for(let e=0;e<n;e++)this[this.Y++]=t[e]}fill(t,n,e){super.fill(t,n,e),e>this.Y&&(this.Y=e)}set(t,n){t>=this.Y&&(this.Y=t+1),this[t]=n}getLength(){return this.Y}setLength(t){this.Y=t,super.length<t&&(super.length=t)}trySetLength(t){t>this.Y&&this.setLength(t)}reset(){this.Y=0}}const Yo={get:function(t,n){return"length"===n?t.getLength():t[n]}};class Zo extends Array{setLength(t){super.length=t}trySetLength(t){super.length=t}}let Ko;class Qo{static createTypedArray(t,n){return or(t,n)}static getInstance(){return Ko}constructor(){this.Z=[],this.Y=0}get(){if(!Jo)return new Zo;const t=this.Z[this.Y]=this.Z[this.Y]||new Proxy(new Xo,Yo);return t.reset(),this.Y++,t}reset(){this.Y=0}}Ko=new Qo;const ta=[],na={},ea={},ra={},ia=[],sa=Qo.getInstance();class oa{static isAtlasLoaded(t,n={}){const{iconAtlas:e}=n;return!!(!t||e&&e.positions[t])}static genFnTypes(t){const n={};for(const e in t)if(Vo(t[e])){const r=(e+"_Fn_0").trim(),i=(e+"Fn").trim(),s=Go(e);n[r]=Lo(t[e],s),n[i]=(t,e)=>{let i;na.zoom=t,ea.properties=e;try{i=n[r].evaluateWithoutErrorHandling(na,ea,ra,null,ia)}catch(t){return null}return i}}else if(gr(t[e])){const r=(e+"_Fn_0").trim(),i=(e+"Fn").trim();Ho(e)?(n[r]=p(t[e]),n[i]=(t,e)=>{const i=n[r](t,e);return gr(i)?p(i)(t,e):i}):(n[r]=y(t[e]),n[i]=(t,e)=>{const i=n[r](t,e);return gr(i)?y(i)(t,e):i})}return n}constructor(t,n,e){this.options=e;const r=[];this.symbolDef=n,this.symbol=m(n,()=>(r[0]=e.zoom,r)),this.styledVectors=[],this.properties={},this.K=e.fnTypes||oa.genFnTypes(this.symbolDef),gr(this.symbolDef.visible)&&(this.tt=p(this.symbolDef.visible)),e.atlas&&(this.iconAtlas=e.atlas.iconAtlas,this.glyphAtlas=e.atlas.glyphAtlas),this.features=this.nt(t)}needAltitudeAttribute(){return this.options.forceAltitudeAttribute||this.maxPosZ>=Math.pow(2,17)||this.options.positionType===Float32Array}getPositionFormat(){return this.needAltitudeAttribute()?[{type:Int16Array,width:2,name:"aPosition"},{type:Float32Array,width:1,name:"aAltitude"}]:[{type:Int16Array,width:3,name:"aPosition"}]}fillPosition(t,n,e,r){n<this.et&&(this.et=n),n>this.rt&&(this.rt=n),e<this.it&&(this.it=e),e>this.st&&(this.st=e),this.needAltitudeAttribute()?(t.aPosition.push(n,e),t.aAltitude.push(r)):(Tr(ta,n,e,r),t.aPosition.push(ta[0],ta[1],ta[2]))}nt(t){if(!t.length)return t;const n="__fea_idx".trim();let e,r=0,i=t[r];for(;!i.geometry;)r++,i=t[r];if(Array.isArray(i.geometry)&&i.properties){let n=i.geometry[0];for(;Array.isArray(n);)n=n[0];n instanceof Ut&&(e=t)}if(!e)if(e=[],Array.isArray(i.geometry))for(let n=0;n<t.length;n++){const r=ur({},t[n]);e.push(ar(r))}else for(let r=0;r<t.length;r++){const i=t[r],s=Ve(i);for(let t=0;t<s.length;t++){const r=s[t];r[n]=i[n],e.push(r)}}if(this.maxPosZ=0,!this.options.forceAltitudeAttribute){const t="line"===this.symbolDef.textPlacement;let n=0,r=!1;const{textPitchAlignmentFn:i}=this.K;!i&&t&&"map"===this.symbolDef.textPitchAlignment&&(r=!0);for(let s=0;s<e.length;s++){const o=ua(e[s]&&e[s].geometry);if(o>n&&(n=o),t&&!r&&i&&e[s].properties){const t=i(null,e[s].properties);"map"===t&&(r=t)}}this.hasMapPitchAlign=r,this.maxPosZ=n}const s=this.options.order;if(s){const t=[];for(let n=0;n<s.length;n++)s[n]&&t.push(Uo(s[n]));e=e.sort((n,e)=>{const r=t.length;let i=-1,s=-1;for(let o=0;o<r&&(t[o](n)&&(i=o),t[o](e)&&(s=o),!(i>=0&&i<r&&s>=0&&s<r));o++);return i-s})}return e}load(t=1){const n="__fea_idx".trim(),e="_debug_info".trim(),r=this.K,i=this.styledVectors;this.count=0;const s=this.features;if(!s||!s.length)return Promise.resolve(null);const o={},a={},u={zoom:this.options.zoom,isVector3D:!!this.options.center},h=[],l=m(this.symbolDef,()=>(h[0]=u.zoom,h));let c=0,f=s.length;const d=this.options.debugIndex;try{for(;c<f;c++){const t=s[c];if(!t||!t.geometry)continue;if(lr(d)&&t[e].index!==d)continue;t.properties||(t.properties={}),t.properties.$layer=t.layer,t.properties.$type=t.type;const h=this.createStyledVector(t,l,r,u,o,a);h&&h.feature.geometry&&(h.featureIdx=void 0===t[n]?c:t[n],this.count++,i.push(h))}}catch(t){return Promise.reject(t)}return this.options.atlas?Promise.resolve(this.pack(t)):this.loadAtlas(o,a).then(()=>this.pack(t))}loadAtlas(t,n){return new Promise((e,r)=>{this.fetchAtlas(t,n,(t,n)=>{if(t)r(t);else{if(n){const{icons:t,glyphs:e}=n;if(t&&Object.keys(t).length){for(const n in t){const e=t[n],{width:r,height:i,data:s}=e.data;e.data=new Ze({width:r,height:i},s)}this.iconAtlas=new Qe(t)}if(e&&Object.keys(e).length){for(const t in e){const n=e[t];for(const t in n){const e=n[t],{width:r,height:i,data:s}=e.bitmap;e.bitmap=new Ye({width:r,height:i},s)}}this.glyphAtlas=new er(e)}}e({glyphAtlas:this.glyphAtlas,iconAtlas:this.iconAtlas})}})})}fetchAtlas(t,n,e){Object.keys(t).length>0||Object.keys(n).length>0?this.options.requestor(t,n,e):e()}pack(t){if(!this.count)return null;if(null==t)throw new Error("layout scale is undefined");const n=this.createDataPack(this.styledVectors,t);if(!n)return null;n.properties=this.properties,this.empty&&(n.empty=!0);const e=n.buffers;delete n.buffers;const r={data:n,buffers:e};if(this.iconAtlas){const t=r.data.iconAtlas=aa(this.iconAtlas);if(t.glyphMap)for(const n in t.glyphMap)e.push(t.glyphMap[n].data.data.buffer);e.push(r.data.iconAtlas.image.data.buffer)}return this.glyphAtlas&&(r.data.glyphAtlas=aa(this.glyphAtlas),e.push(r.data.glyphAtlas.image.data.buffer)),r}createStyledVector(t,n,e,r){return new Cr(t,n,e,r)}createDataPack(t,n){if(!t||!t.length)return null;this.maxIndex=0,this.maxPos=0,this.et=this.it=1/0,this.rt=this.st=-1/0,this.maxAltitude=0,this.dynamicAttrs={};const e=this.data={};this.ot=sa,sa.reset();let r=this.elements=sa.get();const i=this.getFormat(Array.isArray(t[0])?t[0][0].symbol:t[0].symbol),s=this.needAltitudeAttribute()?2:3;for(let t=0;t<i.length;t++)e[i[t].name]=sa.get();let o=sa.get(),a=0;const u=sa.get();let h=0,l=!1,c=!0;const f=new Set;for(let r=0,i=t.length;r<i;r++){if(!t[r].feature.geometry)continue;const i=Array.isArray(t[r])?t[r][0].feature.id:t[r].feature.id;c&&(void 0!==ea.id?f&&(f.has(ea.id)?c=!1:f.add(ea.id)):c=!1),lr(i)&&(Math.abs(i)>h&&(h=Math.abs(i)),i<0&&(l=!0));const d=this.data.aPosition.length;if(Array.isArray(t[r]))for(let e=0;e<t[r].length;e++)this.ut(t[r][e],n);else this.ut(t[r],n);const p=(e.aPosition.length-d)/s;for(let n=0;n<p;n++)o.push(t[r].featureIdx),lr(i)&&u.push(i);a=Math.max(a,t[r].featureIdx)}if(this.countOutOfAngle>0&&console.warn("text anchor along line is ignored as anchor\'s line angle is bigger than textMaxAngle."),this.hasElements()&&!r.length)return null;const d=this.options.center?Float32Array:sr(a);o=Qo.createTypedArray(o,d),i[0].type=this.options.positionType?this.options.positionType:ir(this.maxPos);const p=this.options.center;if(p&&(p[0]||p[1])){const t=e.aPosition;for(let n=0;n<t.length;n+=s)t[n]-=p[0],t[n+1]-=p[1]}const y=function(t,n){const e={};for(let r=0;r<t.length;r++){const i=t[r],s=i.type,o=i.name;e[o]=s===Array?n[o]:or(n[o],s)}return e}(i,e);y.aPickingId=o;const m=[];for(const t in y)m.push(y[t].buffer);const g=rr(this.maxIndex);r=Qo.createTypedArray(r,g),m.push(r.buffer);const v={data:y,isIdUnique:c,is2D:0===this.maxPosZ,indices:this.hasElements()?r:null,positionSize:s,positionBounding:[this.et,this.it,this.rt,this.st],buffers:m,symbolIndex:this.symbolDef.index||{index:0},dynamicAttributes:this.dynamicAttrs};if(this.ht&&(v.markerPlacement=this.ht),this.lt&&(v.textPlacement=this.lt),u.length){const t=l?ir(h):sr(h);v.featureIds=Qo.createTypedArray(u,t),m.push(v.featureIds.buffer)}else v.featureIds=[];return v.pickingIdIndiceMap=$r(o,v.indices),v}ut(t,n){this.tt&&!this.tt(this.options.zoom,t.feature.properties)||this.placeVector(t,n,this.formatWidth)}addElements(...t){this.maxIndex=Math.max(this.maxIndex,...t),this.elements.push(...t)}hasElements(){return!0}getAltitude(t){const{altitudeProperty:n,defaultAltitude:e,altitudeScale:r}=this.options;let i=Sr(t,n,e);return r&&(i*=r),this.maxAltitude=Math.max(this.maxAltitude,Math.abs(i)),i}getIconAtlasMaxValue(){const t=this.iconAtlas.positions;let n=0;for(const e in t)if(yr(t,e)){const{tl:r,displaySize:i}=t[e],s=Math.max(r[0],r[1],i[0]-1,i[1]-1);s>n&&(n=s)}return n}}function aa(t){let n=t.positions,e=t.image&&t.image.format||"alpha";if(t instanceof Qe){n={};for(const e in t.positions){const r=t.positions[e];n[e]={paddedRect:r.paddedRect,pixelRatio:r.pixelRatio,tl:r.tl,br:r.br,displaySize:r.displaySize}}e="rgba"}const r=t.image;return{image:{width:r.width,height:r.height,data:r.data,format:e},glyphMap:t.glyphMap,positions:n}}function ua(t){if(!t)return 0;let n=0;if(Array.isArray(t))for(let e=0;e<t.length;e++)if(Array.isArray(t[e])){const r=ua(t[e]);r>n&&(n=r)}else{const r=Math.abs(t[e].z||0);r>n&&(n=r)}else{const e=Math.abs(t.z||0);e>n&&(n=e)}return n}function ha(t,n,e,r){const i="__fn_textSize".trim();let s=t.textSize;if(hr(n.textSize))return[16,16];t[i]&&(s=t[i]);const o=[];if(o[0]=dr(s)?s(r,e):s,d(o[0])){const n=o[0].ct=o[0].ct||JSON.stringify(o[0]);t.ft||(t.ft={}),t.ft[n]||(t.ft[n]=p(o[0])),o[0]=(0,t.ft[n])(r,e)}return o[1]=o[0],o}function la(t){const n=t.stops;let e=-1/0;for(let t=0;t<n.length;t++){let r=n[t][1];cr(n[t][1])&&(r=la(n[t][1])),r>e&&(e=r)}return e}function ca(t,n,e){return[n||"normal",e||"normal","24px",t||"Open Sans Regular"].join(" ")}const fa=/\\{[\\w-]+(?:\\|[\\w-]+)*\\}/g;function da(t,n){return fr(t)?t.replace(fa,(function(t){if(!n)return"";if((t=t.substring(1,t.length-1)).indexOf("|")>0){const e=t.split("|");for(let t=0;t<e.length;t++){const r=n[e[t]];if(!hr(r))return r}return""}const e=n[t];return hr(e)?"":Array.isArray(e)?e.join():e})):t}var pa=Object.freeze({__proto__:null,getSDFFont:ca,resolveText:da,resolveVarNames:function(t){return t.match(fa)},resolveExpVarNames:function t(n,e){if(2!==e.length||"get"!==e[0])for(let r=0;r<e.length;r++)2===e[r].length&&"get"===e[r][0]?n.push(e[r][1]):Array.isArray(e[r])&&t(n,e[r]);else n.push(e[1])}});const ya=t=>t>=11904&&t<=12031,ma=t=>t>=12032&&t<=12255,ga=t=>t>=12272&&t<=12287,va=t=>t>=12288&&t<=12351,ba=t=>t>=12352&&t<=12447,wa=t=>t>=12448&&t<=12543,Ma=t=>t>=12544&&t<=12591,xa=t=>t>=12704&&t<=12735,Fa=t=>t>=12736&&t<=12783,Aa=t=>t>=12784&&t<=12799,ka=t=>t>=12800&&t<=13055,Pa=t=>t>=13056&&t<=13311,Sa=t=>t>=13312&&t<=19903,_a=t=>t>=19968&&t<=40959,Oa=t=>t>=40960&&t<=42127,Ea=t=>t>=42128&&t<=42191,Ia=t=>t>=63744&&t<=64255,$a=t=>t>=64336&&t<=65023,Ca=t=>t>=65040&&t<=65055,Ta=t=>t>=65072&&t<=65103,za=t=>t>=65104&&t<=65135,Da=t=>t>=65136&&t<=65279,ja=t=>t>=65280&&t<=65519;function Ua(t){return!((t=>t>=1536&&t<=1791)(t)||(t=>t>=1872&&t<=1919)(t)||(t=>t>=2208&&t<=2303)(t)||$a(t)||Da(t))}function Na(t){return!!(746===t||747===t||!(t<4352)&&(xa(t)||Ma(t)||Ta(t)&&!(t>=65097&&t<=65103)||Ia(t)||Pa(t)||ya(t)||Fa(t)||!(!va(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Sa(t)||_a(t)||ka(t)||(t=>t>=12592&&t<=12687)(t)||(t=>t>=43360&&t<=43391)(t)||(t=>t>=55216&&t<=55295)(t)||(t=>t>=4352&&t<=4607)(t)||(t=>t>=44032&&t<=55215)(t)||ba(t)||ga(t)||(t=>t>=12688&&t<=12703)(t)||ma(t)||Aa(t)||wa(t)&&12540!==t||!(!ja(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)||!(!za(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||Ca(t)||(t=>t>=19904&&t<=19967)(t)||Oa(t)||Ea(t)))}function La(t){return!(Na(t)||function(t){return!!((t=>t>=128&&t<=255)(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||(t=>t>=8192&&t<=8303)(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||(t=>t>=8448&&t<=8527)(t)||(t=>t>=8528&&t<=8591)(t)||(t=>t>=8960&&t<=9215)(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||(t=>t>=9216&&t<=9279)(t)&&9251!==t||(t=>t>=9280&&t<=9311)(t)||(t=>t>=9312&&t<=9471)(t)||(t=>t>=9632&&t<=9727)(t)||(t=>t>=9728&&t<=9983)(t)&&!(t>=9754&&t<=9759)||(t=>t>=11008&&t<=11263)(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||va(t)||wa(t)||(t=>t>=57344&&t<=63743)(t)||Ta(t)||za(t)||ja(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Va(t){return t>=1424&&t<=2303||$a(t)||Da(t)}const Ra=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]];function Ha(t){for(const n of Ra)if(t>=n[0]&&t<=n[1])return!0;return!1}const Wa={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",dt:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function qa(t,n,e,r,i,s,o,a,u,h){let l=t.trim();2===h&&(l=function(t){let n="";for(let e=0;e<t.length;e++){const r=t.charCodeAt(e+1)||null,i=t.charCodeAt(e-1)||null;n+=r&&La(r)&&!Wa[t[e+1]]||i&&La(i)&&!Wa[t[e-1]]||!Wa[t[e]]?t[e]:Wa[t[e]]}return n}(l));const c=[],f={positionedGlyphs:c,text:l,top:a[1],bottom:a[1],left:a[0],right:a[0],writingMode:h};let d;return d=function(t,n){const e=[];let r=0;for(let i=0;i<n.length;i++){const s=n[i];e.push(t.substring(r,s)),r=s}return r<t.length&&e.push(t.substring(r,t.length)),e}(l,function(t,n,e,r){if(!e)return[];if(!t)return[];const i=[],s=function(t,n,e,r){let i=0;for(let e=0;e<t.length;e++){const s=r[t.charCodeAt(e)];s&&(i+=s.metrics.advance+n)}return i/Math.max(1,Math.ceil(i/e))}(t,n,e,r);let o=0;for(let e=0;e<t.length;e++){const u=t.charCodeAt(e),h=r[u];h&&!Ga[u]&&(o+=h.metrics.advance+n),e<t.length-1&&(Ba[u]||!((a=u)<11904)&&(xa(a)||Ma(a)||Ta(a)||Ia(a)||Pa(a)||ya(a)||Fa(a)||va(a)||Sa(a)||_a(a)||ka(a)||ja(a)||ba(a)||ga(a)||ma(a)||Aa(a)||wa(a)||Ca(a)||Ea(a)||Oa(a)))&&i.push(Ya(e+1,o,s,i,Xa(u,t.charCodeAt(e+1)),!1))}var a;return function t(n){return n?t(n.priorBreak).concat(n.index):[]}(Ya(t.length,o,s,i,0,!0))}(l,o,e,n)),function(t,n,e,r,i,s,o,a,u,h){let l=0,c=0,f=0;const d=t.positionedGlyphs,p="right"===s?1:"left"===s?0:.5;for(let t=0;t<e.length;t++){let i=e[t];if(i=i.trim(),!i.length){c-=r;continue}const s=d.length;for(let t=0;t<i.length;t++){const e=i.charCodeAt(t),r=n[e];r&&(Na(e)&&1!==o?(32!==e&&d.push({glyph:e,x:l,y:0,vertical:!0}),l+=u+a):(32!==e&&d.push({glyph:e,x:l,y:c,vertical:!1}),l+=r.metrics.advance+a))}d.length!==s&&(f=Math.max(l-a,f),Ka(d,n,s,d.length-1,p)),l=0,c-=r}const{horizontalAlign:y,verticalAlign:m}=Za(i,void 0);!function(t,n,e,r,i,s,o){const a=(n-e)*i,u=-(-r*o+.5)*s;if(a||u)for(let n=0;n<t.length;n++)t[n].x+=a,t[n].y+=u}(d,p,y,m,f,r,e.length);const g=e.length*r;t.top+=-m*g,t.bottom=t.top+g,t.left+=-y*f,t.right=t.left+f}(f,n,d,r,i,s,h,o,u),!!c.length&&f}const Ga={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ba={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Ja(t,n,e,r){const i=Math.pow(t-n,2);return r?t<n?i/2:2*i:i+Math.abs(e)*e}function Xa(t,n){let e=0;return 10===t&&(e-=1e4),40!==t&&65288!==t||(e+=50),41!==n&&65289!==n||(e+=50),e}function Ya(t,n,e,r,i,s){let o=null,a=Ja(n,e,i,s);for(let t=0;t<r.length;t++){const u=r[t],h=Ja(n-u.x,e,i,s)+u.badness;h<=a&&(o=u,a=h)}return{index:t,x:n,priorBreak:o,badness:a}}function Za(t,n){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=n?1:0;break;case"left":case"top-left":case"bottom-left":e=n?0:1}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=n?1:0;break;case"top":case"top-right":case"top-left":r=n?0:1}return{horizontalAlign:e,verticalAlign:r}}function Ka(t,n,e,r,i){if(!i)return;const s=n[t[r].glyph];if(s){const n=(t[r].x+s.metrics.advance)*i;if(!n)return;for(let i=e;i<=r;i++)t[i].x-=n}}function Qa(t){if(!function(t){for(const n of t)if(Va(n.charCodeAt(0)))return!0;return!1}(t))return t;const n=[],e=[],r=[];let i=0,s=0,o=1,a=1;for(const u of t){const t=u.codePointAt(0);Ha(t)?(r.push(u),i++):(o=Va(t)?-1:1,a!==o?(s=i,e.length&&(a>0&&e.reverse(),n.push(...e)),r.length&&(n.splice(s,0,...r),r.length=0),a=o,e.length=0):r.length&&(e.push(...r),r.length=0),e.push(u),i++)}return r.length&&e.push(...r),e.length&&(a>0&&e.reverse(),n.push(...e)),n.reverse().join("")}const tu=/\\{ *([\\w_]+) *\\}/g;class nu{constructor(t,n,e,r,i){this.feature=t,this.symbolDef=n,this.symbol=e,this.options=i,this.pt=this.yt.bind(this),this.K=r}yt(t,n){return this.feature.properties[n]||"default"}getShape(t,n){if(this.gt)return this.gt;const{textHorizontalAlignmentFn:e,textVerticalAlignmentFn:r,markerHorizontalAlignmentFn:i,markerVerticalAlignmentFn:s,textWrapWidthFn:o}=this.K;let a;const u=this.symbol,h=this.getIconAndGlyph(),l=this.feature.properties;if(h&&h.glyph){const{font:t,text:i}=h.glyph;if(""===i)return null;const s=this.size[0]/24,c=24,f=u.textKeepUpright,d="map"===u.textRotationAlignment&&"line"===u.textPlacement&&!u.isIconText,p=n.glyphMap[t],y=eu(e?e(null,l):u.textHorizontalAlignment,r?r(null,l):u.textVerticalAlignment),m=1.2*c,g=function(t){for(let n=0;n<t.length;n++)if(!Ua(t.charAt(n).charCodeAt(0)))return!1;return!0}(i),v=g&&u.textLetterSpacing/s||0,b=[u.textDx/s||0,u.textDy/s||0],w=((o?o(null,l):u.textWrapWidth)||10*c)/s;a={},a.horizontal=qa(i,p,w,m,y,"center",v,b,c,1),g&&d&&f&&(a.vertical=qa(i,p,w,m,y,"center",v,b,c,2))}else if(h&&h.icon){if(!t.positions[h.icon.url])return null;const n=eu(i?i(null,l):u.markerHorizontalAlignment,s?s(null,l):u.markerVerticalAlignment);a=function(t,n,e){let{horizontalAlign:r,verticalAlign:i}=Za(n,e);e?r=1-r:i=1-i;const s=-2048*r,o=-2048*i;return{image:t,top:o,bottom:o+2048,left:s,right:s+2048}}(t.positions[h.icon.url],n,this.options.isVector3D),this.size||(this.size=a.image.displaySize)}return this.gt=a,a}getIconAndGlyph(){if(this.iconGlyph)return this.iconGlyph;const{markerFileFn:t,markerTypeFn:n,markerPathFn:e,markerWidthFn:r,markerHeightFn:i,markerFillFn:s,markerFillPatternFileFn:o,markerFillOpacityFn:a,markerTextFitFn:u,markerTextFitPaddingFn:h,markerLineColorFn:l,markerLineWidthFn:c,markerLineOpacityFn:f,markerLineDasharrayFn:y,markerLinePatternFileFn:m,markerPathWidthFn:g,markerPathHeightFn:v,textNameFn:b,textFaceNameFn:w,textStyleFn:M,textWeightFn:x}=this.K,{zoom:F}=this.options,A={},k=this.symbol,P=this.feature.properties,S=t?t(null,P):k.markerFile,_=n?n(null,P):k.markerType,O=S||_||k.markerPath,E=!hr(this.symbolDef.textName);let I;if(O){I=function(t,n,e,r,i,s){if(hr(n.markerWidth)&&hr(n.markerHeight))return null;const o="__fn_markerWidth".trim(),a="__fn_markerHeight".trim();let u=n.markerWidth||0,h=n.markerHeight||0;return cr(u)&&("identity"!==u.type?u=la(u):(u=t.markerWidth,t[o]&&(u=t[o](r,e)),cr(u)&&(u="identity"===u.type?i(r,e):la(u)))),cr(h)&&("identity"!==h.type?h=la(h):(h=t.markerHeight,t[a]&&(h=t[a](r,e)),cr(h)&&(h="identity"===h.type?s(r,e):la(h)))),[u,h]}(k,this.symbolDef,P,F,r,i)||[0,0];let t=k.markerTextFit;if(u&&(t=u(F,P)),t&&k.text&&"none"!==t){const n=k.text.textSize;let e=k.text.textName;d(e)&&(e=p(e)(F,P));const r=da(e,P);if(r){const e="__fn_textSize".trim(),i="__fn_textSize_0".trim();d(n)&&!k.text[e]&&(k.text[i]=p(n),k.text[e]=(t,n)=>{const e=k.text[i](t,n);return d(e)?p(e)(t,n):e});const s=ha(k.text,k.text,P,F);if("width"!==t&&"both"!==t||(I[0]=s[0]*r.length),"height"!==t&&"both"!==t||(I[1]=s[1]),s[0]&&s[1]){let t=k.markerTextFitPadding||[0,0,0,0];h&&(t=h(F,P)),I[0]+=t[1]+t[3],I[1]+=t[0]+t[2]}}else I[0]=I[1]=-1}}if(E&&(I=ha(k,this.symbolDef,P,F)),!I)return A;if(I[0]=Math.ceil(I[0]),I[1]=Math.ceil(I[1]),this.size=I,O&&I[0]>=0&&I[1]>=0){let t;if(_){const n={};if(n.markerType=_,"path"===_&&(n.markerPath=e?e(null,P):k.markerPath,n.markerPathWidth=g?g(null,P):k.markerPathWidth,n.markerPathHeight=v?v(null,P):k.markerPathHeight),r){const t=r(null,P);hr(t)||(n.markerWidth=t)}else k.markerWidth>=0&&(n.markerWidth=k.markerWidth);if(i){const t=i(null,P);hr(t)||(n.markerHeight=t)}else k.markerHeight>=0&&(n.markerHeight=k.markerHeight);if(s){const t=s(null,P);hr(t)||(n.markerFill=t)}else k.markerFill&&(n.markerFill=k.markerFill);if(o){const t=o(null,P);hr(t)||(n.markerFillPatternFile=t)}else k.markerFillPatternFile&&(n.markerFillPatternFile=k.markerFillPatternFile);if(a){const t=a(null,P);hr(t)||(n.markerFillOpacity=t)}else k.markerFillOpacity>=0&&(n.markerFillOpacity=k.markerFillOpacity);if(l){const t=l(null,P);hr(t)||(n.markerLineColor=t)}else k.markerLineColor&&(n.markerLineColor=k.markerLineColor);if(c){const t=c(null,P);hr(t)||(n.markerLineWidth=t)}else k.markerLineWidth>=0&&(n.markerLineWidth=k.markerLineWidth);if(f){const t=f(null,P);hr(t)||(n.markerLineOpacity=t)}else k.markerLineOpacity>=0&&(n.markerLineOpacity=k.markerLineOpacity);if(y){const t=y(null,P);hr(t)||(n.markerLineDasharray=t)}else k.markerLineDasharray&&(n.markerLineDasharray=k.markerLineDasharray);if(m){const t=m(null,P);hr(t)||(n.markerLinePatternFile=t)}else k.markerLinePatternFile&&(n.markerLinePatternFile=k.markerLinePatternFile);t="vector://"+JSON.stringify(n)}else t=S?S.replace(tu,this.pt):k.markerPath?function(t,n,e){if(!t.markerPath)return null;let r=1;const i=function(t){const n={stroke:{stroke:t.markerLineColor,"stroke-width":t.markerLineWidth,"stroke-opacity":t.markerLineOpacity,"stroke-dasharray":null,"stroke-linecap":"butt","stroke-linejoin":"round"},fill:{fill:t.markerFill,"fill-opacity":t.markerFillOpacity}};return 0===n.stroke["stroke-width"]&&(n.stroke["stroke-opacity"]=0),n}(t);lr(t.markerOpacity)&&(r=t.markerOpacity),lr(t.opacity)&&(r*=t.opacity);const s={};if(i){for(const t in i.stroke)yr(i.stroke,t)&&(hr(i.stroke[t])||(s[t]=i.stroke[t]));for(const t in i.fill)yr(i.fill,t)&&(hr(i.fill[t])||(s[t]=i.fill[t]))}const o=Array.isArray(t.markerPath)?t.markerPath:[t.markerPath];let a;const u=[];for(let t=0;t<o.length;t++)a=fr(o[t])?{path:o[t]}:o[t],a=ur({},a,s),a.d=a.path,delete a.path,u.push(a);const h=[\'<svg version="1.1"\',\'xmlns="http://www.w3.org/2000/svg"\'];r<1&&h.push(\'opacity="\'+r+\'"\'),t.markerPathWidth&&t.markerPathHeight&&h.push(\'viewBox="0 0 \'+t.markerPathWidth+" "+t.markerPathHeight+\'"\'),h.push(\'preserveAspectRatio="none"\'),n&&h.push(\'width="\'+n+\'"\'),e&&h.push(\'height="\'+e+\'"\'),h.push("><defs></defs>");for(let t=0;t<u.length;t++){let n="<path ";for(const e in u[t])yr(u[t],e)&&(n+=" "+e+\'="\'+u[t][e]+\'"\');n+="></path>",h.push(n)}return h.push("</svg>"),"data:image/svg+xml;base64,"+btoa(h.join(" "))}(k,I[0],I[1]):null;A.icon={url:t,size:I}}if(E){const t=b?b(this.options.zoom,P):k.textName;if(t||0===t){const n=ca(w?w(null,P):k.textFaceName,M?M(null,P):k.textStyle,x?x(null,P):k.textWeight);let e=da(t,P);e&&e.length&&(e=Qa(e),A.glyph={font:n,text:e})}}return this.iconGlyph=A,A}}function eu(t,n){n&&"middle"!==n||(n="center"),t&&"middle"!==t||(t="center");let e="center"!==n?n:"";return e+="center"!==t?(e.length?"-":"")+t:"",e\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */}function ru(t,n,e,r,i){const s=[];let o;for(let a=0;a<t.length;a++){const u=t[a];let h,l=!1;for(let t=0;t<u.length-1;t++){let a=u[t],c=u[t+1];a.x<n&&c.x<n||(a.x<n?(o=a,a=new Ut(n,a.y+(n-a.x)/(c.x-a.x)*(c.y-a.y)).T(),a.z=o.z+(n-o.x)/(c.x-o.x)*(c.z-o.z),l=!0):c.x<n&&(o=c,c=new Ut(n,a.y+(n-a.x)/(c.x-a.x)*(c.y-a.y)).T(),c.z=a.z+(n-a.x)/(o.x-a.x)*(o.z-a.z),l=!0),a.y<e&&c.y<e||(a.y<e?(o=a,a=new Ut(a.x+(e-a.y)/(c.y-a.y)*(c.x-a.x),e).T(),a.z=o.z+(e-o.y)/(c.y-o.y)*(c.z-o.z),l=!0):c.y<e&&(o=c,c=new Ut(a.x+(e-a.y)/(c.y-a.y)*(c.x-a.x),e).T(),c.z=a.z+(e-a.y)/(o.y-a.y)*(o.z-a.z),l=!0),a.x>=r&&c.x>=r||(a.x>=r?(o=a,a=new Ut(r,a.y+(r-a.x)/(c.x-a.x)*(c.y-a.y)).T(),a.z=o.z+(r-o.x)/(c.x-o.x)*(c.z-o.z),l=!0):c.x>=r&&(o=c,c=new Ut(r,a.y+(r-a.x)/(c.x-a.x)*(c.y-a.y)).T(),c.z=a.z+(r-a.x)/(o.x-a.x)*(o.z-a.z),l=!0),a.y>=i&&c.y>=i||(a.y>=i?(o=a,a=new Ut(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i).T(),a.z=o.z+(i-o.y)/(c.y-o.y)*(c.z-o.z),l=!0):c.y>=i&&(o=c,c=new Ut(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i).T(),c.z=a.z+(i-a.y)/(o.y-a.y)*(o.z-a.z),l=!0),h&&a.equals(h[h.length-1])||(h=[a],s.push(h)),l&&(h.clipped=!0),h.push(c)))))}}return s}class iu extends Ut{constructor(t,n,e,r){super(t,n),this.angle=e,void 0!==r&&(this.segment=r)}clone(){return new iu(this.x,this.y,this.angle,this.segment)}}\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */function su(t,n,e,r,i){if(void 0===n.segment)return!0;let s=n,o=n.segment+1,a=0;for(;a>-e/2;){if(o--,o<0)return!1;a-=t[o].dist(s),s=t[o]}a+=t[o].dist(t[o+1]),o++;const u=[];let h=0;for(;a<e/2;){const n=t[o],e=t[o+1];if(!e)return!1;let s=t[o-1].angleTo(n)-n.angleTo(e);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:a,angleDelta:s}),h+=s;a-u[0].distance>r;)h-=u.shift().angleDelta;if(h>i)return!1;o++,a+=n.dist(e)}return!0}function ou(t,n,e,r,i,s,o,a,u,h,l){const c=function(t,n,e){return t?.6*n*e:0}(r,s,o),f=function(t,n){return Math.max(t?t.right-t.left:0,n?n.right-n.left:0)}(r,i),d=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return n-f*o<n/4&&(n=f*o+n/4),function t(n,e,r,i,s,o,a,u,h,l,c){let f=0;const d=o/2,p=function(t){let n=0;for(let e=0;e<t.length-1;e++)n+=t[e].dist(t[e+1]);return n}(n);let y=0,m=e-r,g=[];for(let t=0;t<n.length-1;t++){const e=n[t],a=n[t+1],u=e.dist(a),v=a.angleTo(e);for(;m+r<y+u;){m+=r;const b=(m-y)/u,w=au(e.x,a.x,b),M=au(e.y,a.y,b),x=au(e.z||0,a.z||0,b);if(w>=0&&w<h&&M>=0&&M<h&&m-d>=0&&m+d<=p){const r=new iu(w,M,v,t);r.z=x,l&&(r.axis=[e.y-M,w-e.x],r.angleR=x===(e.z||0)?0:Math.atan(.9*(x-(e.z||0))*c/e.dist(r))),r.line=n,r.T(),!i||su(n,r,o,i,s)?g.push(r):i&&f++}}y+=u}return u||g.length||a||(g=t(n,y/2,r,i,s,o,a,!0,h,l,c)),g.countOutOfAngle=f,g}(t,d?n/2*a%n:(f/2+2*s)*o*a%n,n,c,e,f*o,d,!1,u,h,l)}function au(t,n,e){return t*(1-e)+n*e}function uu(t,n){const e=t.length;if(e<=1)return[t];const r=[];let i,s;for(let n=0;n<e;n++){const e=kr(t[n]);0!==e&&(t[n].area=Math.abs(e),void 0===s&&(s=e<0),s===e<0?(i&&r.push(i),i=[t[n]]):i.push(t[n]))}if(i&&r.push(i),n>1)for(let t=0;t<r.length;t++)r[t].length<=n||(Gn(r[t],n,1,r[t].length-1,hu),r[t]=r[t].slice(0,n));return r}function hu(t,n){return n.area-t.area}function lu(t,n,e){const r=n.distSqr(e);if(0===r)return t.distSqr(n);const i=((t.x-n.x)*(e.x-n.x)+(t.y-n.y)*(e.y-n.y))/r;return t.distSqr(i<0?n:i>1?e:e.sub(n).k(i).m(n))}function cu(t,n=1,e=!1){let r=1/0,i=1/0,s=-1/0,o=-1/0;const a=t[0];for(let t=0;t<a.length;t++){const n=a[t];(!t||n.x<r)&&(r=n.x),(!t||n.y<i)&&(i=n.y),(!t||n.x>s)&&(s=n.x),(!t||n.y>o)&&(o=n.y)}const u=Math.min(s-r,o-i);let h=u/2;const l=new Bn([],fu);if(0===u)return new Ut(r,i);for(let n=r;n<s;n+=u)for(let e=i;e<o;e+=u)l.push(new du(n+h,e+h,h,t));let c=function(t){let n=0,e=0,r=0;const i=t[0];for(let t=0,s=i.length,o=s-1;t<s;o=t++){const s=i[t],a=i[o],u=s.x*a.y-a.x*s.y;e+=(s.x+a.x)*u,r+=(s.y+a.y)*u,n+=3*u}return new du(e/n,r/n,0,t)}(t),f=l.length;for(;l.length;){const r=l.pop();(r.d>c.d||!c.d)&&(c=r,e&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,f)),r.max-c.d<=n||(h=r.h/2,l.push(new du(r.p.x-h,r.p.y-h,h,t)),l.push(new du(r.p.x+h,r.p.y-h,h,t)),l.push(new du(r.p.x-h,r.p.y+h,h,t)),l.push(new du(r.p.x+h,r.p.y+h,h,t)),f+=4)}return e&&(console.log("num probes: "+f),console.log("best distance: "+c.d)),c.p}function fu(t,n){return n.max-t.max}function du(t,n,e,r){this.p=new Ut(t,n),this.h=e,this.d=function(t,n){let e=!1,r=1/0;for(let i=0;i<n.length;i++){const s=n[i];for(let n=0,i=s.length,o=i-1;n<i;o=n++){const i=s[n],a=s[o];i.y>t.y!=a.y>t.y&&t.x<(a.x-i.x)*(t.y-i.y)/(a.y-i.y)+i.x&&(e=!e),r=Math.min(r,lu(t,i,a))}}return(e?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}function pu(t,n,e,r,i,s,o,a,u,h){const{feature:l,size:c,symbol:f}=t,d=c?24:0,p=i*(c?c[0]/d:1);if("line"===o){const t=[];t.countOutOfAngle=0;let i=l.geometry;s&&(i=ru(l.geometry,0,0,s,s));for(let o=0;o<i.length;o++){const l=ou(i[o],a,e,f.isIconText?null:r&&r.vertical||r&&r.horizontal||r,null,d,f.isIconText?1:p,1,s||1/0,u,h);if(f.textPlacement&&!f.isIconText)for(let t=0;t<l.length;t++)l[t].startIndex=n.length/3;if(t.push.apply(t,l),f.textPlacement&&!f.isIconText)for(let t=0;t<i[o].length;t++)n.push(i[o][t].x,i[o][t].y,i[o][t].z||0);t.countOutOfAngle+=l.countOutOfAngle||0}return t}return yu(l,o,s)}function yu(t,n,e,r,i){const s=[];if(3===t.type){const o=uu(t.geometry,0);for(let t=0;t<o.length;t++){const a=o[t];if("vertex"===n)for(let t=0;t<a.length;t++){const n=a[t];for(let o=0;o<n.length;o++)Or(n[o],e)||(s.push(n[o]),r&&(0===o?mu(n[o],n[o],n[t+1],i):mu(n[o],n[o-1],n[o],i)))}else if("vertex-first"===n){const t=a[0];t&&t[0]&&!Or(t[0],e)&&(s.push(t[0]),r&&mu(t[0],t[0],t[1],i))}else if("vertex-last"===n||"vertex-firstlast"===n){const t=a[0];if("vertex-firstlast"===n&&t&&t[0]&&!Or(t[0],e)&&(s.push(t[0]),r&&mu(t[0],t[0],t[1],i)),t&&t[t.length-1]&&!Or(t[t.length-1],e)){const n=t.length-1;s.push(t[n]),r&&mu(t[n],t[n-1],t[n],i)}}else{const t=cu(a,16);Or(t,e)||s.push(t)}}}else if(2===t.type)for(let o=0;o<t.geometry.length;o++){const a=t.geometry[o];if("vertex"===n)for(let t=0;t<a.length;t++)Or(a[t],e)||(s.push(a[t]),r&&(0===t?mu(a[t],a[t],a[t+1],i):mu(a[t],a[t-1],a[t],i)));else if("vertex-last"===n||"vertex-firstlast"===n){if("vertex-firstlast"!==n||Or(a[0],e)||(s.push(a[0]),r&&mu(a[0],a[0],a[1],i)),a&&a[a.length-1]&&!Or(a[a.length-1],e)){const t=a.length-1;s.push(a[t]),r&&mu(a[t],a[t-1],a[t],i)}}else Or(a[0],e)||(s.push(a[0]),r&&mu(a[0],a[0],a[1],i))}else if(1===t.type)for(let n=0;n<t.geometry.length;n++){const i=t.geometry[n];for(let t=0;t<i.length;t++){const n=i[t];Or(n,e)||(r&&(n.xRotation=0,n.yRotation=0,n.zRotation=0),s.push(n))}}return s}function mu(t,n,e,r){if(t.xRotation||t.yRotation||t.zRotation)return t;const i=e.x-n.x,s=n.y-e.y,o=(e.z-n.z)*r,a=Math.atan2(s,i);t.zRotation=a;const u=Math.atan2(o,Math.sqrt(i*i+s*s));return t.xyRotation=u,t}function gu(t,n){const e={},r={},i=[];let s=0;function o(n){i.push(t[n]),s++}function a(t,n,e){const s=r[t];return delete r[t],r[n]=s,i[s].geometry[0].pop(),i[s].geometry[0]=i[s].geometry[0].concat(e[0]),s}function u(t,n,r){const s=e[n];return delete e[n],e[t]=s,i[s].geometry[0].shift(),i[s].geometry[0]=r[0].concat(i[s].geometry[0]),s}function h(t,n,e){const r=e?n[0][n[0].length-1]:n[0][0];return`${t}:${r.x}:${r.y}`}for(let l=0;l<t.length;l++){const c=t[l],f=c.geometry;if(!f)continue;const d=c.properties[n]?c.properties[n].toString():null;if(!d){o(l);continue}const p=h(d,f),y=h(d,f,!0);if(p in r&&y in e&&r[p]!==e[y]){const t=u(p,y,f),n=a(p,y,i[t].geometry);delete e[p],delete r[y],r[h(d,i[n].geometry,!0)]=n,i[t].geometry=null}else p in r?a(p,y,f):y in e?u(p,y,f):(o(l),e[p]=s-1,r[y]=s-1)}return i.filter(t=>t.geometry)}class vu extends oa{static needMerge(t,n,e){if(!t)return!1;let r="line"===t.textPlacement||"line"===t.markerPlacement;return r||(n.textPlacementFn&&(r="line"===n.textPlacementFn(e)),n.markerPlacementFn&&(r="line"===n.markerPlacementFn(e))),t.mergeOnProperty&&r}static mergeLineFeatures(t,n,e,r){const i="__index".trim();let s=n.textPlacement,o=n.markerPlacement;e.textPlacementFn&&(s=e.textPlacementFn(r)),e.markerPlacementFn&&(o=e.markerPlacementFn(r));const a=function(t,n,e,r,i){const s="__index".trim(),o=oa.genFnTypes(n),{mergeOnPropertyFn:a}=o;if(!n.mergeOnProperty||"line"!==r&&"line"!==e)return[];if(!(Er(u=n.mergeOnProperty)||"string"!=typeof u&&(null===u.constructor||u.constructor!==String)||"line"!==r&&"line"!==e))return[{features:t,property:n.mergeOnProperty}];var u;const h=[],l={},c=[];for(let o=0;o<t.length;o++){t[o][s]=o;const u=t[o].properties=t[o].properties||{};u.$layer=t[o].layer,u.$type=t[o].type;let f=e;"line"!==f&&(f=r);const d=a?a(i,u):n.mergeOnProperty;"line"!==f||Er(d)?c.push(t[o]):(void 0===l[d]&&(l[d]=h.length,h.push({features:[],property:d})),h[l[d]].features.push(t[o]))}return c.length&&h.push({features:c}),h}(t,n,o,s,r);if(a.length){const n=[];for(let e=0;e<a.length;e++)n.push(a[e].property?gu(a[e].features,a[e].property):t);if(1===n.length)return n[0];{let t=[];for(let e=0;e<n.length;e++)t=t.concat(n[e]);return t.sort((t,n)=>t[i]-n[i]),t}}}static splitPointSymbol(t,n=0){const e=[];if(Array.isArray(t)){const n=t;for(let t=0;t<n.length;t++)n[t]&&e.push(...vu.splitPointSymbol(n[t],t));return e}let r=null,i=null;for(const n in t)0===n.indexOf("marker")?(r=r||{},r[n]=t[n]):0===n.indexOf("text")&&(i=i||{},i[n]=t[n]);return r&&(r.isIconText=!0,t.mergeOnProperty&&(r.mergeOnProperty=t.mergeOnProperty),e.push(r)),i&&(r&&(i.textPlacement=r.markerPlacement,i.textSpacing=r.markerSpacing,i.isIconText=!0),t.mergeOnProperty&&(i.mergeOnProperty=t.mergeOnProperty),e.push(i)),void 0!==t.visible&&(r&&(r.visible=t.visible),i&&(i.visible=t.visible)),r&&(r.markerTextFit&&i&&(r.text={},r.text.textName=i.textName,r.text.textSize=i.textSize),r.index={index:n,type:0}),i&&(i.index={index:n,type:1}),e}static isAtlasLoaded(t,n){const{icon:e,glyph:r}=t,{iconAtlas:i,glyphAtlas:s}=n;if(e&&(!i||!i.positions[e.url]))return!1;if(r){if(!s||!s.positions[r.font])return!1;const t=s.positions[r.font],{text:n}=r;for(let e=0;e<n.length;e++)if(!t[n.charCodeAt(e)])return!1}return!0}constructor(t,n,e){super(t,n,e),this.vt=n.textPlacement,this.K.textPlacementFn&&(this.vt=this.K.textPlacementFn(this.options.zoom))}createStyledVector(t,n,e,r,i,s){const o=new nu(t,this.symbolDef,n,e,r),a=o.getIconAndGlyph();if(a.icon&&!this.options.atlas){const{url:t,size:n}=a.icon;i[t]||(i[t]=a.icon.size),i[t][0]<n[0]&&(i[t][0]=n[0]),i[t][1]<n[1]&&(i[t][1]=n[1])}if(a.glyph&&!this.options.atlas){const{font:t,text:n}=a.glyph,e=s[t]=s[t]||{};for(let t=0;t<n.length;t++)e[n.charCodeAt(t)]=1;"line"===this.vt&&(s.options={isCharsCompact:!1})}return this.options.allowEmptyPack||a.icon||a.glyph?o:null}getFormat(t){const n=void 0!==t.textName,e=n?this.getPackSDFFormat(t):this.getPackMarkerFormat();n?e.push(...this.bt()):e.push(...this.wt());const{markerOpacityFn:r,textOpacityFn:i,markerPitchAlignmentFn:s,textPitchAlignmentFn:o,markerRotationAlignmentFn:a,textRotationAlignmentFn:u,markerRotationFn:h,textRotationFn:l,markerAllowOverlapFn:c,textAllowOverlapFn:f,markerIgnorePlacementFn:d,textIgnorePlacementFn:p}=this.K;return(r||i)&&e.push({type:Uint8Array,width:1,name:"aColorOpacity"}),(s||o)&&e.push({type:Uint8Array,width:1,name:"aPitchAlign"}),(a||u)&&e.push({type:Uint8Array,width:1,name:"aRotationAlign"}),(h||l)&&e.push({type:Uint16Array,width:1,name:"aRotation"}),(c||f||d||p)&&e.push({type:Uint8Array,width:1,name:"aOverlap"}),e}Mt(){return this.hasMapPitchAlign}bt(){const{textFillFn:t,textSizeFn:n,textHaloFillFn:e,textHaloRadiusFn:r,textHaloOpacityFn:i,textDxFn:s,textDyFn:o}=this.K,a=[];return t&&a.push({type:Uint8Array,width:4,name:"aTextFill"}),n&&a.push({type:Uint8Array,width:1,name:"aTextSize"}),e&&a.push({type:Uint8Array,width:4,name:"aTextHaloFill"}),r&&a.push({type:Uint8Array,width:1,name:"aTextHaloRadius"}),i&&a.push({type:Uint8Array,width:1,name:"aTextHaloOpacity"}),s&&a.push({type:Int8Array,width:1,name:"aTextDx"}),o&&a.push({type:Int8Array,width:1,name:"aTextDy"}),a}wt(){const{markerWidthFn:t,markerHeightFn:n,markerDxFn:e,markerDyFn:r}=this.K,i=[];return t&&i.push({type:this.options.markerWidthType||Uint8Array,width:1,name:"aMarkerWidth"}),n&&i.push({type:this.options.markerHeightType||Uint8Array,width:1,name:"aMarkerHeight"}),e&&i.push({type:Int8Array,width:1,name:"aMarkerDx"}),r&&i.push({type:Int8Array,width:1,name:"aMarkerDy"}),i}createDataPack(){if(!this.iconAtlas&&!this.glyphAtlas){if(!this.options.allowEmptyPack)return null;this.empty=!0}this.countOutOfAngle=0,this.lineVertex=[];const t=super.createDataPack.apply(this,arguments);return t?(t.lineVertex=new Int16Array(this.lineVertex),t.buffers.push(t.lineVertex.buffer),t):null}placeVector(t,n){const e=t.getShape(this.iconAtlas,this.glyphAtlas);if(!(this.options.allowEmptyPack||e&&e.image||e&&(e.horizontal||e.vertical)))return;const r=this.xt(t,e,n);if(this.countOutOfAngle+=r.countOutOfAngle||0,0===r.length)return;const i=this.data,s=this.needAltitudeAttribute()?2:3;let o=this.data.aPosition.length/s;const a=t.symbol,u=t.feature.properties,h="line"===this.vt&&!a.isIconText,l=void 0!==a.textName,c=l&&h&&function(t){let n=0;for(let e=0;e<t.length;e++)if(Na(t.charAt(e).charCodeAt(0)))n=0;else if(n++,n>=1)return!1;return!0}(t.getIconAndGlyph().glyph.text)?1:0,{textFillFn:f,textSizeFn:p,textHaloFillFn:y,textHaloRadiusFn:m,textHaloOpacityFn:g,textDxFn:v,textDyFn:b,textPitchAlignmentFn:w,textRotationAlignmentFn:M,textRotationFn:x,textAllowOverlapFn:F,textIgnorePlacementFn:A,textOpacityFn:k,markerWidthFn:P,markerHeightFn:S,markerDxFn:_,markerDyFn:O,markerPitchAlignmentFn:E,markerRotationAlignmentFn:I,markerRotationFn:$,markerAllowOverlapFn:C,markerIgnorePlacementFn:T,markerOpacityFn:z}=this.K;let D,j,U,N,L,V,R,H,W,q,G,B,J,X,Y,Z,K;if(l){const n=t.getIconAndGlyph().glyph.font;D=function(t,n,e){const r=t.positionedGlyphs,i=[];for(let s=0;s<r.length;s++){const o=r[s],a=e[o.glyph];if(!a)continue;const u=a.rect;if(!u)continue;const h=4,l=a.metrics.advance/2,c=a.metrics.height/2,f=n?[o.x+l,0]:[0,0],d=n?[0,o.y-c]:[o.x+l,o.y-c],p=a.metrics.left-h-l+d[0],y=a.metrics.top-h+d[1],m=p+u.w,g=y+u.h,v=new Ut(p,y),b=new Ut(m,y),w=new Ut(p,g),M=new Ut(m,g);if(n&&o.vertical){const t=new Ut(-l,l),n=-Math.PI/2,e=new Ut(5,0);v._(n,t).m(e),b._(n,t).m(e),w._(n,t).m(e),M._(n,t).m(e)}i.push({tl:v,tr:b,bl:w,br:M,tex:u,writingMode:t.writingMode,glyphOffset:f})}return i}(e.horizontal,h,this.glyphAtlas.positions[n]),f&&(j=f(null,u),d(j)?(this.dynamicAttrs.aTextFill=1,j=[0,0,0,0]):j=Mr([],j)),p&&(U=p(this.options.zoom,u),Er(U)&&(U=14)),y&&(N=y(null,u),d(N)?(this.dynamicAttrs.aTextHaloFill=1,N=[0,0,0,0]):N=Mr([],N)),m&&(L=m(null,u)),g&&(V=255*g(null,u)),v&&(R=v(null,u)||0),b&&(H=b(null,u)||0),w&&(J=+("map"===w(null,u))),M&&(X=+("map"===M(null,u))),x&&(Y=Ir(x(null,u),0,360)*Math.PI/180)}else D=e?function(t){const n=t.image,e=t.top-1/n.pixelRatio,r=t.left-1/n.pixelRatio,i=t.bottom+1/n.pixelRatio,s=t.right+1/n.pixelRatio;let o,a,u,h;return o=new Ut(r,e),a=new Ut(s,e),u=new Ut(s,i),h=new Ut(r,i),[{tl:o,tr:a,bl:h,br:u,tex:{x:n.tl[0],y:n.tl[1],w:n.displaySize[0],h:n.displaySize[1]},writingMode:void 0,glyphOffset:[0,0]}]}(e):function(){const t=new Ut(0,0),n=new Ut(0,0),e=new Ut(0,0);return[{tl:t,tr:n,bl:new Ut(0,0),br:e,tex:{x:0,y:0,w:0,h:0},writingMode:void 0,glyphOffset:[0,0]}]}(),P&&(W=P(null,u)),Er(W)&&(W=D[0].tex.w),S&&(q=S(null,u)),Er(q)&&(q=D[0].tex.h),_&&(G=_(null,u)),O&&(B=O(null,u)),E&&(J=+("map"===E(null,u))),I&&(X=+("map"===I(null,u))),$&&(Y=Ir($(null,u),0,360)*Math.PI/180);d(U)&&(this.dynamicAttrs.aTextSize=1),d(L)&&(this.dynamicAttrs.aTextHaloRadius=1),d(V)&&(this.dynamicAttrs.aTextHaloOpacity=1),d(R)&&(this.dynamicAttrs.aTextDx=1),d(H)&&(this.dynamicAttrs.aTextDy=1),d(W)&&(this.dynamicAttrs.aMarkerWidth=1),d(q)&&(this.dynamicAttrs.aMarkerHeight=1),d(G)&&(this.dynamicAttrs.aMarkerDx=1),d(B)&&(this.dynamicAttrs.aMarkerDy=1),d(J)&&(this.dynamicAttrs.aPitchAlign=1),d(X)&&(this.dynamicAttrs.aRotationAlign=1),d(Y)&&(this.dynamicAttrs.aRotation=1);const Q=C||F;Q&&(Z=Q(null,u)||0);const tt=T||A;let nt;tt&&(K=tt(null,u)||0);const et=k||z;et&&(nt=255*et(this.options.zoom,u));const rt=this.options.EXTENT,it=D.length,{altitudeScale:st,altitudeProperty:ot,defaultAltitude:at}=this.options,{altitude:ut}=_r(t.feature,st,ot,at);for(let t=0;t<r.length;t++){const n=r[t],e=n.z||ut||0;if(rt!==1/0&&Or(n,rt))continue;const s=n.x,a=n.y,u=D.length;for(let t=0;t<u;t++){const r=D[t],{tl:u,tr:f,bl:d,br:p,tex:y}=r;this.Ft(i,s,a,e,10*u.x,10*u.y,y.x,y.y+y.h),l&&this.At(i,h,it,r.glyphOffset,n,c,n.axis,n.angleR),this.kt(i,j,U,N,L,V,R,H,W,q,G,B,nt,J,X,Y,Z,K),this.Ft(i,s,a,e,10*f.x,10*f.y,y.x+y.w,y.y+y.h),l&&this.At(i,h,it,r.glyphOffset,n,c,n.axis,n.angleR),this.kt(i,j,U,N,L,V,R,H,W,q,G,B,nt,J,X,Y,Z,K),this.Ft(i,s,a,e,10*d.x,10*d.y,y.x,y.y),l&&this.At(i,h,it,r.glyphOffset,n,c,n.axis,n.angleR),this.kt(i,j,U,N,L,V,R,H,W,q,G,B,nt,J,X,Y,Z,K),this.Ft(i,s,a,e,10*p.x,10*p.y,y.x+y.w,y.y),l&&this.At(i,h,it,r.glyphOffset,n,c,n.axis,n.angleR),this.kt(i,j,U,N,L,V,R,H,W,q,G,B,nt,J,X,Y,Z,K),this.addElements(o,o+1,o+2),this.addElements(o+1,o+2,o+3),o+=4;const m=Math.max(Math.abs(s),Math.abs(a),Math.abs(e));m>this.maxPos&&(this.maxPos=m)}}}Ft(t,n,e,r,i,s,o,a){this.fillPosition(t,n,e,r),t.aShape.push(i,s),t.aTexCoord.push(o,a)}At(t,n,e,r,i,s,o,a){if(t.aCount.push(e),n){t.aGlyphOffset.push(r[0],r[1]),this.Mt()&&t.aPitchRotation.push(o[0],o[1],a);const n=i.startIndex;t.aSegment.push(i.segment+n,n,i.line.length),t.aVertical.push(s)}}kt(t,n,e,r,i,s,o,a,u,h,l,c,f,d,p,y,m,g){const{textFillFn:v,textSizeFn:b,textHaloFillFn:w,textHaloRadiusFn:M,textHaloOpacityFn:x,textDxFn:F,textDyFn:A,textPitchAlignmentFn:k,textRotationAlignmentFn:P,textRotationFn:S,textAllowOverlapFn:_,textIgnorePlacementFn:O,textOpacityFn:E,markerWidthFn:I,markerHeightFn:$,markerDxFn:C,markerDyFn:T,markerPitchAlignmentFn:z,markerRotationAlignmentFn:D,markerRotationFn:j,markerAllowOverlapFn:U,markerIgnorePlacementFn:N,markerOpacityFn:L}=this.K;v&&t.aTextFill.push(...n),b&&t.aTextSize.push(e),w&&t.aTextHaloFill.push(...r),M&&t.aTextHaloRadius.push(i),x&&t.aTextHaloOpacity.push(s),F&&t.aTextDx.push(o),A&&t.aTextDy.push(a),I&&t.aMarkerWidth.push(u),$&&t.aMarkerHeight.push(h),C&&t.aMarkerDx.push(l),T&&t.aMarkerDy.push(c),(L||E)&&t.aColorOpacity.push(f),(k||z)&&t.aPitchAlign.push(d),(D||P)&&t.aRotationAlign.push(p),(j||S)&&t.aRotation.push(9362*y);const V=U||_,R=N||O;(V||R)&&t.aOverlap.push((V?8:0)+4*m+((R?2:0)+g)),i>0&&(this.properties.hasHalo=1)}xt(t,n,e){const{feature:r,symbol:i}=t,s=this.Pt(t,i),o=r.properties,{markerSpacingFn:a,textSpacingFn:u,textMaxAngleFn:h}=this.K,l=((a?a(null,o):i.markerSpacing)||(u?u(null,o):i.textSpacing)||250)*e;let c=h?h(this.options.zoom,o):i.textMaxAngle;Er(c)&&(c=80),c*=Math.PI/180;const f=this.options.EXTENT,d=this.options.altitudeToTileScale,p=this.Mt();return pu(t,this.lineVertex,c,n,e,f,s,l,p,d)}Pt(t,n){let e;return e=this.K.markerPlacementFn?this.K.markerPlacementFn(this.options.zoom,t.feature.properties):n.markerPlacement||this.vt,this.ht||!n.markerPlacement&&!n.isIconText||(this.ht=e),!this.vt||n.isIconText||this.lt||(this.lt=e),e}getPackSDFFormat(t){if("line"!==this.vt||t.isIconText)return[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"}];{const t=[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"},{type:Int16Array,width:2,name:"aGlyphOffset"},{type:Uint16Array,width:3,name:"aSegment"},{type:Uint8Array,width:1,name:"aVertical"}];return this.Mt()&&t.push({type:Float32Array,width:3,name:"aPitchRotation"}),t}}getPackMarkerFormat(){return[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"}]}}class bu{constructor(t){this.x=t.x,this.y=t.y,this.z=t.z||0}clone(){return new bu(this)}I(){return this.P(this.mag()),this}P(t){return this.x/=t,this.y/=t,this.z/=t,this}C(){var t=this.y;return this.y=this.x,this.x=-t,this}mag(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}add(t){return this.clone().m(t)}sub(t){return this.clone().M(t)}m(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}M(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}equals(t){return this.x===t.x&&this.y===t.y&&this.z===t.z}mult(t){return this.clone().k(t)}k(t){return this.x*=t,this.y*=t,this.z*=t,this}dist(t){return Math.sqrt(this.distSqr(t))}distSqr(t){var n=t.x-this.x,e=t.y-this.y,r=t.z-this.z;return n*n+e*e+r*r}T(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)}}const wu=Math.cos(Math.PI/180*37.5),Mu=Math.pow(2,16)/1,xu=new Ut,Fu=new Ut,Au=new Ut;class ku extends oa{constructor(t,n,e){super(t,n,e);let r=!1;const{lineDasharrayFn:i,lineDashColorFn:s}=this.K;this.hasGradient=this.symbol.lineGradientProperty,i&&(r=function(t,n,e){for(let r=0;r<t.length;r++)if(e(n,t[r].properties))return!0;return!1}(t,this.options.zoom,i),r&&(this.dasharrayFn=i)),this.hasDasharray=_u(this.symbol.lineDasharray)||r,this.hasDasharray&&s&&(this.dashColorFn=s)}createStyledVector(t,n,e,r,i){const s=new Cr(t,n,e,r),o=s.getLineResource();return!this.options.atlas&&o&&(i[o]=[0,0]),s}getFormat(){const{lineWidthFn:t,lineStrokeWidthFn:n,lineStrokeColorFn:e,lineColorFn:r,lineOpacityFn:i,lineDxFn:s,lineDyFn:o,linePatternAnimSpeedFn:a,linePatternGapFn:u}=this.K,h=[...this.getPositionFormat()];if(h.push(this.iconAtlas||this.hasDasharray?{type:Int8Array,width:3,name:"aExtrude"}:{type:Int8Array,width:2,name:"aExtrude"}),h.push({type:this.options.positionType||Uint16Array,width:1,name:"aLinesofar"}),t&&h.push({type:Uint8Array,width:1,name:"aLineWidth"}),n&&h.push({type:Uint8Array,width:1,name:"aLineStrokeWidth"}),r&&h.push({type:Uint8Array,width:4,name:"aColor"}),e&&h.push({type:Uint8Array,width:4,name:"aStrokeColor"}),i&&h.push({type:Uint8Array,width:1,name:"aOpacity"}),this.dasharrayFn&&h.push({type:Uint8Array,width:4,name:"aDasharray"}),this.dashColorFn&&h.push({type:Uint8Array,width:4,name:"aDashColor"}),this.iconAtlas){const t=this.getIconAtlasMaxValue();h.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return(s||o)&&h.push({type:Int8Array,width:2,name:"aLineDxDy"}),(a||u)&&h.push({type:Int8Array,width:2,name:"aLinePattern"}),h}placeVector(t){const{lineJoinFn:n,lineCapFn:e,lineWidthFn:r,lineHeightFn:i,lineStrokeWidthFn:s,lineStrokeColorFn:o,lineColorFn:a,lineOpacityFn:u,lineDxFn:h,lineDyFn:l,linePatternAnimSpeedFn:c,linePatternGapFn:f}=this.K,p=this.symbol,y=t.feature,m=y.properties;let g=p.lineJoin||"miter",v=p.lineCap||"butt";if(n&&(g=n(this.options.zoom,m)||"miter"),e&&(v=e(this.options.zoom,m)||"butt"),r){let t=r(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineWidth=1,t=4),hr(t)&&(t=4),this.feaLineWidth=+t}else this.feaLineWidth=+p.lineWidth;if(i){let t=i(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineHeight=1),hr(t)&&(t=this.feaLineWidth),this.feaLineHeight=+t}else this.feaLineHeight=+p.lineHeight||this.feaLineWidth;if(s){let t=s(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineStrokeWidth=1,t=0),hr(t)&&(t=0),this.feaLineStrokeWidth=t}else this.feaLineStrokeWidth=p.lineStrokeWidth||0;if(a&&(this.feaColor=a(this.options.zoom,m)||[255,255,255,255],d(this.feaColor)?(this.dynamicAttrs.aColor=1,this.feaColor=[0,0,0,0]):this.feaColor=Mr([],this.feaColor)),o&&(this.feaStrokeColor=o(this.options.zoom,m)||[0,0,0,255],d(this.feaStrokeColor)?(this.dynamicAttrs.aStrokeColor=1,this.feaStrokeColor=[0,0,0,0]):this.feaStrokeColor=Mr([],this.feaStrokeColor)),u){let t=u(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aOpacity=1,t=1),hr(t)&&(t=1),this.feaOpacity=255*t}if(this.dasharrayFn){let t=this.dasharrayFn(this.options.zoom,m)||[0,0,0,0];if(d(t)&&(this.dynamicAttrs.aDasharray=1,t=[0,0,0,0]),t.length<4){const n=t;1===t.length?t=[n[0],n[0],n[0],n[0]]:2===t.length?t=[n[0],n[1],n[0],n[1]]:3===t.length&&(t=[n[0],n[1],n[2],n[2]])}this.feaDash=t}if(this.dashColorFn){let t=(this.dashColorFn?this.dashColorFn(this.options.zoom,m):this.symbol.lineDashColor)||[0,0,0,0];d(t)&&(this.dynamicAttrs.aDashColor=1,t=[0,0,0,0]),t=Mr([],t),this.feaDashColor=t}if(this.iconAtlas){const n=t.getLineResource(),e=this.iconAtlas.glyphMap[n];if(this.feaTexInfo=this.feaTexInfo||[0,0,0,0],e){const{tl:t,displaySize:e}=this.iconAtlas.positions[n];this.feaTexInfo[0]=t[0]+1,this.feaTexInfo[1]=t[1]+1,this.feaTexInfo[2]=e[0]-3,this.feaTexInfo[3]=e[1]-3}else this.feaTexInfo[0]=this.feaTexInfo[1]=this.feaTexInfo[2]=this.feaTexInfo[3]=0}if(h){let t=h(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineDxDy=1,t=0),hr(t)&&(t=0),this.feaLineDx=t}if(l){let t=l(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineDxDy=1,t=0),hr(t)&&(t=0),this.feaLineDy=t}if(c){let t=c(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLinePatternAnimSpeed=1,t=0),hr(t)&&(t=0),0!==t&&(this.properties.hasPatternAnim=1),this.feaPatternAnimSpeed=t}if(f){let t=f(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLinePatternGap=1,t=0),hr(t)&&(t=0),this.feaLinePatternGap=t}const b=this.options.EXTENT;let w=y.geometry;if(b!==1/0){w=[];const t=[];for(let n=0;n<y.geometry.length;n++){t[0]=y.geometry[n];const e=ru(t,-1,-1,b+1,b+1);if(3===y.type&&e.length>1){const t=e[0],n=e[e.length-1];$u(t[0],n[n.length-1])&&(e[0]=n.concat(t.slice(1)),e.length=e.length-1)}w.push(...e)}}const M=this.needAltitudeAttribute()?2:3;for(let t=0;t<w.length;t++)this.offset=this.data.aPosition.length/M,this.St(w[t],y,g,v,2,1.05)}_t(){return this.iconAtlas&&this.feaTexInfo[2]&&this.feaTexInfo[3]}St(t,n,e,r,i,s){const o=this._t()||_u(this.feaDash)||_u(this.symbol.lineDasharray),a=this.options.isTube;a&&(t=t.map(t=>new bu(t))),this.overscaling=1;const u=this.options.EXTENT;if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.prevVertex=null,this.symbol.lineGradientProperty&&n.properties&&lr(n.properties.mapbox_clip_start)&&lr(n.properties.mapbox_clip_end)){this.clipStart=+n.properties.mapbox_clip_start,this.clipEnd=+n.properties.mapbox_clip_end;for(let n=0;n<t.length-1;n++)this.totalDistance+=t[n].dist(t[n+1]);this.updateScaledDistance()}const h=3===n.type&&!t.clipped;let l=t.length;for(;l>=2&&$u(t[l-1],t[l-2]);)l--;let c=0;for(;c<l-1&&$u(t[c],t[c+1]);)c++;if(l<(h?3:2))return;"bevel"===e&&(i=1.05);const f=this.overscaling<=16?15*u/(512*this.overscaling):0,d={vertexLength:0,primitiveLength:0,currentNormal:null};let p,y,m,g,v;this.e1=this.e2=-1,h&&(p=t[l-2],v=t[c].sub(p).I().C());for(let n=c;n<l;n++){if(m=n===l-1?h?t[c+1]:void 0:t[n+1],m&&$u(t[n],m))continue;v&&(g=v),p&&(y=p),p=t[n],m&&p.x===m.x&&p.y===m.y&&(p.x+=1e-4),v=m?m.sub(p).I().C():g,d.dir=y?p.sub(y).I():m.sub(p).I(),g=g||v,d.currentNormal=g;let u=g.add(v);0===u.x&&0===u.y||u.I();const b=g.x*v.x+g.y*v.y,w=u.x*v.x+u.y*v.y,M=0!==w?1/w:1/0,x=2*Math.sqrt(2-2*w),F=w<wu&&y&&m,A=g.x*v.y-g.y*v.x>0;if(!a&&F&&n>c){const t=p.dist(y);if(t>2*f){const n=p.sub(p.sub(y).k(f/t).T());n.z=p.z,this.updateDistance(y,n),this.addCurrentVertex(n,g,0,0,d),y=n}}const k=y&&m;d.middleVertex=k;let P=k?e:h?"butt":r;if(k&&"round"===P&&(M<s?P="miter":M<=2&&(P="fakeround")),"miter"===P&&M>i&&!a&&(P="bevel"),"bevel"===P&&(M>2&&(P="flipbevel"),M<i&&(P="miter")),y&&this.updateDistance(y,p),"miter"===P)a?(this.addCurrentVertex(p,g,0,0,d),d.dir=m.sub(p).I(),this.addCurrentVertex(p,v,0,0,d)):(u.k(M),this.addCurrentVertex(p,u,0,0,d),o&&(d.currentNormal=v,this.addCurrentVertex(p,u,0,0,d)));else if("flipbevel"===P){if(M>100)u=v.mult(-1);else{const t=M*g.add(v).mag()/g.sub(v).mag();u.C().k(t*(A?-1:1))}this.addCurrentVertex(p,u,0,0,d),this.addCurrentVertex(p,u.mult(-1),0,0,d)}else if("bevel"===P||"fakeround"===P){const t=-Math.sqrt(M*M-1),n=A?t:0,e=A?0:t;if(y&&this.addCurrentVertex(p,g,n,e,d),"fakeround"===P){const t=Math.round(180*x/Math.PI/20);for(let n=1;n<t;n++){let e=n/t;if(.5!==e){const t=e-.5;e+=e*t*(e-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*t*t+(.848013+b*(.215638*b-1.06021)))}const r=v.sub(g).k(e).m(g).I().k(A?-1:1);this.addHalfVertex(p,r.x,r.y,!1,A,0,d)}}m&&(d.currentNormal=v,this.addCurrentVertex(p,v,-n,-e,d))}else if("butt"===P)this.addCurrentVertex(p,u,0,0,d);else if("square"===P){const t=y?1:-1;this.addCurrentVertex(p,u,t,t,d)}else"round"===P&&(y&&(this.addCurrentVertex(p,g,0,0,d),this.addCurrentVertex(p,g,1,1,d,!0)),m&&(this.addCurrentVertex(p,v,-1,-1,d,!0),this.addCurrentVertex(p,v,0,0,d)));if(!a&&F&&n<l-1){const t=p.dist(m);if(t>2*f){const n=p.add(m.sub(p).k(f/t).T());n.z=p.z,this.updateDistance(p,n),this.addCurrentVertex(n,v,0,0,d),p=n}}}}addCurrentVertex(t,n,e,r,i,s=!1){const o=n.x+n.y*e,a=n.y-n.x*e,u=n.y*r-n.x,h=-n.y-n.x*r;let l=0,c=0;if(i.middleVertex){xu.x=o,xu.y=a,Fu.x=u,Fu.y=h;const t=i.currentNormal;if(l=Iu(t,xu),0===e&&0===r)c=-l;else{const n=Au;n.x=t.x,n.y=t.y,n.k(-1),c=Iu(n,Fu)}}this.addHalfVertex(t,o,a,s,!1,e,i,l),this.addHalfVertex(t,u,h,s,!0,-r,i,c),this.prevVertex&&$u(t,this.prevVertex)||(this.prevVertex=t),this.distance>Mu/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,n,e,r,i,s))}addHalfVertex({x:t,y:n,z:e},r,i,s,o,a,u,h){this.fillData(this.data,t,n,e||0,r,i,s,o,1*this.scaledDistance,h);const l=u.vertexLength++;this.e1>=0&&this.e2>=0&&(this.addElements(this.e1,this.e2,l),u.primitiveLength++),o?this.e2=l:this.e1=l}fillData(t,n,e,r,i,s,o,a,u,h){const{lineWidthFn:l,lineStrokeWidthFn:c,lineStrokeColorFn:f,lineColorFn:d,lineOpacityFn:p,lineDxFn:y,lineDyFn:m,linePatternAnimSpeedFn:g,linePatternGapFn:v}=this.K;this.fillPosition(t,n,e,r);let b=63*i;b=(Math.sign(b)||1)*((Math.floor(Math.abs(b))>>1<<1)+ +o);let w=63*s;w=(Math.sign(w)||1)*((Math.floor(Math.abs(w))>>1<<1)+ +a),t.aExtrude.push(b,w),(this.iconAtlas||this.hasDasharray)&&t.aExtrude.push(63*h),t.aLinesofar.push(u),l&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),c&&t.aLineStrokeWidth.push(Math.round(2*this.feaLineStrokeWidth)),d&&t.aColor.push(...this.feaColor),f&&t.aStrokeColor.push(...this.feaStrokeColor),p&&t.aOpacity.push(this.feaOpacity),this.dasharrayFn&&t.aDasharray.push(...this.feaDash),this.dashColorFn&&t.aDashColor.push(...this.feaDashColor),this.iconAtlas&&t.aTexInfo.push(...this.feaTexInfo),(y||m)&&t.aLineDxDy.push(this.feaLineDx||0,this.feaLineDy||0),(g||v)&&t.aLinePattern.push(127*(this.feaPatternAnimSpeed||0),10*(this.feaLinePatternGap||0)),this.maxPos=Math.max(this.maxPos,Math.abs(n)+1,Math.abs(e)+1)}addElements(t,n,e){super.addElements(this.offset+t,this.offset+n,this.offset+e)}Ot(t){const n=this.options.EXTENT,e=this.elements;for(let r=0;r<e.length;r+=3)n!==1/0&&(Su(this.data.aPosition,e[r],e[r+1],3,n)||Su(this.data.aPosition,e[r+1],e[r+2],3,n))||t.push(e[r],e[r+1],e[r+2])}Et(t){if(t.length<=1)return t;const n=[],e=this.options.EXTENT;let r,i=!0;for(r=0;r<t.length-1;r++){const s=Pu(t[r],t[r+1],e);s&&i||(n.push(t[r]),i=s)}return i||n.push(t[r]),n}updateDistance(t,n){if(this.options.isTube){const e=t.dist(n),r=vr(this.options)*(n.z-t.z);this.distance+=Math.sqrt(e*e+r*r)}else this.distance+=t.dist(n);this.updateScaledDistance()}updateScaledDistance(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Mu-1):this.distance}}function Pu(t,n,e){return e!==1/0&&(t.x<0&&n.x<0||t.x>e&&n.x>e||t.y<0&&n.y<0||t.y>e&&n.y>e)}function Su(t,n,e,r,i){if(i===1/0)return!1;const s=Math.floor(.5*t[n*r]),o=Math.floor(.5*t[n*r+1]),a=Math.floor(.5*t[e*r]),u=Math.floor(.5*t[e*r+1]);return s===a&&(s<0||s>i)&&o!==u||o===u&&(o<0||o>i)&&s!==a}function _u(t){if(!Array.isArray(t))return!1;for(let n=0;n<t.length;n++)if(t[n])return!0;return!1}const Ou=new Ut(0,0),Eu=new Ut(0,0);function Iu(t,n){const e=t.mag(),r=n.mag();Ou.x=n.x,Ou.y=n.y;const i=t.angleTo(Eu),s=n.angleTo(Eu);return Math.sign(s-i)*Math.sqrt(r*r-e*e)}function $u(t,n){return t.equals(n)&&t.z===n.z}class Cu extends ku{constructor(t,n,e){super(t,n,e),this.It=e.altitudeProperty}getFormat(){const{lineColorFn:t,lineWidthFn:n}=this.K,e=[{type:this.maxPosZ>=Math.pow(2,15)?Float32Array:Int16Array,width:3,name:"aPosition"},{type:Uint16Array,width:1,name:"aLinesofar"},{type:Uint8Array,width:1,name:"aUp"},{type:Int16Array,width:3,name:"aExtrudedPosition"},{type:Int8Array,width:2,name:"aExtrude"}];return t&&e.push({type:Uint8Array,width:4,name:"aColor"}),n&&e.push({type:Uint8Array,width:1,name:"aLineWidth"}),this.It&&e.push({type:Array,width:1,name:"aLineHeight"}),e}placeVector(t){const n=t.feature;if(this.It){const{altitudeScale:t,altitudeProperty:e,defaultAltitude:r,heightProperty:i,defaultHeight:s,minHeightProperty:o}=this.options,{altitude:a,height:u}=_r(n,t,e,r,i,s,o);this.feaAltitude=a,this.feaMinHeight=(a-u)/a*32767,a>this.maxAltitude&&(this.maxAltitude=a)}return super.placeVector(t)}needAltitudeAttribute(){return!1}St(t,n,e,r,i,s){const o=this.data.aPosition.length/3;super.St(t,n,e,r,i,s);const a=this.data.aPosition.length/3,u=this.data.aPosition.length/3-this.offset;if(3!==n.type&&u>0&&!1!==this.options.side){const t=!1!==this.options.top?1:0,n=t+4;let e=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/e;for(let t=0;t<r;t++)n.push(n[o*r+3*r+t])}e=this.data.aPosition.length/3;for(const t in this.data){const r=this.data[t],i=r.length/e;for(let t=0;t<i;t++)r.push(r[o*i+i*n+t])}e=this.data.aPosition.length/3;for(const t in this.data){const r=this.data[t],i=r.length/e;for(let t=0;t<i;t++)r.push(r[o*i+i*(n+3)+t])}super.addElements(t+1,u+1,u),super.addElements(u,u+1,u+2);const r=this.data.aPosition.length/3-this.offset;e=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/e;for(let t=0;t<r;t++)n.push(n[a*r-r+t])}e=this.data.aPosition.length/3;for(const t in this.data){const r=this.data[t],i=r.length/e;for(let t=0;t<i;t++)r.push(r[a*i-n*i-i+t])}e=this.data.aPosition.length/3;for(const t in this.data){const r=this.data[t],i=r.length/e;for(let t=0;t<i;t++)r.push(r[a*i-n*i-3*i+t])}super.addElements(r,u-3,r+1),super.addElements(u-3,r+2,r+1)}}fillData(t,n,e,r,i,s,o,a,u){const h=!1!==this.options.top,l=!1!==this.options.side,c=this.feaLineWidth||this.symbol.lineWidth/2*(this.options.EXTENT/this.options.tileSize),f=63*i,d=63*s,p=c*i+n,y=c*s+e;this.$t(t,n,e,i,s,o,a,u,p,y,f,d),l&&(h&&this.$t(t,n,e,i,s,o,a,u,p,y,f,d),this.$t(t,n,e,i,s,o,a,u,p,y,f,d),this.Ct(t,n,e,i,s,o,a,u,p,y,f,d),this.Ct(t,n,e,i,s,o,a,u,p,y,f,d)),this.maxPos=Math.max(this.maxPos,Math.abs(n),Math.abs(e))}$t(t,n,e,r,i,s,o,a,u,h,l,c){const{lineColorFn:f,lineWidthFn:d}=this.K;t.aPosition.push(n,e,32767),t.aLinesofar.push(a),t.aUp.push(+o),t.aExtrudedPosition.push(u,h,1),t.aExtrude.push(l,c),f&&t.aColor.push(...this.feaColor),d&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.It&&t.aLineHeight.push(this.feaAltitude)}Ct(t,n,e,r,i,s,o,a,u,h,l,c){const{lineColorFn:f,lineWidthFn:d}=this.K;t.aPosition.push(n,e,this.feaMinHeight||0),t.aLinesofar.push(a),t.aUp.push(+o),t.aExtrudedPosition.push(u,h,1),t.aExtrude.push(l,c),f&&t.aColor.push(...this.feaColor),d&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.It&&t.aLineHeight.push(this.feaAltitude)}addElements(t,n,e){const r=!1!==this.options.top,i=!1!==this.options.side,s=(r?1:0)+(i?4:0);if(t*=s,n*=s,this.data.aUp[this.offset+(e*=s)+4]){if(r&&super.addElements(n,t,e),i){const t=r?1:0;super.addElements(n+t,e+t,e+t+2),super.addElements(n+t+1,e+t+1+2,n+t+1+2)}}else if(r&&super.addElements(t,e,n),i){const n=r?1:0;super.addElements(t+n,t+n+2,e+n),super.addElements(t+n+1+2,e+n+1+2,e+n+1)}}createDataPack(t,n){this.maxAltitude=0;const e=super.createDataPack(t,n);if(!e)return e;const{data:r,indices:i}=e;this.getFormat().reduce((t,n)=>(t[n.name]={size:n.width},t),{}).aPickingId={size:1};const{aExtrudedPosition:s,aPosition:o,aLinesofar:a,aUp:u,aExtrude:h,aColor:l,aLineHeight:c,aLineWidth:f}=r,d={},p=ne(s,i);let y,m=!0;for(let t=0;t<p.length;t++)p[t]=-p[t],p[t]%1!=0&&(m=!1);if(!1!==this.options.top&&this.symbol.material&&function(t){for(const n in t)if(n.indexOf("Texture")>=0&&t[n])return!0;return!1}(this.symbol.material)&&(y=function(t,n,e){const r=[];for(let i=0;i<t.length;i+=3){const t=n[i/3];r.push(t/256,e[i/3]?1:0)}return r}(s,a,u)),d.aPosition=o,y&&(d.aTexCoord0=new Float32Array(y)),d.aNormal=m?new Int8Array(p):new Float32Array(p),d.aPickingId=r.aPickingId,d.aExtrude=h,l&&(d.aColor=l),f&&(d.aLineWidth=f),c){const t=ir(this.maxAltitude);d.aLineHeight=new t(c)}const g=[];for(const t in d)g.push(d[t].buffer);return e.data=d,e.buffers=g,e}}const Tu=Math.pow(2,16)/1;class zu extends oa{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const n=t.feature,e=3===n.type,r=n.geometry,i=this.elements;e&&(this.elements=[]);const s=this.needAltitudeAttribute()?2:3;for(let t=0;t<r.length;t++)this.offset=this.data.aPosition.length/s,this.St(r[t],n),e&&(this.Ot(i),this.elements=[]);e&&(this.elements=i)}St(t,n){const e=3===n.type;let r=t.length;for(;r>=2&&t[r-1].equals(t[r-2]);)r--;let i,s,o,a=0;for(;a<r-1&&t[a].equals(t[a+1]);)a++;if(!(r<(e?3:2))){this.distance=0,this.vertexLength=0,this.primitiveLength=0,this.e1=this.e2=this.e3=-1,e&&(i=t[r-2]);for(let n=a;n<r;n++)o=e&&n===r-1?t[a+1]:t[n+1],o&&t[n].equals(o)||(i&&(s=i),i=t[n],s&&(this.distance+=i.dist(s)),this.addCurrentVertex(i,this.distance))}}addCurrentVertex(t,n){const e=this.vertexLength++;this.addLineVertex(this.data,t,n),e>=1&&this.addElements(e-1,e),n>Tu&&(this.distance=0,this.addCurrentVertex(t,this.distance))}addLineVertex(t,n){this.fillPosition(t,n.x,n.y,n.z||0),this.maxPos=Math.max(this.maxPos,Math.abs(n.x),Math.abs(n.y))}addElements(t,n){super.addElements(this.offset+t,this.offset+n)}Ot(t){const n=this.options.EXTENT,e=this.elements;for(let r=0;r<e.length;r+=2)Pr(this.data.aPosition,e[r],e[r+1],3,n)||t.push(e[r],e[r+1])}}const Du=45*Math.PI/100;class ju extends oa{getFormat(){const{markerFillFn:t}=this.K;let n;return n="line"===this.symbol.markerRotationAlignment?[...this.getPositionFormat(),{type:Float32Array,width:1,name:"aXYRotation"},{type:Float32Array,width:1,name:"aZRotation"}]:[...this.getPositionFormat()],t&&n.push({type:Uint8Array,width:4,name:"aColor"}),n}placeVector(t){const n=t.feature.properties,{markerFillFn:e}=this.K;let r;e&&(r=e(this.options.zoom,n)||[255,255,255,255],d(r)?(this.dynamicAttrs.aColor=1,r=[0,0,0,0]):r=Mr([],r));const i="line"===this.symbol.markerRotationAlignment,s=this.xt(t,this.symbol.markerSpacing||250,this.symbol.markerPlacement||"point",i);for(let t=0;t<s.length;t++){const n=s[t];this.fillPosition(this.data,n.x,n.y,n.z),i&&(this.data.aXYRotation.push(n.xyRotation||0),this.data.aZRotation.push(n.zRotation||0)),r&&this.data.aColor.push(...r);const e=Math.max(Math.abs(n.x),Math.abs(n.y));e>this.maxPos&&(this.maxPos=e)}}xt(t,n,e,r){const i=t.feature,s=this.options.EXTENT;if("line"===e){const t=[];let e=i.geometry;s&&(e=ru(i.geometry,0,0,s,s));for(let r=0;r<e.length;r++){const i=ou(e[r],n,Du,null,null,24,1,1,s||1/0);t.push.apply(t,i)}return t}return yu(i,e,s,r,this.options.altitudeToTileScale)}hasElements(){return!1}}\n/*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */const Uu=[],Nu=[];function Lu(t,n){var e,r,i,s,o,a,u;for(r=1;r<=8;r*=2){for(e=[],s=!(Ru(i=t[t.length-1],n)&r),o=0;o<t.length;o++){if((u=!(Ru(a=t[o],n)&r))!==s){const t=Vu(i,a,r,n);e.push(void 0!==a.x?new Ut(t[0],t[1]):t)}u&&e.push(a),i=a,s=u}if(!(t=e).length)break}return e}function Vu(t,n,e,r){return Uu[0]=void 0===t.x?t[0]:t.x,Uu[1]=void 0===t.y?t[1]:t.y,t=Uu,Nu[0]=void 0===n.x?n[0]:n.x,Nu[1]=void 0===n.y?n[1]:n.y,n=Nu,8&e?[t[0]+(n[0]-t[0])*(r[3]-t[1])/(n[1]-t[1]),r[3]]:4&e?[t[0]+(n[0]-t[0])*(r[1]-t[1])/(n[1]-t[1]),r[1]]:2&e?[r[2],t[1]+(n[1]-t[1])*(r[2]-t[0])/(n[0]-t[0])]:1&e?[r[0],t[1]+(n[1]-t[1])*(r[0]-t[0])/(n[0]-t[0])]:null}function Ru(t,n){Uu[0]=void 0===t.x?t[0]:t.x,Uu[1]=void 0===t.y?t[1]:t.y;var e=0;return(t=Uu)[0]<n[0]?e|=1:t[0]>n[2]&&(e|=2),t[1]<n[1]?e|=4:t[1]>n[3]&&(e|=8),e}const Hu=[0,0,0,0];class Wu extends oa{constructor(...t){super(...t),this.lineElements=[]}createStyledVector(t,n,e,r,i){const s=new Cr(t,n,e,r),o=s.getPolygonResource();return!this.options.atlas&&o&&(i[o]=[0,0]),s}getFormat(){const t=[...this.getPositionFormat()],{polygonFillFn:n,polygonOpacityFn:e,uvScaleFn:r,uvOffsetFn:i,polygonPatternUVFn:s}=this.K;if(this.iconAtlas){const n=this.getIconAtlasMaxValue();t.push({type:n>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return n&&t.push({type:Uint8Array,width:4,name:"aColor"}),e&&t.push({type:Uint8Array,width:1,name:"aOpacity"}),r&&t.push({type:Uint16Array,width:2,name:"aUVScale"}),i&&t.push({type:Uint8Array,width:2,name:"aUVOffset"}),s&&t.push({type:Float32Array,width:2,name:"aTexCoord"}),t}placeVector(t,n){const e=t.feature;this.Tt(e.geometry,e,n)}Tt(t,n){let e,r,i,s;const{polygonFillFn:o,polygonOpacityFn:a,uvScaleFn:u,uvOffsetFn:h,uvOffsetInMeterFn:l,polygonPatternUVFn:c}=this.K,f=n.properties;o&&(e=o(this.options.zoom,f)||bt([],255,255,255,255),d(e)?(this.dynamicAttrs.aColor=1,e=Hu):e=Mr([],e)),a&&(r=a(this.options.zoom,f),d(r)?(this.dynamicAttrs.aOpacity=1,r=255):(hr(r)&&(r=1),r*=255)),u&&(i=u(this.options.zoom,f),d(i)?(i=[255,255],this.dynamicAttrs.aUVScale=1):(hr(i)&&(i=[1,1]),i=[255*i[0],255*i[1]])),h&&(l&&l(null,f)?s=[0,0]:(s=h(this.options.zoom,f),d(s)?(s=[0,0],this.dynamicAttrs.aUVOffset=1):(hr(s)&&(s=[0,0]),s=[255*s[0],255*s[1]])));const p=!!this.iconAtlas,y=uu(t,500),m=[0,0],g=[0,0];if(p){const{polygonPatternFileFn:t}=this.K,n=t?t(null,f):this.symbol.polygonPatternFile;if(this.iconAtlas.glyphMap[n]){const t=this.iconAtlas.positions[n];m[0]=t.tl[0]+1,m[1]=t.tl[1]+1,g[0]=t.displaySize[0]-3,g[1]=t.displaySize[1]-3}}let v,b=0;c&&(v=c(this.options.zoom,f));const w=this.needAltitudeAttribute()?2:3,M=[-1,-1,n.extent+1,n.extent+1],x=this.zt=this.zt||this.ot.get(),F=this.Dt=this.Dt||this.ot.get();for(let t=0;t<y.length;t++){const n=y[t],o=this.data.aPosition.length/w;x.setLength(0),F.setLength(0);for(let t=0;t<n.length;t++){let o=n[t];if(this.options.EXTENT!==1/0&&0===this.maxPosZ&&(o=Lu(o,M)),0!==o.length){0!==t&&F.push(x.length/3);for(let t=0;t<o.length;t++){const n=o[t].x,a=o[t].y,u=o[t].z||0;if(this.fillPosition(this.data,n,a,u),p&&this.data.aTexInfo.push(m[0],m[1],g[0],g[1]),void 0!==e&&this.data.aColor.push(e[0],e[1],e[2],e[3]),void 0!==r&&this.data.aOpacity.push(r),void 0!==i&&this.data.aUVScale.push(i[0],i[1]),void 0!==s&&this.data.aUVOffset.push(s[0],s[1]),c){if(v){const t=hr(v[2*b])?v[0]:v[2*b],n=hr(v[2*b]+1)?v[1]:v[2*b+1];this.data.aTexCoord.push(t,n)}else this.data.aTexCoord.push(-9999999,-9999999);b++}const h=Math.abs(n),l=Math.abs(a);h>this.maxPos&&(this.maxPos=h),l>this.maxPos&&(this.maxPos=l),x.push(n,a,u)}}}let a=Ne(x,F,3);if(x.length&&!a.length){const t=[];for(let n=0;n<x.length;n+=3)t[n]=x[n],t[n+1]=x[n+2],t[n+2]=x[n+1];if(a=Ne(t,F,3),!a.length){for(let n=0;n<x.length;n+=3)t[n]=x[n+1],t[n+1]=x[n+2],t[n+2]=x[n];a=Ne(t,F,3)}}for(let t=0;t<a.length;t+=3)this.addElements(o+a[t],o+a[t+1],o+a[t+2])}}}const qu=[{type:Int16Array,width:3,name:"aPosition"}];class Gu extends oa{getFormat(){return qu}placeVector(t,n){const e=this.xt(t,n);if(0===e.length)return;const r=this.data,i=this.getAltitude(t.feature.properties);let s=r.aPosition.length/qu[0].width;for(let t=0;t<e.length;t++){const n=e[t];r.aPosition.push(2*n.x+0,2*n.y+0,i),r.aPosition.push(2*n.x+1,2*n.y+0,i),r.aPosition.push(2*n.x+1,2*n.y+1,i),r.aPosition.push(2*n.x+0,2*n.y+1,i),this.addElements(s,s+1,s+2),this.addElements(s,s+2,s+3),s+=4;const o=Math.max(Math.abs(2*n.x+1),Math.abs(2*n.y+1));o>this.maxPos&&(this.maxPos=o)}}xt(t,n){const{feature:e,symbol:r}=t,i=this.Pt(t,r),s=e.properties,{markerSpacingFn:o}=this.K,a=((o?o(null,s):r.markerSpacing)||250)*n;return pu(t,null,null,n,this.options.EXTENT,i,a)}Pt(t,n){return this.K.markerPlacementFn?this.K.markerPlacementFn(this.options.zoom,t.feature.properties):n.markerPlacement}}class Bu extends ku{constructor(t,n,e){(n=ur({},n)).lineJoin="miter",n.lineCap="butt",super(t,n,e),this.options.radialSegments%2==1&&this.options.radialSegments--}getFormat(){const{lineWidthFn:t,lineColorFn:n,lineOpacityFn:e,linePatternAnimSpeedFn:r,linePatternGapFn:i}=this.K,s=[...this.getPositionFormat(),{type:Int8Array,size:4,name:"aTubeNormal"},{type:this.options.positionType||Uint16Array,width:1,name:"aLinesofar"}];if(this.iconAtlas){s.push({type:Int8Array,width:1,name:"aNormalDistance"});const t=this.getIconAtlasMaxValue();s.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return t&&s.push({type:Uint16Array,width:1,name:"aLineWidth"}),n&&s.push({type:Uint8Array,width:4,name:"aColor"}),e&&s.push({type:Uint8Array,width:1,name:"aOpacity"}),r&&s.push({type:Int8Array,width:1,name:"aLinePatternAnimSpeed"}),i&&s.push({type:Int8Array,width:1,name:"aLinePatternGap"}),s}addHalfVertex(t,n,e,r,i,s,o,a){const{x:u,y:h,z:l}=t,c=1*this.scaledDistance,f=this.options.radialSegments/2,{x:d,y:p,z:y}=o.dir,m=function(t,n,e,r,i,s,o,a){ft(Ju,e,r,i),ft(Xu,s,o,0),mt(Yu,Ju,Xu),pt(Xu,Xu),pt(Yu,Yu),Zu[n]||(Zu[n]=[]);const u=Zu[n];for(var h=0;h<n;h++){const t=Math.PI*h/n,e=1-Math.abs(t-0)/(Math.PI/2);u[h]=u[h]||[],Ku(Xu,Yu,u[h],1,t,e*(a?-1:1))}return u}(0,f,d,p,y,n,e,i);this.prevVertex&&this.fillTubeElements(i),this.fillData(this.data,u,h,l||0,m,i,c,a)}fillTubeElements(t){const n=this.options.radialSegments/2,e=this.needAltitudeAttribute()?2:3,r=this.data.aPosition.length/e;for(let e=0;e<n;e++){const i=e+r-2*n;let s,o;e===n-1&&t?(s=e+r-2*n+1,o=e+r-2*n-2*n+1):(s=e+r+1,o=e+r+1-2*n),super.addElements(e+r-this.offset,s-this.offset,i-this.offset),super.addElements(i-this.offset,s-this.offset,o-this.offset)}}fillData(t,n,e,r,i,s,o,a){const{lineWidthFn:u,lineColorFn:h,lineOpacityFn:l,linePatternAnimSpeedFn:c,linePatternGapFn:f}=this.K,d=i.length;for(let s=0;s<d;s++){if(this.fillPosition(t,n,e,r),Mt(i[s],i[s],63),t.aTubeNormal.push(...i[s]),t.aLinesofar.push(o),this.iconAtlas&&(t.aNormalDistance.push(63*a),t.aTexInfo.push(...this.feaTexInfo)),u){const n=br(this.options.metric);let e=this.feaLineWidth*n;isNaN(e)&&(e=0),t.aLineWidth.push(Math.round(e))}h&&t.aColor.push(...this.feaColor),l&&t.aOpacity.push(this.feaOpacity),c&&t.aLinePatternAnimSpeed.push(127*(this.feaPatternAnimSpeed||0)),f&&t.aLinePatternGap.push(10*(this.feaLinePatternGap||0))}this.maxPos=Math.max(this.maxPos,Math.abs(n)+1,Math.abs(e)+1)}createDataPack(t,n){const e=super.createDataPack(t,n);return e&&(e.is2D=!1),e}}const Ju=[],Xu=[],Yu=[],Zu={};function Ku(t,n,e,r,i,s){return bt(e,r*(Math.cos(i)*t[0]+Math.sin(i)*n[0]),r*(Math.cos(i)*t[1]+Math.sin(i)*n[1]),r*(Math.cos(i)*t[2]+Math.sin(i)*n[2]),s),e}class Qu extends Bu{addHalfVertex(t,n,e,r,i,s,o,a){const{x:u,y:h,z:l}=t,c=1*this.scaledDistance,{x:f,y:d,z:p}=o.dir,y=function(t,n,e,r,i,s,o,a){ft(nh,e,r,i),ft(eh,s,o,0),mt(rh,nh,eh),pt(eh,eh),pt(rh,rh),_t(th,t,n);const u=Et(th)/t,h=Math.atan(n/t);let l=Math.PI/2+(Math.PI/2-h);return ih[0]||(ih[0]=[]),Ku(eh,rh,ih[0],u,l,a?1:-1),l+=2*h,ih[1]||(ih[1]=[]),Ku(eh,rh,ih[1],u,l,a?1:-1),ih}(this.feaLineWidth,this.feaLineHeight,f,d,p,n,e,i);this.prevVertex&&this.fillTubeElements(i),this.fillData(this.data,u,h,l||0,y,i,c,a)}}const th=[],nh=[],eh=[],rh=[],ih=[];class sh{constructor(t){this.max=t,this.reset()}reset(){return this.data={},this.order=[],this}clear(){this.reset()}add(t,n){return this.has(t)?(this.order.splice(this.order.indexOf(t),1),this.data[t]=n,this.order.push(t)):(this.data[t]=n,this.order.push(t),this.order.length>this.max&&this.getAndRemove(this.order[0])),this}has(t){return t in this.data}keys(){return this.order}getAndRemove(t){if(!this.has(t))return null;const n=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),n}get(t){return this.has(t)?this.data[t]:null}remove(t){return this.has(t)?(delete this.data[t],this.order.splice(this.order.indexOf(t),1),this):this}setMaxSize(t){for(this.max=t;this.order.length>this.max;)this.getAndRemove(this.order[0]);return this}}\n/*!\n * based on @mapbox/tiny-sdf\n * https://github.com/mapbox/tiny-sdf\n * @License BSD 2-Clause\n */var oh=1e20;function ah(t,n,e,r,i,s,o){this.fontSize=t||24,this.buffer=void 0===n?3:n,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=s||"normal",this.fontStyle=o||"normal",this.radius=e||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas="undefined"==typeof document?new OffscreenCanvas(a,a):document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0}),this.ctx.font=this.fontStyle+" "+this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function uh(t,n,e,r,i,s){for(var o=0;o<n;o++)hh(t,o,n,e,r,i,s);for(var a=0;a<e;a++)hh(t,a*n,1,n,r,i,s)}function hh(t,n,e,r,i,s,o){var a,u,h,l;for(s[0]=0,o[0]=-oh,o[1]=oh,a=0;a<r;a++)i[a]=t[n+a*e];for(a=1,u=0,h=0;a<r;a++){do{h=(i[a]-i[l=s[u]]+a*a-l*l)/(a-l)/2}while(h<=o[u]&&--u>-1);s[++u]=a,o[u]=h,o[u+1]=oh}for(a=0,u=0;a<r;a++){for(;o[u+1]<a;)u++;t[n+a*e]=i[l=s[u]]+(a-l)*(a-l)}}ah.prototype.draw=function(t,n,e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.textBaseline="top",this.ctx.fillText(t,this.buffer,this.buffer);for(var r=this.ctx.getImageData(0,0,n,e),i=new Uint8ClampedArray(n*e),s=0;s<n*e;s++){var o=r.data[4*s+3]/255;this.gridOuter[s]=1===o?0:0===o?oh:Math.pow(Math.max(0,.5-o),2),this.gridInner[s]=1===o?oh:0===o?0:Math.pow(Math.max(0,o-.5),2)}for(uh(this.gridOuter,n,e,this.f,this.v,this.z),uh(this.gridInner,n,e,this.f,this.v,this.z),s=0;s<n*e;s++){var a=Math.sqrt(this.gridOuter[s])-Math.sqrt(this.gridInner[s]);i[s]=Math.round(255-255*(a/this.radius+this.cutoff))}return i};let lh=0;class ch{constructor(t,n=15,e){this.entries={},this.jt={},this.Ut=new sh(2048,(function(){})),this.Nt=t,this.Lt=n,this.Vt=e}getGlyphs(t,n){if(!t||!Object.keys(t).length)return void n(null,{glyphs:null});const e=this.entries,r=t.options;let i=!0;r&&(i=!1!==r.isCharsCompact),i=i||this.Vt;const s=(r,s,a)=>{let u=0,h=0;for(const n in t)if("options"!==n){e[n]=e[n]||{},s[n]=s[n]||{};for(const l in t[n]){if(h++,h<=r)continue;const t=n.split(" "),c=i&&"normal"===t[0]&&!Na(+l),f=n+":"+l+":"+c;let d;if(this.Ut.has(f)?d=this.Ut.get(f):(d=this.Rt(e[n],t,l,c),this.Ut.add(f,d),u++),d=fh(d),s[n][l]=d,a.push(d.bitmap.data.buffer),this.Nt&&u>this.Lt)return void this.Nt(o(h,s,a))}}n(null,{glyphs:s,buffers:a})};function o(t,n,e){return()=>{s(t,n,e)}}s(0,{},[])}Rt(t,n,e,r){const i=n[0],s=n[1],o=n.slice(3).join(" ");let a=t.tinySDF,u="normal"!==i?5:2;const h=r?-1:2;if(!a){let n="400";/bolder/i.test(s)?n="1000":/bold/i.test(s)?n="900":/medium/i.test(s)?n="500":/light/i.test(s)&&(n="200"),a=t.tinySDF=new ah(24,u,8,.25,o,n,i)}const l=String.fromCharCode(e),c=a.ctx.measureText(l),f=Math.round(c.width),d=a.draw(String.fromCharCode(e),f+2*u,24+2*u);if(lh<4){const t="undefined"!=typeof document&&document.getElementById("sdf-debug-"+lh++);t&&(t.width=f+2*u,t.height=a.canvas.height,t.getContext("2d").drawImage(a.canvas,0,0))}return{charCode:e,bitmap:{width:f+2*u,height:24+2*u,data:d},metrics:{width:f,height:24,left:1,top:-u,advance:f+u+h}}}}function fh(t){const n={width:t.bitmap.width,height:t.bitmap.height,data:new Uint8ClampedArray(t.bitmap.data)};return{charCode:t.charCode,bitmap:n,metrics:ur({},t.metrics)}}var dh=Object.freeze({__proto__:null,clipPolygon:Lu,calculateSignedArea:kr,getFeaAltitudeAndHeight:_r,generatePickingIndiceIndex:$r,convertRTLText:Qa,packPosition:Tr,unpackPosition:function(t,n,e,r){const i=(Math.sign(n)||1)*(Math.abs(n)%zr),s=(Math.sign(e)||1)*(Math.abs(e)%zr),o=Math.floor(Math.abs(n)/zr),a=Math.floor(Math.abs(e)/zr);return t[0]=i,t[1]=s,t[2]=Math.sign(r+1e-5)*(2*o+a)*Dr+r,t},convertGeometry:ar,getPosArrayType:ir,getUnsignedArrayType:sr,getIndexArrayType:rr});const ph={},yh={},mh=[];Object.freeze({__proto__:null,loadSymbolFnTypes:function t(n,e){if(!n)return null;var r=!1;if(Array.isArray(n)){var i,s=[];for(let o=0;o<n.length;o++)(i=t(n[o],e))?(s.push(i),r=!0):s.push(n[o]);return r?s:n}var o={__fn_types_loaded:!0};const a=[];for(const t in n)yr(n,t)&&a.push(t);const u=function(t){Object.defineProperty(o,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=p(this["_"+t])),this["__fn_"+t].apply(this,e())},set:function(n){this["_"+t]=n},configurable:!0,enumerable:!0})},h={},l=function(t,n){Object.defineProperty(o,t,{get:function(){this["__fn_"+t]||(this["__fn_"+t]=Lo(this["_"+t],n));const r=e()[0];h.zoom=r;try{return this["__fn_"+t].evaluateWithoutErrorHandling(h,ph,yh,null,mh)}catch(t){return null}},set:function(n){this["_"+t]=n},configurable:!0,enumerable:!0})};for(let t=0,e=a.length;t<e;t++){const e=a[t];if(d(n[e]))r=!0,o["_"+e]=n[e],u(e);else if(Vo(n[e])){r=!0;const t=Go(e);o["_"+e]=n[e],l(e,t)}else o[e]=n[e]}return r?o:n}});const gh={polygonPatternFile:1,markerFile:1,markerPlacement:1,markerSpacing:1,textName:1,textStyle:1,textFaceName:1,textWeight:1,textPlacement:1,textSpacing:1,lineJoin:1,lineCap:1,linePatternFile:1};Object.assign({visible:1,textHorizontalAlignment:1,textVerticalAlignment:1,textWrapWidth:1,markerHorizontalAlignment:1,markerVerticalAlignment:1},gh),Object.assign({lineDasharray:1,topPolygonFill:1,bottomPolygonFill:1},gh);new Float32Array([-1e12])[0];const vh="maptalks_ombb";function bh(t,n,e,r,i,s,o,a,u,h,l,c,f,d,p,y,m){const g=n.length,v=i/3;for(let e=2,r=g;e<r;e+=3)t[i+e-2]=n[e-2],t[i+e-1]=n[e-1],t[i+e-0]=n[e]-o;i+=g;for(let e=2,r=g;e<r;e+=3)t[i+e-2]=n[e-2],t[i+e-1]=n[e-1],t[i+e-0]=n[e]-a;i+=g,t.trySetLength(i+g),t.copyWithin(i,i-2*g,i-g),i+=g,t.trySetLength(i+g),t.copyWithin(i,i-2*g,i-g),i+=g,(e=e||[]).push(g/3);for(let n=0;n<e.length;n++){wh(v+(e[n-1]||0),v+e[n],t,g/3,u,r,h,l,c,f,s,d,p,y,m)}return i}function wh(t,n,e,r,i,s,o,a,u,h,l,c,f,d,p){const y=s.length;let m,g;for(let o=t,a=n;o<a-1;o++)m=o,g=o+1,i!==1/0&&at(e,m,g,i)||((o-t)%2==1&&(m+=2*r,g+=2*r),p?(s.push(m+r,g,m),s.push(g+r,g,m+r)):(s.push(m+r,m,g),s.push(g,g+r,m+r)));o&&function(t,n,e,r,i,s,o,a,u,h,l){let c,f=0,d=0,p=0,y=0;const m=l?[1,3,4]:[2,3,4];for(let l=s.length-1;l>=0;l--){const g=s[l],v=3*g+1,b=3*g+2,w=i[3*g],M=i[v],x=i[b];f||d||(f=Math.max(i[b],i[3*s[l-3]+2]),d=Math.min(i[b],i[3*s[l-3]+2]),c=f-d);let F=p;const A=l%6;0===t?(5===A&&(y=jt(i,s,l,w,M)),F=A===m[0]||A===m[1]||A===m[2]?p:p+y):1===t&&(A===m[0]||A===m[1]||A===m[2]?F=0:5===A?(y=jt(i,s,l,w,M),F=y):F=y);const k=F/u*(1/(100*h))/o;let P;P=1===n?x===f?1:0:"bottom"===e?x===f?c/100/a:0:x===f?0:-c/100/a,r[2*g]=k,r[2*g+1]=P,0===A&&(p+=y)}}(a,u,h,l,e,s.slice(y,s.length),c[0],c[1],f,d,p)}function Mh(t){const n=[t[0]];let e=t[0];for(let r=1;r<t.length;r++)Array.isArray(t[r])?t[r][0]===e[0]&&t[r][1]===e[1]&&t[r][2]===e[2]||n.push(t[r]):t[r].x===e.x&&t[r].y===e.y&&t[r].z===e.z||n.push(t[r]),e=t[r];return n}const xh=Qo.getInstance();function Fh(t,n,e,r,i,s,o,a,u,h,l,c,f,m,g,v){void 0===n.top&&(n.top=!0),void 0===n.side&&(n.side=!0),xh.reset();const{altitudeScale:b,altitudeProperty:w,defaultAltitude:M,heightProperty:F,minHeightProperty:A,defaultHeight:k,tangent:_,uv:O,topUVMode:E,sideUVMode:I,sideVerticalUVMode:$,top:C,side:T,textureYOrigin:z,topThickness:D}=n,j=!!v,U=function(t,n,{altitudeScale:e,altitudeProperty:r,defaultAltitude:i,heightProperty:s,minHeightProperty:o,defaultHeight:a},{center:u,side:h,top:l,topThickness:c,uvOrigin:f,uv:d,uvSize:p,topUVMode:y,sideUVMode:m,sideVerticalUVMode:g,textureYOrigin:v,tileRatio:b,centimeterToPoint:w,verticalCentimeterToPoint:M,positionType:F,res:A,glScale:k,projectionCode:S},_,O){let E=n/t[0].extent;n===1/0&&(E=1);const I=n===1/0,$=O.get(),C=O.get(),T=O.get(),z=O.get(),D=O.get(),j=O.get(),U=O.get(),N=!!d,L=!!l,V=!!h,R=N?O.get():null;function H(t,e,r,i,s,o){let a=e;if(L){const i=Ne(z,r,3);if(0===i.length)return e;if(P(D,z),e+=z.length,o)for(let n=2,e=i.length;n<e;n+=3)i[n]+=t/3,i[n-1]+=t/3,i[n-2]+=t/3;else{let n;for(let e=2,r=i.length;e<r;e+=3)n=i[e-1],i[e-1]=i[e]+t/3,i[e]=n+t/3,i[e-2]+=t/3}P(j,i),N&&zt(y||0,t,e,R,D,f,w,b,p[0],p[1],s,A,k,S,u),c>0&&!V&&(e=bh(D,z,r,j,e,R,0,c,n,N,m||0,g||0,v,p,b,M,o)),U.setLength(e/3),U.fill(1,a/3,e/3)}if(V){L&&(c=0),a=e,e=bh(D,z,r,j,e,R,c,i,n,N,m||0,g||0,v,p,b,M,o),U.setLength(e/3);const t=z.length/3;U.fill(1,a/3,a/3+t),U.fill(0,a/3+t,a/3+2*t),U.fill(1,a/3+2*t,a/3+3*t),U.fill(0,a/3+3*t,e/3)}return e}let W=0,q=0;const G=[-1,-1,n+1,n+1];let B=0,J=t.length;x(_)&&(B=_,J=_+1);let X=0,Y=!1;const Z=O.get();for(;B<J;B++){const u=t[B],h=u.id;x(h)&&(Math.abs(h)>X&&(X=Math.abs(h)),h<0&&(Y=!0));const l=u.geometry,c=u.properties[vh];let f=Array.isArray(c&&c[0]&&c[0][0])?c[0]:c;const{altitude:d,height:p}=dh.getFeaAltitudeAndHeight(u,e,r,i,s,a,o);W=Math.max(Math.abs(d),W);const y=D.length;let m=0,g=q;Z.setLength(0),z.setLength(0);const v=dh.calculateSignedArea(l[0])<0;for(let t=0,e=l.length;t<e;t++){let r=l[t];v&&(r=r.reverse()),r=Mh(r);const i=dh.calculateSignedArea(r)<0;if(!i&&t>0&&(m++,f=c&&c[m],q=H(g,q,Z,p*E,f,I),z.setLength(0),Z.setLength(0),g=q),n!==1/0&&(r=dh.clipPolygon(r,G)),!r.length){t===e-1&&(q=H(g,q,Z,p*E,f,I));continue}const s=r.length;Array.isArray(r[0])?r[0][0]===r[s-1][0]&&r[0][1]===r[s-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[s-1].x&&r[0].y===r[s-1].y||r.push(r[0]),i&&Z.push(z.length/3),ot(z,z.length,r,E,d,!1,F),t===e-1&&(q=H(g,q,Z,p*E,f,I))}const b=D.length-y,w="__fea_idx".trim();for(let t=0;t<b/3;t++)C.push(void 0===u[w]?B:u[w]),$.push(B),x(h)&&T.push(h)}const K=dh.getUnsignedArrayType(C.length?C[C.length-1]:0),Q={maxAltitude:W,vertices:D,verticeTypes:U,indices:j,pickingIds:Qo.createTypedArray(C,K),featureIndexes:$};if(T.length){const t=Y?dh.getPosArrayType(X):dh.getUnsignedArrayType(X);Q.featureIds=Qo.createTypedArray(T,t)}else Q.featureIds=[];return R&&(R.setLength(D.length/3*2),Q.uvs=R),Q}(t,e,{altitudeScale:b,altitudeProperty:w,defaultAltitude:M||0,heightProperty:F,minHeightProperty:A,defaultHeight:k||0},{center:v,top:C,side:T,topThickness:10*D||0,uv:O||_,uvSize:[i,i],uvOrigin:r,topUVMode:E,sideUVMode:I,sideVerticalUVMode:$,textureYOrigin:z,tileRatio:a,centimeterToPoint:u,verticalCentimeterToPoint:h,positionType:g,res:s,glScale:o,projectionCode:f},m,xh),N=[],L=U.vertices.length/3,V=dh.getIndexArrayType(L),R=Qo.createTypedArray(U.indices,V);delete U.indices,N.push(R.buffer,U.pickingIds.buffer);const H=_?xh.get():new Float32Array(3*L);H.setLength&&H.setLength(3*L);const W=ne(U.vertices,R,H);let q=!0;for(let t=0;t<W.length;t++){j||(W[t]=-W[t]);const n=W[t]%1;1-Math.abs(n)>1e-6?q=!1:0!==n&&(W[t]=Math.round(W[t]))}if(U.normals=W,_){let t=xh.get();t.setLength(4*L),t=function(t,n,e,r,i){const s=t.length/3,o=i||new Array(4*s),a=[],u=[];for(let t=0;t<s;t++)a[t]=[0,0,0],u[t]=[0,0,0];const h=[0,0,0],l=[0,0,0],c=[0,0,0],f=[0,0],d=[0,0],p=[0,0],y=[0,0,0],m=[0,0,0];function g(n,r,i){le(h,t,3*n),le(l,t,3*r),le(c,t,3*i),ce(f,e,2*n),ce(d,e,2*r),ce(p,e,2*i);const s=l[0]-h[0],o=c[0]-h[0],g=l[1]-h[1],v=c[1]-h[1],b=l[2]-h[2],w=c[2]-h[2],M=d[0]-f[0],x=p[0]-f[0],F=d[1]-f[1],A=p[1]-f[1],k=1/(M*A-x*F);ft(y,(A*s-F*o)*k,(A*g-F*v)*k,(A*b-F*w)*k),ft(m,(M*o-x*s)*k,(M*v-x*g)*k,(M*w-x*b)*k),dt(a[n],a[n],y),dt(a[r],a[r],y),dt(a[i],a[i],y),dt(u[n],u[n],m),dt(u[r],u[r],m),dt(u[i],u[i],m)}for(let t=0,n=r.length;t<n;t+=3)g(r[t+0],r[t+1],r[t+2]);const v=[],b=[],w=[],M=[];let x,F,A;function k(t){le(w,n,3*t),ct(M,w),F=a[t],ct(v,F),gt(v,v,function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}(w,w,yt(w,F))),pt(v,v),mt(b,M,F),A=yt(b,u[t]),x=A<0?-1:1,o[4*t]=v[0],o[4*t+1]=v[1],o[4*t+2]=v[2],o[4*t+3]=x}for(let t=0,n=r.length;t<n;t+=3)k(r[t+0]),k(r[t+1]),k(r[t+2]);return o}(U.vertices,U.normals,U.uvs,R,t),t=function(t,n){const e=new Float32Array(n.length),r=[],i=[],s=[];for(let o=0;o<n.length;o+=4){const a=o/4*3;ft(i,t[a]||0,t[a+1]||0,t[a+2]||0),bt(r,n[o]||0,n[o+1]||0,n[o+2]||0,n[o+3]||0),Qn(s,i,r),vt(e.subarray(o,o+4),s)}return e}(U.normals,t),U.tangents=t,N.push(t.buffer),delete U.normals}if(U.normals&&(q&&(U.normals=Qo.createTypedArray(U.normals,Int8Array)),N.push(U.normals.buffer)),U.uvs){const t=U.uvs;U.uvs=Qo.createTypedArray(t,Float32Array),N.push(U.uvs.buffer)}if(v){const t=U.vertices;for(let n=0;n<t.length;n+=3)t[n]-=v[0],t[n+1]-=v[1]}const G=g||dh.getPosArrayType(Math.max(512,U.maxAltitude)),B=function(t,n,e,r){const i={},s={};if(S(n.polygonFill)){let o=y(n.polygonFill);const a=new Uint8Array(4*r.length);a.fill(255);for(let n=0;n<r.length;n++){const s=t[r[n]],u=s.properties||{};u.$layer=s.layer,u.$type=s.type;let h=o(e,u);d(h)&&(i.aColor=1,o=y(h),h=o(e,u)),delete u.$layer,delete u.$type,Ar.normalizeColor(Ah,h),a[4*n]=Ah[0],a[4*n+1]=Ah[1],a[4*n+2]=Ah[2],a[4*n+3]=Ah[3]}s.aColor=a}if(S(n.polygonOpacity)){let o=p(n.polygonOpacity);const a=new Uint8Array(r.length);a.fill(255);for(let n=0;n<r.length;n++){const s=t[r[n]],u=s.properties||{};u.$layer=s.layer,u.$type=s.type;let h=o(e,u);d(h)&&(i.aOpacity=1,o=y(h),h=o(e,u)),delete u.$layer,delete u.$type,a[n]=255*h}s.aOpacity=a}return s.dynamicAttributes=i,s}(t,l,c,U.featureIndexes),J=function(t,n,e,r,i){const s=[[],[]],o=S(r.topPolygonFill),a=S(r.bottomPolygonFill),u=[255,255,255,255];if(o||a){let h=o&&y(r.topPolygonFill),l=a&&y(r.bottomPolygonFill),c=null,f=null,p=null,m=null;for(let r=0;r<n.length;r++){if(1===t[r]&&!o||0===t[r]&&!a)continue;const g=1===t[r];if(g&&n[r]===c){t[r]=p;continue}if(!g&&n[r]===f){t[r]=m;continue}const v=e[n[r]],b=v.properties||{};b.$layer=v.layer,b.$type=v.type;let w=g?h:l,M=w(i,b);d(M)&&(w=y(M),M=w(i,b)),delete b.$layer,delete b.$type,Ar.normalizeColor(Ah,M),wt(Ah,Ah,u);let x=kh(s,Ah);x<0&&(x=s.length,s.push(vt([],Ah))),t[r]=x,g?(c=n[r],p=x):(f=n[r],m=x)}}return s.slice(2)}(U.verticeTypes,U.featureIndexes,t,l,c),X={data:{data:{aVertexColorType:J.length<=252?Qo.createTypedArray(U.verticeTypes,Uint8Array):Qo.createTypedArray(U.verticeTypes,Uint16Array),aPosition:Qo.createTypedArray(U.vertices,G),aNormal:U.normals,aTexCoord0:U.uvs,aTangent:U.tangents,aPickingId:U.pickingIds},indices:R,properties:{maxAltitude:U.maxAltitude},dynamicAttributes:B.dynamicAttributes,vertexColors:J},buffers:N};return U.featureIds.length?(X.data.featureIds=U.featureIds,N.push(X.data.featureIds.buffer)):X.data.featureIds=[],B.aColor&&(X.data.data.aColor=B.aColor,X.buffers.push(B.aColor.buffer)),B.aOpacity&&(X.data.data.aOpacity=B.aOpacity,X.buffers.push(B.aOpacity.buffer)),X.buffers.push(X.data.data.aPosition.buffer),X.data.pickingIdIndiceMap=dh.generatePickingIndiceIndex(X.data.data.aPickingId,X.data.indices),X}const Ah=[];function kh(t,n){for(let e=0;e<t.length;e++)if(xt(n,t[e]))return e;return-1}function Ph(t,n,e,r,{altitudeScale:i,altitudeProperty:s,defaultAltitude:o,heightProperty:a,minHeightProperty:u,defaultHeight:h,bottom:l}){const c=l,f=n/t[0].extent,p=2*function(t,n){let e=0;for(let r=0,i=t.length;r<i;r++){const i=t[r];if(x(i.geometry[0][0])){const t=3*i.geometry.length;e+=n?2*t-6:t}else for(let t=0,r=i.geometry.length;t<r;t++){let r=3*i.geometry[t].length;3===i.type&&(r-=3),e+=n?2*r-6:r}}return e}(t)+3*t.length*2,y=[],m=new Int16Array(p),g=new Uint8Array(m.length/3*4);d(e)&&(e=Bo.compileFilter(e));const v=[];function b(t,e,r){const i=e-t,s=m.subarray(t,e),o=m.subarray(e,e+i);o.set(s);for(let t=2,n=o.length;t<n;t+=3)o[t]=s[t]-r;const a=t/3,u=i/3;let h,l;for(let t=a,e=u+a;t<e;t++)t<e-1?(h=t,l=t+1):(h=t,l=a),at(m,h,l,n)||(v.push(h,l),c&&v.push(h+u,l+u),Sh(m,h,n)||v.push(h,h+u));return e+i}let w=0,M=0;const F="__fea_idx".trim(),A=[];for(let n=0,l=t.length;n<l;n++){const l=t[n],c=l.geometry;if(e){let t;t="function"==typeof e?e(l&&l.properties):e,Ar.normalizeColor(A,t)}else ft(A,255,255,255);const d=w/3*4,{altitude:p,height:x}=dh.getFeaAltitudeAndHeight(l,i,s,o,a,h,u);M=Math.max(Math.abs(p),M);let k=w;for(let t=0,n=c.length;t<n;t++){let n=c[t];const e=n.length;n[0][0]===n[e-1][0]&&n[0][1]===n[e-1][1]&&(n=n.slice(0,e-1)),w=ot(m,k,n,f,p),w=b(k,w,x*f),k=w}const P=k/3*4;for(let t=d;t<P;t+=4)g[t]=A[0],g[t+1]=A[1],g[t+2]=A[2],g[t+3]=255*(r||1);const S=v.length-y.length;for(let t=0;t<S;t++)y.push(l[F])}const k=v.reduce((t,n)=>Math.max(t,n),0),P=new(dh.getIndexArrayType(k))(v),S=dh.getUnsignedArrayType(t.length);return{aPosition:new(dh.getPosArrayType(Math.max(512,M)))(m),indices:P,aPickingId:new S(y),aColor:g}}function Sh(t,n,e){const r=t[3*n],i=t[3*n+1];return r<0||r>e||i<0||i>e}function _h(t,n,e,r){const i=Ph(t,n,e.lineColor,e.lineOpacity,r),s=[i.aPosition.buffer,i.indices.buffer,i.aPickingId.buffer],o=i.indices;return delete i.indices,{data:{data:i,indices:o},buffers:s}}let Oh=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),Oh=!0}catch(t){Oh=!1}var Eh=Oh;const Ih="__original_properties",$h="__fn-type_properties";class Ch{constructor(t,n,e,r,i){this.id=t,this.options=n,this.upload=e,this.Ht(n.style),this.requests={},this.Ut=r,this.Wt=0,this.loadings=i}updateStyle(t,n){this.options.style=t,this.Wt=t.styleCounter,this.Ht(t),n()}updateOptions(t,n){this.options=w(this.options,t),n()}loadTile(t,n){const e=this.loadings,r=t.tileInfo.url,i=this.options.debugTile;if(i){const{x:e,y:r,z:s}=t.tileInfo;let o=!1;for(let t=0;t<i.length;t++)if(e===i[t].x&&r===i[t].y&&s===i[t].z){o=!0;break}if(!o)return void n()}if(e[r])return void e[r].push({context:t,callback:n,ref:this});e[r]=[{context:t,callback:n,ref:this}];const s=this.options.featureIdProperty;this.requests[r]=this.getTileFeatures(t,(n,i,o,a)=>{const u=e[r];if(delete e[r],this.checkIfCanceled(r))return delete this.requests[r],void this.qt(u,null,{canceled:!0});if(delete this.requests[r],(this.options.debug||s)&&i)for(let n=0;n<i.length;n++)if(this.options.debug&&(i[n]._debug_info={index:n,id:i[n].id,tileId:t.tileInfo.id}),s){const t=A(s)?s[i[n].layer]:s,e=i[n].properties;i[n].id=e&&e[t]||null}if(n)this.qt(u,n);else if(i&&i.length){if(u)for(let t=0;t<u.length;t++)this.Gt.call(u[t].ref,u[t].context,u[t].callback,r,o,i,a)}else this.qt(u)})}Gt(t,n,e,r,i,s){this.Bt(r,i,t).then(e=>{e.canceled?n(null,{canceled:!0}):(e.data.style=t.styleCounter,s&&w(e.data,s),n(null,e.data,e.buffers))}).catch(t=>{n(t)})}abortTile(t,n){delete this.requests[t],this.Jt(t),n()}Jt(t){const n=this.loadings[t];if(n)for(let t=0;t<n.length;t++)n[t].callback(null,{canceled:!0});delete this.loadings[t]}qt(t,n,e){if(t)for(let r=0;r<t.length;r++)t[r].callback(n,e)}checkIfCanceled(t){return!this.requests[t]}onRemove(){this.loadings={},delete this.Ut,this.requests={}}fetchIconGlyphs(t,n,e){if(this.options.workerGlyph&&Eh){const r=[];if(t&&Object.keys(t).length){const n=new Promise(n=>{this.upload("fetchIconGlyphs",{icons:t},null,(t,e)=>{n({err:t,iconData:e})})});r.push(n)}if(n&&Object.keys(n).length){const t=new Promise(t=>{this.Xt||(this.Xt=new ch),this.Xt.getGlyphs(n,(n,e)=>{t({err:n,glyphData:e})})});r.push(t)}Promise.all(r).then(t=>{const n={icons:null,glyphs:null};for(let r=0;r<t.length;r++){if(t[r].err)return void e(t[r].err);t[r].iconData?n.icons=t[r].iconData.icons:t[r].glyphData&&(n.glyphs=t[r].glyphData.glyphs)}return n}).then(t=>{e(null,t)})}else this.upload("fetchIconGlyphs",{icons:t,glyphs:n},null,e)}Bt(t,n,e){if(!n.length)return Promise.resolve({data:null,buffers:[]});const{glScale:r,tileInfo:i}=e,s=!this.options.style.style.length&&!this.options.style.featureStyle.length;let o=this.pluginConfig.slice(0);s&&(o=this.Yt(t)),this.featurePlugins&&P(o,this.featurePlugins);const a={};for(let t=0;t<o.length;t++)Lh(n,e.tileInfo.z,o[t],a);const u=[],h=[];for(let t=0;t<n.length;t++){const e=n[t],r=a[t];if(r){h.fill(null);let t=0;for(const n in r){let i=0;const s=r[n].values();for(const t of s){let r=h[i];r||(r=Wh(e),h[i]=r),r.properties[n]=t,i++}i>t&&(t=i)}for(let n=0;n<t;n++)u.push(h[n])}else u.push(e)}const l=(n=u)[0].extent,c=i.z,f={x:i.extent2d.xmin*r,y:i.extent2d.ymax*r},d=[],p=[],y=[],m=this.options,g=[],v={},b=[Promise.resolve(e.styleCounter)];let M=0,x=-1;const F=[];let A=!1;for(let t=0;t<o.length;t++){x++;const r=o[t];r.type!==M&&(x=0,M=r.type);const a=0===r.type?d:p;if(r.symbol&&!1===r.symbol.visible){a[x]=null;continue}Bh(r.symbol,F,t),A=A||F[t]&&F[t].size>0;const{tileFeatures:u,tileFeaIndexes:h}=this.Zt(c,r.type,r.filter,n,v,t);if(!u.length){a[x]=null;continue}const m=h[h.length-1],k=dh.getIndexArrayType(m);a[x]={styledFeatures:new k(h)},y.push({idx:t,typeIdx:x}),g.push(a[x].styledFeatures.buffer);const P=w({},e,{extent:l,zoom:c,tilePoint:f});if(this.options.debugTile){const t=this.options.debugTile;for(let n=0;n<t.length;n++){const{x:e,y:r,z:s}=t[n];if(i.x===e&&i.y===r&&i.z===s){P.debugIndex=t[n].index;break}}}let S=this.Kt(u,r,P);s&&(S=S.then(t=>{if(!t)return null;if(t.data)t.data.layer=u[0].layer;else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]&&t[n].data&&(t[n].data.layer=u[0].layer);return t})),b.push(S)}return Promise.all(b).then(([e,...r])=>{function i(t,n){if(void 0===t.data.ref&&(t.data.type=o[y[n].idx].renderPlugin.dataConfig.type,t.data.filter=o[y[n].idx].filter.def,t.buffers&&t.buffers.length))for(let n=0;n<t.buffers.length;n++)g.push(t.buffers[n])}if(e!==this.Wt)return{canceled:!0};for(let t=0;t<r.length;t++){if(!r[t])continue;const n=r[t],e=0===o[y[t].idx].type?d:p;if(Array.isArray(n)){const r=[];for(let e=0;e<n.length;e++)n[e]&&(i(n[e],t),(void 0===n[e].data.ref||n[n[e].data.ref])&&r.push(n[e].data));r.length&&(e[y[t].typeIdx].data=r)}else i(n,t),e[y[t].typeIdx].data=n.data}const s={},a=t;if(m.features||m.schema||A){let t,e=!1;for(let r=0,i=n.length;r<i;r++)if(t=n[r],a[t.layer].properties||(a[t.layer].properties=Dh(t.properties)),t&&(m.features||A&&v[r]))if("id"===m.features)s[r]=t.id;else{m.pickingGeometry||delete t.geometry,delete t.extent,delete t.properties.$layer,delete t.properties.$type,delete t.__index;const n=t.originalFeature;if(n){const n=t.properties,e=w({},t.originalFeature);delete n[Ih],e.customProps=w({},n),t=e}const i=w({},t);if(!m.features){const i=v[r];for(let r=0;r<i.length;r++){const i=F[r];i&&i.forEach(r=>{const i=n?n.properties:t.properties;i[$h]||(i[$h]=new Set),i[$h].add(r),e=!0})}}s[r]=i}if(e)for(const t in s){const n=s[t];if(n.properties[$h]){const t=n.properties[$h];delete n.properties[$h];for(const e in n.properties)t.has(e)||delete n.properties[e]}}}return{data:{schema:a,data:d,featureData:p,extent:l,features:s},buffers:g}}).catch(t=>{console.error(t)})}Kt(t,n,e){let r=t;const i=n.renderPlugin.dataConfig,s=n.symbol,o=this.options.tileSize,{extent:a,glScale:u,zScale:h,zoom:l,tilePoint:c,centimeterToPoint:f,verticalCentimeterToPoint:d}=e,p=a/o,y=i.type,m=e.debugIndex;let g=w({},i,{EXTENT:a,zoom:l,debugIndex:m,features:this.options.features});if("3d-extrusion"===y){const t=jh(s);t&&(i.uv=1,2===t&&(i.tangent=1));const n=this.options.projectionCode,o=s.material&&s.material.textureWidth||23.25;return Promise.all([Promise.resolve(Fh(r,i,a,c,o,e.tileInfo.res,u,a/this.options.tileSize,f,d,s,l,n,m))])}if("3d-wireframe"===y)return Promise.all([Promise.resolve(_h(r,a,s,i))]);if("point"===y){g=w(g,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:h*a/this.options.tileSize/u});const t=vu.splitPointSymbol(s),n=oa.genFnTypes(t[0]);return vu.needMerge(t[0],n,l)&&(r=vu.mergeLineFeatures(r,t[0],n,l)),Promise.all(t.map((t,e)=>(0===e?g.fnTypes=n:delete g.fnTypes,new vu(r,t,g).load(p))))}if("native-point"===y){const t=h*a/this.options.tileSize/u;return g.altitudeToTileScale=t,Uh(r,s,g,ju,a/o)}if("line"===y)return g=w(g,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:p}),Uh(r,s,g,ku);if("native-line"===y)return Uh(r,s,g,zu);if("fill"===y)return g=w(g,{requestor:this.fetchIconGlyphs.bind(this)}),Uh(r,s,g,Wu);if("line-extrusion"===y){delete s.lineGradientProperty,s.lineJoin="miter",s.lineCap="butt";const t=jh(s);if(t&&(i.uv=1,2===t&&(i.tangent=1)),g=w(g,{tileSize:o,zScale:h,glScale:u}),t){const t=[];if(!1!==i.top){const n=w({},g);n.side=!1,t.push(new Cu(r,s,n))}return!1!==i.side&&(g.side=!0,g.top=!1,t.push(new Cu(r,s,g))),Promise.all(t.map(t=>t.load()))}return Promise.all([new Cu(r,s,g).load()])}if("circle"===y)return Uh(r,s,g,Gu);if("round-tube"===y||"square-tube"===y){const t="round-tube"===y?Bu:Qu;return g=w(g,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:"round-tube"===y?i.radialSegments||8:4,centimeterToPoint:f,verticalCentimeterToPoint:d,tileRatio:p,isTube:!0}),Uh(r,s,g,t)}return Promise.resolve([])}Zt(t,n,e,r,i,s){const o="__fea_idx".trim(),a=[],u=[],h=r.length;for(let l=0;l<h;l++)if((1===n||void 0===r[l].id||!this.styledFeatures[r[l].id])&&((!e.def||"default"===e.def)&&!i[l]||!0===e.def||e.def&&(void 0!==e.def.condition||Array.isArray(e.def))&&e(r[l],t))){const t=r[l];if(void 0===t[o]&&(t[o]=l),i[l]||(i[l]=[]),i[l].push(s),u.push(t),a.push(l),1===n)break}return{tileFeatures:u,tileFeaIndexes:a}}Ht(t){const{style:n,featureStyle:e}=t,r={};e.forEach(t=>{Array.isArray(t.id)?(t.id.forEach(t=>{r[t]=1}),t.filter=["in","$id",...t.id]):(r[t.id]=1,t.filter=["==","$id",t.id])});const i=Bo.compileStyle(n);for(let t=0;t<n.length;t++)i[t].filter&&(i[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0),i[t].type=0;const s=[],o=Bo.compileStyle(e);for(let t=0;t<e.length;t++)o[t].type=1,o[t].filter.def=e[t].filter?e[t].filter.value||e[t].filter:void 0,o[t].renderPlugin&&s.push(o[t]);this.pluginConfig=i,this.featurePlugins=s,this.styledFeatures=r}Yt(t){let n=this.Qt;this.Qt||(n=this.Qt={});const e=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],r=[];for(const i in t){const s=i;if(!n[i]){const r=[];for(let n=0;n<t[i].types.length;n++){const o=t[i].types[n],a=["all",["==","$layer",s],["==","$type",e[o]]],u={filter:zn(a),renderPlugin:Th(o),symbol:zh(o)};u.filter.def=a,u.type=0,r.push(u)}n[s]=r}r.push(...n[s])}return r}}function Th(t){switch(t){case 1:return{type:"native-point",dataConfig:{type:"native-point",only2D:!0}};case 2:return{type:"native-line",dataConfig:{type:"native-line",only2D:!0}};case 3:return{type:"fill",dataConfig:{type:"fill",only2D:!0}}}return null}function zh(t){switch(t){case 1:return{markerFill:"#f00",markerSize:10};case 2:return{lineColor:"#fff"};case 3:return{polygonFill:"#00f",polygonOpacity:.4}}return null}function Dh(t){if(Array.isArray(t)||!A(t))return{};const n={};for(const e in t){const r=t[e];M(r)?n[e]="string":x(r)?n[e]="number":!0===r||!1===r?n[e]="boolean":Array.isArray(r)?n[e]="array":n[e]="object"}return n}function jh(t){if(!t)return 0;let n=0;for(const e in t){if(("normalTexture"===e||"bumpTexture"===e)&&t[e])return 2;if(e.indexOf("Texture")>0&&t[e])n=1;else if(A(t[e])){const r=jh(t[e]);if(2===r)return r;1===r&&(n=1)}}return n}function Uh(t,n,e,r,i){const s={},o=Array.isArray(n)?n:[n];let a=-1;for(let t=0;t<o.length;t++)s[t]=Nh(o[t]),!s[t]&&o[t]&&-1===a&&(a=t);const u=[];for(let n=0;n<o.length;n++)o[n]&&(o[n].index={index:n},s[n]||n===a?u.push(new r(t,o[n],e).load(i)):u.push({data:{ref:a,symbolIndex:{index:n}}}));return Promise.all(u)}function Nh(t){if(!t)return 0;for(const n in t)if(S(t[n]))return 1;return 0}function Lh(t,n,e,r){const i=e.customProperties;if(!i)return t;if(i)for(let t=0;t<i.length;t++)i[t].fn=Bo.compileFilter(i[t].filter);for(let e=0;e<i.length;e++)for(let s=0,o=t.length;s<o;s++)if(i[e].fn(t[s],n))for(const t in i[e].properties){const n=i[e].properties[t];k(n)||(r[s]||(r[s]={}),r[s][t]||(r[s][t]=new Set),r[s][t].add(n))}}const Vh={get:(t,n)=>n in t?t[n]:t.originalFeature[n],has:(t,n)=>n in t||n in t.originalFeature},Rh={get:function(t,n){return n in t?t[n]:t[Ih][n]},has:(t,n)=>n in t||n in t[Ih]},Hh={};function Wh(t){const n={};n.originalFeature=t;const e=new Proxy(n,Vh);return e.properties=new Proxy({},Rh),e.properties[Ih]=t.properties||Hh,e}function qh(t,n,e){t[n]||(t[n]=new Set),t[n].add(e)}const Gh=[];function Bh(t,n,e){if(!t)return Gh;for(const r in t){if(!t[r]||!Ar.checkIfZoomFnTypeSymbol(r))continue;if(S(t[r]))qh(n,e,t[r].property);else{if("lineGradientProperty"===r){qh(n,e,t[r]);continue}if("textName"===r)if(M(t[r])){const i=pa.resolveVarNames(t[r]);if(i)for(let t=0;t<i.length;t++)qh(n,e,i[t])}else if(Bo.isExpression(t[r])){const i=[];pa.resolveExpVarNames(i,t[r]);for(let t=0;t<i.length;t++)qh(n,e,i[t])}}const i=t[r].stops;if(i&&i.length)for(let t=0;t<i.length;t++)S(i[t][1])&&qh(n,t,i[t][1].property)}return n[e]}function Jh(t,n){Xh(t.geometry,n)}function Xh(t,n){if(t)switch(t.type){case"Point":Yh(t.coordinates,n);break;case"MultiPoint":case"LineString":Zh(t.coordinates,n);break;case"MultiLineString":!function(t,n){for(let e=0,r=t.length;e<r;e++)Zh(t[e],n)}(t.coordinates,n);break;case"Polygon":Kh(t.coordinates,n);break;case"MultiPolygon":!function(t,n){for(let e=0,r=t.length;e<r;e++)Kh(t[e],n)}(t.coordinates,n);break;case"GeometryCollection":const e=t.geometries.length;for(let r=0;r<e;r++)Xh(t.geometries[r],n)}}function Yh(t,n){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.max(n[2],t[0]),n[3]=Math.max(n[3],t[1])}function Zh(t,n){for(let e=0,r=t.length;e<r;e++)Yh(t[e],n)}function Kh(t,n){t.length&&Zh(t[0],n)}function Qh(t,n,e,r,i){!function t(n,e,r,i,s){for(;i>r;){if(i-r>600){var o=i-r+1,a=e-r+1,u=Math.log(o),h=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*h*(o-h)/o)*(a-o/2<0?-1:1),c=Math.max(r,Math.floor(e-a*h/o+l)),f=Math.min(i,Math.floor(e+(o-a)*h/o+l));t(n,e,c,f,s)}var d=n[e],p=r,y=i;for(tl(n,r,e),s(n[i],d)>0&&tl(n,r,i);p<y;){for(tl(n,p,y),p++,y--;s(n[p],d)<0;)p++;for(;s(n[y],d)>0;)y--}0===s(n[r],d)?tl(n,r,y):(y++,tl(n,y,i)),y<=e&&(r=y+1),e<=y&&(i=y-1)}}(t,n,e||0,r||t.length-1,i||nl)}function tl(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function nl(t,n){return t<n?-1:t>n?1:0}class el{constructor(t=9){this.tn=Math.max(4,t),this.nn=Math.max(2,Math.ceil(.4*this.tn)),this.clear()}all(){return this.en(this.data,[])}search(t){let n=this.data;const e=[];if(!pl(t,n))return e;const r=this.toBBox,i=[];for(;n;){for(let s=0;s<n.children.length;s++){const o=n.children[s],a=n.leaf?r(o):o;pl(t,a)&&(n.leaf?e.push(o):dl(t,a)?this.en(o,e):i.push(o))}n=i.pop()}return e}collides(t){let n=this.data;if(!pl(t,n))return!1;const e=[];for(;n;){for(let r=0;r<n.children.length;r++){const i=n.children[r],s=n.leaf?this.toBBox(i):i;if(pl(t,s)){if(n.leaf||dl(t,s))return!0;e.push(i)}}n=e.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this.nn){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let n=this.rn(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this.sn(this.data,n);else{if(this.data.height<n.height){const t=this.data;this.data=n,n=t}this.an(n,this.data.height-n.height-1,!0)}else this.data=n;return this}insert(t){return t&&this.an(t,this.data.height-1),this}clear(){return this.data=yl([]),this}remove(t,n){if(!t)return this;let e=this.data;const r=this.toBBox(t),i=[],s=[];let o,a,u;for(;e||i.length;){if(e||(e=i.pop(),a=i[i.length-1],o=s.pop(),u=!0),e.leaf){const r=rl(t,e.children,n);if(-1!==r)return e.children.splice(r,1),i.push(e),this.un(i),this}u||e.leaf||!dl(e,r)?a?(o++,e=a.children[o],u=!1):e=null:(i.push(e),s.push(o),o=0,a=e,e=e.children[0])}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}en(t,n){const e=[];for(;t;)t.leaf?n.push(...t.children):e.push(...t.children),t=e.pop();return n}rn(t,n,e,r){const i=e-n+1;let s,o=this.tn;if(i<=o)return s=yl(t.slice(n,e+1)),il(s,this.toBBox),s;r||(r=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,r-1))),s=yl([]),s.leaf=!1,s.height=r;const a=Math.ceil(i/o),u=a*Math.ceil(Math.sqrt(o));ml(t,n,e,u,this.compareMinX);for(let i=n;i<=e;i+=u){const n=Math.min(i+u-1,e);ml(t,i,n,a,this.compareMinY);for(let e=i;e<=n;e+=a){const i=Math.min(e+a-1,n);s.children.push(this.rn(t,e,i,r-1))}}return il(s,this.toBBox),s}hn(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){let e,r=1/0,i=1/0;for(let s=0;s<n.children.length;s++){const o=n.children[s],a=hl(o),u=cl(t,o)-a;u<i?(i=u,r=a<r?a:r,e=o):u===i&&a<r&&(r=a,e=o)}n=e||n.children[0]}return n}an(t,n,e){const r=e?t:this.toBBox(t),i=[],s=this.hn(r,this.data,n,i);for(s.children.push(t),ol(s,r);n>=0&&i[n].children.length>this.tn;)this.cn(i,n),n--;this.dn(r,i,n)}cn(t,n){const e=t[n],r=e.children.length,i=this.nn;this.pn(e,i,r);const s=this.yn(e,i,r),o=yl(e.children.splice(s,e.children.length-s));o.height=e.height,o.leaf=e.leaf,il(e,this.toBBox),il(o,this.toBBox),n?t[n-1].children.push(o):this.sn(e,o)}sn(t,n){this.data=yl([t,n]),this.data.height=t.height+1,this.data.leaf=!1,il(this.data,this.toBBox)}yn(t,n,e){let r,i=1/0,s=1/0;for(let o=n;o<=e-n;o++){const n=sl(t,0,o,this.toBBox),a=sl(t,o,e,this.toBBox),u=fl(n,a),h=hl(n)+hl(a);u<i?(i=u,r=o,s=h<s?h:s):u===i&&h<s&&(s=h,r=o)}return r||e-n}pn(t,n,e){const r=t.leaf?this.compareMinX:al,i=t.leaf?this.compareMinY:ul;this.mn(t,n,e,r)<this.mn(t,n,e,i)&&t.children.sort(r)}mn(t,n,e,r){t.children.sort(r);const i=this.toBBox,s=sl(t,0,n,i),o=sl(t,e-n,e,i);let a=ll(s)+ll(o);for(let r=n;r<e-n;r++){const n=t.children[r];ol(s,t.leaf?i(n):n),a+=ll(s)}for(let r=e-n-1;r>=n;r--){const n=t.children[r];ol(o,t.leaf?i(n):n),a+=ll(o)}return a}dn(t,n,e){for(let r=e;r>=0;r--)ol(n[r],t)}un(t){for(let n,e=t.length-1;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():il(t[e],this.toBBox)}}function rl(t,n,e){if(!e)return n.indexOf(t);for(let r=0;r<n.length;r++)if(e(t,n[r]))return r;return-1}function il(t,n){sl(t,0,t.children.length,n,t)}function sl(t,n,e,r,i){i||(i=yl(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s=n;s<e;s++){const n=t.children[s];ol(i,t.leaf?r(n):n)}return i}function ol(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function al(t,n){return t.minX-n.minX}function ul(t,n){return t.minY-n.minY}function hl(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ll(t){return t.maxX-t.minX+(t.maxY-t.minY)}function cl(t,n){return(Math.max(n.maxX,t.maxX)-Math.min(n.minX,t.minX))*(Math.max(n.maxY,t.maxY)-Math.min(n.minY,t.minY))}function fl(t,n){const e=Math.max(t.minX,n.minX),r=Math.max(t.minY,n.minY),i=Math.min(t.maxX,n.maxX),s=Math.min(t.maxY,n.maxY);return Math.max(0,i-e)*Math.max(0,s-r)}function dl(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function pl(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function yl(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ml(t,n,e,r,i){const s=[n,e];for(;s.length;){if((e=s.pop())-(n=s.pop())<=r)continue;const o=n+Math.ceil((e-n)/r/2)*r;Qh(t,o,n,e,i),s.push(n,o,o,e)}}var gl={exports:{}},vl=function(t,n,e,r){var i=t[0],s=t[1],o=!1;void 0===e&&(e=0),void 0===r&&(r=n.length);for(var a=(r-e)/2,u=0,h=a-1;u<a;h=u++){var l=n[e+2*u+0],c=n[e+2*u+1],f=n[e+2*h+0],d=n[e+2*h+1];c>s!=d>s&&i<(f-l)*(s-c)/(d-c)+l&&(o=!o)}return o},bl=function(t,n,e,r){var i=t[0],s=t[1],o=!1;void 0===e&&(e=0),void 0===r&&(r=n.length);for(var a=r-e,u=0,h=a-1;u<a;h=u++){var l=n[u+e][0],c=n[u+e][1],f=n[h+e][0],d=n[h+e][1];c>s!=d>s&&i<(f-l)*(s-c)/(d-c)+l&&(o=!o)}return o};gl.exports=function(t,n,e,r){return n.length>0&&Array.isArray(n[0])?bl(t,n,e,r):vl(t,n,e,r)};var wl=gl.exports.nested=bl;gl.exports.flat=vl;function Ml(t,n,e,r,i){let s,o,a,u,h=n[0],l=r[0],c=0,f=0;l>h==l>-h?(s=h,h=n[++c]):(s=l,l=r[++f]);let d=0;if(c<t&&f<e)for(l>h==l>-h?(o=h+s,a=s-(o-h),h=n[++c]):(o=l+s,a=s-(o-l),l=r[++f]),s=o,0!==a&&(i[d++]=a);c<t&&f<e;)l>h==l>-h?(o=s+h,u=o-s,a=s-(o-u)+(h-u),h=n[++c]):(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=r[++f]),s=o,0!==a&&(i[d++]=a);for(;c<t;)o=s+h,u=o-s,a=s-(o-u)+(h-u),h=n[++c],s=o,0!==a&&(i[d++]=a);for(;f<e;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=r[++f],s=o,0!==a&&(i[d++]=a);return 0===s&&0!==d||(i[d++]=s),d}function xl(t){return new Float64Array(t)}const Fl=xl(4),Al=xl(8),kl=xl(12),Pl=xl(16),Sl=xl(4);function _l(t,n,e,r,i,s){const o=(n-s)*(e-i),a=(t-i)*(r-s),u=o-a;if(0===o||0===a||o>0!=a>0)return u;const h=Math.abs(o+a);return Math.abs(u)>=33306690738754716e-32*h?u:-function(t,n,e,r,i,s,o){let a,u,h,l,c,f,d,p,y,m,g,v,b,w,M,x,F,A;const k=t-i,P=e-i,S=n-s,_=r-s;w=k*_,f=134217729*k,d=f-(f-k),p=k-d,f=134217729*_,y=f-(f-_),m=_-y,M=p*m-(w-d*y-p*y-d*m),x=S*P,f=134217729*S,d=f-(f-S),p=S-d,f=134217729*P,y=f-(f-P),m=P-y,F=p*m-(x-d*y-p*y-d*m),g=M-F,c=M-g,Fl[0]=M-(g+c)+(c-F),v=w+g,c=v-w,b=w-(v-c)+(g-c),g=b-x,c=b-g,Fl[1]=b-(g+c)+(c-x),A=v+g,c=A-v,Fl[2]=v-(A-c)+(g-c),Fl[3]=A;let O=function(t,n){let e=n[0];for(let r=1;r<t;r++)e+=n[r];return e}(4,Fl),E=22204460492503146e-32*o;if(O>=E||-O>=E)return O;if(c=t-k,a=t-(k+c)+(c-i),c=e-P,h=e-(P+c)+(c-i),c=n-S,u=n-(S+c)+(c-s),c=r-_,l=r-(_+c)+(c-s),0===a&&0===u&&0===h&&0===l)return O;if(E=11093356479670487e-47*o+33306690738754706e-32*Math.abs(O),O+=k*l+_*a-(S*h+P*u),O>=E||-O>=E)return O;w=a*_,f=134217729*a,d=f-(f-a),p=a-d,f=134217729*_,y=f-(f-_),m=_-y,M=p*m-(w-d*y-p*y-d*m),x=u*P,f=134217729*u,d=f-(f-u),p=u-d,f=134217729*P,y=f-(f-P),m=P-y,F=p*m-(x-d*y-p*y-d*m),g=M-F,c=M-g,Sl[0]=M-(g+c)+(c-F),v=w+g,c=v-w,b=w-(v-c)+(g-c),g=b-x,c=b-g,Sl[1]=b-(g+c)+(c-x),A=v+g,c=A-v,Sl[2]=v-(A-c)+(g-c),Sl[3]=A;const I=Ml(4,Fl,4,Sl,Al);w=k*l,f=134217729*k,d=f-(f-k),p=k-d,f=134217729*l,y=f-(f-l),m=l-y,M=p*m-(w-d*y-p*y-d*m),x=S*h,f=134217729*S,d=f-(f-S),p=S-d,f=134217729*h,y=f-(f-h),m=h-y,F=p*m-(x-d*y-p*y-d*m),g=M-F,c=M-g,Sl[0]=M-(g+c)+(c-F),v=w+g,c=v-w,b=w-(v-c)+(g-c),g=b-x,c=b-g,Sl[1]=b-(g+c)+(c-x),A=v+g,c=A-v,Sl[2]=v-(A-c)+(g-c),Sl[3]=A;const $=Ml(I,Al,4,Sl,kl);w=a*l,f=134217729*a,d=f-(f-a),p=a-d,f=134217729*l,y=f-(f-l),m=l-y,M=p*m-(w-d*y-p*y-d*m),x=u*h,f=134217729*u,d=f-(f-u),p=u-d,f=134217729*h,y=f-(f-h),m=h-y,F=p*m-(x-d*y-p*y-d*m),g=M-F,c=M-g,Sl[0]=M-(g+c)+(c-F),v=w+g,c=v-w,b=w-(v-c)+(g-c),g=b-x,c=b-g,Sl[1]=b-(g+c)+(c-x),A=v+g,c=A-v,Sl[2]=v-(A-c)+(g-c),Sl[3]=A;const C=Ml($,kl,4,Sl,Pl);return Pl[C-1]}(t,n,e,r,i,s,h)}function Ol(t,n,e){n=Math.max(0,void 0===n?2:n),e=e||0;var r=function(t){for(var n=t[0],e=t[0],r=t[0],i=t[0],s=0;s<t.length;s++){var o=t[s];o[0]<n[0]&&(n=o),o[0]>r[0]&&(r=o),o[1]<e[1]&&(e=o),o[1]>i[1]&&(i=o)}var a=[n,e,r,i],u=a.slice();for(s=0;s<t.length;s++)wl(t[s],a)||u.push(t[s]);return function(t){t.sort(Vl);for(var n=[],e=0;e<t.length;e++){for(;n.length>=2&&zl(n[n.length-2],n[n.length-1],t[e])<=0;)n.pop();n.push(t[e])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&zl(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),n.pop(),n.concat(r)}(u)}(t),i=new el(16);i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,n){return t[0]-n[0]},i.compareMinY=function(t,n){return t[1]-n[1]},i.load(t);for(var s,o=[],a=0;a<r.length;a++){var u=r[a];i.remove(u),s=jl(u,s),o.push(s)}var h=new el(16);for(a=0;a<o.length;a++)h.insert(Dl(o[a]));for(var l=n*n,c=e*e;o.length;){var f=o.shift(),d=f.p,p=f.next.p,y=Ul(d,p);if(!(y<c)){var m=y/l;(u=El(i,f.prev.p,d,p,f.next.next.p,m,h))&&Math.min(Ul(u,d),Ul(u,p))<=m&&(o.push(f),o.push(jl(u,f)),i.remove(u),h.remove(f),h.insert(Dl(f)),h.insert(Dl(f.next)))}}f=s;var g=[];do{g.push(f.p),f=f.next}while(f!==s);return g.push(f.p),g}function El(t,n,e,r,i,s,o){for(var a=new Bn([],Il),u=t.data;u;){for(var h=0;h<u.children.length;h++){var l=u.children[h],c=u.leaf?Nl(l,e,r):$l(e,r,l);c>s||a.push({node:l,dist:c})}for(;a.length&&!a.peek().node.children;){var f=a.pop(),d=f.node,p=Nl(d,n,e),y=Nl(d,r,i);if(f.dist<p&&f.dist<y&&Tl(e,d,o)&&Tl(r,d,o))return d}(u=a.pop())&&(u=u.node)}return null}function Il(t,n){return t.dist-n.dist}function $l(t,n,e){if(Cl(t,e)||Cl(n,e))return 0;var r=Ll(t[0],t[1],n[0],n[1],e.minX,e.minY,e.maxX,e.minY);if(0===r)return 0;var i=Ll(t[0],t[1],n[0],n[1],e.minX,e.minY,e.minX,e.maxY);if(0===i)return 0;var s=Ll(t[0],t[1],n[0],n[1],e.maxX,e.minY,e.maxX,e.maxY);if(0===s)return 0;var o=Ll(t[0],t[1],n[0],n[1],e.minX,e.maxY,e.maxX,e.maxY);return 0===o?0:Math.min(r,i,s,o)}function Cl(t,n){return t[0]>=n.minX&&t[0]<=n.maxX&&t[1]>=n.minY&&t[1]<=n.maxY}function Tl(t,n,e){for(var r,i,s,o,a=Math.min(t[0],n[0]),u=Math.min(t[1],n[1]),h=Math.max(t[0],n[0]),l=Math.max(t[1],n[1]),c=e.search({minX:a,minY:u,maxX:h,maxY:l}),f=0;f<c.length;f++)if(r=c[f].p,i=c[f].next.p,s=t,r!==(o=n)&&i!==s&&zl(r,i,s)>0!=zl(r,i,o)>0&&zl(s,o,r)>0!=zl(s,o,i)>0)return!1;return!0}function zl(t,n,e){return _l(t[0],t[1],n[0],n[1],e[0],e[1])}function Dl(t){var n=t.p,e=t.next.p;return t.minX=Math.min(n[0],e[0]),t.minY=Math.min(n[1],e[1]),t.maxX=Math.max(n[0],e[0]),t.maxY=Math.max(n[1],e[1]),t}function jl(t,n){var e={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return n?(e.next=n.next,e.prev=n,n.next.prev=e,n.next=e):(e.prev=e,e.next=e),e}function Ul(t,n){var e=t[0]-n[0],r=t[1]-n[1];return e*e+r*r}function Nl(t,n,e){var r=n[0],i=n[1],s=e[0]-r,o=e[1]-i;if(0!==s||0!==o){var a=((t[0]-r)*s+(t[1]-i)*o)/(s*s+o*o);a>1?(r=e[0],i=e[1]):a>0&&(r+=s*a,i+=o*a)}return(s=t[0]-r)*s+(o=t[1]-i)*o}function Ll(t,n,e,r,i,s,o,a){var u,h,l,c,f=e-t,d=r-n,p=o-i,y=a-s,m=t-i,g=n-s,v=f*f+d*d,b=f*p+d*y,w=p*p+y*y,M=f*m+d*g,x=p*m+y*g,F=v*w-b*b,A=F,k=F;0===F?(h=0,A=1,c=x,k=w):(c=v*x-b*M,(h=b*x-w*M)<0?(h=0,c=x,k=w):h>A&&(h=A,c=x+b,k=w)),c<0?(c=0,-M<0?h=0:-M>v?h=A:(h=-M,A=v)):c>k&&(c=k,-M+b<0?h=0:-M+b>v?h=A:(h=-M+b,A=v));var P=(1-(l=0===c?0:c/k))*i+l*o-((1-(u=0===h?0:h/A))*t+u*e),S=(1-l)*s+l*a-((1-u)*n+u*r);return P*P+S*S}function Vl(t,n){return t[0]===n[0]?t[1]-n[1]:t[0]-n[0]}class Rl{constructor(t,n){this.x=t,this.y=n}clone(){return new Rl(this.x,this.y)}normalize(){const t=this.length();this.x/=t,this.y/=t}negate(){this.x=-this.x,this.y=-this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}diff(t){return new Rl(this.x-t.x,this.y-t.y)}distance(t){const n=this.x-t.x,e=this.y-t.y;return Math.sqrt(n*n+e*e)}dot(t){return this.x*t.x+this.y*t.y}equals(t){return this.x===t.x&&this.y===t.y}orthogonal(){return new Rl(this.y,-this.x)}}function Hl(t,n,e,r){const i=n.x*r.y-n.y*r.x,s=e.x-t.x,o=e.y-t.y,a=(s*r.y-o*r.x)/i;return new Rl(t.x+a*n.x,t.y+a*n.y)}const Wl=[],ql=[];function Gl(t){if(x(t[0]&&t[0].x)){const n=[];let e=0;for(let r=0;r<t.length;r++)ql[e]?(ql[e][0]=t[r].x,ql[e][1]=t[r].y):ql[e]=[t[r].x,t[r].y],n.push(ql[e]),e++;t=n}try{const n=Ol(t,1/0);let e=[1/0,1/0],r=[-1/0,-1/0];for(let t=0;t<n.length;t++)n[t][0]<e[0]&&(e[0]=n[t][0]),n[t][0]>r[0]&&(r[0]=n[t][0]),n[t][1]<e[1]&&(e[1]=n[t][1]),n[t][1]>r[1]&&(r[1]=n[t][1]);const i=[];let s=[],o=0;for(let t=0;t<n.length;t++)t===n.length-1&&n[t][0]===n[0][0]&&n[t][1]===n[0][1]||(Ct(i,n[t],"EPSG:3857"),Wl[o]?(Wl[o].x=i[0],Wl[o].y=i[1]):Wl[o]=new Rl(i[0],i[1]),s.push(Wl[o]),o++);dh.calculateSignedArea(s)<0&&(s=s.reverse());const a=function(t){let n,e=Number.MAX_VALUE;const r=function(t,r,i,s,o,a,u,h){var l=Hl(t,r,o,a),c=Hl(i,s,o,a),f=Hl(u,h,t,r),d=Hl(u,h,i,s),p=l.distance(c)*l.distance(f);0!==p&&p<e&&(n=[l,f,d,c],e=p)};var i=[];for(let n=0;n<t.length;n++)i.push(t[(n+1)%t.length].diff(t[n])),i[n].normalize();var s,o,a,u,h=new Rl(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=new Rl(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let n=0;n<t.length;n++){var c=t[n];c.x<h.x&&(h.x=c.x,s=n),c.x>l.x&&(l.x=c.x,o=n),c.y<h.y&&(h.y=c.y,u=n),c.y>l.y&&(l.y=c.y,a=n)}var f=new Rl(0,-1),d=new Rl(0,1),p=new Rl(-1,0),y=new Rl(1,0);for(let n=0;n<t.length;n++){var m=[Math.acos(f.dot(i[s])),Math.acos(d.dot(i[o])),Math.acos(p.dot(i[a])),Math.acos(y.dot(i[u]))];switch(m.indexOf(Math.min.apply(Math,m))){case 0:(d=(f=i[s].clone()).clone()).negate(),(y=(p=f.orthogonal()).clone()).negate(),s=(s+1)%t.length;break;case 1:(f=(d=i[o].clone()).clone()).negate(),(y=(p=f.orthogonal()).clone()).negate(),o=(o+1)%t.length;break;case 2:(y=(p=i[a].clone()).clone()).negate(),(d=(f=y.orthogonal()).clone()).negate(),a=(a+1)%t.length;break;case 3:(p=(y=i[u].clone()).clone()).negate(),(d=(f=y.orthogonal()).clone()).negate(),u=(u+1)%t.length}r(t[s],f,t[o],d,t[a],p,t[u],y)}return n}(s);if(!a||4!==a.length)return null;const u=a[0].distance(a[1]),h=a[1].distance(a[2]),l=a.map(t=>[t.x,t.y]);return l.push(+(h>u)),l}catch(t){return null}}const Bl=[];function Jl(t,n){const e=Array.isArray(t&&t[0]&&t[0][0]);for(let r=0;r<t.length;r++)e?t[r]=Jl(t[r]):(Ct(Bl,t[r],n),t[r][0]=Bl[0],t[r][1]=Bl[1]);return t}class Xl extends Ch{constructor(t,n,e,r,i,s){super(t,n,e,r,i),(n=n||{}).extent||(n.extent=8192),this.zoomOffset=0,n.tileSize&&(this.zoomOffset=-function(t){if(Math.log2)return Math.log2(t);const n=Math.log(t)*Math.LOG2E,e=Math.round(n);return Math.abs(e-n)<1e-14?e:n}(n.tileSize/256)),this.setData(n.data,s)}setData(t,n){if(delete this.index,!t)return void n();const e={maxZoom:24,tolerance:this.options.simplifyTolerance,extent:this.options.extent,buffer:x(this.options.tileBuffer)?this.options.tileBuffer:64,hasAltitude:!!this.options.hasAltitude,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5,disableFilter:!0};if(this.options.projection&&(e.projection=this.options.projection,"EPSG:4490"===e.projection&&(e.projection="EPSG:4326")),M(t)&&"{"!=t.substring(0,1)||t.url){const r=t.url?t.url:t;O.getJSON(r,t.url?t:{},(t,i)=>{if(t&&(console.error("Failed to fetch geojson:"+r),n(t)),!i)return void n(null,{extent:null,idMap:{}});let s=i;if(this.options.convertFn){s=new Function("data",this.options.convertFn+"\\nreturn convert(data)")(s)}const o=Array.isArray(s)?s:s.features;this.gn(o);const{first1000:a,idMap:u}=this.vn(o);this.bn(a,u,s,e,n)})}else{"string"==typeof t&&(t=JSON.parse(t));const r=Array.isArray(t)?t:t.features;this.gn(r);let i=r;r&&r.length>1e3&&(i=r.slice(0,1e3)),this.bn(i,null,t,e,n)}}gn(t){if(this.options.generateOMBB&&t)for(let n=0;n<t.length;n++){const e=t[n];if(e&&e.geometry&&e.geometry.coordinates)if("Polygon"===e.geometry.type){const t=e.geometry.coordinates[0];if(!t)continue;const n=Gl(t,t.length);e.properties=e.properties||{},e.properties[vh]=n}else if("MultiPolygon"===e.geometry.type){const t=e.geometry.coordinates;for(let n=0;n<t.length;n++){if(!t[n])continue;const r=t[n][0];if(!r)continue;const i=Gl(r,r.length);e.properties=e.properties||{},e.properties[vh]=e.properties[vh]||[],e.properties[vh][n]=i}}}}bn(t,n,e,r,i){try{const s=t&&t.length?function(t){let n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];switch(t.type){case"FeatureCollection":const e=t.features.length;for(let r=0;r<e;r++)Jh(t.features[r],n);break;case"Feature":Jh(t,n);break;default:Xh(t,n)}return n}({type:"FeatureCollection",features:t}):null;this.index=function(t,n){return new it(t,n)}(e,this.options.geojsonvt||r),i(null,{extent:s,idMap:n})}catch(t){console.warn(t),i({error:t.message})}}vn(t){const n=[],e={};let r=0;const i=this.options.featureIdProperty;return t&&t.forEach(t=>{!function(t){if(t&&("Feature"!==t.type||t.geometry)){if(x(t.id)||(t.id=r++),i){let n=i;A(i)&&(n=i[t.layer||"0"]),t.id=t.properties[n]}e[t.id]=w({},t),t.geometry?(e[t.id].geometry=w({},t.geometry),e[t.id].geometry.coordinates=null):t.coordinates&&(e[t.id].coordinates=null),n.length<1e3&&n.push(t)}}(t)}),{first1000:n,idMap:e}}getTileFeatures(t,n){const e=t.tileInfo,r=[];if(!this.index)return setTimeout((function(){n({loading:!0})}),1),1;const i=this.index.getTile(e.z+this.zoomOffset,e.x,e.y);if(!i||0===i.features.length)return setTimeout((function(){n(null,r,[])}),1),1;const s=[];for(let t=0,n=i.features.length;t<n;t++){const n=i.features[t];let e=n.layer;void 0===e&&(e="0"),s[e]={types:{}};s[e].types[n.type]=1,n.tags=n.tags||{},n.geometry.converted||(dh.convertGeometry(n),n.geometry.converted=1),r.push({type:n.type,layer:e,id:n.id,geometry:n.geometry,properties:n.tags,extent:this.options.extent})}for(const t in s)s[t].types=Object.keys(s[t].types).map(t=>+t);return setTimeout((function(){n(null,r,s)}),1),1}onRemove(){super.onRemove(),delete this.index}}var Yl={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,n,e,r,i){var s,o,a=8*i-r-1,u=(1<<a)-1,h=u>>1,l=-7,c=e?i-1:0,f=e?-1:1,d=t[n+c];for(c+=f,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+t[n+c],c+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[n+c],c+=f,l-=8);if(0===s)s=1-h;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),s-=h}return(d?-1:1)*o*Math.pow(2,s-r)},write:function(t,n,e,r,i,s){var o,a,u,h=8*s-i-1,l=(1<<h)-1,c=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,p=r?1:-1,y=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,o=l):(o=Math.floor(Math.log(n)/Math.LN2),n*(u=Math.pow(2,-o))<1&&(o--,u*=2),(n+=o+c>=1?f/u:f*Math.pow(2,1-c))*u>=2&&(o++,u/=2),o+c>=l?(a=0,o=l):o+c>=1?(a=(n*u-1)*Math.pow(2,i),o+=c):(a=n*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[e+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,h+=i;h>0;t[e+d]=255&o,d+=p,o/=256,h-=8);t[e+d-p]|=128*y}},Zl=Ql,Kl=Yl;function Ql(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ql.Varint=0,Ql.Fixed64=1,Ql.Bytes=2,Ql.Fixed32=5;var tc="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function nc(t){return t.type===Ql.Bytes?t.readVarint()+t.pos:t.pos+1}function ec(t,n,e){return e?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function rc(t,n,e){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));e.realloc(r);for(var i=e.pos-1;i>=t;i--)e.buf[i+r]=e.buf[i]}function ic(t,n){for(var e=0;e<t.length;e++)n.writeVarint(t[e])}function sc(t,n){for(var e=0;e<t.length;e++)n.writeSVarint(t[e])}function oc(t,n){for(var e=0;e<t.length;e++)n.writeFloat(t[e])}function ac(t,n){for(var e=0;e<t.length;e++)n.writeDouble(t[e])}function uc(t,n){for(var e=0;e<t.length;e++)n.writeBoolean(t[e])}function hc(t,n){for(var e=0;e<t.length;e++)n.writeFixed32(t[e])}function lc(t,n){for(var e=0;e<t.length;e++)n.writeSFixed32(t[e])}function cc(t,n){for(var e=0;e<t.length;e++)n.writeFixed64(t[e])}function fc(t,n){for(var e=0;e<t.length;e++)n.writeSFixed64(t[e])}function dc(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+16777216*t[n+3]}function pc(t,n,e){t[e]=n,t[e+1]=n>>>8,t[e+2]=n>>>16,t[e+3]=n>>>24}function yc(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}Ql.prototype={destroy:function(){this.buf=null},readFields:function(t,n,e){for(e=e||this.length;this.pos<e;){var r=this.readVarint(),i=r>>3,s=this.pos;this.type=7&r,t(i,n,this),this.pos===s&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=dc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=yc(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=dc(this.buf,this.pos)+4294967296*dc(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=dc(this.buf,this.pos)+4294967296*yc(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Kl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Kl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,e,r=this.buf;return n=127&(e=r[this.pos++]),e<128?n:(n|=(127&(e=r[this.pos++]))<<7,e<128?n:(n|=(127&(e=r[this.pos++]))<<14,e<128?n:(n|=(127&(e=r[this.pos++]))<<21,e<128?n:function(t,n,e){var r,i,s=e.buf;if(i=s[e.pos++],r=(112&i)>>4,i<128)return ec(t,r,n);if(i=s[e.pos++],r|=(127&i)<<3,i<128)return ec(t,r,n);if(i=s[e.pos++],r|=(127&i)<<10,i<128)return ec(t,r,n);if(i=s[e.pos++],r|=(127&i)<<17,i<128)return ec(t,r,n);if(i=s[e.pos++],r|=(127&i)<<24,i<128)return ec(t,r,n);if(i=s[e.pos++],r|=(1&i)<<31,i<128)return ec(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(e=r[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,n=this.pos;return this.pos=t,t-n>=12&&tc?function(t,n,e){return tc.decode(t.subarray(n,e))}(this.buf,n,t):function(t,n,e){var r="",i=n;for(;i<e;){var s,o,a,u=t[i],h=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>e)break;1===l?u<128&&(h=u):2===l?128==(192&(s=t[i+1]))&&(h=(31&u)<<6|63&s)<=127&&(h=null):3===l?(s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&((h=(15&u)<<12|(63&s)<<6|63&o)<=2047||h>=55296&&h<=57343)&&(h=null)):4===l&&(s=t[i+1],o=t[i+2],a=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((h=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,l=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),i+=l}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==Ql.Bytes)return t.push(this.readVarint(n));var e=nc(this);for(t=t||[];this.pos<e;)t.push(this.readVarint(n));return t},readPackedSVarint:function(t){if(this.type!==Ql.Bytes)return t.push(this.readSVarint());var n=nc(this);for(t=t||[];this.pos<n;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ql.Bytes)return t.push(this.readBoolean());var n=nc(this);for(t=t||[];this.pos<n;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ql.Bytes)return t.push(this.readFloat());var n=nc(this);for(t=t||[];this.pos<n;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ql.Bytes)return t.push(this.readDouble());var n=nc(this);for(t=t||[];this.pos<n;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ql.Bytes)return t.push(this.readFixed32());var n=nc(this);for(t=t||[];this.pos<n;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ql.Bytes)return t.push(this.readSFixed32());var n=nc(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ql.Bytes)return t.push(this.readFixed64());var n=nc(this);for(t=t||[];this.pos<n;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ql.Bytes)return t.push(this.readSFixed64());var n=nc(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed64());return t},skip:function(t){var n=7&t;if(n===Ql.Varint)for(;this.buf[this.pos++]>127;);else if(n===Ql.Bytes)this.pos=this.readVarint()+this.pos;else if(n===Ql.Fixed32)this.pos+=4;else{if(n!==Ql.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n<this.pos+t;)n*=2;if(n!==this.length){var e=new Uint8Array(n);e.set(this.buf),this.buf=e,this.length=n}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),pc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),pc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),pc(this.buf,-1&t,this.pos),pc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),pc(this.buf,-1&t,this.pos),pc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,n){var e,r;t>=0?(e=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(e=~(-t%4294967296))?e=e+1|0:(e=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn\'t fit into 10 bytes");n.realloc(10),function(t,n,e){e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos]=127&t}(e,0,n),function(t,n){var e=(7&t)<<4;if(n.buf[n.pos++]|=e|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(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 n=this.pos;this.pos=function(t,n,e){for(var r,i,s=0;s<n.length;s++){if((r=n.charCodeAt(s))>55295&&r<57344){if(!i){r>56319||s+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):i=r;continue}if(r<56320){t[e++]=239,t[e++]=191,t[e++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[e++]=239,t[e++]=191,t[e++]=189,i=null);r<128?t[e++]=r:(r<2048?t[e++]=r>>6|192:(r<65536?t[e++]=r>>12|224:(t[e++]=r>>18|240,t[e++]=r>>12&63|128),t[e++]=r>>6&63|128),t[e++]=63&r|128)}return e}(this.buf,t,this.pos);var e=this.pos-n;e>=128&&rc(n,e,this),this.pos=n-1,this.writeVarint(e),this.pos+=e},writeFloat:function(t){this.realloc(4),Kl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Kl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var e=0;e<n;e++)this.buf[this.pos++]=t[e]},writeRawMessage:function(t,n){this.pos++;var e=this.pos;t(n,this);var r=this.pos-e;r>=128&&rc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,e){this.writeTag(t,Ql.Bytes),this.writeRawMessage(n,e)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,ic,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,sc,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,uc,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,oc,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,ac,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,hc,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,lc,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,cc,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,fc,n)},writeBytesField:function(t,n){this.writeTag(t,Ql.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,Ql.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,Ql.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,Ql.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,Ql.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,Ql.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,Ql.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,Ql.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,Ql.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,Ql.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}};var mc=Ut,gc=vc;function vc(t,n,e,r,i){this.properties={},this.extent=e,this.type=0,this.wn=t,this.Mn=-1,this.xn=r,this.Fn=i,t.readFields(bc,this,n)}function bc(t,n,e){1==t?n.id=e.readVarint():2==t?function(t,n){var e=t.readVarint()+t.pos;for(;t.pos<e;){var r=n.xn[t.readVarint()],i=n.Fn[t.readVarint()];n.properties[r]=i}}(e,n):3==t?n.type=e.readVarint():4==t&&(n.Mn=e.pos)}function wc(t){for(var n,e,r=0,i=0,s=t.length,o=s-1;i<s;o=i++)n=t[i],r+=((e=t[o]).x-n.x)*(n.y+e.y);return r}vc.types=["Unknown","Point","LineString","Polygon"],vc.prototype.loadGeometry=function(){var t=this.wn;t.pos=this.Mn;for(var n,e=t.readVarint()+t.pos,r=1,i=0,s=0,o=0,a=[];t.pos<e;){if(i<=0){var u=t.readVarint();r=7&u,i=u>>3}if(i--,1===r||2===r)s+=t.readSVarint(),o+=t.readSVarint(),1===r&&(n&&a.push(n),n=[]),n.push(new mc(s,o));else{if(7!==r)throw new Error("unknown command "+r);n&&n.push(n[0].clone())}}return n&&a.push(n),a},vc.prototype.bbox=function(){var t=this.wn;t.pos=this.Mn;for(var n=t.readVarint()+t.pos,e=1,r=0,i=0,s=0,o=1/0,a=-1/0,u=1/0,h=-1/0;t.pos<n;){if(r<=0){var l=t.readVarint();e=7&l,r=l>>3}if(r--,1===e||2===e)(i+=t.readSVarint())<o&&(o=i),i>a&&(a=i),(s+=t.readSVarint())<u&&(u=s),s>h&&(h=s);else if(7!==e)throw new Error("unknown command "+e)}return[o,u,a,h]},vc.prototype.toGeoJSON=function(t,n,e){var r,i,s=this.extent*Math.pow(2,e),o=this.extent*t,a=this.extent*n,u=this.loadGeometry(),h=vc.types[this.type];function l(t){for(var n=0;n<t.length;n++){var e=t[n],r=180-360*(e.y+a)/s;t[n]=[360*(e.x+o)/s-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(r=0;r<u.length;r++)c[r]=u[r][0];l(u=c);break;case 2:for(r=0;r<u.length;r++)l(u[r]);break;case 3:for(u=function(t){var n=t.length;if(n<=1)return[t];for(var e,r,i=[],s=0;s<n;s++){var o=wc(t[s]);0!==o&&(void 0===r&&(r=o<0),r===o<0?(e&&i.push(e),e=[t[s]]):e.push(t[s]))}e&&i.push(e);return i}(u),r=0;r<u.length;r++)for(i=0;i<u[r].length;i++)l(u[r][i])}1===u.length?u=u[0]:h="Multi"+h;var f={type:"Feature",geometry:{type:h,coordinates:u},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Mc=gc,xc=Fc;function Fc(t,n){this.version=1,this.name=null,this.extent=4096,this.length=0,this.wn=t,this.xn=[],this.Fn=[],this.An=[],t.readFields(Ac,this,n),this.length=this.An.length}function Ac(t,n,e){15===t?n.version=e.readVarint():1===t?n.name=e.readString():5===t?n.extent=e.readVarint():2===t?n.An.push(e.pos):3===t?n.xn.push(e.readString()):4===t&&n.Fn.push(function(t){var n=null,e=t.readVarint()+t.pos;for(;t.pos<e;){var r=t.readVarint()>>3;n=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return n}(e))}Fc.prototype.feature=function(t){if(t<0||t>=this.An.length)throw new Error("feature index out of bounds");this.wn.pos=this.An[t];var n=this.wn.readVarint()+this.wn.pos;return new Mc(this.wn,n,this.extent,this.xn,this.Fn)};var kc=xc;function Pc(t,n,e){if(3===t){var r=new kc(e,e.readVarint()+e.pos);r.length&&(n[r.name]=r)}}var Sc=function(t,n){this.layers=t.readFields(Pc,{},n)};class _c extends Ch{constructor(t,n,e,r,i,s){super(t,n,e,r,i),n=n||{},s()}getTileFeatures(t,n){const e=t.tileInfo.url,r=t.fetchOptions||{};if(this.Ut.has(e)){const{err:t,data:r}=this.Ut.get(e);return setTimeout(()=>{this.kn(e,t,r,n)},1)}return r.referrer=t.referrer,O.getArrayBuffer(e,r,(t,r)=>{this.Ut&&(t?t.loading||this.Ut.add(e,{err:t,data:r&&r.data}):r&&r.data&&this.Ut.add(e,{err:null,data:r.data}),this.kn(e,t,r&&r.data,n))})}kn(t,n,e,r){if(n)return void r(n);let i;try{i=new Sc(new Zl(e))}catch(n){return void r(n.message,[],[])}const s=[];if(!i.layers)return void r(null,s,[]);const o={};let a;for(const t in i.layers)if(u=i.layers,h=t,Object.prototype.hasOwnProperty.call(u,h)){o[t]={types:{}};const e=o[t].types;for(let r=0,o=i.layers[t].length;r<o;r++)try{a=i.layers[t].feature(r),e[a.type]=1;const n={type:a.type,layer:t,geometry:a.loadGeometry(),properties:a.properties,extent:a.extent};void 0!==a.id&&(n.id=a.id);let o=n.properties[vh];o&&(M(o)&&(o=JSON.parse(o)),n.properties[vh]=Jl(o,"EPSG:3857")),s.push(n)}catch(n){console.warn("error when load vt geometry:",n)}}var u,h;for(const t in o)o[t].types=Object.keys(o[t].types).map(t=>+t);r(null,s,o,{byteLength:e.byteLength})}abortTile(t,n){const e=this.requests[t];delete this.requests[t],e&&e.abort&&e.abort(),this.Jt(t),n()}onRemove(){super.onRemove();for(const t in this.requests){const n=this.requests[t];n&&n.abort&&n.abort()}this.requests={}}}let Oc=0;const Ec=new sh(128);class Ic{constructor(t){this.Pn={},this.Sn={},this.workerId=t}addLayer({actorId:t,mapId:n,layerId:e,params:r},i){if(this._n(n,e))return;const s=this.On(n,e),o=r.type,a=r.options,u=this.send.bind(this,t);this.Pn[s]="GeoJSONVectorTileLayer"===o?new Xl(e,a,u,Ec,{},i):new _c(e,a,u,Ec,{},i)}removeLayer({mapId:t,layerId:n},e){const r=this._n(t,n),i=this.On(t,n);delete this.Pn[i],r&&r.onRemove(e)}loadTile({mapId:t,layerId:n,params:e},r){const i=this._n(t,n);i&&i.loadTile(e,r)}abortTile({mapId:t,layerId:n,params:e},r){const i=this._n(t,n);i&&i.abortTile&&i.abortTile(e.url,r)}removeTile({mapId:t,layerId:n,params:e},r){const i=this._n(t,n);i&&i.removeTile(e,r)}updateStyle({mapId:t,layerId:n,params:e},r){const i=this._n(t,n);i&&i.updateStyle(e,r)}updateOptions({mapId:t,layerId:n,params:e},r){const i=this._n(t,n);i&&i.updateOptions(e,r)}setData({mapId:t,layerId:n,params:e},r){const i=this._n(t,n);i&&i.setData(e.data,r)}receive(t){const n=t.callback,e=this.Sn[n];delete this.Sn[n],e&&t.error?e(new Error(t.error)):e&&e(null,t.data)}send(t,n,e,r,i){const s=i?`${t}-${Oc++}`:null;i&&(this.Sn[s]=i),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:n,params:e,callback:String(s)},r||[])}On(t,n){return`${t}-${n}`}_n(t,n){const e=this.On(t,n);return this.Pn[e]}En(){Ec.reset()}}t.initialize=function(){},t.onmessage=function(t,n){const e=t.data;if(this.dispatcher||(this.dispatcher=new Ic(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const r=e.command;this.dispatcher[r]({actorId:t.actorId,mapId:e.mapId,layerId:e.layerId,params:e.params},(t,e,i)=>{t&&404!==t.status&&204!==t.status&&console.error(r,t),n(t,e,i)})}},Object.defineProperty(t,"In",{value:!0})}';
36
+ const $ = 'function(t){let n;const e={width:100,height:10};function r(){if(!n){const{width:t,height:r}=e;OffscreenCanvas?n=new OffscreenCanvas(t,r):(n=document.createElement("canvas"),n.width=t,n.height=r)}return n}class i{constructor(t,n={}){if(!Array.isArray(t))return void console.error("colors is not array");if(t.length<2)return void console.error("colors.length should >1");this.colors=t;let r=1/0,i=-1/0;for(let n=0,e=t.length;n<e;n++){const e=t[n][0];r=Math.min(e,r),i=Math.max(e,i)}this.min=r,this.max=i,this.valueOffset=this.max-this.min,this.options=Object.assign({},e,n),this.t()}getImageData(){return this.imgData}t(){const t=r(),{width:n,height:e}=this.options;t.width=n,t.height=e;const i=t.getContext("2d");i.clearRect(0,0,t.width,t.height);const s=i.createLinearGradient(0,0,t.width,0),{colors:o,valueOffset:a}=this;for(let t=0,n=o.length;t<n;t++){const[n,e]=o[t],r=(n-this.min)/a;s.addColorStop(r,e)}i.fillStyle=s,i.fillRect(0,0,t.width,t.height),this.imgData=i.getImageData(0,0,t.width,t.height)}getColor(t){t=Math.max(this.min,t);const n=((t=Math.min(t,this.max))-this.min)/this.valueOffset;let e=Math.round(n*this.imgData.width);e=Math.min(e,this.imgData.width-1);const r=4*e;return[this.imgData.data[r],this.imgData.data[r+1],this.imgData.data[r+2],this.imgData.data[r+3]]}}var s;function o(t,n){for(let e=0;e<t.stops.length;e++)if(n===t.stops[e][0])return t.stops[e][1];return t.default}function a(t,n){for(var e=0;e<t.stops.length&&!(n<t.stops[e][0]);e++);return t.stops[Math.max(e-1,0)][1]}function u(t,n){for(var e=void 0!==t.base?t.base:1,r=0;!(r>=t.stops.length||n<=t.stops[r][0]);)r++;return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:function t(n,e,r,i,s,o){return"function"==typeof s?function(){var a=s.apply(void 0,arguments),u=o.apply(void 0,arguments);return t(n,e,r,i,a,u)}:s.length?function(t,n,e,r,i,s){var o=[];for(let a=0;a<i.length;a++)o[a]=f(t,n,e,r,i[a],s[a]);return o}(n,e,r,i,s,o):f(n,e,r,i,s,o)}(n,e,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}"function"==typeof Map&&(s=new Map);const l={width:100,height:1};function h(t,n){const e=t.stops;if(e&&e.length>1){let t;if(s){const n=JSON.stringify(e);if(!s.has(n)){const t=new i(e,l);s.set(n,t)}t=s.get(n)}else t=new i(e,l);const[r,o,a,u]=t.getColor(n);return[r/255,o/255,a/255,u/255]}return e&&1===e.length?e[0][1]:null}function c(t,n){return function(t,n,e){return void 0!==t?t:void 0!==n?n:void 0!==e?e:null}(n,t.default)}function f(t,n,e,r,i,s){var o,a=r-e,u=t-e;return i*(1-(o=1===n?u/a:(Math.pow(n,u)-1)/(Math.pow(n,a)-1)))+s*o}function d(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function p(t){return g(t,"exponential")}function y(t){return g(t,"interval")}function m(t,n){if(!t)return null;var e=!1;if(Array.isArray(t)){var r,i=[];for(let s=0;s<t.length;s++)(r=m(t[s],n))?(i.push(r),e=!0):i.push(t[s]);return e?i:t}var s,o={__fn_types_loaded:!0},a=[];for(s in t)t.hasOwnProperty(s)&&a.push(s);const u=function(t){Object.defineProperty(o,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=p(this["_"+t])),this["__fn_"+t].apply(this,n())},set:function(n){this["_"+t]=n},configurable:!0,enumerable:!0})};for(let n=0,r=a.length;n<r;n++)d(t[s=a[n]])?(e=!0,o["_"+s]=t[s],u(s)):o[s]=t[s];return e?o:t}function g(t,n){if(!d(t))return function(){return t};let e=!0,r=!0;const i=(t=JSON.parse(JSON.stringify(t))).stops;if(i)for(let t=0;t<i.length;t++)if(d(i[t][1])){const s=g(i[t][1],n);e=e&&s.isZoomConstant,r=r&&s.isFeatureConstant,i[t]=[i[t][0],s]}const s=function t(n,e){var r,i,s;if(d(n)){var l,f=n.stops&&"object"==typeof n.stops[0][0],p=f||void 0!==n.property,y=f||!p,m=n.type||e||"exponential";if("exponential"===m)l=u;else if("interval"===m)l=a;else if("categorical"===m)l=o;else if("identity"===m)l=c;else{if("color-interpolate"!==m)throw new Error(\'Unknown function type "\'+m+\'"\');l=h}if(f){var g={},v=[];for(let t=0;t<n.stops.length;t++){var b=n.stops[t];void 0===g[b[0].zoom]&&(g[b[0].zoom]={zoom:b[0].zoom,type:n.type,property:n.property,default:n.default,stops:[]}),g[b[0].zoom].stops.push([b[0].value,b[1]])}for(let n in g)v.push([g[n].zoom,t(g[n])]);r=function(t,e){const r=u({stops:v,base:n.base},t)(t,e);return"function"==typeof r?r(t,e):r},i=!1,s=!1}else y?(r=function(t){const e=l(n,t);return"function"==typeof e?e(t):e},i=!0,s=!1):(r=function(t,e){const r=l(n,e?e[n.property]:null);return"function"==typeof r?r(t,e):r},i=!1,s=!0)}else r=function(){return n},i=!0,s=!0;return r.isZoomConstant=s,r.isFeatureConstant=i,r}(t,n);return s.isZoomConstant=e&&s.isZoomConstant,s.isFeatureConstant=r&&s.isFeatureConstant,s}let v=0;const b="function"==typeof Object.assign;function w(t,...n){if(b)return Object.assign(t,...n),t;for(let e=0;e<n.length;e++){const r=n[e];for(const n in r)t[n]=r[n]}return t}function M(t){return!k(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function x(t){return"number"==typeof t&&!isNaN(t)}function F(t){return!k(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function A(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function k(t){return null==t}function P(t){for(let n=1;n<arguments.length;n++){const e=arguments[n];if(e)for(let n=0,r=e.length;n<r;n++)t.push(e[n])}return t.length}function S(t){return d(t)&&t.property}const _="function"==typeof fetch&&"function"==typeof AbortController,O={jsonp:function(t,n){const e="_maptalks_jsonp_"+v++;t.match(/\\?/)?t+="&callback="+e:t+="?callback="+e;let r=document.createElement("script");return r.type="text/javascript",r.src=t,window[e]=function(t){n(null,t),document.getElementsByTagName("head")[0].removeChild(r),r=null,delete window[e]},document.getElementsByTagName("head")[0].appendChild(r),this},get:function(t,n,e){if(F(n)){const t=e;e=n,n=t}(n=n||{}).method&&(n.method=n.method.toUpperCase());const r="POST"===n.method;if(_){const r=new AbortController,i=n;i.signal=r.signal,i.referrerPolicy=i.referrerPolicy||"origin",i.method=i.method||"GET";const s=new Request(t,i);return n.returnJSON&&s.headers.set("Accept","application/json"),fetch(s).then(r=>{const i=this.s(r,n.returnJSON,n.responseType);i.message?(i.url=t,e(i)):i.then(t=>{"arraybuffer"===n.responseType?e(null,{data:t,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),contentType:r.headers.get("Content-Type")}):e(null,t)}).catch(n=>{n.code&&n.code===DOMException.ABORT_ERR||(console.error("Fetch error:",t,n),e(n))})}).catch(n=>{n.code&&n.code===DOMException.ABORT_ERR||(console.error("Fetch error:",t,n),e(n))}),r}{const i=O.o(e);if(i.open(n.method||"GET",t,!0),n){for(const t in n.headers)i.setRequestHeader(t,n.headers[t]);i.withCredentials="include"===n.credentials,n.responseType&&(i.responseType=n.responseType)}return i.send(r?n.body:null),i}},s:(t,n,e)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`}:"arraybuffer"===e?t.arrayBuffer():n?t.json():t.text(),u:function(t,n){return function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?n({status:200,statusText:t.statusText,message:"http status 200 returned without content."}):n(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else n(null,t.responseText);else n({status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`})}},o:function(t){let n;try{n=new XMLHttpRequest}catch(t){try{n=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{n=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return n.onreadystatechange=O.u(n,t),n},getArrayBuffer(t,n,e){if(F(n)){const t=e;e=n,n=t}return n||(n={}),n.responseType="arraybuffer",O.get(t,n,e)}};function E(t,n,e,r,i,s){let o=i-e,a=s-r;if(0!==o||0!==a){const u=((t-e)*o+(n-r)*a)/(o*o+a*a);u>1?(e=i,r=s):u>0&&(e+=o*u,r+=a*u)}return o=t-e,a=n-r,o*o+a*a}function I(t,n,e,r,i,s){const o={id:null==t?null:t,type:n,geometry:e,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};i&&(o.layer=i);return function(t,n){const e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)$(t,e,n);else if("Polygon"===r)$(t,e[0],n);else if("MultiLineString"===r)for(const r of e)$(t,r,n);else if("MultiPolygon"===r)for(const r of e)$(t,r[0],n)}(o,s?4:3),o}function $(t,n,e){for(let r=0;r<n.length;r+=e)t.minX=Math.min(t.minX,n[r]),t.minY=Math.min(t.minY,n[r+1]),t.maxX=Math.max(t.maxX,n[r]),t.maxY=Math.max(t.maxY,n[r+1])}function C(t,n,e,r){if(r.layer=n,"FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)T(t,e.features[n],r,n);else"Feature"===e.type?T(t,e,r):T(t,{geometry:e},r)}function T(t,n,e,r){if(!n.geometry)return;const i=n.geometry.coordinates,s=n.geometry.type,o=Math.pow(e.tolerance/((1<<e.maxZoom)*e.extent),2);let a=[],u=n.id;if(e.promoteId?u=n.properties[e.promoteId]:e.generateId&&(u=r||0),"Point"===s)z(i,a,e);else if("MultiPoint"===s)for(const t of i)z(t,a,e);else if("LineString"===s)D(i,a,o,!1,e);else if("MultiLineString"===s){if(e.lineMetrics){for(const r of i)a=[],D(r,a,o,!1,e),t.push(I(u,"LineString",a,n.properties,e.layer,e.hasAltitude));return}j(i,a,o,!1,e)}else if("Polygon"===s)j(i,a,o,!0,e);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(const i of n.geometry.geometries)T(t,{id:u,geometry:i,properties:n.properties},e,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of i){const n=[];j(t,n,o,!0,e),a.push(n)}}t.push(I(u,s,a,n.properties,e.layer,e.hasAltitude))}function z(t,n,e){n.push(U(t[0]),N(t[1],e.projection),0),e.hasAltitude&&(t.length>2?n.push(t[2]):n.push(0))}function D(t,n,e,r,i){let s,o,a=0;for(let e=0;e<t.length;e++){const u=U(t[e][0]),l=N(t[e][1],i.projection);n.push(u,l,0),i.hasAltitude&&(t[e].length>2?n.push(t[e][2]):n.push(0)),e>0&&(a+=r?(s*l-u*o)/2:Math.sqrt(Math.pow(u-s,2)+Math.pow(l-o,2))),s=u,o=l}const u=i.hasAltitude?4:3,l=n.length-u;n[2]=1,function t(n,e,r,i,s=3){let o=i;const a=r-e>>1;let u,l=r-e;const h=n[e],c=n[e+1],f=n[r],d=n[r+1];for(let t=e+s;t<r;t+=s){const e=E(n[t],n[t+1],h,c,f,d);if(e>o)u=t,o=e;else if(e===o){const n=Math.abs(t-a);n<l&&(u=t,l=n)}}o>i&&(u-e>s&&t(n,e,u,i,s),n[u+2]=o,r-u>s&&t(n,u,r,i,s))}(n,0,l,e,u),n[l+2]=1,n.size=Math.abs(a),n.start=0,n.end=n.size}function j(t,n,e,r,i){for(let s=0;s<t.length;s++){const o=[];D(t[s],o,e,r,i),n.push(o)}}function U(t){return t/360+.5}function N(t,n){switch(n){case"EPSG:4326":return(90-t)/360}const 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 L(t,n,e,r,i,s,o,a){if(r/=n,s>=(e/=n)&&o<r)return t;if(o<e||s>=r)return null;const u=[];for(const n of t){const t=n.geometry;let s=n.type;const o=0===i?n.minX:n.minY,l=0===i?n.maxX:n.maxY;if(o>=e&&l<r){u.push(n);continue}if(l<e||o>=r)continue;let h=[];if("Point"===s||"MultiPoint"===s)V(t,h,e,r,i,a.hasAltitude);else if("LineString"===s)R(t,h,e,r,i,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===s)W(t,h,e,r,i,!1,a.hasAltitude);else if("Polygon"===s)W(t,h,e,r,i,!0,a.hasAltitude);else if("MultiPolygon"===s)for(const n of t){const t=[];W(n,t,e,r,i,!0,a.hasAltitude),t.length&&h.push(t)}if(h.length){if(a.lineMetrics&&"LineString"===s){for(const t of h)u.push(I(n.id,s,t,n.tags,n.layer,a.hasAltitude));continue}"LineString"!==s&&"MultiLineString"!==s||(1===h.length?(s="LineString",h=h[0]):s="MultiLineString"),"Point"!==s&&"MultiPoint"!==s||(s=3===h.length?"Point":"MultiPoint"),u.push(I(n.id,s,h,n.tags,n.layer,a.hasAltitude))}}return u.length?u:null}function V(t,n,e,r,i,s){const o=s?4:3;for(let a=0;a<t.length;a+=o){const o=t[a+i];o>=e&&o<=r&&(q(n,t[a],t[a+1],t[a+2]),s&&n.push(t[a+3]))}}function R(t,n,e,r,i,s,o,a){let u=H(t);const l=0===i?G:B;let h,c,f=t.start;const d=a?4:3,p=s?t.length:t.length-d;for(let y=0;y<p;y+=d){const m=t[y],g=t[y+1],v=t[y+2];let b,w,M,x;s&&y===p-d?(b=t[0],w=t[1]):(b=t[y+d],w=t[y+d+1]),a&&(M=t[y+3],x=s&&y===p-d?t[3]:t[y+d+3]);const F=0===i?m:g,A=0===i?b:w;let k=!1;o&&(h=Math.sqrt(Math.pow(m-b,2)+Math.pow(g-w,2))),F<e?A>e&&(c=l(u,m,g,b,w,e),a&&u.push(J(M,x,c)),o&&(u.start=f+h*c)):F>r?A<r&&(c=l(u,m,g,b,w,r),a&&u.push(J(M,x,c)),o&&(u.start=f+h*c)):(q(u,m,g,v),a&&u.push(M)),A<e&&F>=e&&(c=l(u,m,g,b,w,e),a&&u.push(J(M,x,c)),k=!0),A>r&&F<=r&&(c=l(u,m,g,b,w,r),a&&u.push(J(M,x,c)),k=!0),!s&&k&&(o&&(u.end=f+h*c),n.push(u),u=H(t)),o&&(f+=h)}let y=t.length-d;if(!s){const n=t[y],s=t[y+1],o=t[y+2],l=0===i?n:s;if(l>=e&&l<=r&&q(u,n,s,o),l>=e&&l<=r&&a){const n=t[y+3];u.push(n)}}y=u.length-d,s&&y>=d&&(u[y]!==u[0]||u[y+1]!==u[1])&&(q(u,u[0],u[1],u[2]),a&&u.push(u[3])),u.length&&n.push(u)}function H(t){const n=[];return n.size=t.size,n.start=t.start,n.end=t.end,n}function W(t,n,e,r,i,s,o){for(const a of t)R(a,n,e,r,i,s,!1,o)}function q(t,n,e,r){t.push(n,e,r)}function G(t,n,e,r,i,s){const o=(s-n)/(r-n);return q(t,s,e+(i-e)*o,1),o}function B(t,n,e,r,i,s){const o=(s-e)/(i-e);return q(t,n+(r-n)*o,s,1),o}function J(t,n,e){return t+(n-t)*e}function X(t,n,e){const r=[];for(let i=0;i<t.length;i++){const s=t[i],o=s.type;let a;if("Point"===o||"MultiPoint"===o||"LineString"===o)a=Y(s.geometry,n,e);else if("MultiLineString"===o||"Polygon"===o){a=[];for(const t of s.geometry)a.push(Y(t,n,e))}else if("MultiPolygon"===o){a=[];for(const t of s.geometry){const r=[];for(const i of t)r.push(Y(i,n,e));a.push(r)}}r.push(I(s.id,o,a,s.tags,s.layer,e))}return r}function Y(t,n,e){const r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);const i=e?4:3;for(let s=0;s<t.length;s+=i)r.push(t[s]+n,t[s+1],t[s+2]),e&&r.push(t[s+3]);return r}function Z(t,n,e){if(t.transformed)return t;const r=1<<t.z,i=t.x,s=t.y,o=e?3:2;for(const a of t.features){const t=a.geometry,u=a.type;if(a.geometry=[],1===u)for(let u=0;u<t.length;u+=o)a.geometry.push(K(t[u],t[u+1],n,r,i,s)),e&&a.geometry[a.geometry.length-1].push(t[u+2]);else for(let u=0;u<t.length;u++){const l=[];for(let a=0;a<t[u].length;a+=o)l.push(K(t[u][a],t[u][a+1],n,r,i,s)),e&&l[l.length-1].push(t[u][a+2]);a.geometry.push(l)}}return t.transformed=!0,t}function K(t,n,e,r,i,s){return[Math.round(e*(t*r-i)),Math.round(e*(n*r-s))]}function Q(t,n,e,r,i){const s=n===i.maxZoom?0:i.tolerance/((1<<n)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:e,y:r,z:n,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const n of t)tt(o,n,s,i);return o}function tt(t,n,e,r){const i=n.geometry,s=n.type,o=[],a=r.hasAltitude?4:3;if(t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),"Point"===s||"MultiPoint"===s)for(let n=0;n<i.length;n+=a)o.push(i[n],i[n+1]),r.hasAltitude&&o.push(i[n+3]),t.numPoints++,t.numSimplified++;else if("LineString"===s)et(o,i,t,e,!1,!1,r);else if("MultiLineString"===s||"Polygon"===s)for(let n=0;n<i.length;n++)et(o,i[n],t,e,"Polygon"===s,0===n,r);else if("MultiPolygon"===s)for(let n=0;n<i.length;n++){const s=i[n];for(let n=0;n<s.length;n++)et(o,s[n],t,e,!0,0===n,r)}if(o.length){let e=n.tags||null;if("LineString"===s&&r.lineMetrics){e={};for(const t in n.tags)e[t]=n.tags[t];e.mapbox_clip_start=i.start/i.size,e.mapbox_clip_end=i.end/i.size}const a={geometry:o,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:e};n.layer&&(a.layer=n.layer),null!==n.id&&(a.id=n.id),t.features.push(a)}}function nt(t,n,e){return 0===t[n+2]&&t[n+3]>0&&e}function et(t,n,e,r,i,s,o){const a=r*r,{hasAltitude:u,disableFilter:l}=o,h=u?4:3;if(!l&&r>0&&n.size<(i?a:r))return void(e.numPoints+=n.length/h);const c=[];for(let t=0;t<n.length;t+=h)(0===r||n[t+2]>a||nt(n,t,u))&&(e.numSimplified++,c.push(n[t],n[t+1]),u&&c.push(n[t+3])),e.numPoints++;i&&function(t,n,e){const r=e?3:2;let i=0;for(let n=0,e=t.length,s=e-r;n<e;s=n,n+=r)i+=(t[n]-t[s])*(t[n+1]+t[s+1]);if(i>0===n){const n=r,i=r-1,s=r-2;for(let o=0,a=t.length;o<a/2;o+=r){const r=t[o],u=t[o+1];let l;e&&(l=t[o+2]),t[o]=t[a-n-o],t[o+1]=t[a-i-o],e&&(t[o+2]=t[a-s-o]),t[a-n-o]=r,t[a-i-o]=u,e&&(t[a-s-o]=l)}}}(c,s,u),t.push(c)}O.getJSON=function(t,n,e){if(F(n)){const t=e;e=n,n=t}const r=function(t,n){const r="string"==typeof n?JSON.parse(n):n||null;e(t,r)};return n&&n.jsonp?O.jsonp(t,r):((n=n||{}).returnJSON=!0,O.get(t,n,r))};const rt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,hasAltitude:!1,disableFilter:!1,debug:0};class it{constructor(t,n){const e=(n=this.options=function(t,n){for(const e in n)t[e]=n[e];return t}(Object.create(rt),n)).debug;if(e&&console.time("preprocess data"),n.maxZoom<0||n.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(n.promoteId&&n.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,n){const e=[];if(Array.isArray(t)){for(let r=0;r<t.length;r++)C(e,t[r].layer,t[r].data,n);return e}if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)T(e,t.features[r],n,r);else"Feature"===t.type?T(e,t,n):T(e,{geometry:t},n);return e}(t,n);this.tiles={},this.tileCoords=[],e&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",n.indexMaxZoom,n.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,n){const e=n.buffer/n.extent;let r=t;const i=L(t,1,-1-e,e,0,-1,2,n),s=L(t,1,1-e,2+e,0,-1,2,n);return(i||s)&&(r=L(t,1,-e,1+e,0,-1,2,n)||[],i&&(r=X(i,1,n.hasAltitude).concat(r)),s&&(r=r.concat(X(s,-1,n.hasAltitude)))),r}(r,n),r.length&&this.splitTile(r,0,0,0),e&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,n,e,r,i,s,o){const a=[t,n,e,r],u=this.options,l=u.debug;for(;a.length;){r=a.pop(),e=a.pop(),n=a.pop(),t=a.pop();const h=1<<n,c=st(n,e,r);let f=this.tiles[c];if(!f&&(l>1&&console.time("creation"),f=this.tiles[c]=Q(t,n,e,r,u),this.tileCoords.push({z:n,x:e,y:r}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",n,e,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));const t="z"+n;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(n===u.indexMaxZoom||f.numPoints<=u.indexMaxPoints)continue}else{if(n===u.maxZoom||n===i)continue;if(null!=i){const t=i-n;if(e!==s>>t||r!==o>>t)continue}}if(f.source=null,0===t.length)continue;l>1&&console.time("clipping");const d=.5*u.buffer/u.extent,p=.5-d,y=.5+d,m=1+d;let g=null,v=null,b=null,w=null,M=L(t,h,e-d,e+y,0,f.minX,f.maxX,u),x=L(t,h,e+p,e+m,0,f.minX,f.maxX,u);t=null,M&&(g=L(M,h,r-d,r+y,1,f.minY,f.maxY,u),v=L(M,h,r+p,r+m,1,f.minY,f.maxY,u),M=null),x&&(b=L(x,h,r-d,r+y,1,f.minY,f.maxY,u),w=L(x,h,r+p,r+m,1,f.minY,f.maxY,u),x=null),l>1&&console.timeEnd("clipping"),a.push(g||[],n+1,2*e,2*r),a.push(v||[],n+1,2*e,2*r+1),a.push(b||[],n+1,2*e+1,2*r),a.push(w||[],n+1,2*e+1,2*r+1)}}getTile(t,n,e){t=+t,n=+n,e=+e;const r=this.options,{extent:i,debug:s}=r,{hasAltitude:o,wrapX:a}=r;if(t<0||t>24)return null;if(a){const e=1<<t;n=n+e&e-1}const u=st(t,n,e);if(this.tiles[u])return Z(this.tiles[u],i,o);s>1&&console.log("drilling down to z%d-%d-%d",t,n,e);let l,h=t,c=n,f=e;for(;!l&&h>0;)h--,c>>=1,f>>=1,l=this.tiles[st(h,c,f)];return l&&l.source?(s>1&&(console.log("found parent tile z%d-%d-%d",h,c,f),console.time("drilling down")),this.splitTile(l.source,h,c,f,t,n,e),s>1&&console.timeEnd("drilling down"),this.tiles[u]?Z(this.tiles[u],i,o):null):null}}function st(t,n,e){return 32*((1<<t)*e+n)+t}function ot(t,n,e,r,i,s,o){const a=e&&Array.isArray(e[0]);for(let u=0,l=e.length;u<l;u++){t[n]=(a?e[u][0]:e[u].x)*r,t[n+1]=(a?e[u][1]:e[u].y)*r,o!==Float32Array&&(t[n]=Math.round(t[n]),t[n+1]=Math.round(t[n+1]));let h=i||0;Array.isArray(i)&&(h=i[u]),h=h?Math.round(r*h):0,t[n+2]=h,n+=3,s&&0!==u&&u!==l-1&&(t[n]=t[n-3],t[n+1]=t[n-2],t[n+2]=t[n-1],n+=3)}return t.trySetLength&&t.trySetLength(n),n}function at(t,n,e,r){const i=t[3*n],s=t[3*n+1],o=t[3*e],a=t[3*e+1];return i===o&&(i<0||i>r)||s===a&&(s<0||s>r)}var ut="undefined"!=typeof Float32Array?Float32Array:Array;function lt(){var t=new ut(3);return ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ht(t,n,e){var r=new ut(3);return r[0]=t,r[1]=n,r[2]=e,r}function ct(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function ft(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function dt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function pt(t,n){var e=n[0],r=n[1],i=n[2],s=e*e+r*r+i*i;return s>0&&(s=1/Math.sqrt(s),t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s),t}function yt(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function mt(t,n,e){var r=n[0],i=n[1],s=n[2],o=e[0],a=e[1],u=e[2];return t[0]=i*u-s*a,t[1]=s*o-r*u,t[2]=r*a-i*o,t}var gt=function(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t};function vt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function bt(t,n,e,r,i){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t}function wt(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t[3]=n[3]/e[3],t}function Mt(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t}function xt(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function Ft(){var t=new ut(4);return ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function At(t,n){var e=n[0]+n[4]+n[8],r=void 0;if(e>0)r=Math.sqrt(e+1),t[3]=.5*r,r=.5/r,t[0]=(n[5]-n[7])*r,t[1]=(n[6]-n[2])*r,t[2]=(n[1]-n[3])*r;else{var i=0;n[4]>n[0]&&(i=1),n[8]>n[3*i+i]&&(i=2);var s=(i+1)%3,o=(i+2)%3;r=Math.sqrt(n[3*i+i]-n[3*s+s]-n[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(n[3*s+o]-n[3*o+s])*r,t[s]=(n[3*s+i]+n[3*i+s])*r,t[o]=(n[3*o+i]+n[3*i+o])*r}return t}!function(){var t=lt()}(),function(){var t,n=(t=new ut(4),ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var kt,Pt=Mt,St=function(t,n){var e=n[0],r=n[1],i=n[2],s=n[3],o=e*e+r*r+i*i+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=e*o,t[1]=r*o,t[2]=i*o,t[3]=s*o),t};function _t(t,n,e){return t[0]=n,t[1]=e,t}function Ot(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}lt(),ht(1,0,0),ht(0,1,0),Ft(),Ft(),kt=new ut(9),ut!=Float32Array&&(kt[1]=0,kt[2]=0,kt[3]=0,kt[5]=0,kt[6]=0,kt[7]=0),kt[0]=1,kt[4]=1,kt[8]=1;var Et=function(t){var n=t[0],e=t[1];return Math.sqrt(n*n+e*e)};!function(){var t=function(){var t=new ut(2);return ut!=Float32Array&&(t[0]=0,t[1]=0),t}()}();const It=Math.PI/180,$t=6378137*Math.PI/180;function Ct(t,n,e){if("EPSG:3857"===e)return function(t,n){const e=85.0511287798,r=n[0],i=Math.max(Math.min(e,n[1]),-e);let s;s=0===i?0:Math.log(Math.tan((90+i)*It/2))/It;return t[0]=r*$t,t[1]=s*$t,t}(t,n);if("EPSG:4326"===e||"EPSG:4490"===e||"identity"===e)return Tt(t,n);if("baidu"===e)return Tt(t,n);throw new Error("unsupported projection:"+e)}function Tt(t,n){return t[0]=n[0],t[1]=n[1],t}function zt(t,n,e,r,i,s,o,a,u,l,h,c,f,d,p){0===t?function(t,n,e,r,i,s,o,a,u,l){const h=1/(100*s[0]),c=1/(100*s[1]),f=l&&l[0]||0,d=l&&l[1]||0,p=[0,0];for(let i=t;i<n;i+=3){const t=i/3*2,n=r[i]-f,s=r[i+1]-d;e[t]=p[0]+n/o*h/a,e[t+1]=p[1]-s/o*c/u}}(n,e,r,i,0,o,a,u,l,p):1===t&&function(t,n,e,r,i,s,o,a,u,l,h){if(!t)return;let c,f,d,p;0===t[4]?(c=t[0],f=t[1],d=t[2],p=t[3]):(c=t[1],f=t[2],d=t[3],p=t[0]);const y=Ot(c,f),m=Ot(f,d),g=[],v=[],b=[];for(let t=n;t<e;t+=3){const n=t/3*2,e=(s.x/u+i[t]/o)*a,d=s.y/u*a+(h?i[t+1]:-i[t+1])/o*a;_t(g,e,d),"EPSG:4326"!==l&&"EPSG:4490"!==l||Ct(g,g,"EPSG:3857"),Dt(v,g,c,f),Dt(b,g,p,c),r[n]=Ot(c,v)/y,r[n+1]=Ot(c,b)/m}}(h,n,e,r,i,s,a,c,f,d,!!p)}function Dt(t,n,e,r){const i=e[0]-r[0],s=e[1]-r[1];let o=(n[0]-e[0])*(e[0]-r[0])+(n[1]-e[1])*(e[1]-r[1]);return o/=i*i+s*s,t[0]=e[0]+o*i,t[1]=e[1]+o*s,t}function jt(t,n,e,r,i){const s=3*n[e-1],o=3*n[e-1]+1,a=t[s],u=t[o];return l=r,h=i,c=a,f=u,Math.sqrt((c-l)*(c-l)+(f-h)*(f-h));var l,h,c,f}"undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self&&self;var Ut=Nt;function Nt(t,n){this.x=t,this.y=n}function Lt(t,n,e){e=e||{},this.w=t||64,this.h=n||64,this.autoResize=!!e.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function Vt(t,n,e){this.x=0,this.y=t,this.w=this.free=n,this.h=e}function Rt(t,n,e,r,i,s,o){this.id=t,this.x=n,this.y=e,this.w=r,this.h=i,this.maxw=s||r,this.maxh=o||i,this.refcount=0}Nt.prototype={clone:function(){return new Nt(this.x,this.y)},add:function(t){return this.clone().m(t)},sub:function(t){return this.clone().M(t)},multByPoint:function(t){return this.clone().F(t)},divByPoint:function(t){return this.clone().A(t)},mult:function(t){return this.clone().k(t)},div:function(t){return this.clone().P(t)},rotate:function(t){return this.clone().S(t)},rotateAround:function(t,n){return this.clone()._(t,n)},matMult:function(t){return this.clone().O(t)},unit:function(){return this.clone().I()},perp:function(){return this.clone().C()},round:function(){return this.clone().T()},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 n=t.x-this.x,e=t.y-this.y;return n*n+e*e},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,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},O:function(t){var n=t[0]*this.x+t[1]*this.y,e=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=e,this},m:function(t){return this.x+=t.x,this.y+=t.y,this},M:function(t){return this.x-=t.x,this.y-=t.y,this},k:function(t){return this.x*=t,this.y*=t,this},P:function(t){return this.x/=t,this.y/=t,this},F:function(t){return this.x*=t.x,this.y*=t.y,this},A:function(t){return this.x/=t.x,this.y/=t.y,this},I:function(){return this.P(this.mag()),this},C:function(){var t=this.y;return this.y=this.x,this.x=-t,this},S:function(t){var n=Math.cos(t),e=Math.sin(t),r=n*this.x-e*this.y,i=e*this.x+n*this.y;return this.x=r,this.y=i,this},_:function(t,n){var e=Math.cos(t),r=Math.sin(t),i=n.x+e*(this.x-n.x)-r*(this.y-n.y),s=n.y+r*(this.x-n.x)+e*(this.y-n.y);return this.x=i,this.y=s,this},T:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Nt.convert=function(t){return t instanceof Nt?t:Array.isArray(t)?new Nt(t[0],t[1]):t},Lt.prototype.pack=function(t,n){t=[].concat(t),n=n||{};for(var e,r,i,s,o=[],a=0;a<t.length;a++)if(e=t[a].w||t[a].width,r=t[a].h||t[a].height,i=t[a].id,e&&r){if(!(s=this.packOne(e,r,i)))continue;n.inPlace&&(t[a].x=s.x,t[a].y=s.y,t[a].id=s.id),o.push(s)}return this.shrink(),o},Lt.prototype.packOne=function(t,n,e){var r,i,s,o,a,u,l,h,c={freebin:-1,shelf:-1,waste:1/0},f=0;if("string"==typeof e||"number"==typeof e){if(r=this.getBin(e))return this.ref(r),r;"number"==typeof e&&(this.maxId=Math.max(e,this.maxId))}else e=++this.maxId;for(o=0;o<this.freebins.length;o++){if(n===(r=this.freebins[o]).maxh&&t===r.maxw)return this.allocFreebin(o,t,n,e);n>r.maxh||t>r.maxw||n<=r.maxh&&t<=r.maxw&&(s=r.maxw*r.maxh-t*n)<c.waste&&(c.waste=s,c.freebin=o)}for(o=0;o<this.shelves.length;o++)if(f+=(i=this.shelves[o]).h,!(t>i.free)){if(n===i.h)return this.allocShelf(o,t,n,e);n>i.h||n<i.h&&(s=(i.h-n)*t)<c.waste&&(c.freebin=-1,c.waste=s,c.shelf=o)}return-1!==c.freebin?this.allocFreebin(c.freebin,t,n,e):-1!==c.shelf?this.allocShelf(c.shelf,t,n,e):n<=this.h-f&&t<=this.w?(i=new Vt(f,this.w,n),this.allocShelf(this.shelves.push(i)-1,t,n,e)):this.autoResize?(a=u=this.h,((l=h=this.w)<=a||t>l)&&(h=2*Math.max(t,l)),(a<l||n>a)&&(u=2*Math.max(n,a)),this.resize(h,u),this.packOne(t,n,e)):null},Lt.prototype.allocFreebin=function(t,n,e,r){var i=this.freebins.splice(t,1)[0];return i.id=r,i.w=n,i.h=e,i.refcount=0,this.bins[r]=i,this.ref(i),i},Lt.prototype.allocShelf=function(t,n,e,r){var i=this.shelves[t].alloc(n,e,r);return this.bins[r]=i,this.ref(i),i},Lt.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,n=0,e=0;e<this.shelves.length;e++){var r=this.shelves[e];n+=r.h,t=Math.max(r.w-r.free,t)}this.resize(t,n)}},Lt.prototype.getBin=function(t){return this.bins[t]},Lt.prototype.ref=function(t){if(1==++t.refcount){var n=t.h;this.stats[n]=1+(0|this.stats[n])}return t.refcount},Lt.prototype.unref=function(t){return 0===t.refcount?0:(0==--t.refcount&&(this.stats[t.h]--,delete this.bins[t.id],this.freebins.push(t)),t.refcount)},Lt.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},Lt.prototype.resize=function(t,n){this.w=t,this.h=n;for(var e=0;e<this.shelves.length;e++)this.shelves[e].resize(t);return!0},Vt.prototype.alloc=function(t,n,e){if(t>this.free||n>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,new Rt(e,r,this.y,t,n,t,this.h)},Vt.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0};var Ht={exports:{}},Wt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},qt={exports:{}},Gt=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},Bt=Array.prototype.concat,Jt=Array.prototype.slice,Xt=qt.exports=function(t){for(var n=[],e=0,r=t.length;e<r;e++){var i=t[e];Gt(i)?n=Bt.call(n,Jt.call(i)):n.push(i)}return n};Xt.wrap=function(t){return function(){return t(Xt(arguments))}};var Yt=Wt,Zt=qt.exports,Kt=Object.hasOwnProperty,Qt=Object.create(null);for(var tn in Yt)Kt.call(Yt,tn)&&(Qt[Yt[tn]]=tn);var nn=Ht.exports={to:{},get:{}};function en(t,n,e){return Math.min(Math.max(n,t),e)}function rn(t){var n=Math.round(t).toString(16).toUpperCase();return n.length<2?"0"+n:n}nn.get=function(t){var n,e;switch(t.substring(0,3).toLowerCase()){case"hsl":n=nn.get.hsl(t),e="hsl";break;case"hwb":n=nn.get.hwb(t),e="hwb";break;default:n=nn.get.rgb(t),e="rgb"}return n?{model:e,value:n}:null},nn.get.rgb=function(t){if(!t)return null;var n,e,r,i=[0,0,0,1];if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=n[2],n=n[1],e=0;e<3;e++){var s=2*e;i[e]=parseInt(n.slice(s,s+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(n=n[1])[3],e=0;e<3;e++)i[e]=parseInt(n[e]+n[e],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(n=t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)){for(e=0;e<3;e++)i[e]=parseInt(n[e+1],0);n[4]&&(n[5]?i[3]=.01*parseFloat(n[4]):i[3]=parseFloat(n[4]))}else{if(!(n=t.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)))return(n=t.match(/^(\\w+)$/))?"transparent"===n[1]?[0,0,0,0]:Kt.call(Yt,n[1])?((i=Yt[n[1]])[3]=1,i):null:null;for(e=0;e<3;e++)i[e]=Math.round(2.55*parseFloat(n[e+1]));n[4]&&(n[5]?i[3]=.01*parseFloat(n[4]):i[3]=parseFloat(n[4]))}for(e=0;e<3;e++)i[e]=en(i[e],0,255);return i[3]=en(i[3],0,1),i},nn.get.hsl=function(t){if(!t)return null;var n=t.match(/^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);if(n){var e=parseFloat(n[4]);return[(parseFloat(n[1])%360+360)%360,en(parseFloat(n[2]),0,100),en(parseFloat(n[3]),0,100),en(isNaN(e)?1:e,0,1)]}return null},nn.get.hwb=function(t){if(!t)return null;var n=t.match(/^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);if(n){var e=parseFloat(n[4]);return[(parseFloat(n[1])%360+360)%360,en(parseFloat(n[2]),0,100),en(parseFloat(n[3]),0,100),en(isNaN(e)?1:e,0,1)]}return null},nn.to.hex=function(){var t=Zt(arguments);return"#"+rn(t[0])+rn(t[1])+rn(t[2])+(t[3]<1?rn(Math.round(255*t[3])):"")},nn.to.rgb=function(){var t=Zt(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},nn.to.rgb.percent=function(){var t=Zt(arguments),n=Math.round(t[0]/255*100),e=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+n+"%, "+e+"%, "+r+"%)":"rgba("+n+"%, "+e+"%, "+r+"%, "+t[3]+")"},nn.to.hsl=function(){var t=Zt(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},nn.to.hwb=function(){var t=Zt(arguments),n="";return t.length>=4&&1!==t[3]&&(n=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+n+")"},nn.to.keyword=function(t){return Qt[t.slice(0,3)]};var sn={exports:{}},on=Wt,an={};for(var un in on)on.hasOwnProperty(un)&&(an[on[un]]=un);var ln=sn.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var hn in ln)if(ln.hasOwnProperty(hn)){if(!("channels"in ln[hn]))throw new Error("missing channels property: "+hn);if(!("labels"in ln[hn]))throw new Error("missing channel labels property: "+hn);if(ln[hn].labels.length!==ln[hn].channels)throw new Error("channel and label counts mismatch: "+hn);var cn=ln[hn].channels,fn=ln[hn].labels;delete ln[hn].channels,delete ln[hn].labels,Object.defineProperty(ln[hn],"channels",{value:cn}),Object.defineProperty(ln[hn],"labels",{value:fn})}function dn(t,n){return Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)+Math.pow(t[2]-n[2],2)}ln.rgb.hsl=function(t){var n,e,r=t[0]/255,i=t[1]/255,s=t[2]/255,o=Math.min(r,i,s),a=Math.max(r,i,s),u=a-o;return a===o?n=0:r===a?n=(i-s)/u:i===a?n=2+(s-r)/u:s===a&&(n=4+(r-i)/u),(n=Math.min(60*n,360))<0&&(n+=360),e=(o+a)/2,[n,100*(a===o?0:e<=.5?u/(a+o):u/(2-a-o)),100*e]},ln.rgb.hsv=function(t){var n,e,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,l=Math.max(o,a,u),h=l-Math.min(o,a,u),c=function(t){return(l-t)/6/h+.5};return 0===h?i=s=0:(s=h/l,n=c(o),e=c(a),r=c(u),o===l?i=r-e:a===l?i=1/3+n-r:u===l&&(i=2/3+e-n),i<0?i+=1:i>1&&(i-=1)),[360*i,100*s,100*l]},ln.rgb.hwb=function(t){var n=t[0],e=t[1],r=t[2];return[ln.rgb.hsl(t)[0],100*(1/255*Math.min(n,Math.min(e,r))),100*(r=1-1/255*Math.max(n,Math.max(e,r)))]},ln.rgb.cmyk=function(t){var n,e=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-e-(n=Math.min(1-e,1-r,1-i)))/(1-n)||0),100*((1-r-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*n]},ln.rgb.keyword=function(t){var n=an[t];if(n)return n;var e,r=1/0;for(var i in on)if(on.hasOwnProperty(i)){var s=dn(t,on[i]);s<r&&(r=s,e=i)}return e},ln.keyword.rgb=function(t){return on[t]},ln.rgb.xyz=function(t){var n=t[0]/255,e=t[1]/255,r=t[2]/255;return[100*(.4124*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.3576*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*n+.7152*e+.0722*r),100*(.0193*n+.1192*e+.9505*r)]},ln.rgb.lab=function(t){var n=ln.rgb.xyz(t),e=n[0],r=n[1],i=n[2];return r/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},ln.hsl.rgb=function(t){var n,e,r,i,s,o=t[0]/360,a=t[1]/100,u=t[2]/100;if(0===a)return[s=255*u,s,s];n=2*u-(e=u<.5?u*(1+a):u+a-u*a),i=[0,0,0];for(var l=0;l<3;l++)(r=o+1/3*-(l-1))<0&&r++,r>1&&r--,s=6*r<1?n+6*(e-n)*r:2*r<1?e:3*r<2?n+(e-n)*(2/3-r)*6:n,i[l]=255*s;return i},ln.hsl.hsv=function(t){var n=t[0],e=t[1]/100,r=t[2]/100,i=e,s=Math.max(r,.01);return e*=(r*=2)<=1?r:2-r,i*=s<=1?s:2-s,[n,100*(0===r?2*i/(s+i):2*e/(r+e)),100*((r+e)/2)]},ln.hsv.rgb=function(t){var n=t[0]/60,e=t[1]/100,r=t[2]/100,i=Math.floor(n)%6,s=n-Math.floor(n),o=255*r*(1-e),a=255*r*(1-e*s),u=255*r*(1-e*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}},ln.hsv.hsl=function(t){var n,e,r,i=t[0],s=t[1]/100,o=t[2]/100,a=Math.max(o,.01);return r=(2-s)*o,e=s*a,[i,100*(e=(e/=(n=(2-s)*a)<=1?n:2-n)||0),100*(r/=2)]},ln.hwb.rgb=function(t){var n,e,r,i,s,o,a,u=t[0]/360,l=t[1]/100,h=t[2]/100,c=l+h;switch(c>1&&(l/=c,h/=c),r=6*u-(n=Math.floor(6*u)),0!=(1&n)&&(r=1-r),i=l+r*((e=1-h)-l),n){default:case 6:case 0:s=e,o=i,a=l;break;case 1:s=i,o=e,a=l;break;case 2:s=l,o=e,a=i;break;case 3:s=l,o=i,a=e;break;case 4:s=i,o=l,a=e;break;case 5:s=e,o=l,a=i}return[255*s,255*o,255*a]},ln.cmyk.rgb=function(t){var n=t[0]/100,e=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},ln.xyz.rgb=function(t){var n,e,r,i=t[0]/100,s=t[1]/100,o=t[2]/100;return e=-.9689*i+1.8758*s+.0415*o,r=.0557*i+-.204*s+1.057*o,n=(n=3.2406*i+-1.5372*s+-.4986*o)>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(n=Math.min(Math.max(0,n),1)),255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1))]},ln.xyz.lab=function(t){var n=t[0],e=t[1],r=t[2];return e/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116)-16,500*(n-e),200*(e-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},ln.lab.xyz=function(t){var n,e,r,i=t[0];n=t[1]/500+(e=(i+16)/116),r=e-t[2]/200;var s=Math.pow(e,3),o=Math.pow(n,3),a=Math.pow(r,3);return e=s>.008856?s:(e-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,[n*=95.047,e*=100,r*=108.883]},ln.lab.lch=function(t){var n,e=t[0],r=t[1],i=t[2];return(n=360*Math.atan2(i,r)/2/Math.PI)<0&&(n+=360),[e,Math.sqrt(r*r+i*i),n]},ln.lch.lab=function(t){var n,e=t[0],r=t[1];return n=t[2]/360*2*Math.PI,[e,r*Math.cos(n),r*Math.sin(n)]},ln.rgb.ansi16=function(t){var n=t[0],e=t[1],r=t[2],i=1 in arguments?arguments[1]:ln.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var s=30+(Math.round(r/255)<<2|Math.round(e/255)<<1|Math.round(n/255));return 2===i&&(s+=60),s},ln.hsv.ansi16=function(t){return ln.rgb.ansi16(ln.hsv.rgb(t),t[2])},ln.rgb.ansi256=function(t){var n=t[0],e=t[1],r=t[2];return n===e&&e===r?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5)},ln.ansi16.rgb=function(t){var n=t%10;if(0===n||7===n)return t>50&&(n+=3.5),[n=n/10.5*255,n,n];var e=.5*(1+~~(t>50));return[(1&n)*e*255,(n>>1&1)*e*255,(n>>2&1)*e*255]},ln.ansi256.rgb=function(t){if(t>=232){var n=10*(t-232)+8;return[n,n,n]}var e;return t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255]},ln.rgb.hex=function(t){var n=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(n.length)+n},ln.hex.rgb=function(t){var n=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];var e=n[0];3===n[0].length&&(e=e.split("").map((function(t){return t+t})).join(""));var r=parseInt(e,16);return[r>>16&255,r>>8&255,255&r]},ln.rgb.hcg=function(t){var n,e=t[0]/255,r=t[1]/255,i=t[2]/255,s=Math.max(Math.max(e,r),i),o=Math.min(Math.min(e,r),i),a=s-o;return n=a<=0?0:s===e?(r-i)/a%6:s===r?2+(i-e)/a:4+(e-r)/a+4,n/=6,[360*(n%=1),100*a,100*(a<1?o/(1-a):0)]},ln.hsl.hcg=function(t){var n=t[1]/100,e=t[2]/100,r=1,i=0;return(r=e<.5?2*n*e:2*n*(1-e))<1&&(i=(e-.5*r)/(1-r)),[t[0],100*r,100*i]},ln.hsv.hcg=function(t){var n=t[1]/100,e=t[2]/100,r=n*e,i=0;return r<1&&(i=(e-r)/(1-r)),[t[0],100*r,100*i]},ln.hcg.rgb=function(t){var n=t[0]/360,e=t[1]/100,r=t[2]/100;if(0===e)return[255*r,255*r,255*r];var i,s=[0,0,0],o=n%1*6,a=o%1,u=1-a;switch(Math.floor(o)){case 0:s[0]=1,s[1]=a,s[2]=0;break;case 1:s[0]=u,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=a;break;case 3:s[0]=0,s[1]=u,s[2]=1;break;case 4:s[0]=a,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=u}return i=(1-e)*r,[255*(e*s[0]+i),255*(e*s[1]+i),255*(e*s[2]+i)]},ln.hcg.hsv=function(t){var n=t[1]/100,e=n+t[2]/100*(1-n),r=0;return e>0&&(r=n/e),[t[0],100*r,100*e]},ln.hcg.hsl=function(t){var n=t[1]/100,e=t[2]/100*(1-n)+.5*n,r=0;return e>0&&e<.5?r=n/(2*e):e>=.5&&e<1&&(r=n/(2*(1-e))),[t[0],100*r,100*e]},ln.hcg.hwb=function(t){var n=t[1]/100,e=n+t[2]/100*(1-n);return[t[0],100*(e-n),100*(1-e)]},ln.hwb.hcg=function(t){var n=t[1]/100,e=1-t[2]/100,r=e-n,i=0;return r<1&&(i=(e-r)/(1-r)),[t[0],100*r,100*i]},ln.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},ln.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},ln.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},ln.gray.hsl=ln.gray.hsv=function(t){return[0,0,t[0]]},ln.gray.hwb=function(t){return[0,100,t[0]]},ln.gray.cmyk=function(t){return[0,0,0,t[0]]},ln.gray.lab=function(t){return[t[0],0,0]},ln.gray.hex=function(t){var n=255&Math.round(t[0]/100*255),e=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(e.length)+e},ln.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var pn=sn.exports;function yn(t){var n=function(){for(var t={},n=Object.keys(pn),e=n.length,r=0;r<e;r++)t[n[r]]={distance:-1,parent:null};return t}(),e=[t];for(n[t].distance=0;e.length;)for(var r=e.pop(),i=Object.keys(pn[r]),s=i.length,o=0;o<s;o++){var a=i[o],u=n[a];-1===u.distance&&(u.distance=n[r].distance+1,u.parent=r,e.unshift(a))}return n}function mn(t,n){return function(e){return n(t(e))}}function gn(t,n){for(var e=[n[t].parent,t],r=pn[n[t].parent][t],i=n[t].parent;n[i].parent;)e.unshift(n[i].parent),r=mn(pn[n[i].parent][i],r),i=n[i].parent;return r.conversion=e,r}var vn=sn.exports,bn=function(t){for(var n=yn(t),e={},r=Object.keys(n),i=r.length,s=0;s<i;s++){var o=r[s];null!==n[o].parent&&(e[o]=gn(o,n))}return e},wn={};Object.keys(vn).forEach((function(t){wn[t]={},Object.defineProperty(wn[t],"channels",{value:vn[t].channels}),Object.defineProperty(wn[t],"labels",{value:vn[t].labels});var n=bn(t);Object.keys(n).forEach((function(e){var r=n[e];wn[t][e]=function(t){var n=function(n){if(null==n)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var e=t(n);if("object"==typeof e)for(var r=e.length,i=0;i<r;i++)e[i]=Math.round(e[i]);return e};return"conversion"in t&&(n.conversion=t.conversion),n}(r),wn[t][e].raw=function(t){var n=function(n){return null==n?n:(arguments.length>1&&(n=Array.prototype.slice.call(arguments)),t(n))};return"conversion"in t&&(n.conversion=t.conversion),n}(r)}))}));var Mn=wn,xn=Ht.exports,Fn=Mn,An=[].slice,kn=["keyword","gray","hex"],Pn={};Object.keys(Fn).forEach((function(t){Pn[An.call(Fn[t].labels).sort().join("")]=t}));var Sn={};function _n(t,n){if(!(this instanceof _n))return new _n(t,n);if(n&&n in kn&&(n=null),n&&!(n in Fn))throw new Error("Unknown model: "+n);var e,r;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof _n)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var i=xn.get(t);if(null===i)throw new Error("Unable to parse color from string: "+t);this.model=i.model,r=Fn[this.model].channels,this.color=i.value.slice(0,r),this.valpha="number"==typeof i.value[r]?i.value[r]:1}else if(t.length){this.model=n||"rgb",r=Fn[this.model].channels;var s=An.call(t,0,r);this.color=$n(s,r),this.valpha="number"==typeof t[r]?t[r]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var o=Object.keys(t);"alpha"in t&&(o.splice(o.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var a=o.sort().join("");if(!(a in Pn))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Pn[a];var u=Fn[this.model].labels,l=[];for(e=0;e<u.length;e++)l.push(t[u[e]]);this.color=$n(l)}if(Sn[this.model])for(r=Fn[this.model].channels,e=0;e<r;e++){var h=Sn[this.model][e];h&&(this.color[e]=h(this.color[e]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function On(t,n,e){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(Sn[t]||(Sn[t]=[]))[n]=e})),t=t[0],function(r){var i;return arguments.length?(e&&(r=e(r)),(i=this[t]()).color[n]=r,i):(i=this[t]().color[n],e&&(i=e(i)),i)}}function En(t){return function(n){return Math.max(0,Math.min(t,n))}}function In(t){return Array.isArray(t)?t:[t]}function $n(t,n){for(var e=0;e<n;e++)"number"!=typeof t[e]&&(t[e]=0);return t}_n.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var n=this.model in xn.to?this:this.rgb(),e=1===(n=n.round("number"==typeof t?t:1)).valpha?n.color:n.color.concat(this.valpha);return xn.to[n.model](e)},percentString:function(t){var n=this.rgb().round("number"==typeof t?t:1),e=1===n.valpha?n.color:n.color.concat(this.valpha);return xn.to.rgb.percent(e)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},n=Fn[this.model].channels,e=Fn[this.model].labels,r=0;r<n;r++)t[e[r]]=this.color[r];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new _n(this.color.map(function(t){return function(n){return function(t,n){return Number(t.toFixed(n))}(n,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new _n(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:On("rgb",0,En(255)),green:On("rgb",1,En(255)),blue:On("rgb",2,En(255)),hue:On(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:On("hsl",1,En(100)),lightness:On("hsl",2,En(100)),saturationv:On("hsv",1,En(100)),value:On("hsv",2,En(100)),chroma:On("hcg",1,En(100)),gray:On("hcg",2,En(100)),white:On("hwb",1,En(100)),wblack:On("hwb",2,En(100)),cyan:On("cmyk",0,En(100)),magenta:On("cmyk",1,En(100)),yellow:On("cmyk",2,En(100)),black:On("cmyk",3,En(100)),x:On("xyz",0,En(100)),y:On("xyz",1,En(100)),z:On("xyz",2,En(100)),l:On("lab",0,En(100)),a:On("lab",1),b:On("lab",2),keyword:function(t){return arguments.length?new _n(t):Fn[this.model].keyword(this.color)},hex:function(t){return arguments.length?new _n(t):xn.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,n=[],e=0;e<t.length;e++){var r=t[e]/255;n[e]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*n[0]+.7152*n[1]+.0722*n[2]},contrast:function(t){var n=this.luminosity(),e=t.luminosity();return n>e?(n+.05)/(e+.05):(e+.05)/(n+.05)},level:function(t){var n=this.contrast(t);return n>=7.1?"AAA":n>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),n=0;n<3;n++)t.color[n]=255-t.color[n];return t},lighten:function(t){var n=this.hsl();return n.color[2]+=n.color[2]*t,n},darken:function(t){var n=this.hsl();return n.color[2]-=n.color[2]*t,n},saturate:function(t){var n=this.hsl();return n.color[1]+=n.color[1]*t,n},desaturate:function(t){var n=this.hsl();return n.color[1]-=n.color[1]*t,n},whiten:function(t){var n=this.hwb();return n.color[1]+=n.color[1]*t,n},blacken:function(t){var n=this.hwb();return n.color[2]+=n.color[2]*t,n},grayscale:function(){var t=this.rgb().color,n=.3*t[0]+.59*t[1]+.11*t[2];return _n.rgb(n,n,n)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var n=this.hsl(),e=n.color[0];return e=(e=(e+t)%360)<0?360+e:e,n.color[0]=e,n},mix:function(t,n){if(!t||!t.rgb)throw new Error(\'Argument to "mix" was not a Color instance, but rather an instance of \'+typeof t);var e=t.rgb(),r=this.rgb(),i=void 0===n?.5:n,s=2*i-1,o=e.alpha()-r.alpha(),a=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,u=1-a;return _n.rgb(a*e.red()+u*r.red(),a*e.green()+u*r.green(),a*e.blue()+u*r.blue(),e.alpha()*i+r.alpha()*(1-i))}},Object.keys(Fn).forEach((function(t){if(-1===kn.indexOf(t)){var n=Fn[t].channels;_n.prototype[t]=function(){if(this.model===t)return new _n(this);if(arguments.length)return new _n(arguments,t);var e="number"==typeof arguments[n]?n:this.valpha;return new _n(In(Fn[this.model][t].raw(this.color)).concat(e),t)},_n[t]=function(e){return"number"==typeof e&&(e=$n(An.call(arguments),n)),new _n(e,t)}}}));var Cn=_n;\n/*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */const Tn=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function zn(t){return new Function("f","var p = (f && f.properties || {}); return "+Dn(t))}function Dn(t){if(!t)return"true";const n=t[0];if(t.length<=1)return"any"===n?"false":"true";return`(${"=="===n?Un(t[1],t[2],"===",!1):"!="===n?Un(t[1],t[2],"!==",!1):"<"===n||">"===n||"<="===n||">="===n?Un(t[1],t[2],n,!0):"any"===n?Ln(t.slice(1),"||"):"all"===n?Ln(t.slice(1),"&&"):"none"===n?Hn(Ln(t.slice(1),"||")):"in"===n?Vn(t[1],t.slice(2)):"!in"===n?Hn(Vn(t[1],t.slice(2))):"has"===n?Rn(t[1]):"!has"===n?Hn(Rn(t[1])):"contains"===n?function(t,n,e){const r=jn(t);return void 0!==e?`(${r} + \'\').indexOf("${n}") === ${e}`:`(${r} + \'\').indexOf("${n}") >= 0`}(t[1],t[2],t[3]):"true"})`}function jn(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function Un(t,n,e,r){if("object"==typeof(i=t)&&i&&t.op)return function(t,n,e,r){const i=t.property,s=t.op;let o=jn(i);return"length"!==s?(console.error(`not support ${s} op`),"false"):(o=`((${o}+=\'\').length)`,Nn(o,i,n,e,r))}(t,n,e,r);var i;return Nn(jn(t),t,n,e,r)}function Nn(t,n,e,r,i){const s="$type"===n?Tn.indexOf(e):JSON.stringify(e);return(i?`typeof ${t}=== typeof ${s}&&`:"")+t+r+s}function Ln(t,n){return t.map(Dn).join(n)}function Vn(t,n){"$type"===t&&(n=n.map(t=>Tn.indexOf(t)));const e=JSON.stringify(n.sort(Wn)),r=jn(t);return n.length<=200?`${e}.indexOf(${r}) !== -1`:`function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${r}, ${e},0,${n.length-1})`}function Rn(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function Hn(t){return`!(${t})`}function Wn(t,n){return t<n?-1:t>n?1:0}var qn={exports:{}};qn.exports=function(){function t(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function n(t,n){return t<n?-1:t>n?1:0}return function(e,r,i,s,o){!function n(e,r,i,s,o){for(;s>i;){if(s-i>600){var a=s-i+1,u=r-i+1,l=Math.log(a),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(a-h)/a)*(u-a/2<0?-1:1),f=Math.max(i,Math.floor(r-u*h/a+c)),d=Math.min(s,Math.floor(r+(a-u)*h/a+c));n(e,r,f,d,o)}var p=e[r],y=i,m=s;for(t(e,i,r),o(e[s],p)>0&&t(e,i,s);y<m;){for(t(e,y,m),y++,m--;o(e[y],p)<0;)y++;for(;o(e[m],p)>0;)m--}0===o(e[i],p)?t(e,i,m):(m++,t(e,m,s)),m<=r&&(i=m+1),r<=m&&(s=m-1)}}(e,r,i||0,s||e.length-1,o||n)}}();var Gn=qn.exports;class Bn{constructor(t=[],n=Jn){if(this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this.D(t)}push(t){this.data.push(t),this.length++,this.j(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],n=this.data.pop();return this.length--,this.length>0&&(this.data[0]=n,this.D(0)),t}peek(){return this.data[0]}j(t){const{data:n,compare:e}=this,r=n[t];for(;t>0;){const i=t-1>>1,s=n[i];if(e(r,s)>=0)break;n[t]=s,t=i}n[t]=r}D(t){const{data:n,compare:e}=this,r=this.length>>1,i=n[t];for(;t<r;){let r=1+(t<<1),s=n[r];const o=r+1;if(o<this.length&&e(n[o],s)<0&&(r=o,s=n[o]),e(s,i)>=0)break;n[t]=s,t=r}n[t]=i}}function Jn(t,n){return t<n?-1:t>n?1:0}\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */const Xn=[],Yn=[],Zn=[],Kn=[];function Qn(t,n,e){const r=mt(Yn,n,e);t=At(t,function(t,n,e,r,i,s,o,a,u,l){return t[0]=n,t[1]=e,t[2]=r,t[3]=i,t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=l,t}(Xn,e[0],e[1],e[2],...r,...n));if((t=function(t){return t[3]<0?Pt(t,t,-1):t}(t=St(t,t)))[3]<1/32767){t[3]=1/32767;const n=Math.sqrt(.9999999990686206);t[0]*=n,t[1]*=n,t[2]*=n}const i=e[3]>0?mt(Zn,e,n):mt(Zn,n,e);return yt(mt(Kn,e,n),i)<0&&Pt(t,t,-1),t}const te=[];function ne(t,n,e){const r=e||[];r.setLength&&r.setLength(t.length);const i=te;i.length<t.length/3&&(i.length=t.length/3),i.fill(0,0,t.length/3);const s=void 0===n.length?n:n.length;for(let e=0;e<s/3;e++)void 0===n.length?le(t,3*e,3*e+1,3*e+2,r,i):le(t,n[3*e],n[3*e+1],n[3*e+2],r,i);for(let t=0;t<r.length;t+=3){const n=i[t/3];0!==n?(r[t]/=n,r[t+1]/=n,r[t+2]/=n):(r[t]=0,r[t+1]=0,r[t+2]=0)}return r}const ee=[],re=[],ie=[],se=[],oe=[],ae=[],ue=[];function le(t,n,e,r,i,s){ft(se,t[3*n],t[3*n+1],t[3*n+2]),ft(oe,t[3*e],t[3*e+1],t[3*e+2]),ft(ae,t[3*r],t[3*r+1],t[3*r+2]);const o=gt(ee,ae,oe),a=gt(re,se,oe),u=mt(ie,o,a);pt(ue,u),i[3*n]=i[3*n]||0,i[3*e]=i[3*e]||0,i[3*r]=i[3*r]||0,i[3*n+1]=i[3*n+1]||0,i[3*e+1]=i[3*e+1]||0,i[3*r+1]=i[3*r+1]||0,i[3*n+2]=i[3*n+2]||0,i[3*e+2]=i[3*e+2]||0,i[3*r+2]=i[3*r+2]||0,i[3*n]+=ue[0],i[3*e]+=ue[0],i[3*r]+=ue[0],i[3*n+1]+=ue[1],i[3*e+1]+=ue[1],i[3*r+1]+=ue[1],i[3*n+2]+=ue[2],i[3*e+2]+=ue[2],i[3*r+2]+=ue[2],s[n]+=1,s[e]+=1,s[r]+=1}\n/*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */function he(t,n,e){return t[0]=n[e],t[1]=n[e+1],t[2]=n[e+2],t}function ce(t,n,e){return t[0]=n[e],t[1]=n[e+1],t}var fe={exports:{}};function de(t,n,e){e=e||2;var r,i,s,o,a,u,l,h=n&&n.length,c=h?n[0]*e:t.length,f=pe(t,0,c,e,!0),d=[];if(!f||f.next===f.prev)return d;if(h&&(f=function(t,n,e,r){var i,s,o,a,u,l=[];for(i=0,s=n.length;i<s;i++)o=n[i]*r,a=i<s-1?n[i+1]*r:t.length,(u=pe(t,o,a,r,!1))===u.next&&(u.steiner=!0),l.push(ke(u));for(l.sort(Me),i=0;i<l.length;i++)e=xe(l[i],e);return e}(t,n,f,e)),t.length>80*e){r=s=t[0],i=o=t[1];for(var p=e;p<c;p+=e)(a=t[p])<r&&(r=a),(u=t[p+1])<i&&(i=u),a>s&&(s=a),u>o&&(o=u);l=0!==(l=Math.max(s-r,o-i))?32767/l:0}return me(f,d,e,r,i,l,0),d}function pe(t,n,e,r,i){var s,o;if(i===Ue(t,n,e,r)>0)for(s=n;s<e;s+=r)o=ze(s,t[s],t[s+1],o);else for(s=e-r;s>=n;s-=r)o=ze(s,t[s],t[s+1],o);return o&&Oe(o,o.next)&&(De(o),o=o.next),o}function ye(t,n){if(!t)return t;n||(n=t);var e,r=t;do{if(e=!1,r.steiner||!Oe(r,r.next)&&0!==_e(r.prev,r,r.next))r=r.next;else{if(De(r),(r=n=r.prev)===r.next)break;e=!0}}while(e||r!==n);return n}function me(t,n,e,r,i,s,o){if(t){!o&&s&&function(t,n,e,r){var i=t;do{0===i.z&&(i.z=Ae(i.x,i.y,n,e,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var n,e,r,i,s,o,a,u,l=1;do{for(e=t,t=null,s=null,o=0;e;){for(o++,r=e,a=0,n=0;n<l&&(a++,r=r.nextZ);n++);for(u=l;a>0||u>0&&r;)0!==a&&(0===u||!r||e.z<=r.z)?(i=e,e=e.nextZ,a--):(i=r,r=r.nextZ,u--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;e=r}s.nextZ=null,l*=2}while(o>1)}(i)}(t,r,i,s);for(var a,u,l=t;t.prev!==t.next;)if(a=t.prev,u=t.next,s?ve(t,r,i,s):ge(t))n.push(a.i/e|0),n.push(t.i/e|0),n.push(u.i/e|0),De(t),t=u.next,l=u.next;else if((t=u)===l){o?1===o?me(t=be(ye(t),n,e),n,e,r,i,s,2):2===o&&we(t,n,e,r,i,s):me(ye(t),n,e,r,i,s,1);break}}}function ge(t){var n=t.prev,e=t,r=t.next;if(_e(n,e,r)>=0)return!1;for(var i=n.x,s=e.x,o=r.x,a=n.y,u=e.y,l=r.y,h=i<s?i<o?i:o:s<o?s:o,c=a<u?a<l?a:l:u<l?u:l,f=i>s?i>o?i:o:s>o?s:o,d=a>u?a>l?a:l:u>l?u:l,p=r.next;p!==n;){if(p.x>=h&&p.x<=f&&p.y>=c&&p.y<=d&&Pe(i,a,s,u,o,l,p.x,p.y)&&_e(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function ve(t,n,e,r){var i=t.prev,s=t,o=t.next;if(_e(i,s,o)>=0)return!1;for(var a=i.x,u=s.x,l=o.x,h=i.y,c=s.y,f=o.y,d=a<u?a<l?a:l:u<l?u:l,p=h<c?h<f?h:f:c<f?c:f,y=a>u?a>l?a:l:u>l?u:l,m=h>c?h>f?h:f:c>f?c:f,g=Ae(d,p,n,e,r),v=Ae(y,m,n,e,r),b=t.prevZ,w=t.nextZ;b&&b.z>=g&&w&&w.z<=v;){if(b.x>=d&&b.x<=y&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&Pe(a,h,u,c,l,f,b.x,b.y)&&_e(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,w.x>=d&&w.x<=y&&w.y>=p&&w.y<=m&&w!==i&&w!==o&&Pe(a,h,u,c,l,f,w.x,w.y)&&_e(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=y&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&Pe(a,h,u,c,l,f,b.x,b.y)&&_e(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;w&&w.z<=v;){if(w.x>=d&&w.x<=y&&w.y>=p&&w.y<=m&&w!==i&&w!==o&&Pe(a,h,u,c,l,f,w.x,w.y)&&_e(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function be(t,n,e){var r=t;do{var i=r.prev,s=r.next.next;!Oe(i,s)&&Ee(i,r,r.next,s)&&Ce(i,s)&&Ce(s,i)&&(n.push(i.i/e|0),n.push(r.i/e|0),n.push(s.i/e|0),De(r),De(r.next),r=t=s),r=r.next}while(r!==t);return ye(r)}function we(t,n,e,r,i,s){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Se(o,a)){var u=Te(o,a);return o=ye(o,o.next),u=ye(u,u.next),me(o,n,e,r,i,s,0),void me(u,n,e,r,i,s,0)}a=a.next}o=o.next}while(o!==t)}function Me(t,n){return t.x-n.x}function xe(t,n){var e=function(t,n){var e,r=n,i=t.x,s=t.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>o&&(o=a,e=r.x<r.next.x?r:r.next,a===i))return e}r=r.next}while(r!==n);if(!e)return null;var u,l=e,h=e.x,c=e.y,f=1/0;r=e;do{i>=r.x&&r.x>=h&&i!==r.x&&Pe(s<c?i:o,s,h,c,s<c?o:i,s,r.x,r.y)&&(u=Math.abs(s-r.y)/(i-r.x),Ce(r,t)&&(u<f||u===f&&(r.x>e.x||r.x===e.x&&Fe(e,r)))&&(e=r,f=u)),r=r.next}while(r!==l);return e}(t,n);if(!e)return n;var r=Te(e,t);return ye(r,r.next),ye(e,e.next)}function Fe(t,n){return _e(t.prev,t,n.prev)<0&&_e(n.next,t,t.next)<0}function Ae(t,n,e,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-e)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-r)*i|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function ke(t){var n=t,e=t;do{(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next}while(n!==t);return e}function Pe(t,n,e,r,i,s,o,a){return(i-o)*(n-a)>=(t-o)*(s-a)&&(t-o)*(r-a)>=(e-o)*(n-a)&&(e-o)*(s-a)>=(i-o)*(r-a)}function Se(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Ee(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}(t,n)&&(Ce(t,n)&&Ce(n,t)&&function(t,n){var e=t,r=!1,i=(t.x+n.x)/2,s=(t.y+n.y)/2;do{e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next}while(e!==t);return r}(t,n)&&(_e(t.prev,t,n.prev)||_e(t,n.prev,n))||Oe(t,n)&&_e(t.prev,t,t.next)>0&&_e(n.prev,n,n.next)>0)}function _e(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Oe(t,n){return t.x===n.x&&t.y===n.y}function Ee(t,n,e,r){var i=$e(_e(t,n,e)),s=$e(_e(t,n,r)),o=$e(_e(e,r,t)),a=$e(_e(e,r,n));return i!==s&&o!==a||(!(0!==i||!Ie(t,e,n))||(!(0!==s||!Ie(t,r,n))||(!(0!==o||!Ie(e,t,r))||!(0!==a||!Ie(e,n,r)))))}function Ie(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function $e(t){return t>0?1:t<0?-1:0}function Ce(t,n){return _e(t.prev,t,t.next)<0?_e(t,n,t.next)>=0&&_e(t,t.prev,n)>=0:_e(t,n,t.prev)<0||_e(t,t.next,n)<0}function Te(t,n){var e=new je(t.i,t.x,t.y),r=new je(n.i,n.x,n.y),i=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=i,i.prev=e,r.next=e,e.prev=r,s.next=r,r.prev=s,r}function ze(t,n,e,r){var i=new je(t,n,e);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function De(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 je(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ue(t,n,e,r){for(var i=0,s=n,o=e-r;s<e;s+=r)i+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return i}fe.exports=de,fe.exports.default=de,de.deviation=function(t,n,e,r){var i=n&&n.length,s=i?n[0]*e:t.length,o=Math.abs(Ue(t,0,s,e));if(i)for(var a=0,u=n.length;a<u;a++){var l=n[a]*e,h=a<u-1?n[a+1]*e:t.length;o-=Math.abs(Ue(t,l,h,e))}var c=0;for(a=0;a<r.length;a+=3){var f=r[a]*e,d=r[a+1]*e,p=r[a+2]*e;c+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},de.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},r=0,i=0;i<t.length;i++){for(var s=0;s<t[i].length;s++)for(var o=0;o<n;o++)e.vertices.push(t[i][s][o]);i>0&&(r+=t[i-1].length,e.holes.push(r))}return e};var Ne=fe.exports;\n/*!\n * @maptalks/vector-packer v0.93.0\n * LICENSE : UNLICENSED\n * (c) 2016-2024 maptalks.com\n */const Le={Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6};function Ve(t,n={}){var e=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)Re(e,t.features[r],n,r);else Re(e,"Feature"===t.type?t:{geometry:t},n);return e}function Re(t,n,e,r){if(n.geometry&&n.geometry.geometry){var i=n.geometry.coordinates,s=n.geometry.type,o=[],a=n.id;if(e.promoteId?a=n.properties[e.promoteId]:e.generateId&&(a=r||0),"Point"===s)He(i,o);else if("MultiPoint"===s)for(var u=0;u<i.length;u++)He(i[u],o);else if("LineString"===s)qe([i],o);else if("MultiLineString"===s){if(e.lineMetrics){for(u=0;u<i.length;u++)We(i[u],o=[]),t.push(Ge(a,"LineString",o,n.properties));return}qe(i,o)}else if("Polygon"===s)qe(i,o);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(u=0;u<n.geometry.geometries.length;u++)Re(t,{id:a,geometry:n.geometry.geometries[u],properties:n.properties},e,r);return}return void console.warn(`Input data type(${s}) is not a valid GeoJSON geometry type.`)}for(u=0;u<i.length;u++){var l=[];qe(i[u],l),o.push(l)}}t.push(Ge(a,s,o,n.properties))}}function He(t,n){const e=new Ut(t[0],t[1]);e.z=100*(t[2]||0),n.push([e])}function We(t,n){for(let e=0;e<t.length;e++){const r=new Ut(t[e][0],t[e][1]);r.z=100*(t[e][2]||0),n.push(r)}}function qe(t,n,e,r){for(var i=0;i<t.length;i++){var s=[];We(t[i],s),n.push(s)}}function Ge(t,n,e,r){return{id:void 0===t?null:t,type:Le[n],geometry:e,properties:r}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */function Be(t,{width:n,height:e},r,i){if(i){if(i.length!==n*e*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*e*r);return t.width=n,t.height=e,t.data=i,t}function Je(t,{width:n,height:e},r){if(n===t.width&&e===t.height)return;const i=Be({},{width:n,height:e},r);Xe(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,e)},r),t.width=n,t.height=e,t.data=i.data}function Xe(t,n,e,r,i,s){if(0===i.width||0===i.height)return n;if(i.width>t.width||i.height>t.height||e.x>t.width-i.width||e.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>n.width||i.height>n.height||r.x>n.width-i.width||r.y>n.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const o=t.data,a=n.data;if(o===a)return n;for(let u=0;u<i.height;u++){const l=((e.y+u)*t.width+e.x)*s,h=((r.y+u)*n.width+r.x)*s;for(let t=0;t<i.width*s;t++)a[h+t]=o[l+t]}return n}class Ye{constructor(t,n){Be(this,t,1,n)}resize(t){Je(this,t,1)}clone(){return new Ye({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,e,r,i){Xe(t,n,e,r,i,1)}}class Ze{constructor(t,n){Be(this,t,4,n)}resize(t){Je(this,t,4)}clone(){return new Ze({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,e,r,i){Xe(t,n,e,r,i,4)}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */class Ke{constructor(t,n,{pixelRatio:e}){this.paddedRect=t,this.pixelRatio=e||1,this.padding=n}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.pixelRatio,(this.paddedRect.h-2*this.padding)/this.pixelRatio]}}class Qe{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,n=Object.keys(t).length,e={},r=new Lt(0,0,{autoResize:!0}),i=[],s=n>1?1:0;for(const n in t){const r=t[n],o={x:0,y:0,w:r.data.width+2*s,h:r.data.height+2*s};i.push(o),e[n]=new Ke(o,s,r)}if(r.pack(i,{inPlace:!0}),!tr(r.w)||!tr(r.h)){const t=nr(r.w),n=nr(r.h);r.resize(t,n)}const o=new Ze({width:r.w,height:r.h});for(const n in t){const r=t[n],i=e[n].paddedRect;Ze.copy(r.data,o,{x:0,y:0},{x:i.x+s,y:i.y+s},r.data)}this.image=o,this.positions=e}}function tr(t){return 0==(t&t-1)&&0!==t}function nr(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n * TODO 升级为potpack\n */class er{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,n={},e=new Lt(0,0,{autoResize:!0}),r=[];for(const e in t){const i=t[e],s=n[e]={};for(const t in i){const n=i[+t];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;const e={x:0,y:0,w:n.bitmap.width+2,h:n.bitmap.height+2};r.push(e),s[t]={rect:e,metrics:n.metrics}}}e.pack(r,{inPlace:!0});const i=new Ye({width:e.w,height:e.h});for(const e in t){const r=t[e];for(const t in r){const s=r[+t];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const o=n[e][t].rect;Ye.copy(s.bitmap,i,{x:0,y:0},{x:o.x+1,y:o.y+1},s.bitmap)}}this.image=i,this.positions=n}}function rr(t){return t<65536?Uint16Array:Uint32Array}function ir(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function sr(t){return t<256?Uint8Array:t<65536?Uint16Array:Float32Array}function or(t,n){const e=t.length;t=t.U||t;const r=new n(e);for(let n=0;n<e;n++)r[n]=t[n];return r}function ar(t){const n=t.type,e=[];if(1===n||4===n)for(let n=0;n<t.geometry.length;n++)He(t.geometry[n],e);else if(2===n)qe(t.geometry,e);else if(3===n)qe(t.geometry,e);else if(5===n)qe(t.geometry,e);else if(6===n)for(let n=0;n<t.geometry.length;n++){const r=[];qe(t.geometry[n],r),e.push(r)}return t.geometry=e,t}function ur(t){for(let n=1;n<arguments.length;n++){const e=arguments[n];for(const n in e)t[n]=e[n]}return t}function lr(t){return null==t}function hr(t){return"number"==typeof t&&!isNaN(t)}function cr(t){return"object"==typeof t&&!!t}function fr(t){return!lr(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function dr(t){return!lr(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}const pr=Object.prototype.hasOwnProperty;function yr(t,n){return pr.call(t,n)}const mr=Math.PI/180;function gr(t){return t&&d(t)&&t.property}function vr(t){const{verticalCentimeterToPoint:n,tileRatio:e}=t;return n*e}function br(t){return"centimeter"===t||"cm"===t?1:"millimeter"===t||"mm"===t?.1:100}const wr={};function Mr(t,n){if(!Array.isArray(n)){if(n&&void 0!==n.r&&void 0!==n.g&&void 0!==n.b)return t[0]=255*n.r,t[1]=255*n.g,t[2]=255*n.b,t[3]=void 0!==n.a?255*n.a:255,t;n=wr[n]=wr[n]||Cn(n).unitArray()}for(let e=0;e<n.length;e++)t[e]=255*n[e];return 3===n.length&&(t[3]=255),t}const xr={textFill:1,textSize:1,textOpacity:1,textDx:1,textDy:1,markerWidth:1,markerHeight:1,markerOpacity:1,markerDx:1,markerDy:1,lineWidth:1,lineColor:1,lineOpacity:1,polygonFill:1,polygonOpacity:1,polygonPatternFileWidth:1,polygonPatternFileOrigin:1},Fr={textName:1,markerTextFitPadding:1,markerTextFit:1,lineGradientProperty:1};var Ar=Object.freeze({__proto__:null,now:function(){return Date.now()},extend:ur,isNil:lr,isNumber:hr,isInteger:function(t){return(0|t)===t},isObject:cr,isString:fr,isFunction:dr,hasOwn:yr,join:function(t,n){return t.join?t.join(n||","):Array.prototype.join.call(t,n||",")},toRadian:function(t){return t*mr},toDegree:function(t){return t/mr},evaluate:function(t,n,e){return dr(t)?t(void 0!==e?e:null,n):t},isFnTypeSymbol:gr,getAltitudeToLocal:vr,getTubeSizeScale:br,normalizeColor:Mr,checkIfIdentityZoomDependent:function(t,n,e){if(Array.isArray(e)||(e=Object.values(e)),!e||!e.length)return!1;if(!xr[t])return!1;for(let t=0;t<e.length;t++){const r=e[t]&&(e[t].feature||e[t]);if(!r)continue;const i=r.properties&&r.properties[n];if(i&&d(i)&&!p(i).isZoomConstant)return!0}return!1},checkIfZoomFnTypeSymbol:function(t){return!!xr[t]||!!Fr[t]}});function kr(t){let n=0;for(let e,r,i=0,s=t.length,o=s-1;i<s;o=i++)if(e=t[i],r=t[o],void 0!==e.x){if(e.z||r.z)return 1;n+=(r.x-e.x)*(e.y+r.y)}else{if(e[2]||r[2])return 1;n+=(r[0]-e[0])*(e[1]+r[1])}return n}function Pr(t,n,e,r,i){const s=t[n*r],o=t[n*r+1],a=t[e*r],u=t[e*r+1];return s===a&&(s<0||s>i)&&o!==u||o===u&&(o<0||o>i)&&s!==a}function Sr(t,n,e){let r=e;return n&&t&&(r=+t[n]),isNaN(r)&&(r=e||0),100*r}function _r(t,n,e,r,i,s,o){n||0===n||(n=1);const a=Sr(t.properties,e,r),u=a*n;let l=(s?100*s:0)||a;return i?l=Sr(t.properties,i,s):o&&(l=a-Sr(t.properties,o,s)),l*=n,{altitude:u,height:l}}function Or(t,n){return n<1/0&&(t.x<0||t.x>n||t.y<0||t.y>n)}function Er(t){return null==t}function Ir(t,n,e){if(t===e||t===n)return t;const r=e-n;return((t-n)%r+r)%r+n}function $r(t,n){if(!n)return null;const e=new Map;for(let r=0;r<n.length;r++){const i=n[r],s=t[i];let o=e.get(s);o||(o=[],e.set(s,o)),o.push(i)}return e}class Cr{constructor(t,n,e,r){this.feature=t,this.symbol=n,this.fnTypes=e,this.options=r}getPolygonResource(){let t=this.symbol.polygonPatternFile;const{polygonPatternFileFn:n}=this.fnTypes;return this.L(t,n)}getLineResource(){let t=this.symbol.linePatternFile;const{linePatternFileFn:n}=this.fnTypes;return this.L(t,n)}L(t,n){return n&&(t=n(this.options.zoom,this.feature.properties)),t}}function Tr(t,n,e,r){const i=Math.abs(r)>>15,s=i>>1,o=i%2;let a=r%Math.pow(2,15);const u=n+(s<<14)*Math.sign(n),l=e+(o<<14)*Math.sign(e);return t[0]=u,t[1]=l,a=Math.round(a),t[2]=0===a?r<0?-1:0:a,t}const zr=Math.pow(2,14),Dr=Math.pow(2,15);\n/*!\n * a compact version of mapbox-gl-style-spec\n * based on mapbox-gl-style-spec@13.28.0\n * https://github.com/mapbox/mapbox-gl-js/tree/main/src/style-spec\n * LICENSE : ISC\n */var jr,Ur,Nr="undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self?self:{},Lr={exports:{}};function Vr(t,...n){for(const e of n)for(const n in e)t[n]=e[n];return t}\n/*! https://mths.be/punycode v1.3.2 by @mathias */jr=Lr,Ur=Lr.exports,function(t){var n=Ur&&!Ur.nodeType&&Ur,e=jr&&!jr.nodeType&&jr,r="object"==typeof Nr&&Nr;r.global!==r&&r.window!==r&&r.self!==r||(t=r);var i,s,o=2147483647,a=/^xn--/,u=/[^\\x20-\\x7E]/,l=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,f=String.fromCharCode;function d(t){throw RangeError(h[t])}function p(t,n){for(var e=t.length,r=[];e--;)r[e]=n(t[e]);return r}function y(t,n){var e=t.split("@"),r="";return e.length>1&&(r=e[0]+"@",t=e[1]),r+p((t=t.replace(l,".")).split("."),n).join(".")}function m(t){for(var n,e,r=[],i=0,s=t.length;i<s;)(n=t.charCodeAt(i++))>=55296&&n<=56319&&i<s?56320==(64512&(e=t.charCodeAt(i++)))?r.push(((1023&n)<<10)+(1023&e)+65536):(r.push(n),i--):r.push(n);return r}function g(t){return p(t,(function(t){var n="";return t>65535&&(n+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),n+f(t)})).join("")}function v(t,n){return t+22+75*(t<26)-((0!=n)<<5)}function b(t,n,e){var r=0;for(t=e?c(t/700):t>>1,t+=c(t/n);t>455;r+=36)t=c(t/35);return c(r+36*t/(t+38))}function w(t){var n,e,r,i,s,a,u,l,h,f,p,y=[],m=t.length,v=0,w=128,M=72;for((e=t.lastIndexOf("-"))<0&&(e=0),r=0;r<e;++r)t.charCodeAt(r)>=128&&d("not-basic"),y.push(t.charCodeAt(r));for(i=e>0?e+1:0;i<m;){for(s=v,a=1,u=36;i>=m&&d("invalid-input"),((l=(p=t.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||l>c((o-v)/a))&&d("overflow"),v+=l*a,!(l<(h=u<=M?1:u>=M+26?26:u-M));u+=36)a>c(o/(f=36-h))&&d("overflow"),a*=f;M=b(v-s,n=y.length+1,0==s),c(v/n)>o-w&&d("overflow"),w+=c(v/n),v%=n,y.splice(v++,0,w)}return g(y)}function M(t){var n,e,r,i,s,a,u,l,h,p,y,g,w,M,x,F=[];for(g=(t=m(t)).length,n=128,e=0,s=72,a=0;a<g;++a)(y=t[a])<128&&F.push(f(y));for(r=i=F.length,i&&F.push("-");r<g;){for(u=o,a=0;a<g;++a)(y=t[a])>=n&&y<u&&(u=y);for(u-n>c((o-e)/(w=r+1))&&d("overflow"),e+=(u-n)*w,n=u,a=0;a<g;++a)if((y=t[a])<n&&++e>o&&d("overflow"),y==n){for(l=e,h=36;!(l<(p=h<=s?1:h>=s+26?26:h-s));h+=36)F.push(f(v(p+(x=l-p)%(M=36-p),0))),l=c(x/M);F.push(f(v(l,0))),s=b(e,w,r==i),e=0,++r}++e,++n}return F.join("")}if(i={version:"1.3.2",ucs2:{decode:m,encode:g},decode:w,encode:M,toASCII:function(t){return y(t,(function(t){return u.test(t)?"xn--"+M(t):t}))},toUnicode:function(t){return y(t,(function(t){return a.test(t)?w(t.slice(4).toLowerCase()):t}))}},n&&e)if(jr.exports==n)e.exports=i;else for(s in i)i.hasOwnProperty(s)&&(n[s]=i[s]);else t.punycode=i}(Nr);class Rr extends Error{constructor(t,n){super(n),this.message=n,this.key=t}}var Hr=Rr;class Wr{constructor(t,n=[]){this.parent=t,this.bindings={};for(const[t,e]of n)this.bindings[t]=e}concat(t){return new Wr(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var qr=Wr;const Gr={kind:"null"},Br={kind:"number"},Jr={kind:"string"},Xr={kind:"boolean"},Yr={kind:"color"},Zr={kind:"object"},Kr={kind:"value"},Qr={kind:"collator"},ti={kind:"formatted"},ni={kind:"resolvedImage"};function ei(t,n){return{kind:"array",itemType:t,N:n}}function ri(t){if("array"===t.kind){const n=ri(t.itemType);return"number"==typeof t.N?`array<${n}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${n}>`}return t.kind}const ii=[Gr,Br,Jr,Xr,Yr,ti,Zr,ei(Kr),ni];function si(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!si(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind)for(const t of ii)if(!si(t,n))return null}return`Expected ${ri(t)} but found ${ri(n)} instead.`}function oi(t,n){return n.some(n=>n.kind===t.kind)}function ai(t,n){return n.some(n=>"null"===n?null===t:"array"===n?Array.isArray(t):"object"===n?t&&!Array.isArray(t)&&"object"==typeof t:n===typeof t)}var ui,li={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function hi(t){return(t=Math.round(t))<0?0:t>255?255:t}function ci(t){return hi("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function fi(t){return function(t){return t<0?0:t>1?1:t}("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function di(t,n,e){return e<0?e+=1:e>1&&(e-=1),6*e<1?t+(n-t)*e*6:2*e<1?n:3*e<2?t+(n-t)*(2/3-e)*6:t}try{ui={}.parseCSSColor=function(t){var n,e=t.replace(/ /g,"").toLowerCase();if(e in li)return li[e].slice();if("#"===e[0])return 4===e.length?(n=parseInt(e.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:7===e.length&&(n=parseInt(e.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var r=e.indexOf("("),i=e.indexOf(")");if(-1!==r&&i+1===e.length){var s=e.substr(0,r),o=e.substr(r+1,i-(r+1)).split(","),a=1;switch(s){case"rgba":if(4!==o.length)return null;a=fi(o.pop());case"rgb":return 3!==o.length?null:[ci(o[0]),ci(o[1]),ci(o[2]),a];case"hsla":if(4!==o.length)return null;a=fi(o.pop());case"hsl":if(3!==o.length)return null;var u=(parseFloat(o[0])%360+360)%360/360,l=fi(o[1]),h=fi(o[2]),c=h<=.5?h*(l+1):h+l-h*l,f=2*h-c;return[hi(255*di(f,c,u+1/3)),hi(255*di(f,c,u)),hi(255*di(f,c,u-1/3)),a];default:return null}}return null}}catch(t){}class pi{constructor(t,n,e,r=1){this.r=t,this.g=n,this.b=e,this.a=r}static parse(t){if(!t)return;if(t instanceof pi)return t;if("string"!=typeof t)return;const n=ui(t);return n?new pi(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3]):void 0}toString(){const[t,n,e,r]=this.toArray();return`rgba(${Math.round(t)},${Math.round(n)},${Math.round(e)},${r})`}toArray(){const{r:t,g:n,b:e,a:r}=this;return 0===r?[0,0,0,0]:[255*t/r,255*n/r,255*e/r,r]}toArray01(){const{r:t,g:n,b:e,a:r}=this;return 0===r?[0,0,0,0]:[t/r,n/r,e/r,r]}toArray01PremultipliedAlpha(){const{r:t,g:n,b:e,a:r}=this;return[t,n,e,r]}}pi.black=new pi(0,0,0,1),pi.white=new pi(1,1,1,1),pi.transparent=new pi(0,0,0,0),pi.red=new pi(1,0,0,1),pi.blue=new pi(0,0,1,1);var yi=pi;class mi{constructor(t,n,e){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=e,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,n){return this.collator.compare(t,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class gi{constructor(t,n,e,r,i){this.text=t.normalize?t.normalize():t,this.image=n,this.scale=e,this.fontStack=r,this.textColor=i}}class vi{constructor(t){this.sections=t}static fromString(t){return new vi([new gi(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof vi?t:vi.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const n of this.sections){if(n.image){t.push(["image",n.image.name]);continue}t.push(n.text);const e={};n.fontStack&&(e["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(e["font-scale"]=n.scale),n.textColor&&(e["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(e)}return t}}class bi{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new bi({name:t,available:!1}):null}serialize(){return["image",this.name]}}function wi(t,n,e,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof e&&e>=0&&e<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,n,e,r].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,n,e,r]:[t,n,e]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function Mi(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 yi)return!0;if(t instanceof mi)return!0;if(t instanceof vi)return!0;if(t instanceof bi)return!0;if(Array.isArray(t)){for(const n of t)if(!Mi(n))return!1;return!0}if("object"==typeof t){for(const n in t)if(!Mi(t[n]))return!1;return!0}return!1}function xi(t){if(null===t)return Gr;if("string"==typeof t)return Jr;if("boolean"==typeof t)return Xr;if("number"==typeof t)return Br;if(t instanceof yi)return Yr;if(t instanceof mi)return Qr;if(t instanceof vi)return ti;if(t instanceof bi)return ni;if(Array.isArray(t)){const n=t.length;let e;for(const n of t){const t=xi(n);if(e){if(e===t)continue;e=Kr;break}e=t}return ei(e||Kr,n)}return Zr}function Fi(t){const n=typeof t;return null===t?"":"string"===n||"number"===n||"boolean"===n?String(t):t instanceof yi||t instanceof vi||t instanceof bi?t.toString():JSON.stringify(t)}class Ai{constructor(t,n){this.type=t,this.value=n}static parse(t,n){if(2!==t.length)return n.error(`\'literal\' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Mi(t[1]))return n.error("invalid value");const e=t[1];let r=xi(e);const i=n.expectedType;return"array"!==r.kind||0!==r.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(r=i),new Ai(r,e)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof yi?["rgba"].concat(this.value.toArray()):this.value instanceof vi?this.value.serialize():this.value}}var ki=Ai,Pi=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const Si={string:Jr,number:Br,boolean:Xr,object:Zr};class _i{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");let e,r=1;const i=t[0];if("array"===i){let i,s;if(t.length>2){const e=t[1];if("string"!=typeof e||!(e in Si)||"object"===e)return n.error(\'The item type argument of "array" must be one of string, number, boolean\',1);i=Si[e],r++}else i=Kr;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return n.error(\'The length argument to "array" must be a positive integer literal\',2);s=t[2],r++}e=ei(i,s)}else e=Si[i];const s=[];for(;r<t.length;r++){const e=n.parse(t[r],r,Kr);if(!e)return null;s.push(e)}return new _i(e,s)}evaluate(t){for(let n=0;n<this.args.length;n++){const e=this.args[n].evaluate(t);if(!si(this.type,xi(e)))return e;if(n===this.args.length-1)throw new Pi(`Expected value to be of type ${ri(this.type)}, but found ${ri(xi(e))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=this.type,n=[t.kind];if("array"===t.kind){const e=t.itemType;if("string"===e.kind||"number"===e.kind||"boolean"===e.kind){n.push(e.kind);const r=t.N;("number"==typeof r||this.args.length>1)&&n.push(r)}}return n.concat(this.args.map(t=>t.serialize()))}}var Oi=_i;class Ei{constructor(t){this.type=ti,this.sections=t}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");const e=t[1];if(!Array.isArray(e)&&"object"==typeof e)return n.error("First argument must be an image or text section.");const r=[];let i=!1;for(let e=1;e<=t.length-1;++e){const s=t[e];if(i&&"object"==typeof s&&!Array.isArray(s)){i=!1;let t=null;if(s["font-scale"]&&(t=n.parse(s["font-scale"],1,Br),!t))return null;let e=null;if(s["text-font"]&&(e=n.parse(s["text-font"],1,ei(Jr)),!e))return null;let o=null;if(s["text-color"]&&(o=n.parse(s["text-color"],1,Yr),!o))return null;const a=r[r.length-1];a.scale=t,a.font=e,a.textColor=o}else{const s=n.parse(t[e],1,Kr);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return n.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");i=!0,r.push({content:s,scale:null,font:null,textColor:null})}}return new Ei(r)}evaluate(t){return new vi(this.sections.map(n=>{const e=n.content.evaluate(t);return xi(e)===ni?new gi("",e,null,null,null):new gi(Fi(e),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)}))}eachChild(t){for(const n of this.sections)t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const n of this.sections){t.push(n.content.serialize());const e={};n.scale&&(e["font-scale"]=n.scale.serialize()),n.font&&(e["text-font"]=n.font.serialize()),n.textColor&&(e["text-color"]=n.textColor.serialize()),t.push(e)}return t}}class Ii{constructor(t){this.type=ni,this.input=t}static parse(t,n){if(2!==t.length)return n.error("Expected two arguments.");const e=n.parse(t[1],1,Jr);return e?new Ii(e):n.error("No image name provided.")}evaluate(t){const n=this.input.evaluate(t),e=bi.fromString(n);return e&&t.availableImages&&(e.available=t.availableImages.indexOf(n)>-1),e}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const $i={"to-boolean":Xr,"to-color":Yr,"to-number":Br,"to-string":Jr};class Ci{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expected at least one argument.");const e=t[0];if(("to-boolean"===e||"to-string"===e)&&2!==t.length)return n.error("Expected one argument.");const r=$i[e],i=[];for(let e=1;e<t.length;e++){const r=n.parse(t[e],e,Kr);if(!r)return null;i.push(r)}return new Ci(r,i)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let n,e;for(const r of this.args){if(n=r.evaluate(t),e=null,n instanceof yi)return n;if("string"==typeof n){const e=t.parseColor(n);if(e)return e}else if(Array.isArray(n)&&(e=n.length<3||n.length>4?`Invalid rbga value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:wi(n[0],n[1],n[2],n[3]),!e))return new yi(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new Pi(e||`Could not parse color from value \'${"string"==typeof n?n:String(JSON.stringify(n))}\'`)}if("number"===this.type.kind){let n=null;for(const e of this.args){if(n=e.evaluate(t),null===n)return 0;const r=Number(n);if(!isNaN(r))return r}throw new Pi(`Could not convert ${JSON.stringify(n)} to number.`)}return"formatted"===this.type.kind?vi.fromString(Fi(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?bi.fromString(Fi(this.args[0].evaluate(t))):Fi(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Ei([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ii(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild(n=>{t.push(n.serialize())}),t}}var Ti=Ci;const zi=["Unknown","Point","LineString","Polygon"];var Di=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this.V={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?zi[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,n=this.featureDistanceData.scale,{x:e,y:r}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(e*n-t[0])+this.featureDistanceData.bearing[1]*(r*n-t[1])}return 0}parseColor(t){let n=this.V[t];return n||(n=this.V[t]=yi.parse(t)),n}};class ji{constructor(t,n,e,r){this.name=t,this.type=n,this.R=e,this.args=r}evaluate(t){return this.R(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,n){const e=t[0],r=ji.definitions[e];if(!r)return n.error(`Unknown expression "${e}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(r)?r[0]:r.type,s=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,o=s.filter(([n])=>!Array.isArray(n)||n.length===t.length-1);let a=null;for(const[r,s]of o){a=new ls(n.registry,n.path,null,n.scope);const o=[];let u=!1;for(let n=1;n<t.length;n++){const e=t[n],i=Array.isArray(r)?r[n-1]:r.type,s=a.parse(e,1+o.length,i);if(!s){u=!0;break}o.push(s)}if(!u)if(Array.isArray(r)&&r.length!==o.length)a.error(`Expected ${r.length} arguments, but found ${o.length} instead.`);else{for(let t=0;t<o.length;t++){const n=Array.isArray(r)?r[t]:r.type,e=o[t];a.concat(t+1).checkSubtype(n,e.type)}if(0===a.errors.length)return new ji(e,i,s,o)}}if(1===o.length)n.errors.push(...a.errors);else{const e=(o.length?o:s).map(([t])=>{return n=t,Array.isArray(n)?`(${n.map(ri).join(", ")})`:`(${ri(n.type)}...)`;var n}).join(" | "),r=[];for(let e=1;e<t.length;e++){const i=n.parse(t[e],1+r.length);if(!i)return null;r.push(ri(i.type))}n.error(`Expected arguments of type ${e}, but found (${r.join(", ")}) instead.`)}return null}static register(t,n){ji.definitions=n;for(const e in n)t[e]=ji}}var Ui=ji;class Ni{constructor(t,n,e){this.type=Qr,this.locale=e,this.caseSensitive=t,this.diacriticSensitive=n}static parse(t,n){if(2!==t.length)return n.error("Expected one argument.");const e=t[1];if("object"!=typeof e||Array.isArray(e))return n.error("Collator options argument must be an object.");const r=n.parse(void 0!==e["case-sensitive"]&&e["case-sensitive"],1,Xr);if(!r)return null;const i=n.parse(void 0!==e["diacritic-sensitive"]&&e["diacritic-sensitive"],1,Xr);if(!i)return null;let s=null;return e.locale&&(s=n.parse(e.locale,1,Jr),!s)?null:new Ni(r,i,s)}evaluate(t){return new mi(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function Li(t,n){t[0]=Math.min(t[0],n[0]),t[1]=Math.min(t[1],n[1]),t[2]=Math.max(t[2],n[0]),t[3]=Math.max(t[3],n[1])}function Vi(t,n){return!(t[0]<=n[0]||t[2]>=n[2]||t[1]<=n[1]||t[3]>=n[3])}function Ri(t,n){const e=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,n.z);return[Math.round(e*i*8192),Math.round(r*i*8192)]}function Hi(t,n,e){const r=t[0]-n[0],i=t[1]-n[1],s=t[0]-e[0],o=t[1]-e[1];return r*o-s*i==0&&r*s<=0&&i*o<=0}function Wi(t,n){let e=!1;for(let o=0,a=n.length;o<a;o++){const a=n[o];for(let n=0,o=a.length;n<o-1;n++){if(Hi(t,a[n],a[n+1]))return!1;(i=a[n])[1]>(r=t)[1]!=(s=a[n+1])[1]>r[1]&&r[0]<(s[0]-i[0])*(r[1]-i[1])/(s[1]-i[1])+i[0]&&(e=!e)}}var r,i,s;return e}function qi(t,n){for(let e=0;e<n.length;e++)if(Wi(t,n[e]))return!0;return!1}function Gi(t,n,e,r){const i=r[0]-e[0],s=r[1]-e[1],o=(t[0]-e[0])*s-i*(t[1]-e[1]),a=(n[0]-e[0])*s-i*(n[1]-e[1]);return o>0&&a<0||o<0&&a>0}function Bi(t,n,e){for(const l of e)for(let e=0;e<l.length-1;++e)if(void 0,void 0,0!=(a=[(o=l[e+1])[0]-(s=l[e])[0],o[1]-s[1]])[0]*(u=[(i=n)[0]-(r=t)[0],i[1]-r[1]])[1]-a[1]*u[0]&&Gi(r,i,s,o)&&Gi(s,o,r,i))return!0;var r,i,s,o,a,u;return!1}function Ji(t,n){for(let e=0;e<t.length;++e)if(!Wi(t[e],n))return!1;for(let e=0;e<t.length-1;++e)if(Bi(t[e],t[e+1],n))return!1;return!0}function Xi(t,n){for(let e=0;e<n.length;e++)if(Ji(t,n[e]))return!0;return!1}function Yi(t,n,e){const r=[];for(let i=0;i<t.length;i++){const s=[];for(let r=0;r<t[i].length;r++){const o=Ri(t[i][r],e);Li(n,o),s.push(o)}r.push(s)}return r}function Zi(t,n,e){const r=[];for(let i=0;i<t.length;i++){const s=Yi(t[i],n,e);r.push(s)}return r}function Ki(t,n,e,r){if(t[0]<e[0]||t[0]>e[2]){const n=.5*r;let i=t[0]-e[0]>n?-r:e[0]-t[0]>n?r:0;0===i&&(i=t[0]-e[2]>n?-r:e[2]-t[0]>n?r:0),t[0]+=i}Li(n,t)}function Qi(t,n,e,r){const i=8192*Math.pow(2,r.z),s=[8192*r.x,8192*r.y],o=[];if(!t)return o;for(const r of t)for(const t of r){const r=[t.x+s[0],t.y+s[1]];Ki(r,n,e,i),o.push(r)}return o}function ts(t,n,e,r){const i=8192*Math.pow(2,r.z),s=[8192*r.x,8192*r.y],o=[];if(!t)return o;for(const e of t){const t=[];for(const r of e){const e=[r.x+s[0],r.y+s[1]];Li(n,e),t.push(e)}o.push(t)}if(n[2]-n[0]<=i/2){(a=n)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of o)for(const r of t)Ki(r,n,e,i)}var a;return o}class ns{constructor(t,n){this.type=Xr,this.geojson=t,this.geometries=n}static parse(t,n){if(2!==t.length)return n.error(`\'within\' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Mi(t[1])){const n=t[1];if("FeatureCollection"===n.type)for(let t=0;t<n.features.length;++t){const e=n.features[t].geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new ns(n,n.features[t].geometry)}else if("Feature"===n.type){const t=n.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new ns(n,n.geometry)}else if("Polygon"===n.type||"MultiPolygon"===n.type)return new ns(n,n)}return n.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){const e=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===n.type){const s=Yi(n.coordinates,r,i),o=Qi(t.geometry(),e,r,i);if(!Vi(e,r))return!1;for(const t of o)if(!Wi(t,s))return!1}if("MultiPolygon"===n.type){const s=Zi(n.coordinates,r,i),o=Qi(t.geometry(),e,r,i);if(!Vi(e,r))return!1;for(const t of o)if(!qi(t,s))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){const e=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===n.type){const s=Yi(n.coordinates,r,i),o=ts(t.geometry(),e,r,i);if(!Vi(e,r))return!1;for(const t of o)if(!Ji(t,s))return!1}if("MultiPolygon"===n.type){const s=Zi(n.coordinates,r,i),o=ts(t.geometry(),e,r,i);if(!Vi(e,r))return!1;for(const t of o)if(!Xi(t,s))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var es=ns;function rs(t){if(t instanceof Ui){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof es)return!1;let n=!0;return t.eachChild(t=>{n&&!rs(t)&&(n=!1)}),n}function is(t){if(t instanceof Ui&&"feature-state"===t.name)return!1;let n=!0;return t.eachChild(t=>{n&&!is(t)&&(n=!1)}),n}function ss(t,n){if(t instanceof Ui&&n.indexOf(t.name)>=0)return!1;let e=!0;return t.eachChild(t=>{e&&!ss(t,n)&&(e=!1)}),e}class os{constructor(t,n){this.type=n.type,this.name=t,this.boundExpression=n}static parse(t,n){if(2!==t.length||"string"!=typeof t[1])return n.error("\'var\' expression requires exactly one string literal argument.");const e=t[1];return n.scope.has(e)?new os(e,n.scope.get(e)):n.error(`Unknown variable "${e}". Make sure "${e}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var as=os;class us{constructor(t,n=[],e,r=new qr,i=[]){this.registry=t,this.path=n,this.key=n.map(t=>`[${t}]`).join(""),this.scope=r,this.errors=i,this.expectedType=e}parse(t,n,e,r,i={}){return n?this.concat(n,e,r).H(t,i):this.H(t,i)}H(t,n){function e(t,n,e){return"assert"===e?new Oi(n,[t]):"coerce"===e?new Ti(n,[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", []].\');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[r];if(i){let r=i.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,i=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(t,i))return null}else r=e(r,t,n.typeAnnotation||"coerce");else r=e(r,t,n.typeAnnotation||"assert")}if(!(r instanceof ki)&&"resolvedImage"!==r.type.kind&&function t(n){if(n instanceof as)return t(n.boundExpression);if(n instanceof Ui&&"error"===n.name)return!1;if(n instanceof Ni)return!1;if(n instanceof es)return!1;const e=n instanceof Ti||n instanceof Oi;let r=!0;return n.eachChild(n=>{r=e?r&&t(n):r&&n instanceof ki}),!!r&&(rs(n)&&ss(n,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}(r)){const n=new Di;try{r=new ki(r.type,r.evaluate(n))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". 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.`)}concat(t,n,e){const r="number"==typeof t?this.path.concat(t):this.path,i=e?this.scope.concat(e):this.scope;return new us(this.registry,r,n||null,i,this.errors)}error(t,...n){const e=`${this.key}${n.map(t=>`[${t}]`).join("")}`;this.errors.push(new Hr(e,t))}checkSubtype(t,n){const e=si(t,n);return e&&this.error(e),e}}var ls=us;function hs(t,n){const e=t.length-1;let r,i,s=0,o=e,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),r=t[a],i=t[a+1],r<=n){if(a===e||n<i)return a;s=a+1}else{if(!(r>n))throw new Pi("Input is not a number.");o=a-1}return 0}class cs{constructor(t,n,e){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(const[t,n]of e)this.labels.push(t),this.outputs.push(n)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");const e=n.parse(t[1],1,Br);if(!e)return null;const r=[];let i=null;n.expectedType&&"value"!==n.expectedType.kind&&(i=n.expectedType);for(let e=1;e<t.length;e+=2){const s=1===e?-1/0:t[e],o=t[e+1],a=e,u=e+1;if("number"!=typeof s)return n.error(\'Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',a);if(r.length&&r[r.length-1][0]>=s)return n.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',a);const l=n.parse(o,u,i);if(!l)return null;i=i||l.type,r.push([s,l])}return new cs(i,e,r)}evaluate(t){const n=this.labels,e=this.outputs;if(1===n.length)return e[0].evaluate(t);const r=this.input.evaluate(t);if(r<=n[0])return e[0].evaluate(t);const i=n.length;return r>=n[i-1]?e[i-1].evaluate(t):e[hs(n,r)].evaluate(t)}eachChild(t){t(this.input);for(const n of this.outputs)t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let n=0;n<this.labels.length;n++)n>0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t}}var fs=cs,ds=ps;function ps(t,n,e,r){this.cx=3*t,this.bx=3*(e-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=e,this.p2y=r}function ys(t,n,e){return t*(1-e)+n*e}ps.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,n){if(void 0===n&&(n=1e-6),t<0)return 0;if(t>1)return 1;for(var e=t,r=0;r<8;r++){var i=this.sampleCurveX(e)-t;if(Math.abs(i)<n)return e;var s=this.sampleCurveDerivativeX(e);if(Math.abs(s)<1e-6)break;e-=i/s}var o=0,a=1;for(e=t,r=0;r<20&&(i=this.sampleCurveX(e),!(Math.abs(i-t)<n));r++)t>i?o=e:a=e,e=.5*(a-o)+o;return e},solve:function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))}};var ms=Object.freeze({__proto__:null,number:ys,color:function(t,n,e){return new yi(ys(t.r,n.r,e),ys(t.g,n.g,e),ys(t.b,n.b,e),ys(t.a,n.a,e))},array:function(t,n,e){return t.map((t,r)=>ys(t,n[r],e))}});const gs=6/29*3*(6/29),vs=Math.PI/180,bs=180/Math.PI;function ws(t){return t>.008856451679035631?Math.pow(t,1/3):t/gs+4/29}function Ms(t){return t>6/29?t*t*t:gs*(t-4/29)}function xs(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Fs(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function As(t){const n=Fs(t.r),e=Fs(t.g),r=Fs(t.b),i=ws((.4124564*n+.3575761*e+.1804375*r)/.95047),s=ws((.2126729*n+.7151522*e+.072175*r)/1);return{l:116*s-16,a:500*(i-s),b:200*(s-ws((.0193339*n+.119192*e+.9503041*r)/1.08883)),alpha:t.a}}function ks(t){let n=(t.l+16)/116,e=isNaN(t.a)?n:n+t.a/500,r=isNaN(t.b)?n:n-t.b/200;return n=1*Ms(n),e=.95047*Ms(e),r=1.08883*Ms(r),new yi(xs(3.2404542*e-1.5371385*n-.4985314*r),xs(-.969266*e+1.8760108*n+.041556*r),xs(.0556434*e-.2040259*n+1.0572252*r),t.alpha)}function Ps(t,n,e){const r=n-t;return t+e*(r>180||r<-180?r-360*Math.round(r/360):r)}const Ss={forward:As,reverse:ks,interpolate:function(t,n,e){return{l:ys(t.l,n.l,e),a:ys(t.a,n.a,e),b:ys(t.b,n.b,e),alpha:ys(t.alpha,n.alpha,e)}}},_s={forward:function(t){const{l:n,a:e,b:r}=As(t),i=Math.atan2(r,e)*bs;return{h:i<0?i+360:i,c:Math.sqrt(e*e+r*r),l:n,alpha:t.a}},reverse:function(t){const n=t.h*vs,e=t.c;return ks({l:t.l,a:Math.cos(n)*e,b:Math.sin(n)*e,alpha:t.alpha})},interpolate:function(t,n,e){return{h:Ps(t.h,n.h,e),c:ys(t.c,n.c,e),l:ys(t.l,n.l,e),alpha:ys(t.alpha,n.alpha,e)}}};var Os=Object.freeze({__proto__:null,lab:Ss,hcl:_s});class Es{constructor(t,n,e,r,i){this.type=t,this.operator=n,this.interpolation=e,this.input=r,this.labels=[],this.outputs=[];for(const[t,n]of i)this.labels.push(t),this.outputs.push(n)}static interpolationFactor(t,n,e,r){let i=0;if("exponential"===t.name)i=Is(n,t.base,e,r);else if("linear"===t.name)i=Is(n,1,e,r);else if("cubic-bezier"===t.name){const s=t.controlPoints;i=new ds(s[0],s[1],s[2],s[3]).solve(Is(n,1,e,r))}return i}static parse(t,n){let[e,r,i,...s]=t;if(!Array.isArray(r)||0===r.length)return n.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return n.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return n.error("Unknown interpolation type "+String(r[0]),1,0);{const t=r.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(i=n.parse(i,2,Br),!i)return null;const o=[];let a=null;"interpolate-hcl"===e||"interpolate-lab"===e?a=Yr:n.expectedType&&"value"!==n.expectedType.kind&&(a=n.expectedType);for(let t=0;t<s.length;t+=2){const e=s[t],r=s[t+1],i=t+3,u=t+4;if("number"!=typeof e)return n.error(\'Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',i);if(o.length&&o[o.length-1][0]>=e)return n.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',i);const l=n.parse(r,u,a);if(!l)return null;a=a||l.type,o.push([e,l])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Es(a,e,r,i,o):n.error(`Type ${ri(a)} is not interpolatable.`)}evaluate(t){const n=this.labels,e=this.outputs;if(1===n.length)return e[0].evaluate(t);const r=this.input.evaluate(t);if(r<=n[0])return e[0].evaluate(t);const i=n.length;if(r>=n[i-1])return e[i-1].evaluate(t);const s=hs(n,r),o=Es.interpolationFactor(this.interpolation,r,n[s],n[s+1]),a=e[s].evaluate(t),u=e[s+1].evaluate(t);return"interpolate"===this.operator?ms[this.type.kind.toLowerCase()](a,u,o):"interpolate-hcl"===this.operator?_s.reverse(_s.interpolate(_s.forward(a),_s.forward(u),o)):Ss.reverse(Ss.interpolate(Ss.forward(a),Ss.forward(u),o))}eachChild(t){t(this.input);for(const n of this.outputs)t(n)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const n=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)n.push(this.labels[t],this.outputs[t].serialize());return n}}function Is(t,n,e,r){const i=r-e,s=t-e;return 0===i?0:1===n?s/i:(Math.pow(n,s)-1)/(Math.pow(n,i)-1)}var $s=Es;class Cs{constructor(t,n){this.type=t,this.args=n}static parse(t,n){if(t.length<2)return n.error("Expectected at least one argument.");let e=null;const r=n.expectedType;r&&"value"!==r.kind&&(e=r);const i=[];for(const r of t.slice(1)){const t=n.parse(r,1+i.length,e,void 0,{typeAnnotation:"omit"});if(!t)return null;e=e||t.type,i.push(t)}const s=r&&i.some(t=>si(r,t.type));return new Cs(s?Kr:e,i)}evaluate(t){let n,e=null,r=0;for(const i of this.args){if(r++,e=i.evaluate(t),e&&e instanceof bi&&!e.available&&(n||(n=e),e=null,r===this.args.length))return n;if(null!==e)break}return e}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(n=>{t.push(n.serialize())}),t}}var Ts=Cs;class zs{constructor(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const n of this.bindings)t(n[1]);t(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const e=[];for(let r=1;r<t.length-1;r+=2){const i=t[r];if("string"!=typeof i)return n.error(`Expected string, but found ${typeof i} instead.`,r);if(/[^a-zA-Z0-9_]/.test(i))return n.error("Variable names must contain only alphanumeric characters or \'_\'.",r);const s=n.parse(t[r+1],r+1);if(!s)return null;e.push([i,s])}const r=n.parse(t[t.length-1],t.length-1,n.expectedType,e);return r?new zs(e,r):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[n,e]of this.bindings)t.push(n,e.serialize());return t.push(this.result.serialize()),t}}var Ds=zs;class js{constructor(t,n,e){this.type=t,this.index=n,this.input=e}static parse(t,n){if(3!==t.length)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const e=n.parse(t[1],1,Br),r=n.parse(t[2],2,ei(n.expectedType||Kr));return e&&r?new js(r.type.itemType,e,r):null}evaluate(t){const n=this.index.evaluate(t),e=this.input.evaluate(t);if(n<0)throw new Pi(`Array index out of bounds: ${n} < 0.`);if(n>=e.length)throw new Pi(`Array index out of bounds: ${n} > ${e.length-1}.`);if(n!==Math.floor(n))throw new Pi(`Array index must be an integer, but found ${n} instead.`);return e[n]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Us=js;class Ns{constructor(t,n){this.type=Xr,this.needle=t,this.haystack=n}static parse(t,n){if(3!==t.length)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const e=n.parse(t[1],1,Kr),r=n.parse(t[2],2,Kr);return e&&r?oi(e.type,[Xr,Jr,Br,Gr,Kr])?new Ns(e,r):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${ri(e.type)} instead`):null}evaluate(t){const n=this.needle.evaluate(t),e=this.haystack.evaluate(t);if(null==e)return!1;if(!ai(n,["boolean","string","number","null"]))throw new Pi(`Expected first argument to be of type boolean, string, number or null, but found ${ri(xi(n))} instead.`);if(!ai(e,["string","array"]))throw new Pi(`Expected second argument to be of type array or string, but found ${ri(xi(e))} instead.`);return e.indexOf(n)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ls=Ns;class Vs{constructor(t,n,e){this.type=Br,this.needle=t,this.haystack=n,this.fromIndex=e}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const e=n.parse(t[1],1,Kr),r=n.parse(t[2],2,Kr);if(!e||!r)return null;if(!oi(e.type,[Xr,Jr,Br,Gr,Kr]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${ri(e.type)} instead`);if(4===t.length){const i=n.parse(t[3],3,Br);return i?new Vs(e,r,i):null}return new Vs(e,r)}evaluate(t){const n=this.needle.evaluate(t),e=this.haystack.evaluate(t);if(!ai(n,["boolean","string","number","null"]))throw new Pi(`Expected first argument to be of type boolean, string, number or null, but found ${ri(xi(n))} instead.`);if(!ai(e,["string","array"]))throw new Pi(`Expected second argument to be of type array or string, but found ${ri(xi(e))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(t);return e.indexOf(n,r)}return e.indexOf(n)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var Rs=Vs;class Hs{constructor(t,n,e,r,i,s){this.inputType=t,this.type=n,this.input=e,this.cases=r,this.outputs=i,this.otherwise=s}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error("Expected an even number of arguments.");let e,r;n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);const i={},s=[];for(let o=2;o<t.length-1;o+=2){let a=t[o];const u=t[o+1];Array.isArray(a)||(a=[a]);const l=n.concat(o);if(0===a.length)return l.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return l.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return l.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return l.error("Numeric branch labels must be integer values.");if(e){if(l.checkSubtype(e,xi(t)))return null}else e=xi(t);if(void 0!==i[String(t)])return l.error("Branch labels must be unique.");i[String(t)]=s.length}const h=n.parse(u,o,r);if(!h)return null;r=r||h.type,s.push(h)}const o=n.parse(t[1],1,Kr);if(!o)return null;const a=n.parse(t[t.length-1],t.length-1,r);return a?"value"!==o.type.kind&&n.concat(1).checkSubtype(e,o.type)?null:new Hs(e,r,o,i,s,a):null}evaluate(t){const n=this.input.evaluate(t);return(xi(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],n=Object.keys(this.cases).sort(),e=[],r={};for(const t of n){const n=r[this.cases[t]];void 0===n?(r[this.cases[t]]=e.length,e.push([this.cases[t],[t]])):e[n][1].push(t)}const i=t=>"number"===this.inputType.kind?Number(t):t;for(const[n,r]of e)t.push(1===r.length?i(r[0]):r.map(i)),t.push(this.outputs[n].serialize());return t.push(this.otherwise.serialize()),t}}var Ws=Hs;class qs{constructor(t,n,e){this.type=t,this.branches=n,this.otherwise=e}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error("Expected an odd number of arguments.");let e;n.expectedType&&"value"!==n.expectedType.kind&&(e=n.expectedType);const r=[];for(let i=1;i<t.length-1;i+=2){const s=n.parse(t[i],i,Xr);if(!s)return null;const o=n.parse(t[i+1],i+1,e);if(!o)return null;r.push([s,o]),e=e||o.type}const i=n.parse(t[t.length-1],t.length-1,e);return i?new qs(e,r,i):null}evaluate(t){for(const[n,e]of this.branches)if(n.evaluate(t))return e.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[n,e]of this.branches)t(n),t(e);t(this.otherwise)}outputDefined(){return this.branches.every(([t,n])=>n.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(n=>{t.push(n.serialize())}),t}}var Gs=qs;class Bs{constructor(t,n,e,r){this.type=t,this.input=n,this.beginIndex=e,this.endIndex=r}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const e=n.parse(t[1],1,Kr),r=n.parse(t[2],2,Br);if(!e||!r)return null;if(!oi(e.type,[ei(Kr),Jr,Kr]))return n.error(`Expected first argument to be of type array or string, but found ${ri(e.type)} instead`);if(4===t.length){const i=n.parse(t[3],3,Br);return i?new Bs(e.type,e,r,i):null}return new Bs(e.type,e,r)}evaluate(t){const n=this.input.evaluate(t),e=this.beginIndex.evaluate(t);if(!ai(n,["string","array"]))throw new Pi(`Expected first argument to be of type array or string, but found ${ri(xi(n))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(t);return n.slice(e,r)}return n.slice(e)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var Js=Bs;function Xs(t,n){return"=="===t||"!="===t?"boolean"===n.kind||"string"===n.kind||"number"===n.kind||"null"===n.kind||"value"===n.kind:"string"===n.kind||"number"===n.kind||"value"===n.kind}function Ys(t,n,e,r){return 0===r.compare(n,e)}function Zs(t,n,e){const r="=="!==t&&"!="!==t;return class i{constructor(t,n,e){this.type=Xr,this.lhs=t,this.rhs=n,this.collator=e,this.hasUntypedArgument="value"===t.type.kind||"value"===n.type.kind}static parse(t,n){if(3!==t.length&&4!==t.length)return n.error("Expected two or three arguments.");const e=t[0];let s=n.parse(t[1],1,Kr);if(!s)return null;if(!Xs(e,s.type))return n.concat(1).error(`"${e}" comparisons are not supported for type \'${ri(s.type)}\'.`);let o=n.parse(t[2],2,Kr);if(!o)return null;if(!Xs(e,o.type))return n.concat(2).error(`"${e}" comparisons are not supported for type \'${ri(o.type)}\'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return n.error(`Cannot compare types \'${ri(s.type)}\' and \'${ri(o.type)}\'.`);r&&("value"===s.type.kind&&"value"!==o.type.kind?s=new Oi(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new Oi(s.type,[o])));let a=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return n.error("Cannot use collator to compare non-string types.");if(a=n.parse(t[3],3,Qr),!a)return null}return new i(s,o,a)}evaluate(i){const s=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){const n=xi(s),e=xi(o);if(n.kind!==e.kind||"string"!==n.kind&&"number"!==n.kind)throw new Pi(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${n.kind}, ${e.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const t=xi(s),e=xi(o);if("string"!==t.kind||"string"!==e.kind)return n(i,s,o)}return this.collator?e(i,s,o,this.collator.evaluate(i)):n(i,s,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const n=[t];return this.eachChild(t=>{n.push(t.serialize())}),n}}}const Ks=Zs("==",(function(t,n,e){return n===e}),Ys),Qs=Zs("!=",(function(t,n,e){return n!==e}),(function(t,n,e,r){return!Ys(0,n,e,r)})),to=Zs("<",(function(t,n,e){return n<e}),(function(t,n,e,r){return r.compare(n,e)<0})),no=Zs(">",(function(t,n,e){return n>e}),(function(t,n,e,r){return r.compare(n,e)>0})),eo=Zs("<=",(function(t,n,e){return n<=e}),(function(t,n,e,r){return r.compare(n,e)<=0})),ro=Zs(">=",(function(t,n,e){return n>=e}),(function(t,n,e,r){return r.compare(n,e)>=0}));class io{constructor(t,n,e,r,i,s){this.type=Jr,this.number=t,this.locale=n,this.currency=e,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=s}static parse(t,n){if(3!==t.length)return n.error("Expected two arguments.");const e=n.parse(t[1],1,Br);if(!e)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return n.error("NumberFormat options argument must be an object.");let i=null;if(r.locale&&(i=n.parse(r.locale,1,Jr),!i))return null;let s=null;if(r.currency&&(s=n.parse(r.currency,1,Jr),!s))return null;let o=null;if(r.unit&&(o=n.parse(r.unit,1,Jr),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=n.parse(r["min-fraction-digits"],1,Br),!a))return null;let u=null;return r["max-fraction-digits"]&&(u=n.parse(r["max-fraction-digits"],1,Br),!u)?null:new io(e,i,s,o,a,u)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.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]}}class so{constructor(t){this.type=Br,this.input=t}static parse(t,n){if(2!==t.length)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);const e=n.parse(t[1],1);return e?"array"!==e.type.kind&&"string"!==e.type.kind&&"value"!==e.type.kind?n.error(`Expected argument of type string or array, but found ${ri(e.type)} instead.`):new so(e):null}evaluate(t){const n=this.input.evaluate(t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new Pi(`Expected value to be of type string or array, but found ${ri(xi(n))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(n=>{t.push(n.serialize())}),t}}const oo={"==":Ks,"!=":Qs,">":no,"<":to,">=":ro,"<=":eo,array:Oi,at:Us,boolean:Oi,case:Gs,coalesce:Ts,collator:Ni,format:Ei,image:Ii,in:Ls,"index-of":Rs,interpolate:$s,"interpolate-hcl":$s,"interpolate-lab":$s,length:so,let:Ds,literal:ki,match:Ws,number:Oi,"number-format":io,object:Oi,slice:Js,step:fs,string:Oi,"to-boolean":Ti,"to-color":Ti,"to-number":Ti,"to-string":Ti,var:as,within:es};function ao(t,[n,e,r,i]){n=n.evaluate(t),e=e.evaluate(t),r=r.evaluate(t);const s=i?i.evaluate(t):1,o=wi(n,e,r,s);if(o)throw new Pi(o);return new yi(n/255*s,e/255*s,r/255*s,s)}function uo(t,n){return t in n}function lo(t,n){const e=n[t];return void 0===e?null:e}function ho(t){return{type:t}}Ui.register(oo,{error:[{kind:"error"},[Jr],(t,[n])=>{throw new Pi(n.evaluate(t))}],typeof:[Jr,[Kr],(t,[n])=>ri(xi(n.evaluate(t)))],"to-rgba":[ei(Br,4),[Yr],(t,[n])=>n.evaluate(t).toArray()],rgb:[Yr,[Br,Br,Br],ao],rgba:[Yr,[Br,Br,Br,Br],ao],has:{type:Xr,overloads:[[[Jr],(t,[n])=>uo(n.evaluate(t),t.properties())],[[Jr,Zr],(t,[n,e])=>uo(n.evaluate(t),e.evaluate(t))]]},get:{type:Kr,overloads:[[[Jr],(t,[n])=>lo(n.evaluate(t),t.properties())],[[Jr,Zr],(t,[n,e])=>lo(n.evaluate(t),e.evaluate(t))]]},"feature-state":[Kr,[Jr],(t,[n])=>lo(n.evaluate(t),t.featureState||{})],properties:[Zr,[],t=>t.properties()],"geometry-type":[Jr,[],t=>t.geometryType()],id:[Kr,[],t=>t.id()],zoom:[Br,[],t=>t.globals.zoom],pitch:[Br,[],t=>t.globals.pitch||0],"distance-from-center":[Br,[],t=>t.distanceFromCenter()],"heatmap-density":[Br,[],t=>t.globals.heatmapDensity||0],"line-progress":[Br,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Br,[],t=>t.globals.skyRadialProgress||0],accumulated:[Kr,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Br,ho(Br),(t,n)=>{let e=0;for(const r of n)e+=r.evaluate(t);return e}],"*":[Br,ho(Br),(t,n)=>{let e=1;for(const r of n)e*=r.evaluate(t);return e}],"-":{type:Br,overloads:[[[Br,Br],(t,[n,e])=>n.evaluate(t)-e.evaluate(t)],[[Br],(t,[n])=>-n.evaluate(t)]]},"/":[Br,[Br,Br],(t,[n,e])=>n.evaluate(t)/e.evaluate(t)],"%":[Br,[Br,Br],(t,[n,e])=>n.evaluate(t)%e.evaluate(t)],ln2:[Br,[],()=>Math.LN2],pi:[Br,[],()=>Math.PI],e:[Br,[],()=>Math.E],"^":[Br,[Br,Br],(t,[n,e])=>Math.pow(n.evaluate(t),e.evaluate(t))],sqrt:[Br,[Br],(t,[n])=>Math.sqrt(n.evaluate(t))],log10:[Br,[Br],(t,[n])=>Math.log(n.evaluate(t))/Math.LN10],ln:[Br,[Br],(t,[n])=>Math.log(n.evaluate(t))],log2:[Br,[Br],(t,[n])=>Math.log(n.evaluate(t))/Math.LN2],sin:[Br,[Br],(t,[n])=>Math.sin(n.evaluate(t))],cos:[Br,[Br],(t,[n])=>Math.cos(n.evaluate(t))],tan:[Br,[Br],(t,[n])=>Math.tan(n.evaluate(t))],asin:[Br,[Br],(t,[n])=>Math.asin(n.evaluate(t))],acos:[Br,[Br],(t,[n])=>Math.acos(n.evaluate(t))],atan:[Br,[Br],(t,[n])=>Math.atan(n.evaluate(t))],min:[Br,ho(Br),(t,n)=>Math.min(...n.map(n=>n.evaluate(t)))],max:[Br,ho(Br),(t,n)=>Math.max(...n.map(n=>n.evaluate(t)))],abs:[Br,[Br],(t,[n])=>Math.abs(n.evaluate(t))],round:[Br,[Br],(t,[n])=>{const e=n.evaluate(t);return e<0?-Math.round(-e):Math.round(e)}],floor:[Br,[Br],(t,[n])=>Math.floor(n.evaluate(t))],ceil:[Br,[Br],(t,[n])=>Math.ceil(n.evaluate(t))],"filter-==":[Xr,[Jr,Kr],(t,[n,e])=>t.properties()[n.value]===e.value],"filter-id-==":[Xr,[Kr],(t,[n])=>t.id()===n.value],"filter-type-==":[Xr,[Jr],(t,[n])=>t.geometryType()===n.value],"filter-<":[Xr,[Jr,Kr],(t,[n,e])=>{const r=t.properties()[n.value],i=e.value;return typeof r==typeof i&&r<i}],"filter-id-<":[Xr,[Kr],(t,[n])=>{const e=t.id(),r=n.value;return typeof e==typeof r&&e<r}],"filter->":[Xr,[Jr,Kr],(t,[n,e])=>{const r=t.properties()[n.value],i=e.value;return typeof r==typeof i&&r>i}],"filter-id->":[Xr,[Kr],(t,[n])=>{const e=t.id(),r=n.value;return typeof e==typeof r&&e>r}],"filter-<=":[Xr,[Jr,Kr],(t,[n,e])=>{const r=t.properties()[n.value],i=e.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[Xr,[Kr],(t,[n])=>{const e=t.id(),r=n.value;return typeof e==typeof r&&e<=r}],"filter->=":[Xr,[Jr,Kr],(t,[n,e])=>{const r=t.properties()[n.value],i=e.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[Xr,[Kr],(t,[n])=>{const e=t.id(),r=n.value;return typeof e==typeof r&&e>=r}],"filter-has":[Xr,[Kr],(t,[n])=>n.value in t.properties()],"filter-has-id":[Xr,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Xr,[ei(Jr)],(t,[n])=>n.value.indexOf(t.geometryType())>=0],"filter-id-in":[Xr,[ei(Kr)],(t,[n])=>n.value.indexOf(t.id())>=0],"filter-in-small":[Xr,[Jr,ei(Kr)],(t,[n,e])=>e.value.indexOf(t.properties()[n.value])>=0],"filter-in-large":[Xr,[Jr,ei(Kr)],(t,[n,e])=>function(t,n,e,r){for(;e<=r;){const i=e+r>>1;if(n[i]===t)return!0;n[i]>t?r=i-1:e=i+1}return!1}(t.properties()[n.value],e.value,0,e.value.length-1)],all:{type:Xr,overloads:[[[Xr,Xr],(t,[n,e])=>n.evaluate(t)&&e.evaluate(t)],[ho(Xr),(t,n)=>{for(const e of n)if(!e.evaluate(t))return!1;return!0}]]},any:{type:Xr,overloads:[[[Xr,Xr],(t,[n,e])=>n.evaluate(t)||e.evaluate(t)],[ho(Xr),(t,n)=>{for(const e of n)if(e.evaluate(t))return!0;return!1}]]},"!":[Xr,[Xr],(t,[n])=>!n.evaluate(t)],"is-supported-script":[Xr,[Jr],(t,[n])=>{const e=t.globals&&t.globals.isSupportedScript;return!e||e(n.evaluate(t))}],upcase:[Jr,[Jr],(t,[n])=>n.evaluate(t).toUpperCase()],downcase:[Jr,[Jr],(t,[n])=>n.evaluate(t).toLowerCase()],concat:[Jr,ho(Kr),(t,n)=>n.map(n=>Fi(n.evaluate(t))).join("")],"resolved-locale":[Jr,[Qr],(t,[n])=>n.evaluate(t).resolvedLocale()]});var co=oo;function fo(t){return{result:"success",value:t}}function po(t){return{result:"error",value:t}}function yo(t){return!!t.expression&&t.expression.interpolated}function mo(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function go(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function vo(t){return t}function bo(t,n,e){return void 0!==t?t:void 0!==n?n:void 0!==e?e:void 0}function wo(t,n,e,r,i){return bo(typeof e===i?r[e]:void 0,t.default,n.default)}function Mo(t,n,e){if("number"!==mo(e))return bo(t.default,n.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(e<=t.stops[0][0])return t.stops[0][1];if(e>=t.stops[r-1][0])return t.stops[r-1][1];const i=hs(t.stops.map(t=>t[0]),e);return t.stops[i][1]}function xo(t,n,e){const r=void 0!==t.base?t.base:1;if("number"!==mo(e))return bo(t.default,n.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(e<=t.stops[0][0])return t.stops[0][1];if(e>=t.stops[i-1][0])return t.stops[i-1][1];const s=hs(t.stops.map(t=>t[0]),e),o=function(t,n,e,r){const i=r-e,s=t-e;return 0===i?0:1===n?s/i:(Math.pow(n,s)-1)/(Math.pow(n,i)-1)}(e,r,t.stops[s][0],t.stops[s+1][0]),a=t.stops[s][1],u=t.stops[s+1][1];let l=ms[n.type]||vo;if(t.colorSpace&&"rgb"!==t.colorSpace){const n=Os[t.colorSpace];l=(t,e)=>n.reverse(n.interpolate(n.forward(t),n.forward(e),o))}return"function"==typeof a.evaluate?{evaluate(...t){const n=a.evaluate.apply(void 0,t),e=u.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==e)return l(n,e,o)}}:l(a,u,o)}function Fo(t,n,e){return"color"===n.type?e=yi.parse(e):"formatted"===n.type?e=vi.fromString(e.toString()):"resolvedImage"===n.type?e=bi.fromString(e.toString()):mo(e)===n.type||"enum"===n.type&&n.values[e]||(e=void 0),bo(e,t.default,n.default)}class Ao{constructor(t,n){this.expression=t,this.W={},this.q=new Di,this.G=n?function(t){return"color"===t.type&&(go(t.default)||Array.isArray(t.default))?new yi(0,0,0,0):"color"===t.type?yi.parse(t.default)||null:void 0===t.default?null:t.default}(n):null,this.B=n&&"enum"===n.type?n.values:null}evaluateWithoutErrorHandling(t,n,e,r,i,s,o,a){return this.q.globals=t,this.q.feature=n,this.q.featureState=e,this.q.canonical=r||null,this.q.availableImages=i||null,this.q.formattedSection=s,this.q.featureTileCoord=o||null,this.q.featureDistanceData=a||null,this.expression.evaluate(this.q)}evaluate(t,n,e,r,i,s,o,a){this.q.globals=t,this.q.feature=n||null,this.q.featureState=e||null,this.q.canonical=r||null,this.q.availableImages=i||null,this.q.formattedSection=s||null,this.q.featureTileCoord=o||null,this.q.featureDistanceData=a||null;try{const t=this.expression.evaluate(this.q);if(null==t||"number"==typeof t&&t!=t)return this.G;if(this.B&&!(t in this.B))throw new Pi(`Expected value to be one of ${Object.keys(this.B).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this.W[t.message]||(this.W[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this.G}}}function ko(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in co}function Po(t,n){const e=new ls(co,[],n?function(t){const n={color:Yr,string:Jr,number:Br,enum:Jr,boolean:Xr,formatted:ti,resolvedImage:ni};return"array"===t.type?ei(n[t.value]||Kr,t.length):n[t.type]}(n):void 0),r=e.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return r?fo(new Ao(r,n)):po(e.errors)}class So{constructor(t,n){this.kind=t,this.J=n,this.isStateDependent="constant"!==t&&!is(n.expression)}evaluateWithoutErrorHandling(t,n,e,r,i,s){return this.J.evaluateWithoutErrorHandling(t,n,e,r,i,s)}evaluate(t,n,e,r,i,s){return this.J.evaluate(t,n,e,r,i,s)}}class _o{constructor(t,n,e,r){this.kind=t,this.zoomStops=e,this.J=n,this.isStateDependent="camera"!==t&&!is(n.expression),this.interpolationType=r}evaluateWithoutErrorHandling(t,n,e,r,i,s){return this.J.evaluateWithoutErrorHandling(t,n,e,r,i,s)}evaluate(t,n,e,r,i,s){return this.J.evaluate(t,n,e,r,i,s)}interpolationFactor(t,n,e){return this.interpolationType?$s.interpolationFactor(this.interpolationType,t,n,e):0}}function Oo(t,n){if("error"===(t=Po(t,n)).result)return t;const e=t.value.expression,r=rs(e);if(!r&&!function(t){return"data-driven"===t["property-type"]}(n))return po([new Hr("","data expressions not supported")]);const i=ss(e,["zoom","pitch","distance-from-center"]);if(!i&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(n))return po([new Hr("","zoom expressions not supported")]);const s=function t(n){let e=null;if(n instanceof Ds)e=t(n.result);else if(n instanceof Ts){for(const r of n.args)if(e=t(r),e)break}else(n instanceof fs||n instanceof $s)&&n.input instanceof Ui&&"zoom"===n.input.name&&(e=n);return e instanceof Hr||n.eachChild(n=>{const r=t(n);r instanceof Hr?e=r:!e&&r?e=new Hr("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):e&&r&&e!==r&&(e=new Hr("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),e}(e);if(!s&&!i)return po([new Hr("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(s instanceof Hr)return po([s]);if(s instanceof $s&&!yo(n))return po([new Hr("",\'"interpolate" expressions cannot be used with this property\')]);if(!s)return fo(new So(r?"constant":"source",t.value));const o=s instanceof $s?s.interpolation:void 0;return fo(new _o(r?"camera":"composite",t.value,s.labels,o))}class Eo{constructor(t,n){this.X=t,this.Y=n,Vr(this,function t(n,e){const r="color"===e.type,i=n.stops&&"object"==typeof n.stops[0][0],s=i||!(i||void 0!==n.property),o=n.type||(yo(e)?"exponential":"interval");if(r&&((n=Vr({},n)).stops&&(n.stops=n.stops.map(t=>[t[0],yi.parse(t[1])])),n.default=yi.parse(n.default?n.default:e.default)),n.colorSpace&&"rgb"!==n.colorSpace&&!Os[n.colorSpace])throw new Error("Unknown color space: "+n.colorSpace);let a,u,l;if("exponential"===o)a=xo;else if("interval"===o)a=Mo;else if("categorical"===o){a=wo,u=Object.create(null);for(const t of n.stops)u[t[0]]=t[1];l=typeof n.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=Fo}if(i){const r={},i=[];for(let t=0;t<n.stops.length;t++){const e=n.stops[t],s=e[0].zoom;void 0===r[s]&&(r[s]={zoom:s,type:n.type,property:n.property,default:n.default,stops:[]},i.push(s)),r[s].stops.push([e[0].value,e[1]])}const s=[];for(const n of i)s.push([r[n].zoom,t(r[n],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:$s.interpolationFactor.bind(void 0,o),zoomStops:s.map(t=>t[0]),evaluate:({zoom:t},r)=>xo({stops:s,base:n.base},e,t).evaluate(t,r)}}if(s){const t="exponential"===o?{name:"exponential",base:void 0!==n.base?n.base:1}:null;return{kind:"camera",interpolationType:t,interpolationFactor:$s.interpolationFactor.bind(void 0,t),zoomStops:n.stops.map(t=>t[0]),evaluate:({zoom:t})=>a(n,e,t,u,l)}}return{kind:"source",evaluate(t,r){const i=r&&r.properties?r.properties[n.property]:void 0;return void 0===i?bo(n.default,e.default):a(n,e,i,u,l)}}}(this.X,this.Y))}static deserialize(t){return new Eo(t.X,t.Y)}static serialize(t){return{X:t.X,Y:t.Y}}}function Io(t){if(Array.isArray(t))return t.map(Io);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const n={};for(const e in t)n[e]=Io(t[e]);return n}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function $o(t){if(!Array.isArray(t))return!1;if(function(t){return"pitch"===t||"distance-from-center"===t}(t[0]))return!0;for(let n=1;n<t.length;n++)if($o(t[n]))return!0;return!1}const Co=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]),To={StyleExpression:Ao,isExpression:ko,isExpressionFilter:function t(n){if(!0===n||!1===n)return!0;if(!Array.isArray(n)||0===n.length)return!1;switch(n[0]){case"has":return n.length>=2&&"$id"!==n[1]&&"$type"!==n[1];case"in":return n.length>=3&&("string"!=typeof n[1]||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==n.length||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!t(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}},createExpression:Po,createPropertyExpression:Oo,normalizePropertyExpression:function(t,n){if(go(t))return new Eo(t,n);if(ko(t)){const e=Oo(t,n);if("error"===e.result)throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));return e.value}{let e=t;return"string"==typeof t&&"color"===n.type&&(e=yi.parse(t)),{kind:"constant",evaluate:()=>e}}},ZoomConstantExpression:So,ZoomDependentExpression:_o,StylePropertyFunction:Eo},{isExpression:zo,createExpression:Do}=To,jo={};function Uo(t){if(!0===t)return function(){return!0};if(t&&t.condition){if("any"===t.type){const n=t.condition,e=[];for(let t=0;t<n.length;t++)e.push(Uo(n[t]));return(t,n)=>{for(let r=0;r<e.length;r++)if(e[r](t,n))return!0;return!1}}const n=Uo(t.condition);if(lr(t.layer))return n;const e=n=>n.layer===t.layer;return(t,r)=>e(t)&&n(t,r)}if(function t(n){if(!0===n||!1===n)return!0;if(!Array.isArray(n)||0===n.length)return!1;switch(n[0]){case"has":case"!has":return 2===n.length&&("string"==typeof n[1]||n[1].property&&n[1].op);case"in":case"!in":return n.length>=2&&("string"==typeof n[1]||n[1].property&&n[1].op);case"==":case"!=":case">":case">=":case"<":case"<=":return 3===n.length&&("string"==typeof n[1]||n[1].property&&n[1].op);case"none":case"any":case"all":for(const e of n.slice(1))if(!t(e)&&"boolean"!=typeof e)return!1;return!0;case"contains":return!0;default:return!1}}(t))return zn(t);{let n=function(t,n="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};const e=t;let r=!0;try{r=function(t){if(!$o(t))return t;let n=Io(t);return function t(n){let e=!1;const r=[];if("case"===n[0]){for(let t=1;t<n.length-1;t+=2)e=e||$o(n[t]),r.push(n[t+1]);r.push(n[n.length-1])}else if("match"===n[0]){e=e||$o(n[1]);for(let t=2;t<n.length-1;t+=2)r.push(n[t+1]);r.push(n[n.length-1])}else if("step"===n[0]){e=e||$o(n[1]);for(let t=1;t<n.length-1;t+=2)r.push(n[t+1])}e&&(n.length=0,n.push("any",...r));for(let e=1;e<n.length;e++)t(n[e])}(n),n=function t(n){if(!Array.isArray(n))return n;const e=function(t){if(Co.has(t[0]))for(let n=1;n<t.length;n++)if($o(t[n]))return!0;return t}(n);return!0===e?e:e.map(n=>t(n))}(n),n}(e)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\\nand paste the contents of this message in the report.\\nThank you!\\nFilter Expression:\\n${JSON.stringify(e,null,2)}\\n `)}const i=Po(r,null);let s=null;if("error"===i.result)throw new Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));s=(t,n,e)=>i.value.evaluate(t,n,{},e);let o=null,a=null;if(r!==e){const t=Po(e,null);if("error"===t.result)throw new Error(t.value.map(t=>`${t.key}: ${t.message}`).join(", "));o=(n,e,r,i,s)=>t.value.evaluate(n,e,{},r,void 0,void 0,i,s),a=!rs(t.value.expression)}return s=s,{filter:s,dynamicFilter:o||void 0,needGeometry:function t(n){if(!Array.isArray(n))return!1;if("within"===n[0])return!0;for(let e=1;e<n.length;e++)if(t(n[e]))return!0;return!1}(r),needFeature:!!a}}(t);return n=n&&n.filter,(t,e)=>(jo.zoom=e,n&&n(jo,t))}}const No={type:"number","property-type":"data-driven",expression:{parameters:["zoom","feature"]}};function Lo(t,n){No.type=n||"number";const e=Do(t,No);if("success"!==e.result)throw new Error(`Invalid maplibre spec expression: ${JSON.stringify(t)} (${e.value})`);return e.value}function Vo(t){return zo(t)}const Ro={lineWidth:1,lineStrokeWidth:1,lineDx:1,lineDy:1,lineOpacity:1,linePatternAnimSpeed:1,markerWidth:1,markerHeight:1,markerDx:1,markerDy:1,markerSpacing:1,markerOpacity:1,markerRotation:1,textWrapWidth:1,textSpacing:1,textSize:1,textHaloRadius:1,textHaloOpacity:1,textDx:1,textDy:1,textOpacity:1,textRotation:1,polygonOpacity:1};function Ho(t){return Ro[t]}const Wo={markerPlacement:1,markerFile:1,mergeOnProperty:1,markerTextFit:1,markerType:1,markerHorizontalAlignment:1,markerVerticalAlignment:1,markerRotationAlignment:1,markerPitchAlignment:1,markerFillPatternFile:1,markerLinePatternFile:1,textName:1,textPlacement:1,textFaceName:1,textStyle:1,textHorizontalAlignment:1,textVerticalAlignment:1,textRotationAlignment:1,textPitchAlignment:1,lineJoin:1,lineCap:1,linePatternFile:1,polygonPatternFile:1},qo={lineDasharray:1,markerLineDasharray:1,uvScale:1,uvOffset:1};function Go(t){return Wo[t]?"string":Ho(t)?"number":qo[t]?"array":"color"}var Bo=Object.freeze({__proto__:null,compileStyle:function(t=[]){return function t(n){if(!Array.isArray(n))return t([n]);const e=[];for(let t=0;t<n.length;t++){let r;r=!0===n[t].filter?function(){return!0}:Uo(n[t].filter),e.push(ur({},n[t],{filter:r}))}return e}(t=t.map(t=>{const n=ur({},t);return n.filter&&n.filter.value&&(n.filter=n.filter.value),n}))},compileFilter:Uo,createExpression:Lo,isExpression:Vo,isInterpolated:Ho,getExpressionType:Go});const Jo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;class Xo extends Array{pushIn(...t){const n=t.length;for(let e=0;e<n;e++)this[this.Z++]=t[e]}fill(t,n,e){super.fill(t,n,e),e>this.Z&&(this.Z=e)}set(t,n){t>=this.Z&&(this.Z=t+1),this[t]=n}getLength(){return this.Z}setLength(t){this.Z=t,super.length<t&&(super.length=t)}trySetLength(t){t>this.Z&&this.setLength(t)}reset(){this.Z=0}}const Yo={get:function(t,n){return"length"===n?t.getLength():t[n]}};class Zo extends Array{setLength(t){super.length=t}trySetLength(t){super.length=t}getLength(){return super.length}}let Ko;class Qo{static createTypedArray(t,n){return or(t,n)}static getInstance(){return Ko}static getArray(){const t=new Xo,n=new Proxy(t,Yo);return n.push=(...n)=>{t.pushIn(...n)},n.U=t,n}constructor(){this.K=[],this.Z=0}get(){if(!Jo)return new Zo;const t=this.K[this.Z]=this.K[this.Z]||Qo.getArray();return t.reset(),this.Z++,t}reset(){this.Z=0}}Ko=new Qo;const ta=[],na={},ea={},ra={},ia=[],sa=Qo.getInstance(),oa=Math.pow(2,17);class aa{static isAtlasLoaded(t,n={}){const{iconAtlas:e}=n;return!!(!t||e&&e.positions[t])}static genFnTypes(t){const n={};for(const e in t)if(Vo(t[e])){const r=(e+"_Fn_0").trim(),i=(e+"Fn").trim(),s=Go(e);n[r]=Lo(t[e],s),n[i]=(t,e)=>{let i;na.zoom=t,ea.properties=e;try{i=n[r].evaluateWithoutErrorHandling(na,ea,ra,null,ia)}catch(t){return null}return i}}else if(gr(t[e])){const r=(e+"_Fn_0").trim(),i=(e+"Fn").trim();Ho(e)?(n[r]=p(t[e]),n[i]=(t,e)=>{const i=n[r](t,e);return gr(i)?p(i)(t,e):i}):(n[r]=y(t[e]),n[i]=(t,e)=>{const i=n[r](t,e);return gr(i)?y(i)(t,e):i})}return n}constructor(t,n,e){this.options=e;const r=[];this.symbolDef=n,this.symbol=m(n,()=>(r[0]=e.zoom,r)),this.styledVectors=[],this.properties={},this.tt=e.fnTypes||aa.genFnTypes(this.symbolDef),gr(this.symbolDef.visible)&&(this.nt=p(this.symbolDef.visible)),e.atlas&&(this.iconAtlas=e.atlas.iconAtlas,this.glyphAtlas=e.atlas.glyphAtlas),this.features=this.et(t)}needAltitudeAttribute(){return this.options.forceAltitudeAttribute||this.maxPosZ>=oa||this.options.positionType===Float32Array}getPositionFormat(){return this.needAltitudeAttribute()?[{type:Int16Array,width:2,name:"aPosition"},{type:Float32Array,width:1,name:"aAltitude"}]:[{type:Int16Array,width:3,name:"aPosition"}]}fillPosition(t,n,e,r){n<this.rt&&(this.rt=n),n>this.it&&(this.it=n),e<this.st&&(this.st=e),e>this.ot&&(this.ot=e),this.needAltitudeAttribute()?(t.aPosition.push(n,e),t.aAltitude.push(r)):(Tr(ta,n,e,r),t.aPosition.push(ta[0],ta[1],ta[2]))}et(t){if(!t.length)return t;const n="__fea_idx".trim();let e,r=0,i=t[r];for(;!i.geometry;)r++,i=t[r];if(Array.isArray(i.geometry)&&i.properties){let n=i.geometry[0];for(;Array.isArray(n);)n=n[0];n instanceof Ut&&(e=t)}if(!e)if(e=[],Array.isArray(i.geometry))for(let n=0;n<t.length;n++){const r=ur({},t[n]);e.push(ar(r))}else for(let r=0;r<t.length;r++){const i=t[r],s=Ve(i);for(let t=0;t<s.length;t++){const r=s[t];r[n]=i[n],e.push(r)}}if(this.maxPosZ=0,!this.options.forceAltitudeAttribute){const t="line"===this.symbolDef.textPlacement;let n=0,r=!1;const{textPitchAlignmentFn:i}=this.tt;!i&&t&&"map"===this.symbolDef.textPitchAlignment&&(r=!0);for(let s=0;s<e.length;s++){const o=la(e[s]&&e[s].geometry);if(o>n&&(n=o),t&&!r&&i&&e[s].properties){const t=i(null,e[s].properties);"map"===t&&(r=t)}}this.hasMapPitchAlign=r,this.maxPosZ=n}const s=this.options.order;if(s){const t=[];for(let n=0;n<s.length;n++)s[n]&&t.push(Uo(s[n]));e=e.sort((n,e)=>{const r=t.length;let i=-1,s=-1;for(let o=0;o<r&&(t[o](n)&&(i=o),t[o](e)&&(s=o),!(i>=0&&i<r&&s>=0&&s<r));o++);return i-s})}return e}load(t=1){const n="__fea_idx".trim(),e="_debug_info".trim(),r=this.tt,i=this.styledVectors;this.count=0;const s=this.features;if(!s||!s.length)return Promise.resolve(null);const o={},a={},u={zoom:this.options.zoom,isVector3D:!!this.options.center},l=[],h=m(this.symbolDef,()=>(l[0]=u.zoom,l));let c=0,f=s.length;const d=this.options.debugIndex;try{for(;c<f;c++){const t=s[c];if(!t||!t.geometry)continue;if(hr(d)&&t[e].index!==d)continue;t.properties||(t.properties={}),t.properties.$layer=t.layer,t.properties.$type=t.type;const l=this.createStyledVector(t,h,r,u,o,a);l&&l.feature.geometry&&(l.featureIdx=void 0===t[n]?c:t[n],this.count++,i.push(l))}}catch(t){return Promise.reject(t)}return this.options.atlas?Promise.resolve(this.pack(t)):this.loadAtlas(o,a).then(()=>this.pack(t))}loadAtlas(t,n){return new Promise((e,r)=>{this.fetchAtlas(t,n,(t,n)=>{if(t)r(t);else{if(n){const{icons:t,glyphs:e}=n;if(t&&Object.keys(t).length){for(const n in t){const e=t[n],{width:r,height:i,data:s}=e.data;e.data=new Ze({width:r,height:i},s)}this.iconAtlas=new Qe(t)}if(e&&Object.keys(e).length){for(const t in e){const n=e[t];for(const t in n){const e=n[t],{width:r,height:i,data:s}=e.bitmap;e.bitmap=new Ye({width:r,height:i},s)}}this.glyphAtlas=new er(e)}}e({glyphAtlas:this.glyphAtlas,iconAtlas:this.iconAtlas})}})})}fetchAtlas(t,n,e){Object.keys(t).length>0||Object.keys(n).length>0?this.options.requestor(t,n,e):e()}pack(t){if(!this.count)return null;if(null==t)throw new Error("layout scale is undefined");const n=this.createDataPack(this.styledVectors,t);if(!n)return null;n.properties=this.properties,this.empty&&(n.empty=!0);const e=n.buffers;delete n.buffers;const r={data:n,buffers:e};if(this.iconAtlas){const t=r.data.iconAtlas=ua(this.iconAtlas);if(t.glyphMap)for(const n in t.glyphMap)e.push(t.glyphMap[n].data.data.buffer);e.push(r.data.iconAtlas.image.data.buffer)}return this.glyphAtlas&&(r.data.glyphAtlas=ua(this.glyphAtlas),e.push(r.data.glyphAtlas.image.data.buffer)),r}createStyledVector(t,n,e,r){return new Cr(t,n,e,r)}createDataPack(t,n){if(!t||!t.length)return null;this.maxIndex=0,this.maxPos=0,this.rt=this.st=1/0,this.it=this.ot=-1/0,this.maxAltitude=0,this.dynamicAttrs={};const e=this.data={};this.ut=sa,sa.reset();let r=this.elements=sa.get();const i=this.getFormat(Array.isArray(t[0])?t[0][0].symbol:t[0].symbol),s=this.needAltitudeAttribute()?2:3;for(let t=0;t<i.length;t++)e[i[t].name]=sa.get();let o=sa.get(),a=0;const u=sa.get();let l=0,h=!1,c=!0;const f=new Set;for(let r=0,i=t.length;r<i;r++){if(!t[r].feature.geometry)continue;const i=Array.isArray(t[r])?t[r][0].feature.id:t[r].feature.id;c&&(void 0!==ea.id?f&&(f.has(ea.id)?c=!1:f.add(ea.id)):c=!1),hr(i)&&(Math.abs(i)>l&&(l=Math.abs(i)),i<0&&(h=!0));const d=this.data.aPosition.length;if(Array.isArray(t[r]))for(let e=0;e<t[r].length;e++)this.lt(t[r][e],n);else this.lt(t[r],n);const p=(e.aPosition.length-d)/s;for(let n=0;n<p;n++)o.push(t[r].featureIdx),hr(i)&&u.push(i);a=Math.max(a,t[r].featureIdx)}if(this.countOutOfAngle>0&&console.warn("text anchor along line is ignored as anchor\'s line angle is bigger than textMaxAngle."),this.hasElements()&&!r.length)return null;const d=this.options.center?Float32Array:sr(a);o=Qo.createTypedArray(o,d),i[0].type=this.options.positionType?this.options.positionType:ir(this.maxPos);const p=this.options.center;if(p&&(p[0]||p[1])){const t=e.aPosition;for(let n=0;n<t.length;n+=s)t[n]-=p[0],t[n+1]-=p[1]}const y=function(t,n){const e={};for(let r=0;r<t.length;r++){const i=t[r],s=i.type,o=i.name;e[o]=s===Array?n[o]:or(n[o],s)}return e}(i,e);y.aPickingId=o;const m=[];for(const t in y)m.push(y[t].buffer);const g=rr(this.maxIndex);r=Qo.createTypedArray(r,g),m.push(r.buffer);const v={data:y,isIdUnique:c,is2D:0===this.maxPosZ,indices:this.hasElements()?r:null,positionSize:s,positionBounding:[this.rt,this.st,this.it,this.ot],buffers:m,symbolIndex:this.symbolDef.index||{index:0},dynamicAttributes:this.dynamicAttrs};if(this.ht&&(v.markerPlacement=this.ht),this.ct&&(v.textPlacement=this.ct),u.length){const t=h?ir(l):sr(l);v.featureIds=Qo.createTypedArray(u,t),m.push(v.featureIds.buffer)}else v.featureIds=[];return v.pickingIdIndiceMap=$r(o,v.indices),v}lt(t,n){this.nt&&!this.nt(this.options.zoom,t.feature.properties)||this.placeVector(t,n,this.formatWidth)}addElements(...t){this.maxIndex=Math.max(this.maxIndex,...t),this.elements.push(...t)}hasElements(){return!0}getAltitude(t){const{altitudeProperty:n,defaultAltitude:e,altitudeScale:r}=this.options;let i=Sr(t,n,e);return r&&(i*=r),this.maxAltitude=Math.max(this.maxAltitude,Math.abs(i)),i}getIconAtlasMaxValue(){const t=this.iconAtlas.positions;let n=0;for(const e in t)if(yr(t,e)){const{tl:r,displaySize:i}=t[e],s=Math.max(r[0],r[1],i[0]-1,i[1]-1);s>n&&(n=s)}return n}}function ua(t){let n=t.positions,e=t.image&&t.image.format||"alpha";if(t instanceof Qe){n={};for(const e in t.positions){const r=t.positions[e];n[e]={paddedRect:r.paddedRect,pixelRatio:r.pixelRatio,tl:r.tl,br:r.br,displaySize:r.displaySize}}e="rgba"}const r=t.image;return{image:{width:r.width,height:r.height,data:r.data,format:e},glyphMap:t.glyphMap,positions:n}}function la(t){if(!t)return 0;let n=0;if(Array.isArray(t))for(let e=0;e<t.length;e++)if(Array.isArray(t[e])){const r=la(t[e]);r>n&&(n=r)}else{const r=Math.abs(t[e].z||0);r>n&&(n=r)}else{const e=Math.abs(t.z||0);e>n&&(n=e)}return n}function ha(t,n,e,r){const i="__fn_textSize".trim();let s=t.textSize;if(lr(n.textSize))return[16,16];t[i]&&(s=t[i]);const o=[];if(o[0]=dr(s)?s(r,e):s,d(o[0])){const n=o[0].ft=o[0].ft||JSON.stringify(o[0]);t.dt||(t.dt={}),t.dt[n]||(t.dt[n]=p(o[0])),o[0]=(0,t.dt[n])(r,e)}return o[1]=o[0],o}function ca(t){const n=t.stops;let e=-1/0;for(let t=0;t<n.length;t++){let r=n[t][1];cr(n[t][1])&&(r=ca(n[t][1])),r>e&&(e=r)}return e}function fa(t,n,e){return[n||"normal",e||"normal","24px",t||"Open Sans Regular"].join(" ")}const da=/\\{[\\w-]+(?:\\|[\\w-]+)*\\}/g;function pa(t,n){return fr(t)?t.replace(da,(function(t){if(!n)return"";if((t=t.substring(1,t.length-1)).indexOf("|")>0){const e=t.split("|");for(let t=0;t<e.length;t++){const r=n[e[t]];if(!lr(r))return r}return""}const e=n[t];return lr(e)?"":Array.isArray(e)?e.join():e})):t}var ya=Object.freeze({__proto__:null,getSDFFont:fa,resolveText:pa,resolveVarNames:function(t){return t.match(da)},resolveExpVarNames:function t(n,e){if(2!==e.length||"get"!==e[0])for(let r=0;r<e.length;r++)2===e[r].length&&"get"===e[r][0]?n.push(e[r][1]):Array.isArray(e[r])&&t(n,e[r]);else n.push(e[1])}});const ma=t=>t>=11904&&t<=12031,ga=t=>t>=12032&&t<=12255,va=t=>t>=12272&&t<=12287,ba=t=>t>=12288&&t<=12351,wa=t=>t>=12352&&t<=12447,Ma=t=>t>=12448&&t<=12543,xa=t=>t>=12544&&t<=12591,Fa=t=>t>=12704&&t<=12735,Aa=t=>t>=12736&&t<=12783,ka=t=>t>=12784&&t<=12799,Pa=t=>t>=12800&&t<=13055,Sa=t=>t>=13056&&t<=13311,_a=t=>t>=13312&&t<=19903,Oa=t=>t>=19968&&t<=40959,Ea=t=>t>=40960&&t<=42127,Ia=t=>t>=42128&&t<=42191,$a=t=>t>=63744&&t<=64255,Ca=t=>t>=64336&&t<=65023,Ta=t=>t>=65040&&t<=65055,za=t=>t>=65072&&t<=65103,Da=t=>t>=65104&&t<=65135,ja=t=>t>=65136&&t<=65279,Ua=t=>t>=65280&&t<=65519;function Na(t){return!((t=>t>=1536&&t<=1791)(t)||(t=>t>=1872&&t<=1919)(t)||(t=>t>=2208&&t<=2303)(t)||Ca(t)||ja(t))}function La(t){return!!(746===t||747===t||!(t<4352)&&(Fa(t)||xa(t)||za(t)&&!(t>=65097&&t<=65103)||$a(t)||Sa(t)||ma(t)||Aa(t)||!(!ba(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||_a(t)||Oa(t)||Pa(t)||(t=>t>=12592&&t<=12687)(t)||(t=>t>=43360&&t<=43391)(t)||(t=>t>=55216&&t<=55295)(t)||(t=>t>=4352&&t<=4607)(t)||(t=>t>=44032&&t<=55215)(t)||wa(t)||va(t)||(t=>t>=12688&&t<=12703)(t)||ga(t)||ka(t)||Ma(t)&&12540!==t||!(!Ua(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)||!(!Da(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||Ta(t)||(t=>t>=19904&&t<=19967)(t)||Ea(t)||Ia(t)))}function Va(t){return!(La(t)||function(t){return!!((t=>t>=128&&t<=255)(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||(t=>t>=8192&&t<=8303)(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||(t=>t>=8448&&t<=8527)(t)||(t=>t>=8528&&t<=8591)(t)||(t=>t>=8960&&t<=9215)(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||(t=>t>=9216&&t<=9279)(t)&&9251!==t||(t=>t>=9280&&t<=9311)(t)||(t=>t>=9312&&t<=9471)(t)||(t=>t>=9632&&t<=9727)(t)||(t=>t>=9728&&t<=9983)(t)&&!(t>=9754&&t<=9759)||(t=>t>=11008&&t<=11263)(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||ba(t)||Ma(t)||(t=>t>=57344&&t<=63743)(t)||za(t)||Da(t)||Ua(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Ra(t){return t>=1424&&t<=2303||Ca(t)||ja(t)}const Ha=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]];function Wa(t){for(const n of Ha)if(t>=n[0]&&t<=n[1])return!0;return!1}const qa={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",pt:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Ga(t,n,e,r,i,s,o,a,u,l){let h=t.trim();2===l&&(h=function(t){let n="";for(let e=0;e<t.length;e++){const r=t.charCodeAt(e+1)||null,i=t.charCodeAt(e-1)||null;n+=r&&Va(r)&&!qa[t[e+1]]||i&&Va(i)&&!qa[t[e-1]]||!qa[t[e]]?t[e]:qa[t[e]]}return n}(h));const c=[],f={positionedGlyphs:c,text:h,top:a[1],bottom:a[1],left:a[0],right:a[0],writingMode:l};let d;return d=function(t,n){const e=[];let r=0;for(let i=0;i<n.length;i++){const s=n[i];e.push(t.substring(r,s)),r=s}return r<t.length&&e.push(t.substring(r,t.length)),e}(h,function(t,n,e,r){if(!e)return[];if(!t)return[];const i=[],s=function(t,n,e,r){let i=0;for(let e=0;e<t.length;e++){const s=r[t.charCodeAt(e)];s&&(i+=s.metrics.advance+n)}return i/Math.max(1,Math.ceil(i/e))}(t,n,e,r);let o=0;for(let e=0;e<t.length;e++){const u=t.charCodeAt(e),l=r[u];l&&!Ba[u]&&(o+=l.metrics.advance+n),e<t.length-1&&(Ja[u]||!((a=u)<11904)&&(Fa(a)||xa(a)||za(a)||$a(a)||Sa(a)||ma(a)||Aa(a)||ba(a)||_a(a)||Oa(a)||Pa(a)||Ua(a)||wa(a)||va(a)||ga(a)||ka(a)||Ma(a)||Ta(a)||Ia(a)||Ea(a)))&&i.push(Za(e+1,o,s,i,Ya(u,t.charCodeAt(e+1)),!1))}var a;return function t(n){return n?t(n.priorBreak).concat(n.index):[]}(Za(t.length,o,s,i,0,!0))}(h,o,e,n)),function(t,n,e,r,i,s,o,a,u,l){let h=0,c=0,f=0;const d=t.positionedGlyphs,p="right"===s?1:"left"===s?0:.5;for(let t=0;t<e.length;t++){let i=e[t];if(i=i.trim(),!i.length){c-=r;continue}const s=d.length;for(let t=0;t<i.length;t++){const e=i.charCodeAt(t),r=n[e];r&&(La(e)&&1!==o?(32!==e&&d.push({glyph:e,x:h,y:0,vertical:!0}),h+=u+a):(32!==e&&d.push({glyph:e,x:h,y:c,vertical:!1}),h+=r.metrics.advance+a))}d.length!==s&&(f=Math.max(h-a,f),Qa(d,n,s,d.length-1,p)),h=0,c-=r}const{horizontalAlign:y,verticalAlign:m}=Ka(i,void 0);!function(t,n,e,r,i,s,o){const a=(n-e)*i,u=-(-r*o+.5)*s;if(a||u)for(let n=0;n<t.length;n++)t[n].x+=a,t[n].y+=u}(d,p,y,m,f,r,e.length);const g=e.length*r;t.top+=-m*g,t.bottom=t.top+g,t.left+=-y*f,t.right=t.left+f}(f,n,d,r,i,s,l,o,u),!!c.length&&f}const Ba={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ja={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Xa(t,n,e,r){const i=Math.pow(t-n,2);return r?t<n?i/2:2*i:i+Math.abs(e)*e}function Ya(t,n){let e=0;return 10===t&&(e-=1e4),40!==t&&65288!==t||(e+=50),41!==n&&65289!==n||(e+=50),e}function Za(t,n,e,r,i,s){let o=null,a=Xa(n,e,i,s);for(let t=0;t<r.length;t++){const u=r[t],l=Xa(n-u.x,e,i,s)+u.badness;l<=a&&(o=u,a=l)}return{index:t,x:n,priorBreak:o,badness:a}}function Ka(t,n){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=n?1:0;break;case"left":case"top-left":case"bottom-left":e=n?0:1}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=n?1:0;break;case"top":case"top-right":case"top-left":r=n?0:1}return{horizontalAlign:e,verticalAlign:r}}function Qa(t,n,e,r,i){if(!i)return;const s=n[t[r].glyph];if(s){const n=(t[r].x+s.metrics.advance)*i;if(!n)return;for(let i=e;i<=r;i++)t[i].x-=n}}function tu(t){if(!function(t){for(const n of t)if(Ra(n.charCodeAt(0)))return!0;return!1}(t))return t;const n=[],e=[],r=[];let i=0,s=0,o=1,a=1;for(const u of t){const t=u.codePointAt(0);Wa(t)?(r.push(u),i++):(o=Ra(t)?-1:1,a!==o?(s=i,e.length&&(a>0&&e.reverse(),n.push(...e)),r.length&&(n.splice(s,0,...r),r.length=0),a=o,e.length=0):r.length&&(e.push(...r),r.length=0),e.push(u),i++)}return r.length&&e.push(...r),e.length&&(a>0&&e.reverse(),n.push(...e)),n.reverse().join("")}const nu=/\\{ *([\\w_]+) *\\}/g;class eu{constructor(t,n,e,r,i){this.feature=t,this.symbolDef=n,this.symbol=e,this.options=i,this.yt=this.gt.bind(this),this.tt=r}gt(t,n){return this.feature.properties[n]||"default"}getShape(t,n){if(this.vt)return this.vt;const{textHorizontalAlignmentFn:e,textVerticalAlignmentFn:r,markerHorizontalAlignmentFn:i,markerVerticalAlignmentFn:s,textWrapWidthFn:o}=this.tt;let a;const u=this.symbol,l=this.getIconAndGlyph(),h=this.feature.properties;if(l&&l.glyph){const{font:t,text:i}=l.glyph;if(""===i)return null;const s=this.size[0]/24,c=24,f=u.textKeepUpright,d="map"===u.textRotationAlignment&&"line"===u.textPlacement&&!u.isIconText,p=n.glyphMap[t],y=ru(e?e(null,h):u.textHorizontalAlignment,r?r(null,h):u.textVerticalAlignment),m=1.2*c,g=function(t){for(let n=0;n<t.length;n++)if(!Na(t.charAt(n).charCodeAt(0)))return!1;return!0}(i),v=g&&u.textLetterSpacing/s||0,b=[u.textDx/s||0,u.textDy/s||0],w=((o?o(null,h):u.textWrapWidth)||10*c)/s;a={},a.horizontal=Ga(i,p,w,m,y,"center",v,b,c,1),g&&d&&f&&(a.vertical=Ga(i,p,w,m,y,"center",v,b,c,2))}else if(l&&l.icon){if(!t.positions[l.icon.url])return null;const n=ru(i?i(null,h):u.markerHorizontalAlignment,s?s(null,h):u.markerVerticalAlignment);a=function(t,n,e){let{horizontalAlign:r,verticalAlign:i}=Ka(n,e);e?r=1-r:i=1-i;const s=-2048*r,o=-2048*i;return{image:t,top:o,bottom:o+2048,left:s,right:s+2048}}(t.positions[l.icon.url],n,this.options.isVector3D),this.size||(this.size=a.image.displaySize)}return this.vt=a,a}getIconAndGlyph(){if(this.iconGlyph)return this.iconGlyph;const{markerFileFn:t,markerTypeFn:n,markerPathFn:e,markerWidthFn:r,markerHeightFn:i,markerFillFn:s,markerFillPatternFileFn:o,markerFillOpacityFn:a,markerTextFitFn:u,markerTextFitPaddingFn:l,markerLineColorFn:h,markerLineWidthFn:c,markerLineOpacityFn:f,markerLineDasharrayFn:y,markerLinePatternFileFn:m,markerPathWidthFn:g,markerPathHeightFn:v,textNameFn:b,textFaceNameFn:w,textStyleFn:M,textWeightFn:x}=this.tt,{zoom:F}=this.options,A={},k=this.symbol,P=this.feature.properties,S=t?t(null,P):k.markerFile,_=n?n(null,P):k.markerType,O=S||_||k.markerPath,E=!lr(this.symbolDef.textName);let I;if(O){I=function(t,n,e,r,i,s){if(lr(n.markerWidth)&&lr(n.markerHeight))return null;const o="__fn_markerWidth".trim(),a="__fn_markerHeight".trim();let u=n.markerWidth||0,l=n.markerHeight||0;return cr(u)&&("identity"!==u.type?u=ca(u):(u=t.markerWidth,t[o]&&(u=t[o](r,e)),cr(u)&&(u="identity"===u.type?i(r,e):ca(u)))),cr(l)&&("identity"!==l.type?l=ca(l):(l=t.markerHeight,t[a]&&(l=t[a](r,e)),cr(l)&&(l="identity"===l.type?s(r,e):ca(l)))),[u,l]}(k,this.symbolDef,P,F,r,i)||[0,0];let t=k.markerTextFit;if(u&&(t=u(F,P)),t&&k.text&&"none"!==t){const n=k.text.textSize;let e=k.text.textName;d(e)&&(e=p(e)(F,P));const r=pa(e,P);if(r){const e="__fn_textSize".trim(),i="__fn_textSize_0".trim();d(n)&&!k.text[e]&&(k.text[i]=p(n),k.text[e]=(t,n)=>{const e=k.text[i](t,n);return d(e)?p(e)(t,n):e});const s=ha(k.text,k.text,P,F);if("width"!==t&&"both"!==t||(I[0]=s[0]*r.length),"height"!==t&&"both"!==t||(I[1]=s[1]),s[0]&&s[1]){let t=k.markerTextFitPadding||[0,0,0,0];l&&(t=l(F,P)),I[0]+=t[1]+t[3],I[1]+=t[0]+t[2]}}else I[0]=I[1]=-1}}if(E&&(I=ha(k,this.symbolDef,P,F)),!I)return A;if(I[0]=Math.ceil(I[0]),I[1]=Math.ceil(I[1]),this.size=I,O&&I[0]>=0&&I[1]>=0){let t;if(_){const n={};if(n.markerType=_,"path"===_&&(n.markerPath=e?e(null,P):k.markerPath,n.markerPathWidth=g?g(null,P):k.markerPathWidth,n.markerPathHeight=v?v(null,P):k.markerPathHeight),r){const t=r(null,P);lr(t)||(n.markerWidth=t)}else k.markerWidth>=0&&(n.markerWidth=k.markerWidth);if(i){const t=i(null,P);lr(t)||(n.markerHeight=t)}else k.markerHeight>=0&&(n.markerHeight=k.markerHeight);if(s){const t=s(null,P);lr(t)||(n.markerFill=t)}else k.markerFill&&(n.markerFill=k.markerFill);if(o){const t=o(null,P);lr(t)||(n.markerFillPatternFile=t)}else k.markerFillPatternFile&&(n.markerFillPatternFile=k.markerFillPatternFile);if(a){const t=a(null,P);lr(t)||(n.markerFillOpacity=t)}else k.markerFillOpacity>=0&&(n.markerFillOpacity=k.markerFillOpacity);if(h){const t=h(null,P);lr(t)||(n.markerLineColor=t)}else k.markerLineColor&&(n.markerLineColor=k.markerLineColor);if(c){const t=c(null,P);lr(t)||(n.markerLineWidth=t)}else k.markerLineWidth>=0&&(n.markerLineWidth=k.markerLineWidth);if(f){const t=f(null,P);lr(t)||(n.markerLineOpacity=t)}else k.markerLineOpacity>=0&&(n.markerLineOpacity=k.markerLineOpacity);if(y){const t=y(null,P);lr(t)||(n.markerLineDasharray=t)}else k.markerLineDasharray&&(n.markerLineDasharray=k.markerLineDasharray);if(m){const t=m(null,P);lr(t)||(n.markerLinePatternFile=t)}else k.markerLinePatternFile&&(n.markerLinePatternFile=k.markerLinePatternFile);t="vector://"+JSON.stringify(n)}else t=S?S.replace(nu,this.yt):k.markerPath?function(t,n,e){if(!t.markerPath)return null;let r=1;const i=function(t){const n={stroke:{stroke:t.markerLineColor,"stroke-width":t.markerLineWidth,"stroke-opacity":t.markerLineOpacity,"stroke-dasharray":null,"stroke-linecap":"butt","stroke-linejoin":"round"},fill:{fill:t.markerFill,"fill-opacity":t.markerFillOpacity}};return 0===n.stroke["stroke-width"]&&(n.stroke["stroke-opacity"]=0),n}(t);hr(t.markerOpacity)&&(r=t.markerOpacity),hr(t.opacity)&&(r*=t.opacity);const s={};if(i){for(const t in i.stroke)yr(i.stroke,t)&&(lr(i.stroke[t])||(s[t]=i.stroke[t]));for(const t in i.fill)yr(i.fill,t)&&(lr(i.fill[t])||(s[t]=i.fill[t]))}const o=Array.isArray(t.markerPath)?t.markerPath:[t.markerPath];let a;const u=[];for(let t=0;t<o.length;t++)a=fr(o[t])?{path:o[t]}:o[t],a=ur({},a,s),a.d=a.path,delete a.path,u.push(a);const l=[\'<svg version="1.1"\',\'xmlns="http://www.w3.org/2000/svg"\'];r<1&&l.push(\'opacity="\'+r+\'"\'),t.markerPathWidth&&t.markerPathHeight&&l.push(\'viewBox="0 0 \'+t.markerPathWidth+" "+t.markerPathHeight+\'"\'),l.push(\'preserveAspectRatio="none"\'),n&&l.push(\'width="\'+n+\'"\'),e&&l.push(\'height="\'+e+\'"\'),l.push("><defs></defs>");for(let t=0;t<u.length;t++){let n="<path ";for(const e in u[t])yr(u[t],e)&&(n+=" "+e+\'="\'+u[t][e]+\'"\');n+="></path>",l.push(n)}return l.push("</svg>"),"data:image/svg+xml;base64,"+btoa(l.join(" "))}(k,I[0],I[1]):null;A.icon={url:t,size:I}}if(E){const t=b?b(this.options.zoom,P):k.textName;if(t||0===t){const n=fa(w?w(null,P):k.textFaceName,M?M(null,P):k.textStyle,x?x(null,P):k.textWeight);let e=pa(t,P);e&&e.length&&(e=tu(e),A.glyph={font:n,text:e})}}return this.iconGlyph=A,A}}function ru(t,n){n&&"middle"!==n||(n="center"),t&&"middle"!==t||(t="center");let e="center"!==n?n:"";return e+="center"!==t?(e.length?"-":"")+t:"",e\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */}function iu(t,n,e,r,i){const s=[];let o;for(let a=0;a<t.length;a++){const u=t[a];let l,h=!1;for(let t=0;t<u.length-1;t++){let a=u[t],c=u[t+1];a.x<n&&c.x<n||(a.x<n?(o=a,a=new Ut(n,a.y+(n-a.x)/(c.x-a.x)*(c.y-a.y)).T(),a.z=o.z+(n-o.x)/(c.x-o.x)*(c.z-o.z),h=!0):c.x<n&&(o=c,c=new Ut(n,a.y+(n-a.x)/(c.x-a.x)*(c.y-a.y)).T(),c.z=a.z+(n-a.x)/(o.x-a.x)*(o.z-a.z),h=!0),a.y<e&&c.y<e||(a.y<e?(o=a,a=new Ut(a.x+(e-a.y)/(c.y-a.y)*(c.x-a.x),e).T(),a.z=o.z+(e-o.y)/(c.y-o.y)*(c.z-o.z),h=!0):c.y<e&&(o=c,c=new Ut(a.x+(e-a.y)/(c.y-a.y)*(c.x-a.x),e).T(),c.z=a.z+(e-a.y)/(o.y-a.y)*(o.z-a.z),h=!0),a.x>=r&&c.x>=r||(a.x>=r?(o=a,a=new Ut(r,a.y+(r-a.x)/(c.x-a.x)*(c.y-a.y)).T(),a.z=o.z+(r-o.x)/(c.x-o.x)*(c.z-o.z),h=!0):c.x>=r&&(o=c,c=new Ut(r,a.y+(r-a.x)/(c.x-a.x)*(c.y-a.y)).T(),c.z=a.z+(r-a.x)/(o.x-a.x)*(o.z-a.z),h=!0),a.y>=i&&c.y>=i||(a.y>=i?(o=a,a=new Ut(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i).T(),a.z=o.z+(i-o.y)/(c.y-o.y)*(c.z-o.z),h=!0):c.y>=i&&(o=c,c=new Ut(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i).T(),c.z=a.z+(i-a.y)/(o.y-a.y)*(o.z-a.z),h=!0),l&&a.equals(l[l.length-1])||(l=[a],s.push(l)),h&&(l.clipped=!0),l.push(c)))))}}return s}class su extends Ut{constructor(t,n,e,r){super(t,n),this.angle=e,void 0!==r&&(this.segment=r)}clone(){return new su(this.x,this.y,this.angle,this.segment)}}\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */function ou(t,n,e,r,i){if(void 0===n.segment)return!0;let s=n,o=n.segment+1,a=0;for(;a>-e/2;){if(o--,o<0)return!1;a-=t[o].dist(s),s=t[o]}a+=t[o].dist(t[o+1]),o++;const u=[];let l=0;for(;a<e/2;){const n=t[o],e=t[o+1];if(!e)return!1;let s=t[o-1].angleTo(n)-n.angleTo(e);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:a,angleDelta:s}),l+=s;a-u[0].distance>r;)l-=u.shift().angleDelta;if(l>i)return!1;o++,a+=n.dist(e)}return!0}function au(t,n,e,r,i,s,o,a,u,l,h){const c=function(t,n,e){return t?.6*n*e:0}(r,s,o),f=function(t,n){return Math.max(t?t.right-t.left:0,n?n.right-n.left:0)}(r,i),d=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return n-f*o<n/4&&(n=f*o+n/4),function t(n,e,r,i,s,o,a,u,l,h,c){let f=0;const d=o/2,p=function(t){let n=0;for(let e=0;e<t.length-1;e++)n+=t[e].dist(t[e+1]);return n}(n);let y=0,m=e-r,g=[];for(let t=0;t<n.length-1;t++){const e=n[t],a=n[t+1],u=e.dist(a),v=a.angleTo(e);for(;m+r<y+u;){m+=r;const b=(m-y)/u,w=uu(e.x,a.x,b),M=uu(e.y,a.y,b),x=uu(e.z||0,a.z||0,b);if(w>=0&&w<l&&M>=0&&M<l&&m-d>=0&&m+d<=p){const r=new su(w,M,v,t);r.z=x,h&&(r.axis=[e.y-M,w-e.x],r.angleR=x===(e.z||0)?0:Math.atan(.9*(x-(e.z||0))*c/e.dist(r))),r.line=n,r.T(),!i||ou(n,r,o,i,s)?g.push(r):i&&f++}}y+=u}return u||g.length||a||(g=t(n,y/2,r,i,s,o,a,!0,l,h,c)),g.countOutOfAngle=f,g}(t,d?n/2*a%n:(f/2+2*s)*o*a%n,n,c,e,f*o,d,!1,u,l,h)}function uu(t,n,e){return t*(1-e)+n*e}function lu(t,n){const e=t.length;if(e<=1)return[t];const r=[];let i,s;for(let n=0;n<e;n++){const e=kr(t[n]);0!==e&&(t[n].area=Math.abs(e),void 0===s&&(s=e<0),s===e<0?(i&&r.push(i),i=[t[n]]):i.push(t[n]))}if(i&&r.push(i),n>1)for(let t=0;t<r.length;t++)r[t].length<=n||(Gn(r[t],n,1,r[t].length-1,hu),r[t]=r[t].slice(0,n));return r}function hu(t,n){return n.area-t.area}function cu(t,n,e){const r=n.distSqr(e);if(0===r)return t.distSqr(n);const i=((t.x-n.x)*(e.x-n.x)+(t.y-n.y)*(e.y-n.y))/r;return t.distSqr(i<0?n:i>1?e:e.sub(n).k(i).m(n))}function fu(t,n=1,e=!1){let r=1/0,i=1/0,s=-1/0,o=-1/0;const a=t[0];for(let t=0;t<a.length;t++){const n=a[t];(!t||n.x<r)&&(r=n.x),(!t||n.y<i)&&(i=n.y),(!t||n.x>s)&&(s=n.x),(!t||n.y>o)&&(o=n.y)}const u=Math.min(s-r,o-i);let l=u/2;const h=new Bn([],du);if(0===u)return new Ut(r,i);for(let n=r;n<s;n+=u)for(let e=i;e<o;e+=u)h.push(new pu(n+l,e+l,l,t));let c=function(t){let n=0,e=0,r=0;const i=t[0];for(let t=0,s=i.length,o=s-1;t<s;o=t++){const s=i[t],a=i[o],u=s.x*a.y-a.x*s.y;e+=(s.x+a.x)*u,r+=(s.y+a.y)*u,n+=3*u}return new pu(e/n,r/n,0,t)}(t),f=h.length;for(;h.length;){const r=h.pop();(r.d>c.d||!c.d)&&(c=r,e&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,f)),r.max-c.d<=n||(l=r.h/2,h.push(new pu(r.p.x-l,r.p.y-l,l,t)),h.push(new pu(r.p.x+l,r.p.y-l,l,t)),h.push(new pu(r.p.x-l,r.p.y+l,l,t)),h.push(new pu(r.p.x+l,r.p.y+l,l,t)),f+=4)}return e&&(console.log("num probes: "+f),console.log("best distance: "+c.d)),c.p}function du(t,n){return n.max-t.max}function pu(t,n,e,r){this.p=new Ut(t,n),this.h=e,this.d=function(t,n){let e=!1,r=1/0;for(let i=0;i<n.length;i++){const s=n[i];for(let n=0,i=s.length,o=i-1;n<i;o=n++){const i=s[n],a=s[o];i.y>t.y!=a.y>t.y&&t.x<(a.x-i.x)*(t.y-i.y)/(a.y-i.y)+i.x&&(e=!e),r=Math.min(r,cu(t,i,a))}}return(e?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}function yu(t,n,e,r,i,s,o,a,u,l){const{feature:h,size:c,symbol:f}=t,d=c?24:0,p=i*(c?c[0]/d:1);if("line"===o){const t=[];t.countOutOfAngle=0;let i=h.geometry;s&&(i=iu(h.geometry,0,0,s,s));for(let o=0;o<i.length;o++){const h=au(i[o],a,e,f.isIconText?null:r&&r.vertical||r&&r.horizontal||r,null,d,f.isIconText?1:p,1,s||1/0,u,l);if(f.textPlacement&&!f.isIconText)for(let t=0;t<h.length;t++)h[t].startIndex=n.length/3;if(t.push.apply(t,h),f.textPlacement&&!f.isIconText)for(let t=0;t<i[o].length;t++)n.push(i[o][t].x,i[o][t].y,i[o][t].z||0);t.countOutOfAngle+=h.countOutOfAngle||0}return t}return mu(h,o,s)}function mu(t,n,e,r,i){const s=[];if(3===t.type){const o=lu(t.geometry,0);for(let t=0;t<o.length;t++){const a=o[t];if("vertex"===n)for(let t=0;t<a.length;t++){const n=a[t];for(let o=0;o<n.length;o++)Or(n[o],e)||(s.push(n[o]),r&&(0===o?gu(n[o],n[o],n[t+1],i):gu(n[o],n[o-1],n[o],i)))}else if("vertex-first"===n){const t=a[0];t&&t[0]&&!Or(t[0],e)&&(s.push(t[0]),r&&gu(t[0],t[0],t[1],i))}else if("vertex-last"===n||"vertex-firstlast"===n){const t=a[0];if("vertex-firstlast"===n&&t&&t[0]&&!Or(t[0],e)&&(s.push(t[0]),r&&gu(t[0],t[0],t[1],i)),t&&t[t.length-1]&&!Or(t[t.length-1],e)){const n=t.length-1;s.push(t[n]),r&&gu(t[n],t[n-1],t[n],i)}}else{const t=fu(a,16);Or(t,e)||s.push(t)}}}else if(2===t.type)for(let o=0;o<t.geometry.length;o++){const a=t.geometry[o];if("vertex"===n)for(let t=0;t<a.length;t++)Or(a[t],e)||(s.push(a[t]),r&&(0===t?gu(a[t],a[t],a[t+1],i):gu(a[t],a[t-1],a[t],i)));else if("vertex-last"===n||"vertex-firstlast"===n){if("vertex-firstlast"!==n||Or(a[0],e)||(s.push(a[0]),r&&gu(a[0],a[0],a[1],i)),a&&a[a.length-1]&&!Or(a[a.length-1],e)){const t=a.length-1;s.push(a[t]),r&&gu(a[t],a[t-1],a[t],i)}}else Or(a[0],e)||(s.push(a[0]),r&&gu(a[0],a[0],a[1],i))}else if(1===t.type)for(let n=0;n<t.geometry.length;n++){const i=t.geometry[n];for(let t=0;t<i.length;t++){const n=i[t];Or(n,e)||(r&&(n.xRotation=0,n.yRotation=0,n.zRotation=0),s.push(n))}}return s}function gu(t,n,e,r){if(t.xRotation||t.yRotation||t.zRotation)return t;const i=e.x-n.x,s=n.y-e.y,o=(e.z-n.z)*r,a=Math.atan2(s,i);t.zRotation=a;const u=Math.atan2(o,Math.sqrt(i*i+s*s));return t.xyRotation=u,t}function vu(t,n){const e={},r={},i=[];let s=0;function o(n){i.push(t[n]),s++}function a(t,n,e){const s=r[t];return delete r[t],r[n]=s,i[s].geometry[0].pop(),i[s].geometry[0]=i[s].geometry[0].concat(e[0]),s}function u(t,n,r){const s=e[n];return delete e[n],e[t]=s,i[s].geometry[0].shift(),i[s].geometry[0]=r[0].concat(i[s].geometry[0]),s}function l(t,n,e){const r=e?n[0][n[0].length-1]:n[0][0];return`${t}:${r.x}:${r.y}`}for(let h=0;h<t.length;h++){const c=t[h],f=c.geometry;if(!f)continue;const d=c.properties[n]?c.properties[n].toString():null;if(!d){o(h);continue}const p=l(d,f),y=l(d,f,!0);if(p in r&&y in e&&r[p]!==e[y]){const t=u(p,y,f),n=a(p,y,i[t].geometry);delete e[p],delete r[y],r[l(d,i[n].geometry,!0)]=n,i[t].geometry=null}else p in r?a(p,y,f):y in e?u(p,y,f):(o(h),e[p]=s-1,r[y]=s-1)}return i.filter(t=>t.geometry)}class bu extends aa{static needMerge(t,n,e){if(!t)return!1;let r="line"===t.textPlacement||"line"===t.markerPlacement;return r||(n.textPlacementFn&&(r="line"===n.textPlacementFn(e)),n.markerPlacementFn&&(r="line"===n.markerPlacementFn(e))),t.mergeOnProperty&&r}static mergeLineFeatures(t,n,e,r){const i="__index".trim();let s=n.textPlacement,o=n.markerPlacement;e.textPlacementFn&&(s=e.textPlacementFn(r)),e.markerPlacementFn&&(o=e.markerPlacementFn(r));const a=function(t,n,e,r,i){const s="__index".trim(),o=aa.genFnTypes(n),{mergeOnPropertyFn:a}=o;if(!n.mergeOnProperty||"line"!==r&&"line"!==e)return[];if(!(Er(u=n.mergeOnProperty)||"string"!=typeof u&&(null===u.constructor||u.constructor!==String)||"line"!==r&&"line"!==e))return[{features:t,property:n.mergeOnProperty}];var u;const l=[],h={},c=[];for(let o=0;o<t.length;o++){t[o][s]=o;const u=t[o].properties=t[o].properties||{};u.$layer=t[o].layer,u.$type=t[o].type;let f=e;"line"!==f&&(f=r);const d=a?a(i,u):n.mergeOnProperty;"line"!==f||Er(d)?c.push(t[o]):(void 0===h[d]&&(h[d]=l.length,l.push({features:[],property:d})),l[h[d]].features.push(t[o]))}return c.length&&l.push({features:c}),l}(t,n,o,s,r);if(a.length){const n=[];for(let e=0;e<a.length;e++)n.push(a[e].property?vu(a[e].features,a[e].property):t);if(1===n.length)return n[0];{let t=[];for(let e=0;e<n.length;e++)t=t.concat(n[e]);return t.sort((t,n)=>t[i]-n[i]),t}}}static splitPointSymbol(t,n=0){const e=[];if(Array.isArray(t)){const n=t;for(let t=0;t<n.length;t++)n[t]&&e.push(...bu.splitPointSymbol(n[t],t));return e}let r=null,i=null;for(const n in t)0===n.indexOf("marker")?(r=r||{},r[n]=t[n]):0===n.indexOf("text")&&(i=i||{},i[n]=t[n]);return r&&(r.isIconText=!0,t.mergeOnProperty&&(r.mergeOnProperty=t.mergeOnProperty),e.push(r)),i&&(r&&(i.textPlacement=r.markerPlacement,i.textSpacing=r.markerSpacing,i.isIconText=!0),t.mergeOnProperty&&(i.mergeOnProperty=t.mergeOnProperty),e.push(i)),void 0!==t.visible&&(r&&(r.visible=t.visible),i&&(i.visible=t.visible)),r&&(r.markerTextFit&&i&&(r.text={},r.text.textName=i.textName,r.text.textSize=i.textSize),r.index={index:n,type:0}),i&&(i.index={index:n,type:1}),e}static isAtlasLoaded(t,n){const{icon:e,glyph:r}=t,{iconAtlas:i,glyphAtlas:s}=n;if(e&&(!i||!i.positions[e.url]))return!1;if(r){if(!s||!s.positions[r.font])return!1;const t=s.positions[r.font],{text:n}=r;for(let e=0;e<n.length;e++)if(!t[n.charCodeAt(e)])return!1}return!0}constructor(t,n,e){super(t,n,e),this.bt=n.textPlacement,this.tt.textPlacementFn&&(this.bt=this.tt.textPlacementFn(this.options.zoom))}createStyledVector(t,n,e,r,i,s){const o=new eu(t,this.symbolDef,n,e,r),a=o.getIconAndGlyph();if(a.icon&&!this.options.atlas){const{url:t,size:n}=a.icon;i[t]||(i[t]=a.icon.size),i[t][0]<n[0]&&(i[t][0]=n[0]),i[t][1]<n[1]&&(i[t][1]=n[1])}if(a.glyph&&!this.options.atlas){const{font:t,text:n}=a.glyph,e=s[t]=s[t]||{};for(let t=0;t<n.length;t++)e[n.charCodeAt(t)]=1;"line"===this.bt&&(s.options={isCharsCompact:!1})}return this.options.allowEmptyPack||a.icon||a.glyph?o:null}getFormat(t){const n=void 0!==t.textName,e=n?this.getPackSDFFormat(t):this.getPackMarkerFormat();n?e.push(...this.wt()):e.push(...this.Mt());const{markerOpacityFn:r,textOpacityFn:i,markerPitchAlignmentFn:s,textPitchAlignmentFn:o,markerRotationAlignmentFn:a,textRotationAlignmentFn:u,markerRotationFn:l,textRotationFn:h,markerAllowOverlapFn:c,textAllowOverlapFn:f,markerIgnorePlacementFn:d,textIgnorePlacementFn:p}=this.tt;return(r||i)&&e.push({type:Uint8Array,width:1,name:"aColorOpacity"}),(s||o)&&e.push({type:Uint8Array,width:1,name:"aPitchAlign"}),(a||u)&&e.push({type:Uint8Array,width:1,name:"aRotationAlign"}),(l||h)&&e.push({type:Uint16Array,width:1,name:"aRotation"}),(c||f||d||p)&&e.push({type:Uint8Array,width:1,name:"aOverlap"}),e}xt(){return this.hasMapPitchAlign}wt(){const{textFillFn:t,textSizeFn:n,textHaloFillFn:e,textHaloRadiusFn:r,textHaloOpacityFn:i,textDxFn:s,textDyFn:o}=this.tt,a=[];return t&&a.push({type:Uint8Array,width:4,name:"aTextFill"}),n&&a.push({type:Uint8Array,width:1,name:"aTextSize"}),e&&a.push({type:Uint8Array,width:4,name:"aTextHaloFill"}),r&&a.push({type:Uint8Array,width:1,name:"aTextHaloRadius"}),i&&a.push({type:Uint8Array,width:1,name:"aTextHaloOpacity"}),s&&a.push({type:Int8Array,width:1,name:"aTextDx"}),o&&a.push({type:Int8Array,width:1,name:"aTextDy"}),a}Mt(){const{markerWidthFn:t,markerHeightFn:n,markerDxFn:e,markerDyFn:r}=this.tt,i=[];return t&&i.push({type:this.options.markerWidthType||Uint8Array,width:1,name:"aMarkerWidth"}),n&&i.push({type:this.options.markerHeightType||Uint8Array,width:1,name:"aMarkerHeight"}),e&&i.push({type:Int8Array,width:1,name:"aMarkerDx"}),r&&i.push({type:Int8Array,width:1,name:"aMarkerDy"}),i}createDataPack(){if(!this.iconAtlas&&!this.glyphAtlas){if(!this.options.allowEmptyPack)return null;this.empty=!0}this.countOutOfAngle=0,this.lineVertex=[];const t=super.createDataPack.apply(this,arguments);return t?(t.lineVertex=new Int16Array(this.lineVertex),t.buffers.push(t.lineVertex.buffer),t):null}placeVector(t,n){const e=t.getShape(this.iconAtlas,this.glyphAtlas);if(!(this.options.allowEmptyPack||e&&e.image||e&&(e.horizontal||e.vertical)))return;const r=this.Ft(t,e,n);if(this.countOutOfAngle+=r.countOutOfAngle||0,0===r.length)return;const i=this.data,s=this.needAltitudeAttribute()?2:3;let o=this.data.aPosition.length/s;const a=t.symbol,u=t.feature.properties,l="line"===this.bt&&!a.isIconText,h=void 0!==a.textName,c=h&&l&&function(t){let n=0;for(let e=0;e<t.length;e++)if(La(t.charAt(e).charCodeAt(0)))n=0;else if(n++,n>=1)return!1;return!0}(t.getIconAndGlyph().glyph.text)?1:0,{textFillFn:f,textSizeFn:p,textHaloFillFn:y,textHaloRadiusFn:m,textHaloOpacityFn:g,textDxFn:v,textDyFn:b,textPitchAlignmentFn:w,textRotationAlignmentFn:M,textRotationFn:x,textAllowOverlapFn:F,textIgnorePlacementFn:A,textOpacityFn:k,markerWidthFn:P,markerHeightFn:S,markerDxFn:_,markerDyFn:O,markerPitchAlignmentFn:E,markerRotationAlignmentFn:I,markerRotationFn:$,markerAllowOverlapFn:C,markerIgnorePlacementFn:T,markerOpacityFn:z}=this.tt;let D,j,U,N,L,V,R,H,W,q,G,B,J,X,Y,Z,K;if(h){const n=t.getIconAndGlyph().glyph.font;D=function(t,n,e){const r=t.positionedGlyphs,i=[];for(let s=0;s<r.length;s++){const o=r[s],a=e[o.glyph];if(!a)continue;const u=a.rect;if(!u)continue;const l=4,h=a.metrics.advance/2,c=a.metrics.height/2,f=n?[o.x+h,0]:[0,0],d=n?[0,o.y-c]:[o.x+h,o.y-c],p=a.metrics.left-l-h+d[0],y=a.metrics.top-l+d[1],m=p+u.w,g=y+u.h,v=new Ut(p,y),b=new Ut(m,y),w=new Ut(p,g),M=new Ut(m,g);if(n&&o.vertical){const t=new Ut(-h,h),n=-Math.PI/2,e=new Ut(5,0);v._(n,t).m(e),b._(n,t).m(e),w._(n,t).m(e),M._(n,t).m(e)}i.push({tl:v,tr:b,bl:w,br:M,tex:u,writingMode:t.writingMode,glyphOffset:f})}return i}(e.horizontal,l,this.glyphAtlas.positions[n]),f&&(j=f(null,u),d(j)?(this.dynamicAttrs.aTextFill=1,j=[0,0,0,0]):j=Mr([],j)),p&&(U=p(this.options.zoom,u),Er(U)&&(U=14)),y&&(N=y(null,u),d(N)?(this.dynamicAttrs.aTextHaloFill=1,N=[0,0,0,0]):N=Mr([],N)),m&&(L=m(null,u)),g&&(V=255*g(null,u)),v&&(R=v(null,u)||0),b&&(H=b(null,u)||0),w&&(J=+("map"===w(null,u))),M&&(X=+("map"===M(null,u))),x&&(Y=Ir(x(null,u),0,360)*Math.PI/180)}else D=e?function(t){const n=t.image,e=t.top-1/n.pixelRatio,r=t.left-1/n.pixelRatio,i=t.bottom+1/n.pixelRatio,s=t.right+1/n.pixelRatio;let o,a,u,l;return o=new Ut(r,e),a=new Ut(s,e),u=new Ut(s,i),l=new Ut(r,i),[{tl:o,tr:a,bl:l,br:u,tex:{x:n.tl[0],y:n.tl[1],w:n.displaySize[0],h:n.displaySize[1]},writingMode:void 0,glyphOffset:[0,0]}]}(e):function(){const t=new Ut(0,0),n=new Ut(0,0),e=new Ut(0,0);return[{tl:t,tr:n,bl:new Ut(0,0),br:e,tex:{x:0,y:0,w:0,h:0},writingMode:void 0,glyphOffset:[0,0]}]}(),P&&(W=P(null,u)),Er(W)&&(W=D[0].tex.w),S&&(q=S(null,u)),Er(q)&&(q=D[0].tex.h),_&&(G=_(null,u)),O&&(B=O(null,u)),E&&(J=+("map"===E(null,u))),I&&(X=+("map"===I(null,u))),$&&(Y=Ir($(null,u),0,360)*Math.PI/180);d(U)&&(this.dynamicAttrs.aTextSize=1),d(L)&&(this.dynamicAttrs.aTextHaloRadius=1),d(V)&&(this.dynamicAttrs.aTextHaloOpacity=1),d(R)&&(this.dynamicAttrs.aTextDx=1),d(H)&&(this.dynamicAttrs.aTextDy=1),d(W)&&(this.dynamicAttrs.aMarkerWidth=1),d(q)&&(this.dynamicAttrs.aMarkerHeight=1),d(G)&&(this.dynamicAttrs.aMarkerDx=1),d(B)&&(this.dynamicAttrs.aMarkerDy=1),d(J)&&(this.dynamicAttrs.aPitchAlign=1),d(X)&&(this.dynamicAttrs.aRotationAlign=1),d(Y)&&(this.dynamicAttrs.aRotation=1);const Q=C||F;Q&&(Z=Q(null,u)||0);const tt=T||A;let nt;tt&&(K=tt(null,u)||0);const et=k||z;et&&(nt=255*et(this.options.zoom,u));const rt=this.options.EXTENT,it=D.length,{altitudeScale:st,altitudeProperty:ot,defaultAltitude:at}=this.options,{altitude:ut}=_r(t.feature,st,ot,at);for(let t=0;t<r.length;t++){const n=r[t],e=n.z||ut||0;if(rt!==1/0&&Or(n,rt))continue;const s=n.x,a=n.y,u=D.length;for(let t=0;t<u;t++){const r=D[t],{tl:u,tr:f,bl:d,br:p,tex:y}=r;this.At(i,s,a,e,10*u.x,10*u.y,y.x,y.y+y.h),h&&this.kt(i,l,it,r.glyphOffset,n,c,n.axis,n.angleR),this.Pt(i,j,U,N,L,V,R,H,W,q,G,B,nt,J,X,Y,Z,K),this.At(i,s,a,e,10*f.x,10*f.y,y.x+y.w,y.y+y.h),h&&this.kt(i,l,it,r.glyphOffset,n,c,n.axis,n.angleR),this.Pt(i,j,U,N,L,V,R,H,W,q,G,B,nt,J,X,Y,Z,K),this.At(i,s,a,e,10*d.x,10*d.y,y.x,y.y),h&&this.kt(i,l,it,r.glyphOffset,n,c,n.axis,n.angleR),this.Pt(i,j,U,N,L,V,R,H,W,q,G,B,nt,J,X,Y,Z,K),this.At(i,s,a,e,10*p.x,10*p.y,y.x+y.w,y.y),h&&this.kt(i,l,it,r.glyphOffset,n,c,n.axis,n.angleR),this.Pt(i,j,U,N,L,V,R,H,W,q,G,B,nt,J,X,Y,Z,K),this.addElements(o,o+1,o+2),this.addElements(o+1,o+2,o+3),o+=4;const m=Math.max(Math.abs(s),Math.abs(a),Math.abs(e));m>this.maxPos&&(this.maxPos=m)}}}At(t,n,e,r,i,s,o,a){this.fillPosition(t,n,e,r),t.aShape.push(i,s),t.aTexCoord.push(o,a)}kt(t,n,e,r,i,s,o,a){if(t.aCount.push(e),n){t.aGlyphOffset.push(r[0],r[1]),this.xt()&&t.aPitchRotation.push(o[0],o[1],a);const n=i.startIndex;t.aSegment.push(i.segment+n,n,i.line.length),t.aVertical.push(s)}}Pt(t,n,e,r,i,s,o,a,u,l,h,c,f,d,p,y,m,g){const{textFillFn:v,textSizeFn:b,textHaloFillFn:w,textHaloRadiusFn:M,textHaloOpacityFn:x,textDxFn:F,textDyFn:A,textPitchAlignmentFn:k,textRotationAlignmentFn:P,textRotationFn:S,textAllowOverlapFn:_,textIgnorePlacementFn:O,textOpacityFn:E,markerWidthFn:I,markerHeightFn:$,markerDxFn:C,markerDyFn:T,markerPitchAlignmentFn:z,markerRotationAlignmentFn:D,markerRotationFn:j,markerAllowOverlapFn:U,markerIgnorePlacementFn:N,markerOpacityFn:L}=this.tt;v&&t.aTextFill.push(...n),b&&t.aTextSize.push(e),w&&t.aTextHaloFill.push(...r),M&&t.aTextHaloRadius.push(i),x&&t.aTextHaloOpacity.push(s),F&&t.aTextDx.push(o),A&&t.aTextDy.push(a),I&&t.aMarkerWidth.push(u),$&&t.aMarkerHeight.push(l),C&&t.aMarkerDx.push(h),T&&t.aMarkerDy.push(c),(L||E)&&t.aColorOpacity.push(f),(k||z)&&t.aPitchAlign.push(d),(D||P)&&t.aRotationAlign.push(p),(j||S)&&t.aRotation.push(9362*y);const V=U||_,R=N||O;(V||R)&&t.aOverlap.push((V?8:0)+4*m+((R?2:0)+g)),i>0&&(this.properties.hasHalo=1)}Ft(t,n,e){const{feature:r,symbol:i}=t,s=this.St(t,i),o=r.properties,{markerSpacingFn:a,textSpacingFn:u,textMaxAngleFn:l}=this.tt,h=((a?a(null,o):i.markerSpacing)||(u?u(null,o):i.textSpacing)||250)*e;let c=l?l(this.options.zoom,o):i.textMaxAngle;Er(c)&&(c=80),c*=Math.PI/180;const f=this.options.EXTENT,d=this.options.altitudeToTileScale,p=this.xt();return yu(t,this.lineVertex,c,n,e,f,s,h,p,d)}St(t,n){let e;return e=this.tt.markerPlacementFn?this.tt.markerPlacementFn(this.options.zoom,t.feature.properties):n.markerPlacement||this.bt,this.ht||!n.markerPlacement&&!n.isIconText||(this.ht=e),!this.bt||n.isIconText||this.ct||(this.ct=e),e}getPackSDFFormat(t){if("line"!==this.bt||t.isIconText)return[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"}];{const t=[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"},{type:Int16Array,width:2,name:"aGlyphOffset"},{type:Uint16Array,width:3,name:"aSegment"},{type:Uint8Array,width:1,name:"aVertical"}];return this.xt()&&t.push({type:Float32Array,width:3,name:"aPitchRotation"}),t}}getPackMarkerFormat(){return[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"}]}}class wu{constructor(t){this.x=t.x,this.y=t.y,this.z=t.z||0}clone(){return new wu(this)}I(){return this.P(this.mag()),this}P(t){return this.x/=t,this.y/=t,this.z/=t,this}C(){var t=this.y;return this.y=this.x,this.x=-t,this}mag(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}add(t){return this.clone().m(t)}sub(t){return this.clone().M(t)}m(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}M(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}equals(t){return this.x===t.x&&this.y===t.y&&this.z===t.z}mult(t){return this.clone().k(t)}k(t){return this.x*=t,this.y*=t,this.z*=t,this}dist(t){return Math.sqrt(this.distSqr(t))}distSqr(t){var n=t.x-this.x,e=t.y-this.y,r=t.z-this.z;return n*n+e*e+r*r}T(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)}}const Mu=Math.cos(Math.PI/180*37.5),xu=Math.pow(2,16)/1,Fu=new Ut,Au=new Ut,ku=new Ut;class Pu extends aa{constructor(t,n,e){super(t,n,e);let r=!1;const{lineDasharrayFn:i,lineDashColorFn:s}=this.tt;this.hasGradient=this.symbol.lineGradientProperty,i&&(r=function(t,n,e){for(let r=0;r<t.length;r++)if(e(n,t[r].properties))return!0;return!1}(t,this.options.zoom,i),r&&(this.dasharrayFn=i)),this.hasDasharray=Ou(this.symbol.lineDasharray)||r,this.hasDasharray&&s&&(this.dashColorFn=s)}createStyledVector(t,n,e,r,i){const s=new Cr(t,n,e,r),o=s.getLineResource();return!this.options.atlas&&o&&(i[o]=[0,0]),s}getFormat(){const{lineWidthFn:t,lineStrokeWidthFn:n,lineStrokeColorFn:e,lineColorFn:r,lineOpacityFn:i,lineDxFn:s,lineDyFn:o,linePatternAnimSpeedFn:a,linePatternGapFn:u}=this.tt,l=[...this.getPositionFormat()];if(l.push(this.iconAtlas||this.hasDasharray?{type:Int8Array,width:3,name:"aExtrude"}:{type:Int8Array,width:2,name:"aExtrude"}),l.push({type:this.options.positionType||Uint16Array,width:1,name:"aLinesofar"}),t&&l.push({type:Uint8Array,width:1,name:"aLineWidth"}),n&&l.push({type:Uint8Array,width:1,name:"aLineStrokeWidth"}),r&&l.push({type:Uint8Array,width:4,name:"aColor"}),e&&l.push({type:Uint8Array,width:4,name:"aStrokeColor"}),i&&l.push({type:Uint8Array,width:1,name:"aOpacity"}),this.dasharrayFn&&l.push({type:Uint8Array,width:4,name:"aDasharray"}),this.dashColorFn&&l.push({type:Uint8Array,width:4,name:"aDashColor"}),this.iconAtlas){const t=this.getIconAtlasMaxValue();l.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return(s||o)&&l.push({type:Int8Array,width:2,name:"aLineDxDy"}),(a||u)&&l.push({type:Int8Array,width:2,name:"aLinePattern"}),l}placeVector(t){const{lineJoinFn:n,lineCapFn:e,lineWidthFn:r,lineHeightFn:i,lineStrokeWidthFn:s,lineStrokeColorFn:o,lineColorFn:a,lineOpacityFn:u,lineDxFn:l,lineDyFn:h,linePatternAnimSpeedFn:c,linePatternGapFn:f}=this.tt,p=this.symbol,y=t.feature,m=y.properties;let g=p.lineJoin||"miter",v=p.lineCap||"butt";if(n&&(g=n(this.options.zoom,m)||"miter"),e&&(v=e(this.options.zoom,m)||"butt"),r){let t=r(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineWidth=1,t=4),lr(t)&&(t=4),this.feaLineWidth=+t}else this.feaLineWidth=+p.lineWidth;if(i){let t=i(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineHeight=1),lr(t)&&(t=this.feaLineWidth),this.feaLineHeight=+t}else this.feaLineHeight=+p.lineHeight||this.feaLineWidth;if(s){let t=s(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineStrokeWidth=1,t=0),lr(t)&&(t=0),this.feaLineStrokeWidth=t}else this.feaLineStrokeWidth=p.lineStrokeWidth||0;if(a&&(this.feaColor=a(this.options.zoom,m)||[255,255,255,255],d(this.feaColor)?(this.dynamicAttrs.aColor=1,this.feaColor=[0,0,0,0]):this.feaColor=Mr([],this.feaColor)),o&&(this.feaStrokeColor=o(this.options.zoom,m)||[0,0,0,255],d(this.feaStrokeColor)?(this.dynamicAttrs.aStrokeColor=1,this.feaStrokeColor=[0,0,0,0]):this.feaStrokeColor=Mr([],this.feaStrokeColor)),u){let t=u(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aOpacity=1,t=1),lr(t)&&(t=1),this.feaOpacity=255*t}if(this.dasharrayFn){let t=this.dasharrayFn(this.options.zoom,m)||[0,0,0,0];if(d(t)&&(this.dynamicAttrs.aDasharray=1,t=[0,0,0,0]),t.length<4){const n=t;1===t.length?t=[n[0],n[0],n[0],n[0]]:2===t.length?t=[n[0],n[1],n[0],n[1]]:3===t.length&&(t=[n[0],n[1],n[2],n[2]])}this.feaDash=t}if(this.dashColorFn){let t=(this.dashColorFn?this.dashColorFn(this.options.zoom,m):this.symbol.lineDashColor)||[0,0,0,0];d(t)&&(this.dynamicAttrs.aDashColor=1,t=[0,0,0,0]),t=Mr([],t),this.feaDashColor=t}if(this.iconAtlas){const n=t.getLineResource(),e=this.iconAtlas.glyphMap[n];if(this.feaTexInfo=this.feaTexInfo||[0,0,0,0],e){const{tl:t,displaySize:e}=this.iconAtlas.positions[n];this.feaTexInfo[0]=t[0]+1,this.feaTexInfo[1]=t[1]+1,this.feaTexInfo[2]=e[0]-3,this.feaTexInfo[3]=e[1]-3}else this.feaTexInfo[0]=this.feaTexInfo[1]=this.feaTexInfo[2]=this.feaTexInfo[3]=0}if(l){let t=l(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineDxDy=1,t=0),lr(t)&&(t=0),this.feaLineDx=t}if(h){let t=h(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLineDxDy=1,t=0),lr(t)&&(t=0),this.feaLineDy=t}if(c){let t=c(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLinePatternAnimSpeed=1,t=0),lr(t)&&(t=0),0!==t&&(this.properties.hasPatternAnim=1),this.feaPatternAnimSpeed=t}if(f){let t=f(this.options.zoom,m);d(t)&&(this.dynamicAttrs.aLinePatternGap=1,t=0),lr(t)&&(t=0),this.feaLinePatternGap=t}const b=this.options.EXTENT;let w=y.geometry;if(b!==1/0){w=[];const t=[];for(let n=0;n<y.geometry.length;n++){t[0]=y.geometry[n];const e=iu(t,-1,-1,b+1,b+1);if(3===y.type&&e.length>1){const t=e[0],n=e[e.length-1];Cu(t[0],n[n.length-1])&&(e[0]=n.concat(t.slice(1)),e.length=e.length-1)}w.push(...e)}}const M=this.needAltitudeAttribute()?2:3;for(let t=0;t<w.length;t++)this.offset=this.data.aPosition.length/M,this._t(w[t],y,g,v,2,1.05)}Ot(){return this.iconAtlas&&this.feaTexInfo[2]&&this.feaTexInfo[3]}_t(t,n,e,r,i,s){const o=this.Ot()||Ou(this.feaDash)||Ou(this.symbol.lineDasharray),a=this.options.isTube;a&&(t=t.map(t=>new wu(t))),this.overscaling=1;const u=this.options.EXTENT;if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.prevVertex=null,this.symbol.lineGradientProperty&&n.properties&&hr(n.properties.mapbox_clip_start)&&hr(n.properties.mapbox_clip_end)){this.clipStart=+n.properties.mapbox_clip_start,this.clipEnd=+n.properties.mapbox_clip_end;for(let n=0;n<t.length-1;n++)this.totalDistance+=t[n].dist(t[n+1]);this.updateScaledDistance()}const l=3===n.type&&!t.clipped;let h=t.length;for(;h>=2&&Cu(t[h-1],t[h-2]);)h--;let c=0;for(;c<h-1&&Cu(t[c],t[c+1]);)c++;if(h<(l?3:2))return;"bevel"===e&&(i=1.05);const f=this.overscaling<=16?15*u/(512*this.overscaling):0,d={vertexLength:0,primitiveLength:0,currentNormal:null};let p,y,m,g,v;this.e1=this.e2=-1,l&&(p=t[h-2],v=t[c].sub(p).I().C());for(let n=c;n<h;n++){if(m=n===h-1?l?t[c+1]:void 0:t[n+1],m&&Cu(t[n],m))continue;v&&(g=v),p&&(y=p),p=t[n],m&&p.x===m.x&&p.y===m.y&&(p.x+=1e-4),v=m?m.sub(p).I().C():g,d.dir=y?p.sub(y).I():m.sub(p).I(),g=g||v,d.currentNormal=g;let u=g.add(v);0===u.x&&0===u.y||u.I();const b=g.x*v.x+g.y*v.y,w=u.x*v.x+u.y*v.y,M=0!==w?1/w:1/0,x=2*Math.sqrt(2-2*w),F=w<Mu&&y&&m,A=g.x*v.y-g.y*v.x>0;if(!a&&F&&n>c){const t=p.dist(y);if(t>2*f){const n=p.sub(p.sub(y).k(f/t).T());n.z=p.z,this.updateDistance(y,n),this.addCurrentVertex(n,g,0,0,d),y=n}}const k=y&&m;d.middleVertex=k;let P=k?e:l?"butt":r;if(k&&"round"===P&&(M<s?P="miter":M<=2&&(P="fakeround")),"miter"===P&&M>i&&!a&&(P="bevel"),"bevel"===P&&(M>2&&(P="flipbevel"),M<i&&(P="miter")),y&&this.updateDistance(y,p),"miter"===P)a?(this.addCurrentVertex(p,g,0,0,d),d.dir=m.sub(p).I(),this.addCurrentVertex(p,v,0,0,d)):(u.k(M),this.addCurrentVertex(p,u,0,0,d),o&&(d.currentNormal=v,this.addCurrentVertex(p,u,0,0,d)));else if("flipbevel"===P){if(M>100)u=v.mult(-1);else{const t=M*g.add(v).mag()/g.sub(v).mag();u.C().k(t*(A?-1:1))}this.addCurrentVertex(p,u,0,0,d),this.addCurrentVertex(p,u.mult(-1),0,0,d)}else if("bevel"===P||"fakeround"===P){const t=-Math.sqrt(M*M-1),n=A?t:0,e=A?0:t;if(y&&this.addCurrentVertex(p,g,n,e,d),"fakeround"===P){const t=Math.round(180*x/Math.PI/20);for(let n=1;n<t;n++){let e=n/t;if(.5!==e){const t=e-.5;e+=e*t*(e-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*t*t+(.848013+b*(.215638*b-1.06021)))}const r=v.sub(g).k(e).m(g).I().k(A?-1:1);this.addHalfVertex(p,r.x,r.y,!1,A,0,d)}}m&&(d.currentNormal=v,this.addCurrentVertex(p,v,-n,-e,d))}else if("butt"===P)this.addCurrentVertex(p,u,0,0,d);else if("square"===P){const t=y?1:-1;this.addCurrentVertex(p,u,t,t,d)}else"round"===P&&(y&&(this.addCurrentVertex(p,g,0,0,d),this.addCurrentVertex(p,g,1,1,d,!0)),m&&(this.addCurrentVertex(p,v,-1,-1,d,!0),this.addCurrentVertex(p,v,0,0,d)));if(!a&&F&&n<h-1){const t=p.dist(m);if(t>2*f){const n=p.add(m.sub(p).k(f/t).T());n.z=p.z,this.updateDistance(p,n),this.addCurrentVertex(n,v,0,0,d),p=n}}}}addCurrentVertex(t,n,e,r,i,s=!1){const o=n.x+n.y*e,a=n.y-n.x*e,u=n.y*r-n.x,l=-n.y-n.x*r;let h=0,c=0;if(i.middleVertex){Fu.x=o,Fu.y=a,Au.x=u,Au.y=l;const t=i.currentNormal;if(h=$u(t,Fu),0===e&&0===r)c=-h;else{const n=ku;n.x=t.x,n.y=t.y,n.k(-1),c=$u(n,Au)}}this.addHalfVertex(t,o,a,s,!1,e,i,h),this.addHalfVertex(t,u,l,s,!0,-r,i,c),this.prevVertex&&Cu(t,this.prevVertex)||(this.prevVertex=t),this.distance>xu/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,n,e,r,i,s))}addHalfVertex({x:t,y:n,z:e},r,i,s,o,a,u,l){this.fillData(this.data,t,n,e||0,r,i,s,o,1*this.scaledDistance,l);const h=u.vertexLength++;this.e1>=0&&this.e2>=0&&(this.addElements(this.e1,this.e2,h),u.primitiveLength++),o?this.e2=h:this.e1=h}fillData(t,n,e,r,i,s,o,a,u,l){const{lineWidthFn:h,lineStrokeWidthFn:c,lineStrokeColorFn:f,lineColorFn:d,lineOpacityFn:p,lineDxFn:y,lineDyFn:m,linePatternAnimSpeedFn:g,linePatternGapFn:v}=this.tt;this.fillPosition(t,n,e,r);let b=63*i;b=(Math.sign(b)||1)*((Math.floor(Math.abs(b))>>1<<1)+ +o);let w=63*s;w=(Math.sign(w)||1)*((Math.floor(Math.abs(w))>>1<<1)+ +a),t.aExtrude.push(b,w),(this.iconAtlas||this.hasDasharray)&&t.aExtrude.push(63*l),t.aLinesofar.push(u),h&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),c&&t.aLineStrokeWidth.push(Math.round(2*this.feaLineStrokeWidth)),d&&t.aColor.push(...this.feaColor),f&&t.aStrokeColor.push(...this.feaStrokeColor),p&&t.aOpacity.push(this.feaOpacity),this.dasharrayFn&&t.aDasharray.push(...this.feaDash),this.dashColorFn&&t.aDashColor.push(...this.feaDashColor),this.iconAtlas&&t.aTexInfo.push(...this.feaTexInfo),(y||m)&&t.aLineDxDy.push(this.feaLineDx||0,this.feaLineDy||0),(g||v)&&t.aLinePattern.push(127*(this.feaPatternAnimSpeed||0),10*(this.feaLinePatternGap||0)),this.maxPos=Math.max(this.maxPos,Math.abs(n)+1,Math.abs(e)+1)}addElements(t,n,e){super.addElements(this.offset+t,this.offset+n,this.offset+e)}Et(t){const n=this.options.EXTENT,e=this.elements;for(let r=0;r<e.length;r+=3)n!==1/0&&(_u(this.data.aPosition,e[r],e[r+1],3,n)||_u(this.data.aPosition,e[r+1],e[r+2],3,n))||t.push(e[r],e[r+1],e[r+2])}It(t){if(t.length<=1)return t;const n=[],e=this.options.EXTENT;let r,i=!0;for(r=0;r<t.length-1;r++){const s=Su(t[r],t[r+1],e);s&&i||(n.push(t[r]),i=s)}return i||n.push(t[r]),n}updateDistance(t,n){if(this.options.isTube){const e=t.dist(n),r=vr(this.options)*(n.z-t.z);this.distance+=Math.sqrt(e*e+r*r)}else this.distance+=t.dist(n);this.updateScaledDistance()}updateScaledDistance(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(xu-1):this.distance}}function Su(t,n,e){return e!==1/0&&(t.x<0&&n.x<0||t.x>e&&n.x>e||t.y<0&&n.y<0||t.y>e&&n.y>e)}function _u(t,n,e,r,i){if(i===1/0)return!1;const s=Math.floor(.5*t[n*r]),o=Math.floor(.5*t[n*r+1]),a=Math.floor(.5*t[e*r]),u=Math.floor(.5*t[e*r+1]);return s===a&&(s<0||s>i)&&o!==u||o===u&&(o<0||o>i)&&s!==a}function Ou(t){if(!Array.isArray(t))return!1;for(let n=0;n<t.length;n++)if(t[n])return!0;return!1}const Eu=new Ut(0,0),Iu=new Ut(0,0);function $u(t,n){const e=t.mag(),r=n.mag();Eu.x=n.x,Eu.y=n.y;const i=t.angleTo(Iu),s=n.angleTo(Iu);return Math.sign(s-i)*Math.sqrt(r*r-e*e)}function Cu(t,n){return t.equals(n)&&t.z===n.z}class Tu extends Pu{constructor(t,n,e){super(t,n,e),this.$t=e.altitudeProperty}getFormat(){const{lineColorFn:t,lineWidthFn:n}=this.tt,e=[{type:this.maxPosZ>=Math.pow(2,15)?Float32Array:Int16Array,width:3,name:"aPosition"},{type:Uint16Array,width:1,name:"aLinesofar"},{type:Uint8Array,width:1,name:"aUp"},{type:Int16Array,width:3,name:"aExtrudedPosition"},{type:Int8Array,width:2,name:"aExtrude"}];return t&&e.push({type:Uint8Array,width:4,name:"aColor"}),n&&e.push({type:Uint8Array,width:1,name:"aLineWidth"}),this.$t&&e.push({type:Array,width:1,name:"aLineHeight"}),e}placeVector(t){const n=t.feature;if(this.$t){const{altitudeScale:t,altitudeProperty:e,defaultAltitude:r,heightProperty:i,defaultHeight:s,minHeightProperty:o}=this.options,{altitude:a,height:u}=_r(n,t,e,r,i,s,o);this.feaAltitude=a,this.feaMinHeight=(a-u)/a*32767,a>this.maxAltitude&&(this.maxAltitude=a)}return super.placeVector(t)}needAltitudeAttribute(){return!1}_t(t,n,e,r,i,s){const o=this.data.aPosition.length/3;super._t(t,n,e,r,i,s);const a=this.data.aPosition.length/3,u=this.data.aPosition.length/3-this.offset;if(3!==n.type&&u>0&&!1!==this.options.side){const t=!1!==this.options.top?1:0,n=t+4;let e=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/e;for(let t=0;t<r;t++)n.push(n[o*r+3*r+t])}e=this.data.aPosition.length/3;for(const t in this.data){const r=this.data[t],i=r.length/e;for(let t=0;t<i;t++)r.push(r[o*i+i*n+t])}e=this.data.aPosition.length/3;for(const t in this.data){const r=this.data[t],i=r.length/e;for(let t=0;t<i;t++)r.push(r[o*i+i*(n+3)+t])}super.addElements(t+1,u+1,u),super.addElements(u,u+1,u+2);const r=this.data.aPosition.length/3-this.offset;e=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/e;for(let t=0;t<r;t++)n.push(n[a*r-r+t])}e=this.data.aPosition.length/3;for(const t in this.data){const r=this.data[t],i=r.length/e;for(let t=0;t<i;t++)r.push(r[a*i-n*i-i+t])}e=this.data.aPosition.length/3;for(const t in this.data){const r=this.data[t],i=r.length/e;for(let t=0;t<i;t++)r.push(r[a*i-n*i-3*i+t])}super.addElements(r,u-3,r+1),super.addElements(u-3,r+2,r+1)}}fillData(t,n,e,r,i,s,o,a,u){const l=!1!==this.options.top,h=!1!==this.options.side,c=this.feaLineWidth||this.symbol.lineWidth/2*(this.options.EXTENT/this.options.tileSize),f=63*i,d=63*s,p=c*i+n,y=c*s+e;this.Ct(t,n,e,i,s,o,a,u,p,y,f,d),h&&(l&&this.Ct(t,n,e,i,s,o,a,u,p,y,f,d),this.Ct(t,n,e,i,s,o,a,u,p,y,f,d),this.Tt(t,n,e,i,s,o,a,u,p,y,f,d),this.Tt(t,n,e,i,s,o,a,u,p,y,f,d)),this.maxPos=Math.max(this.maxPos,Math.abs(n),Math.abs(e))}Ct(t,n,e,r,i,s,o,a,u,l,h,c){const{lineColorFn:f,lineWidthFn:d}=this.tt;t.aPosition.push(n,e,32767),t.aLinesofar.push(a),t.aUp.push(+o),t.aExtrudedPosition.push(u,l,1),t.aExtrude.push(h,c),f&&t.aColor.push(...this.feaColor),d&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.$t&&t.aLineHeight.push(this.feaAltitude)}Tt(t,n,e,r,i,s,o,a,u,l,h,c){const{lineColorFn:f,lineWidthFn:d}=this.tt;t.aPosition.push(n,e,this.feaMinHeight||0),t.aLinesofar.push(a),t.aUp.push(+o),t.aExtrudedPosition.push(u,l,1),t.aExtrude.push(h,c),f&&t.aColor.push(...this.feaColor),d&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.$t&&t.aLineHeight.push(this.feaAltitude)}addElements(t,n,e){const r=!1!==this.options.top,i=!1!==this.options.side,s=(r?1:0)+(i?4:0);if(t*=s,n*=s,this.data.aUp[this.offset+(e*=s)+4]){if(r&&super.addElements(n,t,e),i){const t=r?1:0;super.addElements(n+t,e+t,e+t+2),super.addElements(n+t+1,e+t+1+2,n+t+1+2)}}else if(r&&super.addElements(t,e,n),i){const n=r?1:0;super.addElements(t+n,t+n+2,e+n),super.addElements(t+n+1+2,e+n+1+2,e+n+1)}}createDataPack(t,n){this.maxAltitude=0;const e=super.createDataPack(t,n);if(!e)return e;const{data:r,indices:i}=e;this.getFormat().reduce((t,n)=>(t[n.name]={size:n.width},t),{}).aPickingId={size:1};const{aExtrudedPosition:s,aPosition:o,aLinesofar:a,aUp:u,aExtrude:l,aColor:h,aLineHeight:c,aLineWidth:f}=r,d={},p=ne(s,i);let y,m=!0;for(let t=0;t<p.length;t++)p[t]=-p[t],p[t]%1!=0&&(m=!1);if(!1!==this.options.top&&this.symbol.material&&function(t){for(const n in t)if(n.indexOf("Texture")>=0&&t[n])return!0;return!1}(this.symbol.material)&&(y=function(t,n,e){const r=[];for(let i=0;i<t.length;i+=3){const t=n[i/3];r.push(t/256,e[i/3]?1:0)}return r}(s,a,u)),d.aPosition=o,y&&(d.aTexCoord0=new Float32Array(y)),d.aNormal=m?new Int8Array(p):new Float32Array(p),d.aPickingId=r.aPickingId,d.aExtrude=l,h&&(d.aColor=h),f&&(d.aLineWidth=f),c){const t=ir(this.maxAltitude);d.aLineHeight=new t(c)}const g=[];for(const t in d)g.push(d[t].buffer);return e.data=d,e.buffers=g,e}}const zu=Math.pow(2,16)/1;class Du extends aa{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const n=t.feature,e=3===n.type,r=n.geometry,i=this.elements;e&&(this.elements=[]);const s=this.needAltitudeAttribute()?2:3;for(let t=0;t<r.length;t++)this.offset=this.data.aPosition.length/s,this._t(r[t],n),e&&(this.Et(i),this.elements=[]);e&&(this.elements=i)}_t(t,n){const e=3===n.type;let r=t.length;for(;r>=2&&t[r-1].equals(t[r-2]);)r--;let i,s,o,a=0;for(;a<r-1&&t[a].equals(t[a+1]);)a++;if(!(r<(e?3:2))){this.distance=0,this.vertexLength=0,this.primitiveLength=0,this.e1=this.e2=this.e3=-1,e&&(i=t[r-2]);for(let n=a;n<r;n++)o=e&&n===r-1?t[a+1]:t[n+1],o&&t[n].equals(o)||(i&&(s=i),i=t[n],s&&(this.distance+=i.dist(s)),this.addCurrentVertex(i,this.distance))}}addCurrentVertex(t,n){const e=this.vertexLength++;this.addLineVertex(this.data,t,n),e>=1&&this.addElements(e-1,e),n>zu&&(this.distance=0,this.addCurrentVertex(t,this.distance))}addLineVertex(t,n){this.fillPosition(t,n.x,n.y,n.z||0),this.maxPos=Math.max(this.maxPos,Math.abs(n.x),Math.abs(n.y))}addElements(t,n){super.addElements(this.offset+t,this.offset+n)}Et(t){const n=this.options.EXTENT,e=this.elements;for(let r=0;r<e.length;r+=2)Pr(this.data.aPosition,e[r],e[r+1],3,n)||t.push(e[r],e[r+1])}}const ju=45*Math.PI/100;class Uu extends aa{getFormat(){const{markerFillFn:t}=this.tt;let n;return n="line"===this.symbol.markerRotationAlignment?[...this.getPositionFormat(),{type:Float32Array,width:1,name:"aXYRotation"},{type:Float32Array,width:1,name:"aZRotation"}]:[...this.getPositionFormat()],t&&n.push({type:Uint8Array,width:4,name:"aColor"}),n}placeVector(t){const n=t.feature.properties,{markerFillFn:e}=this.tt;let r;e&&(r=e(this.options.zoom,n)||[255,255,255,255],d(r)?(this.dynamicAttrs.aColor=1,r=[0,0,0,0]):r=Mr([],r));const i="line"===this.symbol.markerRotationAlignment,s=this.Ft(t,this.symbol.markerSpacing||250,this.symbol.markerPlacement||"point",i);for(let t=0;t<s.length;t++){const n=s[t];this.fillPosition(this.data,n.x,n.y,n.z),i&&(this.data.aXYRotation.push(n.xyRotation||0),this.data.aZRotation.push(n.zRotation||0)),r&&this.data.aColor.push(...r);const e=Math.max(Math.abs(n.x),Math.abs(n.y));e>this.maxPos&&(this.maxPos=e)}}Ft(t,n,e,r){const i=t.feature,s=this.options.EXTENT;if("line"===e){const t=[];let e=i.geometry;s&&(e=iu(i.geometry,0,0,s,s));for(let r=0;r<e.length;r++){const i=au(e[r],n,ju,null,null,24,1,1,s||1/0);t.push.apply(t,i)}return t}return mu(i,e,s,r,this.options.altitudeToTileScale)}hasElements(){return!1}}\n/*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */const Nu=[],Lu=[];function Vu(t,n){var e,r,i,s,o,a,u;for(r=1;r<=8;r*=2){for(e=[],s=!(Hu(i=t[t.length-1],n)&r),o=0;o<t.length;o++){if((u=!(Hu(a=t[o],n)&r))!==s){const t=Ru(i,a,r,n);e.push(void 0!==a.x?new Ut(t[0],t[1]):t)}u&&e.push(a),i=a,s=u}if(!(t=e).length)break}return e}function Ru(t,n,e,r){return Nu[0]=void 0===t.x?t[0]:t.x,Nu[1]=void 0===t.y?t[1]:t.y,t=Nu,Lu[0]=void 0===n.x?n[0]:n.x,Lu[1]=void 0===n.y?n[1]:n.y,n=Lu,8&e?[t[0]+(n[0]-t[0])*(r[3]-t[1])/(n[1]-t[1]),r[3]]:4&e?[t[0]+(n[0]-t[0])*(r[1]-t[1])/(n[1]-t[1]),r[1]]:2&e?[r[2],t[1]+(n[1]-t[1])*(r[2]-t[0])/(n[0]-t[0])]:1&e?[r[0],t[1]+(n[1]-t[1])*(r[0]-t[0])/(n[0]-t[0])]:null}function Hu(t,n){Nu[0]=void 0===t.x?t[0]:t.x,Nu[1]=void 0===t.y?t[1]:t.y;var e=0;return(t=Nu)[0]<n[0]?e|=1:t[0]>n[2]&&(e|=2),t[1]<n[1]?e|=4:t[1]>n[3]&&(e|=8),e}const Wu=[0,0,0,0];class qu extends aa{constructor(...t){super(...t),this.lineElements=[]}createStyledVector(t,n,e,r,i){const s=new Cr(t,n,e,r),o=s.getPolygonResource();return!this.options.atlas&&o&&(i[o]=[0,0]),s}getFormat(){const t=[...this.getPositionFormat()],{polygonFillFn:n,polygonOpacityFn:e,uvScaleFn:r,uvOffsetFn:i,polygonPatternUVFn:s}=this.tt;if(this.iconAtlas){const n=this.getIconAtlasMaxValue();t.push({type:n>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return n&&t.push({type:Uint8Array,width:4,name:"aColor"}),e&&t.push({type:Uint8Array,width:1,name:"aOpacity"}),r&&t.push({type:Uint16Array,width:2,name:"aUVScale"}),i&&t.push({type:Uint8Array,width:2,name:"aUVOffset"}),s&&t.push({type:Float32Array,width:2,name:"aTexCoord"}),t}placeVector(t,n){const e=t.feature;this.zt(e.geometry,e,n)}zt(t,n){let e,r,i,s;const{polygonFillFn:o,polygonOpacityFn:a,uvScaleFn:u,uvOffsetFn:l,uvOffsetInMeterFn:h,polygonPatternUVFn:c}=this.tt,f=n.properties;o&&(e=o(this.options.zoom,f)||bt([],255,255,255,255),d(e)?(this.dynamicAttrs.aColor=1,e=Wu):e=Mr([],e)),a&&(r=a(this.options.zoom,f),d(r)?(this.dynamicAttrs.aOpacity=1,r=255):(lr(r)&&(r=1),r*=255)),u&&(i=u(this.options.zoom,f),d(i)?(i=[255,255],this.dynamicAttrs.aUVScale=1):(lr(i)&&(i=[1,1]),i=[255*i[0],255*i[1]])),l&&(h&&h(null,f)?s=[0,0]:(s=l(this.options.zoom,f),d(s)?(s=[0,0],this.dynamicAttrs.aUVOffset=1):(lr(s)&&(s=[0,0]),s=[255*s[0],255*s[1]])));const p=!!this.iconAtlas,y=lu(t,500),m=[0,0],g=[0,0];if(p){const{polygonPatternFileFn:t}=this.tt,n=t?t(null,f):this.symbol.polygonPatternFile;if(this.iconAtlas.glyphMap[n]){const t=this.iconAtlas.positions[n];m[0]=t.tl[0]+1,m[1]=t.tl[1]+1,g[0]=t.displaySize[0]-3,g[1]=t.displaySize[1]-3}}let v,b=0;c&&(v=c(this.options.zoom,f));const w=this.needAltitudeAttribute()?2:3,M=[-1,-1,n.extent+1,n.extent+1],x=this.Dt=this.Dt||this.ut.get(),F=this.jt=this.jt||this.ut.get();for(let t=0;t<y.length;t++){const n=y[t],o=this.data.aPosition.length/w;x.setLength(0),F.setLength(0);for(let t=0;t<n.length;t++){let o=n[t];if(this.options.EXTENT!==1/0&&0===this.maxPosZ&&(o=Vu(o,M)),0!==o.length){0!==t&&F.push(x.length/3);for(let t=0;t<o.length;t++){const n=o[t].x,a=o[t].y,u=o[t].z||0;if(this.fillPosition(this.data,n,a,u),p&&this.data.aTexInfo.push(m[0],m[1],g[0],g[1]),void 0!==e&&this.data.aColor.push(e[0],e[1],e[2],e[3]),void 0!==r&&this.data.aOpacity.push(r),void 0!==i&&this.data.aUVScale.push(i[0],i[1]),void 0!==s&&this.data.aUVOffset.push(s[0],s[1]),c){if(v){const t=lr(v[2*b])?v[0]:v[2*b],n=lr(v[2*b]+1)?v[1]:v[2*b+1];this.data.aTexCoord.push(t,n)}else this.data.aTexCoord.push(-9999999,-9999999);b++}const l=Math.abs(n),h=Math.abs(a);l>this.maxPos&&(this.maxPos=l),h>this.maxPos&&(this.maxPos=h),x.push(n,a,u)}}}let a=Ne(x,F,3);if(x.length&&!a.length){const t=[];for(let n=0;n<x.length;n+=3)t[n]=x[n],t[n+1]=x[n+2],t[n+2]=x[n+1];if(a=Ne(t,F,3),!a.length){for(let n=0;n<x.length;n+=3)t[n]=x[n+1],t[n+1]=x[n+2],t[n+2]=x[n];a=Ne(t,F,3)}}for(let t=0;t<a.length;t+=3)this.addElements(o+a[t],o+a[t+1],o+a[t+2])}}}const Gu=[{type:Int16Array,width:3,name:"aPosition"}];class Bu extends aa{getFormat(){return Gu}placeVector(t,n){const e=this.Ft(t,n);if(0===e.length)return;const r=this.data,i=this.getAltitude(t.feature.properties);let s=r.aPosition.length/Gu[0].width;for(let t=0;t<e.length;t++){const n=e[t];r.aPosition.push(2*n.x+0,2*n.y+0,i),r.aPosition.push(2*n.x+1,2*n.y+0,i),r.aPosition.push(2*n.x+1,2*n.y+1,i),r.aPosition.push(2*n.x+0,2*n.y+1,i),this.addElements(s,s+1,s+2),this.addElements(s,s+2,s+3),s+=4;const o=Math.max(Math.abs(2*n.x+1),Math.abs(2*n.y+1));o>this.maxPos&&(this.maxPos=o)}}Ft(t,n){const{feature:e,symbol:r}=t,i=this.St(t,r),s=e.properties,{markerSpacingFn:o}=this.tt,a=((o?o(null,s):r.markerSpacing)||250)*n;return yu(t,null,null,n,this.options.EXTENT,i,a)}St(t,n){return this.tt.markerPlacementFn?this.tt.markerPlacementFn(this.options.zoom,t.feature.properties):n.markerPlacement}}class Ju extends Pu{constructor(t,n,e){(n=ur({},n)).lineJoin="miter",n.lineCap="butt",super(t,n,e),this.options.radialSegments%2==1&&this.options.radialSegments--}getFormat(){const{lineWidthFn:t,lineColorFn:n,lineOpacityFn:e,linePatternAnimSpeedFn:r,linePatternGapFn:i}=this.tt,s=[...this.getPositionFormat(),{type:Int8Array,size:4,name:"aTubeNormal"},{type:this.options.positionType||Uint16Array,width:1,name:"aLinesofar"}];if(this.iconAtlas){s.push({type:Int8Array,width:1,name:"aNormalDistance"});const t=this.getIconAtlasMaxValue();s.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return t&&s.push({type:Uint16Array,width:1,name:"aLineWidth"}),n&&s.push({type:Uint8Array,width:4,name:"aColor"}),e&&s.push({type:Uint8Array,width:1,name:"aOpacity"}),r&&s.push({type:Int8Array,width:1,name:"aLinePatternAnimSpeed"}),i&&s.push({type:Int8Array,width:1,name:"aLinePatternGap"}),s}addHalfVertex(t,n,e,r,i,s,o,a){const{x:u,y:l,z:h}=t,c=1*this.scaledDistance,f=this.options.radialSegments/2,{x:d,y:p,z:y}=o.dir,m=function(t,n,e,r,i,s,o,a){ft(Xu,e,r,i),ft(Yu,s,o,0),mt(Zu,Xu,Yu),pt(Yu,Yu),pt(Zu,Zu),Ku[n]||(Ku[n]=[]);const u=Ku[n];for(var l=0;l<n;l++){const t=Math.PI*l/n,e=1-Math.abs(t-0)/(Math.PI/2);u[l]=u[l]||[],Qu(Yu,Zu,u[l],1,t,e*(a?-1:1))}return u}(0,f,d,p,y,n,e,i);this.prevVertex&&this.fillTubeElements(i),this.fillData(this.data,u,l,h||0,m,i,c,a)}fillTubeElements(t){const n=this.options.radialSegments/2,e=this.needAltitudeAttribute()?2:3,r=this.data.aPosition.length/e;for(let e=0;e<n;e++){const i=e+r-2*n;let s,o;e===n-1&&t?(s=e+r-2*n+1,o=e+r-2*n-2*n+1):(s=e+r+1,o=e+r+1-2*n),super.addElements(e+r-this.offset,s-this.offset,i-this.offset),super.addElements(i-this.offset,s-this.offset,o-this.offset)}}fillData(t,n,e,r,i,s,o,a){const{lineWidthFn:u,lineColorFn:l,lineOpacityFn:h,linePatternAnimSpeedFn:c,linePatternGapFn:f}=this.tt,d=i.length;for(let s=0;s<d;s++){if(this.fillPosition(t,n,e,r),Mt(i[s],i[s],63),t.aTubeNormal.push(...i[s]),t.aLinesofar.push(o),this.iconAtlas&&(t.aNormalDistance.push(63*a),t.aTexInfo.push(...this.feaTexInfo)),u){const n=br(this.options.metric);let e=this.feaLineWidth*n;isNaN(e)&&(e=0),t.aLineWidth.push(Math.round(e))}l&&t.aColor.push(...this.feaColor),h&&t.aOpacity.push(this.feaOpacity),c&&t.aLinePatternAnimSpeed.push(127*(this.feaPatternAnimSpeed||0)),f&&t.aLinePatternGap.push(10*(this.feaLinePatternGap||0))}this.maxPos=Math.max(this.maxPos,Math.abs(n)+1,Math.abs(e)+1)}createDataPack(t,n){const e=super.createDataPack(t,n);return e&&(e.is2D=!1),e}}const Xu=[],Yu=[],Zu=[],Ku={};function Qu(t,n,e,r,i,s){return bt(e,r*(Math.cos(i)*t[0]+Math.sin(i)*n[0]),r*(Math.cos(i)*t[1]+Math.sin(i)*n[1]),r*(Math.cos(i)*t[2]+Math.sin(i)*n[2]),s),e}class tl extends Ju{addHalfVertex(t,n,e,r,i,s,o,a){const{x:u,y:l,z:h}=t,c=1*this.scaledDistance,{x:f,y:d,z:p}=o.dir,y=function(t,n,e,r,i,s,o,a){ft(el,e,r,i),ft(rl,s,o,0),mt(il,el,rl),pt(rl,rl),pt(il,il),_t(nl,t,n);const u=Et(nl)/t,l=Math.atan(n/t);let h=Math.PI/2+(Math.PI/2-l);return sl[0]||(sl[0]=[]),Qu(rl,il,sl[0],u,h,a?1:-1),h+=2*l,sl[1]||(sl[1]=[]),Qu(rl,il,sl[1],u,h,a?1:-1),sl}(this.feaLineWidth,this.feaLineHeight,f,d,p,n,e,i);this.prevVertex&&this.fillTubeElements(i),this.fillData(this.data,u,l,h||0,y,i,c,a)}}const nl=[],el=[],rl=[],il=[],sl=[];class ol{constructor(t){this.max=t,this.reset()}reset(){return this.data={},this.order=[],this}clear(){this.reset()}add(t,n){return this.has(t)?(this.order.splice(this.order.indexOf(t),1),this.data[t]=n,this.order.push(t)):(this.data[t]=n,this.order.push(t),this.order.length>this.max&&this.getAndRemove(this.order[0])),this}has(t){return t in this.data}keys(){return this.order}getAndRemove(t){if(!this.has(t))return null;const n=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),n}get(t){return this.has(t)?this.data[t]:null}remove(t){return this.has(t)?(delete this.data[t],this.order.splice(this.order.indexOf(t),1),this):this}setMaxSize(t){for(this.max=t;this.order.length>this.max;)this.getAndRemove(this.order[0]);return this}}\n/*!\n * based on @mapbox/tiny-sdf\n * https://github.com/mapbox/tiny-sdf\n * @License BSD 2-Clause\n */var al=1e20;function ul(t,n,e,r,i,s,o){this.fontSize=t||24,this.buffer=void 0===n?3:n,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=s||"normal",this.fontStyle=o||"normal",this.radius=e||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas="undefined"==typeof document?new OffscreenCanvas(a,a):document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0}),this.ctx.font=this.fontStyle+" "+this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function ll(t,n,e,r,i,s){for(var o=0;o<n;o++)hl(t,o,n,e,r,i,s);for(var a=0;a<e;a++)hl(t,a*n,1,n,r,i,s)}function hl(t,n,e,r,i,s,o){var a,u,l,h;for(s[0]=0,o[0]=-al,o[1]=al,a=0;a<r;a++)i[a]=t[n+a*e];for(a=1,u=0,l=0;a<r;a++){do{l=(i[a]-i[h=s[u]]+a*a-h*h)/(a-h)/2}while(l<=o[u]&&--u>-1);s[++u]=a,o[u]=l,o[u+1]=al}for(a=0,u=0;a<r;a++){for(;o[u+1]<a;)u++;t[n+a*e]=i[h=s[u]]+(a-h)*(a-h)}}ul.prototype.draw=function(t,n,e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.textBaseline="top",this.ctx.fillText(t,this.buffer,this.buffer);for(var r=this.ctx.getImageData(0,0,n,e),i=new Uint8ClampedArray(n*e),s=0;s<n*e;s++){var o=r.data[4*s+3]/255;this.gridOuter[s]=1===o?0:0===o?al:Math.pow(Math.max(0,.5-o),2),this.gridInner[s]=1===o?al:0===o?0:Math.pow(Math.max(0,o-.5),2)}for(ll(this.gridOuter,n,e,this.f,this.v,this.z),ll(this.gridInner,n,e,this.f,this.v,this.z),s=0;s<n*e;s++){var a=Math.sqrt(this.gridOuter[s])-Math.sqrt(this.gridInner[s]);i[s]=Math.round(255-255*(a/this.radius+this.cutoff))}return i};let cl=0;class fl{constructor(t,n=15,e){this.entries={},this.Ut={},this.Nt=new ol(2048,(function(){})),this.Lt=t,this.Vt=n,this.Rt=e}getGlyphs(t,n){if(!t||!Object.keys(t).length)return void n(null,{glyphs:null});const e=this.entries,r=t.options;let i=!0;r&&(i=!1!==r.isCharsCompact),i=i||this.Rt;const s=(r,s,a)=>{let u=0,l=0;for(const n in t)if("options"!==n){e[n]=e[n]||{},s[n]=s[n]||{};for(const h in t[n]){if(l++,l<=r)continue;const t=n.split(" "),c=i&&"normal"===t[0]&&!La(+h),f=n+":"+h+":"+c;let d;if(this.Nt.has(f)?d=this.Nt.get(f):(d=this.Ht(e[n],t,h,c),this.Nt.add(f,d),u++),d=dl(d),s[n][h]=d,a.push(d.bitmap.data.buffer),this.Lt&&u>this.Vt)return void this.Lt(o(l,s,a))}}n(null,{glyphs:s,buffers:a})};function o(t,n,e){return()=>{s(t,n,e)}}s(0,{},[])}Ht(t,n,e,r){const i=n[0],s=n[1],o=n.slice(3).join(" ");let a=t.tinySDF,u="normal"!==i?5:2;const l=r?-1:2;if(!a){let n="400";/bolder/i.test(s)?n="1000":/bold/i.test(s)?n="900":/medium/i.test(s)?n="500":/light/i.test(s)&&(n="200"),a=t.tinySDF=new ul(24,u,8,.25,o,n,i)}const h=String.fromCharCode(e),c=a.ctx.measureText(h),f=Math.round(c.width),d=a.draw(String.fromCharCode(e),f+2*u,24+2*u);if(cl<4){const t="undefined"!=typeof document&&document.getElementById("sdf-debug-"+cl++);t&&(t.width=f+2*u,t.height=a.canvas.height,t.getContext("2d").drawImage(a.canvas,0,0))}return{charCode:e,bitmap:{width:f+2*u,height:24+2*u,data:d},metrics:{width:f,height:24,left:1,top:-u,advance:f+u+l}}}}function dl(t){const n={width:t.bitmap.width,height:t.bitmap.height,data:new Uint8ClampedArray(t.bitmap.data)};return{charCode:t.charCode,bitmap:n,metrics:ur({},t.metrics)}}var pl=Object.freeze({__proto__:null,clipPolygon:Vu,calculateSignedArea:kr,getFeaAltitudeAndHeight:_r,generatePickingIndiceIndex:$r,convertRTLText:tu,packPosition:Tr,unpackPosition:function(t,n,e,r){const i=(Math.sign(n)||1)*(Math.abs(n)%zr),s=(Math.sign(e)||1)*(Math.abs(e)%zr),o=Math.floor(Math.abs(n)/zr),a=Math.floor(Math.abs(e)/zr);return t[0]=i,t[1]=s,t[2]=Math.sign(r+1e-5)*(2*o+a)*Dr+r,t},convertGeometry:ar,getPosArrayType:ir,getUnsignedArrayType:sr,getIndexArrayType:rr});const yl={},ml={},gl=[];Object.freeze({__proto__:null,loadSymbolFnTypes:function t(n,e){if(!n)return null;var r=!1;if(Array.isArray(n)){var i,s=[];for(let o=0;o<n.length;o++)(i=t(n[o],e))?(s.push(i),r=!0):s.push(n[o]);return r?s:n}var o={__fn_types_loaded:!0};const a=[];for(const t in n)yr(n,t)&&a.push(t);const u=function(t){Object.defineProperty(o,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=p(this["_"+t])),this["__fn_"+t].apply(this,e())},set:function(n){this["_"+t]=n},configurable:!0,enumerable:!0})},l={},h=function(t,n){Object.defineProperty(o,t,{get:function(){this["__fn_"+t]||(this["__fn_"+t]=Lo(this["_"+t],n));const r=e()[0];l.zoom=r;try{return this["__fn_"+t].evaluateWithoutErrorHandling(l,yl,ml,null,gl)}catch(t){return null}},set:function(n){this["_"+t]=n},configurable:!0,enumerable:!0})};for(let t=0,e=a.length;t<e;t++){const e=a[t];if(d(n[e]))r=!0,o["_"+e]=n[e],u(e);else if(Vo(n[e])){r=!0;const t=Go(e);o["_"+e]=n[e],h(e,t)}else o[e]=n[e]}return r?o:n}});const vl={polygonPatternFile:1,markerFile:1,markerPlacement:1,markerSpacing:1,textName:1,textStyle:1,textFaceName:1,textWeight:1,textPlacement:1,textSpacing:1,lineJoin:1,lineCap:1,linePatternFile:1};Object.assign({visible:1,textHorizontalAlignment:1,textVerticalAlignment:1,textWrapWidth:1,markerHorizontalAlignment:1,markerVerticalAlignment:1},vl),Object.assign({lineDasharray:1,topPolygonFill:1,bottomPolygonFill:1},vl);new Float32Array([-1e12])[0];const bl="maptalks_ombb";function wl(t,n,e,r,i,s,o,a,u,l,h,c,f,d,p,y,m){const g=n.length,v=i/3;for(let e=2,r=g;e<r;e+=3)t[i+e-2]=n[e-2],t[i+e-1]=n[e-1],t[i+e-0]=n[e]-o;i+=g;for(let e=2,r=g;e<r;e+=3)t[i+e-2]=n[e-2],t[i+e-1]=n[e-1],t[i+e-0]=n[e]-a;i+=g,t.trySetLength(i+g),t.copyWithin(i,i-2*g,i-g),i+=g,t.trySetLength(i+g),t.copyWithin(i,i-2*g,i-g),i+=g,(e=e||[]).push(g/3);for(let n=0;n<e.length;n++){Ml(v+(e[n-1]||0),v+e[n],t,g/3,u,r,l,h,c,f,s,d,p,y,m)}return i}function Ml(t,n,e,r,i,s,o,a,u,l,h,c,f,d,p){const y=s.length;let m,g;for(let o=t,a=n;o<a-1;o++)m=o,g=o+1,i!==1/0&&at(e,m,g,i)||((o-t)%2==1&&(m+=2*r,g+=2*r),p?(s.push(m+r,g,m),s.push(g+r,g,m+r)):(s.push(m+r,m,g),s.push(g,g+r,m+r)));o&&function(t,n,e,r,i,s,o,a,u,l,h){let c,f=0,d=0,p=0,y=0;const m=h?[1,3,4]:[2,3,4];for(let h=s.length-1;h>=0;h--){const g=s[h],v=3*g+1,b=3*g+2,w=i[3*g],M=i[v],x=i[b];f||d||(f=Math.max(i[b],i[3*s[h-3]+2]),d=Math.min(i[b],i[3*s[h-3]+2]),c=f-d);let F=p;const A=h%6;0===t?(5===A&&(y=jt(i,s,h,w,M)),F=A===m[0]||A===m[1]||A===m[2]?p:p+y):1===t&&(A===m[0]||A===m[1]||A===m[2]?F=0:5===A?(y=jt(i,s,h,w,M),F=y):F=y);const k=F/u*(1/(100*l))/o;let P;P=1===n?x===f?1:0:"bottom"===e?x===f?c/100/a:0:x===f?0:-c/100/a,r[2*g]=k,r[2*g+1]=P,0===A&&(p+=y)}}(a,u,l,h,e,s.slice(y,s.length),c[0],c[1],f,d,p)}function xl(t){const n=[t[0]];let e=t[0];for(let r=1;r<t.length;r++)Array.isArray(t[r])?t[r][0]===e[0]&&t[r][1]===e[1]&&t[r][2]===e[2]||n.push(t[r]):t[r].x===e.x&&t[r].y===e.y&&t[r].z===e.z||n.push(t[r]),e=t[r];return n}const Fl=Qo.getInstance();function Al(t,n,e,r,i,s,o,a,u,l,h,c,f,m,g,v){void 0===n.top&&(n.top=!0),void 0===n.side&&(n.side=!0),Fl.reset();const{altitudeScale:b,altitudeProperty:w,defaultAltitude:M,heightProperty:F,minHeightProperty:A,defaultHeight:k,tangent:_,uv:O,topUVMode:E,sideUVMode:I,sideVerticalUVMode:$,top:C,side:T,textureYOrigin:z,topThickness:D}=n,j=!!v,U=function(t,n,{altitudeScale:e,altitudeProperty:r,defaultAltitude:i,heightProperty:s,minHeightProperty:o,defaultHeight:a},{center:u,side:l,top:h,topThickness:c,uvOrigin:f,uv:d,uvSize:p,topUVMode:y,sideUVMode:m,sideVerticalUVMode:g,textureYOrigin:v,tileRatio:b,centimeterToPoint:w,verticalCentimeterToPoint:M,positionType:F,res:A,glScale:k,projectionCode:S},_,O){let E=n/t[0].extent;n===1/0&&(E=1);const I=n===1/0,$=O.get(),C=O.get(),T=O.get(),z=O.get(),D=O.get(),j=O.get(),U=O.get(),N=!!d,L=!!h,V=!!l,R=N?O.get():null;function H(t,e,r,i,s,o){let a=e;if(L){const i=Ne(z,r,3);if(0===i.length)return e;if(P(D,z),e+=z.length,o)for(let n=2,e=i.length;n<e;n+=3)i[n]+=t/3,i[n-1]+=t/3,i[n-2]+=t/3;else{let n;for(let e=2,r=i.length;e<r;e+=3)n=i[e-1],i[e-1]=i[e]+t/3,i[e]=n+t/3,i[e-2]+=t/3}P(j,i),N&&zt(y||0,t,e,R,D,f,w,b,p[0],p[1],s,A,k,S,u),c>0&&!V&&(e=wl(D,z,r,j,e,R,0,c,n,N,m||0,g||0,v,p,b,M,o)),U.setLength(e/3),U.fill(1,a/3,e/3)}if(V){L&&(c=0),a=e,e=wl(D,z,r,j,e,R,c,i,n,N,m||0,g||0,v,p,b,M,o),U.setLength(e/3);const t=z.length/3;U.fill(1,a/3,a/3+t),U.fill(0,a/3+t,a/3+2*t),U.fill(1,a/3+2*t,a/3+3*t),U.fill(0,a/3+3*t,e/3)}return e}let W=0,q=0;const G=[-1,-1,n+1,n+1];let B=0,J=t.length;x(_)&&(B=_,J=_+1);let X=0,Y=!1;const Z=O.get();for(;B<J;B++){const u=t[B],l=u.id;x(l)&&(Math.abs(l)>X&&(X=Math.abs(l)),l<0&&(Y=!0));const h=u.geometry,c=u.properties[bl];let f=Array.isArray(c&&c[0]&&c[0][0])?c[0]:c;const{altitude:d,height:p}=pl.getFeaAltitudeAndHeight(u,e,r,i,s,a,o);W=Math.max(Math.abs(d),W);const y=D.length;let m=0,g=q;Z.setLength(0),z.setLength(0);const v=pl.calculateSignedArea(h[0])<0;for(let t=0,e=h.length;t<e;t++){let r=h[t];v&&(r=r.reverse()),r=xl(r);const i=pl.calculateSignedArea(r)<0;if(!i&&t>0&&(m++,f=c&&c[m],q=H(g,q,Z,p*E,f,I),z.setLength(0),Z.setLength(0),g=q),n!==1/0&&(r=pl.clipPolygon(r,G)),!r.length){t===e-1&&(q=H(g,q,Z,p*E,f,I));continue}const s=r.length;Array.isArray(r[0])?r[0][0]===r[s-1][0]&&r[0][1]===r[s-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[s-1].x&&r[0].y===r[s-1].y||r.push(r[0]),i&&Z.push(z.length/3),ot(z,z.length,r,E,d,!1,F),t===e-1&&(q=H(g,q,Z,p*E,f,I))}const b=D.length-y,w="__fea_idx".trim();for(let t=0;t<b/3;t++)C.push(void 0===u[w]?B:u[w]),$.push(B),x(l)&&T.push(l)}const K=pl.getUnsignedArrayType(C.length?C[C.length-1]:0),Q={maxAltitude:W,vertices:D,verticeTypes:U,indices:j,pickingIds:Qo.createTypedArray(C,K),featureIndexes:$};if(T.length){const t=Y?pl.getPosArrayType(X):pl.getUnsignedArrayType(X);Q.featureIds=Qo.createTypedArray(T,t)}else Q.featureIds=[];return R&&(R.setLength(D.length/3*2),Q.uvs=R),Q}(t,e,{altitudeScale:b,altitudeProperty:w,defaultAltitude:M||0,heightProperty:F,minHeightProperty:A,defaultHeight:k||0},{center:v,top:C,side:T,topThickness:10*D||0,uv:O||_,uvSize:[i,i],uvOrigin:r,topUVMode:E,sideUVMode:I,sideVerticalUVMode:$,textureYOrigin:z,tileRatio:a,centimeterToPoint:u,verticalCentimeterToPoint:l,positionType:g,res:s,glScale:o,projectionCode:f},m,Fl),N=[],L=U.vertices.length/3,V=pl.getIndexArrayType(L),R=Qo.createTypedArray(U.indices,V);delete U.indices,N.push(R.buffer,U.pickingIds.buffer);const H=_?Fl.get():new Float32Array(3*L);H.setLength&&H.setLength(3*L);const W=ne(U.vertices,R,H);let q=!0;for(let t=0;t<W.length;t++){j||(W[t]=-W[t]);const n=W[t]%1;1-Math.abs(n)>1e-6?q=!1:0!==n&&(W[t]=Math.round(W[t]))}if(U.normals=W,_){let t=Fl.get();t.setLength(4*L),t=function(t,n,e,r,i){const s=t.length/3,o=i||new Array(4*s),a=[],u=[];for(let t=0;t<s;t++)a[t]=[0,0,0],u[t]=[0,0,0];const l=[0,0,0],h=[0,0,0],c=[0,0,0],f=[0,0],d=[0,0],p=[0,0],y=[0,0,0],m=[0,0,0];function g(n,r,i){he(l,t,3*n),he(h,t,3*r),he(c,t,3*i),ce(f,e,2*n),ce(d,e,2*r),ce(p,e,2*i);const s=h[0]-l[0],o=c[0]-l[0],g=h[1]-l[1],v=c[1]-l[1],b=h[2]-l[2],w=c[2]-l[2],M=d[0]-f[0],x=p[0]-f[0],F=d[1]-f[1],A=p[1]-f[1],k=1/(M*A-x*F);ft(y,(A*s-F*o)*k,(A*g-F*v)*k,(A*b-F*w)*k),ft(m,(M*o-x*s)*k,(M*v-x*g)*k,(M*w-x*b)*k),dt(a[n],a[n],y),dt(a[r],a[r],y),dt(a[i],a[i],y),dt(u[n],u[n],m),dt(u[r],u[r],m),dt(u[i],u[i],m)}for(let t=0,n=r.length;t<n;t+=3)g(r[t+0],r[t+1],r[t+2]);const v=[],b=[],w=[],M=[];let x,F,A;function k(t){he(w,n,3*t),ct(M,w),F=a[t],ct(v,F),gt(v,v,function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}(w,w,yt(w,F))),pt(v,v),mt(b,M,F),A=yt(b,u[t]),x=A<0?-1:1,o[4*t]=v[0],o[4*t+1]=v[1],o[4*t+2]=v[2],o[4*t+3]=x}for(let t=0,n=r.length;t<n;t+=3)k(r[t+0]),k(r[t+1]),k(r[t+2]);return o}(U.vertices,U.normals,U.uvs,R,t),t=function(t,n){const e=new Float32Array(n.length),r=[],i=[],s=[];for(let o=0;o<n.length;o+=4){const a=o/4*3;ft(i,t[a]||0,t[a+1]||0,t[a+2]||0),bt(r,n[o]||0,n[o+1]||0,n[o+2]||0,n[o+3]||0),Qn(s,i,r),vt(e.subarray(o,o+4),s)}return e}(U.normals,t),U.tangents=t,N.push(t.buffer),delete U.normals}if(U.normals&&(q&&(U.normals=Qo.createTypedArray(U.normals,Int8Array)),N.push(U.normals.buffer)),U.uvs){const t=U.uvs;U.uvs=Qo.createTypedArray(t,Float32Array),N.push(U.uvs.buffer)}if(v){const t=U.vertices;for(let n=0;n<t.length;n+=3)t[n]-=v[0],t[n+1]-=v[1]}const G=g||pl.getPosArrayType(Math.max(512,U.maxAltitude)),B=function(t,n,e,r){const i={},s={};if(S(n.polygonFill)){let o=y(n.polygonFill);const a=new Uint8Array(4*r.length);a.fill(255);for(let n=0;n<r.length;n++){const s=t[r[n]],u=s.properties||{};u.$layer=s.layer,u.$type=s.type;let l=o(e,u);d(l)&&(i.aColor=1,o=y(l),l=o(e,u)),delete u.$layer,delete u.$type,Ar.normalizeColor(kl,l),a[4*n]=kl[0],a[4*n+1]=kl[1],a[4*n+2]=kl[2],a[4*n+3]=kl[3]}s.aColor=a}if(S(n.polygonOpacity)){let o=p(n.polygonOpacity);const a=new Uint8Array(r.length);a.fill(255);for(let n=0;n<r.length;n++){const s=t[r[n]],u=s.properties||{};u.$layer=s.layer,u.$type=s.type;let l=o(e,u);d(l)&&(i.aOpacity=1,o=y(l),l=o(e,u)),delete u.$layer,delete u.$type,a[n]=255*l}s.aOpacity=a}return s.dynamicAttributes=i,s}(t,h,c,U.featureIndexes),J=function(t,n,e,r,i){const s=[[],[]],o=S(r.topPolygonFill),a=S(r.bottomPolygonFill),u=[255,255,255,255];if(o||a){let l=o&&y(r.topPolygonFill),h=a&&y(r.bottomPolygonFill),c=null,f=null,p=null,m=null;for(let r=0;r<n.length;r++){if(1===t[r]&&!o||0===t[r]&&!a)continue;const g=1===t[r];if(g&&n[r]===c){t[r]=p;continue}if(!g&&n[r]===f){t[r]=m;continue}const v=e[n[r]],b=v.properties||{};b.$layer=v.layer,b.$type=v.type;let w=g?l:h,M=w(i,b);d(M)&&(w=y(M),M=w(i,b)),delete b.$layer,delete b.$type,Ar.normalizeColor(kl,M),wt(kl,kl,u);let x=Pl(s,kl);x<0&&(x=s.length,s.push(vt([],kl))),t[r]=x,g?(c=n[r],p=x):(f=n[r],m=x)}}return s.slice(2)}(U.verticeTypes,U.featureIndexes,t,h,c),X={data:{data:{aVertexColorType:J.length<=252?Qo.createTypedArray(U.verticeTypes,Uint8Array):Qo.createTypedArray(U.verticeTypes,Uint16Array),aPosition:Qo.createTypedArray(U.vertices,G),aNormal:U.normals,aTexCoord0:U.uvs,aTangent:U.tangents,aPickingId:U.pickingIds},indices:R,properties:{maxAltitude:U.maxAltitude},dynamicAttributes:B.dynamicAttributes,vertexColors:J},buffers:N};return U.featureIds.length?(X.data.featureIds=U.featureIds,N.push(X.data.featureIds.buffer)):X.data.featureIds=[],B.aColor&&(X.data.data.aColor=B.aColor,X.buffers.push(B.aColor.buffer)),B.aOpacity&&(X.data.data.aOpacity=B.aOpacity,X.buffers.push(B.aOpacity.buffer)),X.buffers.push(X.data.data.aPosition.buffer),X.data.pickingIdIndiceMap=pl.generatePickingIndiceIndex(X.data.data.aPickingId,X.data.indices),X}const kl=[];function Pl(t,n){for(let e=0;e<t.length;e++)if(xt(n,t[e]))return e;return-1}function Sl(t,n,e,r,{altitudeScale:i,altitudeProperty:s,defaultAltitude:o,heightProperty:a,minHeightProperty:u,defaultHeight:l,bottom:h}){const c=h,f=n/t[0].extent,p=2*function(t,n){let e=0;for(let r=0,i=t.length;r<i;r++){const i=t[r];if(x(i.geometry[0][0])){const t=3*i.geometry.length;e+=n?2*t-6:t}else for(let t=0,r=i.geometry.length;t<r;t++){let r=3*i.geometry[t].length;3===i.type&&(r-=3),e+=n?2*r-6:r}}return e}(t)+3*t.length*2,y=[],m=new Int16Array(p),g=new Uint8Array(m.length/3*4);d(e)&&(e=Bo.compileFilter(e));const v=[];function b(t,e,r){const i=e-t,s=m.subarray(t,e),o=m.subarray(e,e+i);o.set(s);for(let t=2,n=o.length;t<n;t+=3)o[t]=s[t]-r;const a=t/3,u=i/3;let l,h;for(let t=a,e=u+a;t<e;t++)t<e-1?(l=t,h=t+1):(l=t,h=a),at(m,l,h,n)||(v.push(l,h),c&&v.push(l+u,h+u),_l(m,l,n)||v.push(l,l+u));return e+i}let w=0,M=0;const F="__fea_idx".trim(),A=[];for(let n=0,h=t.length;n<h;n++){const h=t[n],c=h.geometry;if(e){let t;t="function"==typeof e?e(h&&h.properties):e,Ar.normalizeColor(A,t)}else ft(A,255,255,255);const d=w/3*4,{altitude:p,height:x}=pl.getFeaAltitudeAndHeight(h,i,s,o,a,l,u);M=Math.max(Math.abs(p),M);let k=w;for(let t=0,n=c.length;t<n;t++){let n=c[t];const e=n.length;n[0][0]===n[e-1][0]&&n[0][1]===n[e-1][1]&&(n=n.slice(0,e-1)),w=ot(m,k,n,f,p),w=b(k,w,x*f),k=w}const P=k/3*4;for(let t=d;t<P;t+=4)g[t]=A[0],g[t+1]=A[1],g[t+2]=A[2],g[t+3]=255*(r||1);const S=v.length-y.length;for(let t=0;t<S;t++)y.push(h[F])}const k=v.reduce((t,n)=>Math.max(t,n),0),P=new(pl.getIndexArrayType(k))(v),S=pl.getUnsignedArrayType(t.length);return{aPosition:new(pl.getPosArrayType(Math.max(512,M)))(m),indices:P,aPickingId:new S(y),aColor:g}}function _l(t,n,e){const r=t[3*n],i=t[3*n+1];return r<0||r>e||i<0||i>e}function Ol(t,n,e,r){const i=Sl(t,n,e.lineColor,e.lineOpacity,r),s=[i.aPosition.buffer,i.indices.buffer,i.aPickingId.buffer],o=i.indices;return delete i.indices,{data:{data:i,indices:o},buffers:s}}let El=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),El=!0}catch(t){El=!1}var Il=El;const $l="__original_properties",Cl="__fn-type_properties";class Tl{constructor(t,n,e,r,i){this.id=t,this.options=n,this.upload=e,this.Wt(n.style),this.requests={},this.Nt=r,this.qt=0,this.loadings=i}updateStyle(t,n){this.options.style=t,this.qt=t.styleCounter,this.Wt(t),n()}updateOptions(t,n){this.options=w(this.options,t),n()}loadTile(t,n){const e=this.loadings,r=t.tileInfo.url,i=this.options.debugTile;if(i){const{x:e,y:r,z:s}=t.tileInfo;let o=!1;for(let t=0;t<i.length;t++)if(e===i[t].x&&r===i[t].y&&s===i[t].z){o=!0;break}if(!o)return void n()}if(e[r])return void e[r].push({context:t,callback:n,ref:this});e[r]=[{context:t,callback:n,ref:this}];const s=this.options.featureIdProperty;this.requests[r]=this.getTileFeatures(t,(n,i,o,a)=>{const u=e[r];if(delete e[r],this.checkIfCanceled(r))return delete this.requests[r],void this.Gt(u,null,{canceled:!0});if(delete this.requests[r],(this.options.debug||s)&&i)for(let n=0;n<i.length;n++)if(this.options.debug&&(i[n]._debug_info={index:n,id:i[n].id,tileId:t.tileInfo.id}),s){const t=A(s)?s[i[n].layer]:s,e=i[n].properties;i[n].id=e&&e[t]||null}if(n)this.Gt(u,n);else if(i&&i.length){if(u)for(let t=0;t<u.length;t++)this.Bt.call(u[t].ref,u[t].context,u[t].callback,r,o,i,a)}else this.Gt(u)})}Bt(t,n,e,r,i,s){this.Jt(r,i,t).then(e=>{e.canceled?n(null,{canceled:!0}):(e.data.style=t.styleCounter,s&&w(e.data,s),n(null,e.data,e.buffers))}).catch(t=>{n(t)})}abortTile(t,n){delete this.requests[t],this.Xt(t),n()}Xt(t){const n=this.loadings[t];if(n)for(let t=0;t<n.length;t++)n[t].callback(null,{canceled:!0});delete this.loadings[t]}Gt(t,n,e){if(t)for(let r=0;r<t.length;r++)t[r].callback(n,e)}checkIfCanceled(t){return!this.requests[t]}onRemove(){this.loadings={},delete this.Nt,this.requests={}}fetchIconGlyphs(t,n,e){if(this.options.workerGlyph&&Il){const r=[];if(t&&Object.keys(t).length){const n=new Promise(n=>{this.upload("fetchIconGlyphs",{icons:t},null,(t,e)=>{n({err:t,iconData:e})})});r.push(n)}if(n&&Object.keys(n).length){const t=new Promise(t=>{this.Yt||(this.Yt=new fl),this.Yt.getGlyphs(n,(n,e)=>{t({err:n,glyphData:e})})});r.push(t)}Promise.all(r).then(t=>{const n={icons:null,glyphs:null};for(let r=0;r<t.length;r++){if(t[r].err)return void e(t[r].err);t[r].iconData?n.icons=t[r].iconData.icons:t[r].glyphData&&(n.glyphs=t[r].glyphData.glyphs)}return n}).then(t=>{e(null,t)})}else this.upload("fetchIconGlyphs",{icons:t,glyphs:n},null,e)}Jt(t,n,e){if(!n.length)return Promise.resolve({data:null,buffers:[]});const{glScale:r,tileInfo:i}=e,s=!this.options.style.style.length&&!this.options.style.featureStyle.length;let o=this.pluginConfig.slice(0);s&&(o=this.Zt(t)),this.featurePlugins&&P(o,this.featurePlugins);const a={};for(let t=0;t<o.length;t++)Vl(n,e.tileInfo.z,o[t],a);const u=[],l=[];for(let t=0;t<n.length;t++){const e=n[t],r=a[t];if(r){l.fill(null);let t=0;for(const n in r){let i=0;const s=r[n].values();for(const t of s){let r=l[i];r||(r=ql(e),l[i]=r),r.properties[n]=t,i++}i>t&&(t=i)}for(let n=0;n<t;n++)u.push(l[n])}else u.push(e)}const h=(n=u)[0].extent,c=i.z,f={x:i.extent2d.xmin*r,y:i.extent2d.ymax*r},d=[],p=[],y=[],m=this.options,g=[],v={},b=[Promise.resolve(e.styleCounter)];let M=0,x=-1;const F=[];let A=!1;for(let t=0;t<o.length;t++){x++;const r=o[t];r.type!==M&&(x=0,M=r.type);const a=0===r.type?d:p;if(r.symbol&&!1===r.symbol.visible){a[x]=null;continue}Jl(r.symbol,F,t),A=A||F[t]&&F[t].size>0;const{tileFeatures:u,tileFeaIndexes:l}=this.Kt(c,r.type,r.filter,n,v,t);if(!u.length){a[x]=null;continue}const m=l[l.length-1],k=pl.getIndexArrayType(m);a[x]={styledFeatures:new k(l)},y.push({idx:t,typeIdx:x}),g.push(a[x].styledFeatures.buffer);const P=w({},e,{extent:h,zoom:c,tilePoint:f});if(this.options.debugTile){const t=this.options.debugTile;for(let n=0;n<t.length;n++){const{x:e,y:r,z:s}=t[n];if(i.x===e&&i.y===r&&i.z===s){P.debugIndex=t[n].index;break}}}let S=this.Qt(u,r,P);s&&(S=S.then(t=>{if(!t)return null;if(t.data)t.data.layer=u[0].layer;else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]&&t[n].data&&(t[n].data.layer=u[0].layer);return t})),b.push(S)}return Promise.all(b).then(([e,...r])=>{function i(t,n){if(void 0===t.data.ref&&(t.data.type=o[y[n].idx].renderPlugin.dataConfig.type,t.data.filter=o[y[n].idx].filter.def,t.buffers&&t.buffers.length))for(let n=0;n<t.buffers.length;n++)g.push(t.buffers[n])}if(e!==this.qt)return{canceled:!0};for(let t=0;t<r.length;t++){if(!r[t])continue;const n=r[t],e=0===o[y[t].idx].type?d:p;if(Array.isArray(n)){const r=[];for(let e=0;e<n.length;e++)n[e]&&(i(n[e],t),(void 0===n[e].data.ref||n[n[e].data.ref])&&r.push(n[e].data));r.length&&(e[y[t].typeIdx].data=r)}else i(n,t),e[y[t].typeIdx].data=n.data}const s={},a=t;if(m.features||m.schema||A){let t,e=!1;for(let r=0,i=n.length;r<i;r++)if(t=n[r],a[t.layer].properties||(a[t.layer].properties=jl(t.properties)),t&&(m.features||A&&v[r]))if("id"===m.features)s[r]=t.id;else{m.pickingGeometry||delete t.geometry,delete t.extent,delete t.properties.$layer,delete t.properties.$type,delete t.__index;const n=t.originalFeature;if(n){const n=t.properties,e=w({},t.originalFeature);delete n[$l],e.customProps=w({},n),t=e}const i=w({},t);if(A&&v[r]&&(!m.features||"transient"===m.features)){const i=v[r];for(let r=0;r<i.length;r++){const i=F[r];i&&i.forEach(r=>{const i=n?n.properties:t.properties;i[Cl]||(i[Cl]=new Set),i[Cl].add(r),e=!0})}}s[r]=i}if(e)for(const t in s){const n=s[t],e=n.properties[Cl];if(e){delete n.properties[Cl],"transient"===m.features&&(n.fnTypeProps=w({},n.properties));for(const t in n.properties)e.has(t)||("transient"===m.features?delete n.fnTypeProps[t]:delete n.properties[t])}}}return{data:{schema:a,data:d,featureData:p,extent:h,features:s},buffers:g}}).catch(t=>{console.error(t)})}Qt(t,n,e){let r=t;const i=n.renderPlugin.dataConfig,s=n.symbol,o=this.options.tileSize,{extent:a,glScale:u,zScale:l,zoom:h,tilePoint:c,centimeterToPoint:f,verticalCentimeterToPoint:d}=e,p=a/o,y=i.type,m=e.debugIndex;let g=w({},i,{EXTENT:a,zoom:h,debugIndex:m,features:this.options.features});if("3d-extrusion"===y){const t=Ul(s);t&&(i.uv=1,2===t&&(i.tangent=1));const n=this.options.projectionCode,o=s.material&&s.material.textureWidth||23.25;return Promise.all([Promise.resolve(Al(r,i,a,c,o,e.tileInfo.res,u,a/this.options.tileSize,f,d,s,h,n,m))])}if("3d-wireframe"===y)return Promise.all([Promise.resolve(Ol(r,a,s,i))]);if("point"===y){g=w(g,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:l*a/this.options.tileSize/u});const t=bu.splitPointSymbol(s),n=aa.genFnTypes(t[0]);return bu.needMerge(t[0],n,h)&&(r=bu.mergeLineFeatures(r,t[0],n,h)),Promise.all(t.map((t,e)=>(0===e?g.fnTypes=n:delete g.fnTypes,new bu(r,t,g).load(p))))}if("native-point"===y){const t=l*a/this.options.tileSize/u;return g.altitudeToTileScale=t,Nl(r,s,g,Uu,a/o)}if("line"===y)return g=w(g,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:p}),Nl(r,s,g,Pu);if("native-line"===y)return Nl(r,s,g,Du);if("fill"===y)return g=w(g,{requestor:this.fetchIconGlyphs.bind(this)}),Nl(r,s,g,qu);if("line-extrusion"===y){delete s.lineGradientProperty,s.lineJoin="miter",s.lineCap="butt";const t=Ul(s);if(t&&(i.uv=1,2===t&&(i.tangent=1)),g=w(g,{tileSize:o,zScale:l,glScale:u}),t){const t=[];if(!1!==i.top){const n=w({},g);n.side=!1,t.push(new Tu(r,s,n))}return!1!==i.side&&(g.side=!0,g.top=!1,t.push(new Tu(r,s,g))),Promise.all(t.map(t=>t.load()))}return Promise.all([new Tu(r,s,g).load()])}if("circle"===y)return Nl(r,s,g,Bu);if("round-tube"===y||"square-tube"===y){const t="round-tube"===y?Ju:tl;return g=w(g,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:"round-tube"===y?i.radialSegments||8:4,centimeterToPoint:f,verticalCentimeterToPoint:d,tileRatio:p,isTube:!0}),Nl(r,s,g,t)}return Promise.resolve([])}Kt(t,n,e,r,i,s){const o="__fea_idx".trim(),a=[],u=[],l=r.length;for(let h=0;h<l;h++)if((1===n||void 0===r[h].id||!this.styledFeatures[r[h].id])&&((!e.def||"default"===e.def)&&!i[h]||!0===e.def||e.def&&(void 0!==e.def.condition||Array.isArray(e.def))&&e(r[h],t))){const t=r[h];if(void 0===t[o]&&(t[o]=h),i[h]||(i[h]=[]),i[h].push(s),u.push(t),a.push(h),1===n)break}return{tileFeatures:u,tileFeaIndexes:a}}Wt(t){const{style:n,featureStyle:e}=t,r={};e.forEach(t=>{Array.isArray(t.id)?(t.id.forEach(t=>{r[t]=1}),t.filter=["in","$id",...t.id]):(r[t.id]=1,t.filter=["==","$id",t.id])});const i=Bo.compileStyle(n);for(let t=0;t<n.length;t++)i[t].filter&&(i[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0),i[t].type=0;const s=[],o=Bo.compileStyle(e);for(let t=0;t<e.length;t++)o[t].type=1,o[t].filter.def=e[t].filter?e[t].filter.value||e[t].filter:void 0,o[t].renderPlugin&&s.push(o[t]);this.pluginConfig=i,this.featurePlugins=s,this.styledFeatures=r}Zt(t){let n=this.tn;this.tn||(n=this.tn={});const e=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],r=[];for(const i in t){const s=i;if(!n[i]){const r=[];for(let n=0;n<t[i].types.length;n++){const o=t[i].types[n],a=["all",["==","$layer",s],["==","$type",e[o]]],u={filter:zn(a),renderPlugin:zl(o),symbol:Dl(o)};u.filter.def=a,u.type=0,r.push(u)}n[s]=r}r.push(...n[s])}return r}}function zl(t){switch(t){case 1:return{type:"native-point",dataConfig:{type:"native-point",only2D:!0}};case 2:return{type:"native-line",dataConfig:{type:"native-line",only2D:!0}};case 3:return{type:"fill",dataConfig:{type:"fill",only2D:!0}}}return null}function Dl(t){switch(t){case 1:return{markerFill:"#f00",markerSize:10};case 2:return{lineColor:"#fff"};case 3:return{polygonFill:"#00f",polygonOpacity:.4}}return null}function jl(t){if(Array.isArray(t)||!A(t))return{};const n={};for(const e in t){const r=t[e];M(r)?n[e]="string":x(r)?n[e]="number":!0===r||!1===r?n[e]="boolean":Array.isArray(r)?n[e]="array":n[e]="object"}return n}function Ul(t){if(!t)return 0;let n=0;for(const e in t){if(("normalTexture"===e||"bumpTexture"===e)&&t[e])return 2;if(e.indexOf("Texture")>0&&t[e])n=1;else if(A(t[e])){const r=Ul(t[e]);if(2===r)return r;1===r&&(n=1)}}return n}function Nl(t,n,e,r,i){const s={},o=Array.isArray(n)?n:[n];let a=-1;for(let t=0;t<o.length;t++)s[t]=Ll(o[t]),!s[t]&&o[t]&&-1===a&&(a=t);const u=[];for(let n=0;n<o.length;n++)o[n]&&(o[n].index={index:n},s[n]||n===a?u.push(new r(t,o[n],e).load(i)):u.push({data:{ref:a,symbolIndex:{index:n}}}));return Promise.all(u)}function Ll(t){if(!t)return 0;for(const n in t)if(S(t[n]))return 1;return 0}function Vl(t,n,e,r){const i=e.customProperties;if(!i)return t;if(i)for(let t=0;t<i.length;t++)i[t].fn=Bo.compileFilter(i[t].filter);for(let e=0;e<i.length;e++)for(let s=0,o=t.length;s<o;s++)if(i[e].fn(t[s],n))for(const t in i[e].properties){const n=i[e].properties[t];k(n)||(r[s]||(r[s]={}),r[s][t]||(r[s][t]=new Set),r[s][t].add(n))}}const Rl={get:(t,n)=>n in t?t[n]:t.originalFeature[n],has:(t,n)=>n in t||n in t.originalFeature},Hl={get:function(t,n){return n in t?t[n]:t[$l][n]},has:(t,n)=>n in t||n in t[$l]},Wl={};function ql(t){const n={};n.originalFeature=t;const e=new Proxy(n,Rl);return e.properties=new Proxy({},Hl),e.properties[$l]=t.properties||Wl,e}function Gl(t,n,e){t[n]||(t[n]=new Set),t[n].add(e)}const Bl=[];function Jl(t,n,e){if(!t)return Bl;for(const r in t){if(!t[r]||!Ar.checkIfZoomFnTypeSymbol(r))continue;if(S(t[r]))Gl(n,e,t[r].property);else{if("lineGradientProperty"===r){Gl(n,e,t[r]);continue}if("textName"===r)if(M(t[r])){const i=ya.resolveVarNames(t[r]);if(i)for(let t=0;t<i.length;t++)Gl(n,e,i[t])}else if(Bo.isExpression(t[r])){const i=[];ya.resolveExpVarNames(i,t[r]);for(let t=0;t<i.length;t++)Gl(n,e,i[t])}}const i=t[r].stops;if(i&&i.length)for(let t=0;t<i.length;t++)S(i[t][1])&&Gl(n,t,i[t][1].property)}return n[e]}function Xl(t,n){Yl(t.geometry,n)}function Yl(t,n){if(t)switch(t.type){case"Point":Zl(t.coordinates,n);break;case"MultiPoint":case"LineString":Kl(t.coordinates,n);break;case"MultiLineString":!function(t,n){for(let e=0,r=t.length;e<r;e++)Kl(t[e],n)}(t.coordinates,n);break;case"Polygon":Ql(t.coordinates,n);break;case"MultiPolygon":!function(t,n){for(let e=0,r=t.length;e<r;e++)Ql(t[e],n)}(t.coordinates,n);break;case"GeometryCollection":const e=t.geometries.length;for(let r=0;r<e;r++)Yl(t.geometries[r],n)}}function Zl(t,n){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.max(n[2],t[0]),n[3]=Math.max(n[3],t[1])}function Kl(t,n){for(let e=0,r=t.length;e<r;e++)Zl(t[e],n)}function Ql(t,n){t.length&&Kl(t[0],n)}function th(t,n,e,r,i){!function t(n,e,r,i,s){for(;i>r;){if(i-r>600){var o=i-r+1,a=e-r+1,u=Math.log(o),l=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*l*(o-l)/o)*(a-o/2<0?-1:1),c=Math.max(r,Math.floor(e-a*l/o+h)),f=Math.min(i,Math.floor(e+(o-a)*l/o+h));t(n,e,c,f,s)}var d=n[e],p=r,y=i;for(nh(n,r,e),s(n[i],d)>0&&nh(n,r,i);p<y;){for(nh(n,p,y),p++,y--;s(n[p],d)<0;)p++;for(;s(n[y],d)>0;)y--}0===s(n[r],d)?nh(n,r,y):(y++,nh(n,y,i)),y<=e&&(r=y+1),e<=y&&(i=y-1)}}(t,n,e||0,r||t.length-1,i||eh)}function nh(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function eh(t,n){return t<n?-1:t>n?1:0}class rh{constructor(t=9){this.nn=Math.max(4,t),this.en=Math.max(2,Math.ceil(.4*this.nn)),this.clear()}all(){return this.rn(this.data,[])}search(t){let n=this.data;const e=[];if(!yh(t,n))return e;const r=this.toBBox,i=[];for(;n;){for(let s=0;s<n.children.length;s++){const o=n.children[s],a=n.leaf?r(o):o;yh(t,a)&&(n.leaf?e.push(o):ph(t,a)?this.rn(o,e):i.push(o))}n=i.pop()}return e}collides(t){let n=this.data;if(!yh(t,n))return!1;const e=[];for(;n;){for(let r=0;r<n.children.length;r++){const i=n.children[r],s=n.leaf?this.toBBox(i):i;if(yh(t,s)){if(n.leaf||ph(t,s))return!0;e.push(i)}}n=e.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this.en){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let n=this.sn(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this.an(this.data,n);else{if(this.data.height<n.height){const t=this.data;this.data=n,n=t}this.un(n,this.data.height-n.height-1,!0)}else this.data=n;return this}insert(t){return t&&this.un(t,this.data.height-1),this}clear(){return this.data=mh([]),this}remove(t,n){if(!t)return this;let e=this.data;const r=this.toBBox(t),i=[],s=[];let o,a,u;for(;e||i.length;){if(e||(e=i.pop(),a=i[i.length-1],o=s.pop(),u=!0),e.leaf){const r=ih(t,e.children,n);if(-1!==r)return e.children.splice(r,1),i.push(e),this.hn(i),this}u||e.leaf||!ph(e,r)?a?(o++,e=a.children[o],u=!1):e=null:(i.push(e),s.push(o),o=0,a=e,e=e.children[0])}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}rn(t,n){const e=[];for(;t;)t.leaf?n.push(...t.children):e.push(...t.children),t=e.pop();return n}sn(t,n,e,r){const i=e-n+1;let s,o=this.nn;if(i<=o)return s=mh(t.slice(n,e+1)),sh(s,this.toBBox),s;r||(r=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,r-1))),s=mh([]),s.leaf=!1,s.height=r;const a=Math.ceil(i/o),u=a*Math.ceil(Math.sqrt(o));gh(t,n,e,u,this.compareMinX);for(let i=n;i<=e;i+=u){const n=Math.min(i+u-1,e);gh(t,i,n,a,this.compareMinY);for(let e=i;e<=n;e+=a){const i=Math.min(e+a-1,n);s.children.push(this.sn(t,e,i,r-1))}}return sh(s,this.toBBox),s}cn(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){let e,r=1/0,i=1/0;for(let s=0;s<n.children.length;s++){const o=n.children[s],a=hh(o),u=fh(t,o)-a;u<i?(i=u,r=a<r?a:r,e=o):u===i&&a<r&&(r=a,e=o)}n=e||n.children[0]}return n}un(t,n,e){const r=e?t:this.toBBox(t),i=[],s=this.cn(r,this.data,n,i);for(s.children.push(t),ah(s,r);n>=0&&i[n].children.length>this.nn;)this.dn(i,n),n--;this.pn(r,i,n)}dn(t,n){const e=t[n],r=e.children.length,i=this.en;this.yn(e,i,r);const s=this.mn(e,i,r),o=mh(e.children.splice(s,e.children.length-s));o.height=e.height,o.leaf=e.leaf,sh(e,this.toBBox),sh(o,this.toBBox),n?t[n-1].children.push(o):this.an(e,o)}an(t,n){this.data=mh([t,n]),this.data.height=t.height+1,this.data.leaf=!1,sh(this.data,this.toBBox)}mn(t,n,e){let r,i=1/0,s=1/0;for(let o=n;o<=e-n;o++){const n=oh(t,0,o,this.toBBox),a=oh(t,o,e,this.toBBox),u=dh(n,a),l=hh(n)+hh(a);u<i?(i=u,r=o,s=l<s?l:s):u===i&&l<s&&(s=l,r=o)}return r||e-n}yn(t,n,e){const r=t.leaf?this.compareMinX:uh,i=t.leaf?this.compareMinY:lh;this.gn(t,n,e,r)<this.gn(t,n,e,i)&&t.children.sort(r)}gn(t,n,e,r){t.children.sort(r);const i=this.toBBox,s=oh(t,0,n,i),o=oh(t,e-n,e,i);let a=ch(s)+ch(o);for(let r=n;r<e-n;r++){const n=t.children[r];ah(s,t.leaf?i(n):n),a+=ch(s)}for(let r=e-n-1;r>=n;r--){const n=t.children[r];ah(o,t.leaf?i(n):n),a+=ch(o)}return a}pn(t,n,e){for(let r=e;r>=0;r--)ah(n[r],t)}hn(t){for(let n,e=t.length-1;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():sh(t[e],this.toBBox)}}function ih(t,n,e){if(!e)return n.indexOf(t);for(let r=0;r<n.length;r++)if(e(t,n[r]))return r;return-1}function sh(t,n){oh(t,0,t.children.length,n,t)}function oh(t,n,e,r,i){i||(i=mh(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s=n;s<e;s++){const n=t.children[s];ah(i,t.leaf?r(n):n)}return i}function ah(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function uh(t,n){return t.minX-n.minX}function lh(t,n){return t.minY-n.minY}function hh(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ch(t){return t.maxX-t.minX+(t.maxY-t.minY)}function fh(t,n){return(Math.max(n.maxX,t.maxX)-Math.min(n.minX,t.minX))*(Math.max(n.maxY,t.maxY)-Math.min(n.minY,t.minY))}function dh(t,n){const e=Math.max(t.minX,n.minX),r=Math.max(t.minY,n.minY),i=Math.min(t.maxX,n.maxX),s=Math.min(t.maxY,n.maxY);return Math.max(0,i-e)*Math.max(0,s-r)}function ph(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function yh(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function mh(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function gh(t,n,e,r,i){const s=[n,e];for(;s.length;){if((e=s.pop())-(n=s.pop())<=r)continue;const o=n+Math.ceil((e-n)/r/2)*r;th(t,o,n,e,i),s.push(n,o,o,e)}}var vh={exports:{}},bh=function(t,n,e,r){var i=t[0],s=t[1],o=!1;void 0===e&&(e=0),void 0===r&&(r=n.length);for(var a=(r-e)/2,u=0,l=a-1;u<a;l=u++){var h=n[e+2*u+0],c=n[e+2*u+1],f=n[e+2*l+0],d=n[e+2*l+1];c>s!=d>s&&i<(f-h)*(s-c)/(d-c)+h&&(o=!o)}return o},wh=function(t,n,e,r){var i=t[0],s=t[1],o=!1;void 0===e&&(e=0),void 0===r&&(r=n.length);for(var a=r-e,u=0,l=a-1;u<a;l=u++){var h=n[u+e][0],c=n[u+e][1],f=n[l+e][0],d=n[l+e][1];c>s!=d>s&&i<(f-h)*(s-c)/(d-c)+h&&(o=!o)}return o};vh.exports=function(t,n,e,r){return n.length>0&&Array.isArray(n[0])?wh(t,n,e,r):bh(t,n,e,r)};var Mh=vh.exports.nested=wh;vh.exports.flat=bh;function xh(t,n,e,r,i){let s,o,a,u,l=n[0],h=r[0],c=0,f=0;h>l==h>-l?(s=l,l=n[++c]):(s=h,h=r[++f]);let d=0;if(c<t&&f<e)for(h>l==h>-l?(o=l+s,a=s-(o-l),l=n[++c]):(o=h+s,a=s-(o-h),h=r[++f]),s=o,0!==a&&(i[d++]=a);c<t&&f<e;)h>l==h>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=n[++c]):(o=s+h,u=o-s,a=s-(o-u)+(h-u),h=r[++f]),s=o,0!==a&&(i[d++]=a);for(;c<t;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=n[++c],s=o,0!==a&&(i[d++]=a);for(;f<e;)o=s+h,u=o-s,a=s-(o-u)+(h-u),h=r[++f],s=o,0!==a&&(i[d++]=a);return 0===s&&0!==d||(i[d++]=s),d}function Fh(t){return new Float64Array(t)}const Ah=Fh(4),kh=Fh(8),Ph=Fh(12),Sh=Fh(16),_h=Fh(4);function Oh(t,n,e,r,i,s){const o=(n-s)*(e-i),a=(t-i)*(r-s),u=o-a;if(0===o||0===a||o>0!=a>0)return u;const l=Math.abs(o+a);return Math.abs(u)>=33306690738754716e-32*l?u:-function(t,n,e,r,i,s,o){let a,u,l,h,c,f,d,p,y,m,g,v,b,w,M,x,F,A;const k=t-i,P=e-i,S=n-s,_=r-s;w=k*_,f=134217729*k,d=f-(f-k),p=k-d,f=134217729*_,y=f-(f-_),m=_-y,M=p*m-(w-d*y-p*y-d*m),x=S*P,f=134217729*S,d=f-(f-S),p=S-d,f=134217729*P,y=f-(f-P),m=P-y,F=p*m-(x-d*y-p*y-d*m),g=M-F,c=M-g,Ah[0]=M-(g+c)+(c-F),v=w+g,c=v-w,b=w-(v-c)+(g-c),g=b-x,c=b-g,Ah[1]=b-(g+c)+(c-x),A=v+g,c=A-v,Ah[2]=v-(A-c)+(g-c),Ah[3]=A;let O=function(t,n){let e=n[0];for(let r=1;r<t;r++)e+=n[r];return e}(4,Ah),E=22204460492503146e-32*o;if(O>=E||-O>=E)return O;if(c=t-k,a=t-(k+c)+(c-i),c=e-P,l=e-(P+c)+(c-i),c=n-S,u=n-(S+c)+(c-s),c=r-_,h=r-(_+c)+(c-s),0===a&&0===u&&0===l&&0===h)return O;if(E=11093356479670487e-47*o+33306690738754706e-32*Math.abs(O),O+=k*h+_*a-(S*l+P*u),O>=E||-O>=E)return O;w=a*_,f=134217729*a,d=f-(f-a),p=a-d,f=134217729*_,y=f-(f-_),m=_-y,M=p*m-(w-d*y-p*y-d*m),x=u*P,f=134217729*u,d=f-(f-u),p=u-d,f=134217729*P,y=f-(f-P),m=P-y,F=p*m-(x-d*y-p*y-d*m),g=M-F,c=M-g,_h[0]=M-(g+c)+(c-F),v=w+g,c=v-w,b=w-(v-c)+(g-c),g=b-x,c=b-g,_h[1]=b-(g+c)+(c-x),A=v+g,c=A-v,_h[2]=v-(A-c)+(g-c),_h[3]=A;const I=xh(4,Ah,4,_h,kh);w=k*h,f=134217729*k,d=f-(f-k),p=k-d,f=134217729*h,y=f-(f-h),m=h-y,M=p*m-(w-d*y-p*y-d*m),x=S*l,f=134217729*S,d=f-(f-S),p=S-d,f=134217729*l,y=f-(f-l),m=l-y,F=p*m-(x-d*y-p*y-d*m),g=M-F,c=M-g,_h[0]=M-(g+c)+(c-F),v=w+g,c=v-w,b=w-(v-c)+(g-c),g=b-x,c=b-g,_h[1]=b-(g+c)+(c-x),A=v+g,c=A-v,_h[2]=v-(A-c)+(g-c),_h[3]=A;const $=xh(I,kh,4,_h,Ph);w=a*h,f=134217729*a,d=f-(f-a),p=a-d,f=134217729*h,y=f-(f-h),m=h-y,M=p*m-(w-d*y-p*y-d*m),x=u*l,f=134217729*u,d=f-(f-u),p=u-d,f=134217729*l,y=f-(f-l),m=l-y,F=p*m-(x-d*y-p*y-d*m),g=M-F,c=M-g,_h[0]=M-(g+c)+(c-F),v=w+g,c=v-w,b=w-(v-c)+(g-c),g=b-x,c=b-g,_h[1]=b-(g+c)+(c-x),A=v+g,c=A-v,_h[2]=v-(A-c)+(g-c),_h[3]=A;const C=xh($,Ph,4,_h,Sh);return Sh[C-1]}(t,n,e,r,i,s,l)}function Eh(t,n,e){n=Math.max(0,void 0===n?2:n),e=e||0;var r=function(t){for(var n=t[0],e=t[0],r=t[0],i=t[0],s=0;s<t.length;s++){var o=t[s];o[0]<n[0]&&(n=o),o[0]>r[0]&&(r=o),o[1]<e[1]&&(e=o),o[1]>i[1]&&(i=o)}var a=[n,e,r,i],u=a.slice();for(s=0;s<t.length;s++)Mh(t[s],a)||u.push(t[s]);return function(t){t.sort(Rh);for(var n=[],e=0;e<t.length;e++){for(;n.length>=2&&Dh(n[n.length-2],n[n.length-1],t[e])<=0;)n.pop();n.push(t[e])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&Dh(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),n.pop(),n.concat(r)}(u)}(t),i=new rh(16);i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,n){return t[0]-n[0]},i.compareMinY=function(t,n){return t[1]-n[1]},i.load(t);for(var s,o=[],a=0;a<r.length;a++){var u=r[a];i.remove(u),s=Uh(u,s),o.push(s)}var l=new rh(16);for(a=0;a<o.length;a++)l.insert(jh(o[a]));for(var h=n*n,c=e*e;o.length;){var f=o.shift(),d=f.p,p=f.next.p,y=Nh(d,p);if(!(y<c)){var m=y/h;(u=Ih(i,f.prev.p,d,p,f.next.next.p,m,l))&&Math.min(Nh(u,d),Nh(u,p))<=m&&(o.push(f),o.push(Uh(u,f)),i.remove(u),l.remove(f),l.insert(jh(f)),l.insert(jh(f.next)))}}f=s;var g=[];do{g.push(f.p),f=f.next}while(f!==s);return g.push(f.p),g}function Ih(t,n,e,r,i,s,o){for(var a=new Bn([],$h),u=t.data;u;){for(var l=0;l<u.children.length;l++){var h=u.children[l],c=u.leaf?Lh(h,e,r):Ch(e,r,h);c>s||a.push({node:h,dist:c})}for(;a.length&&!a.peek().node.children;){var f=a.pop(),d=f.node,p=Lh(d,n,e),y=Lh(d,r,i);if(f.dist<p&&f.dist<y&&zh(e,d,o)&&zh(r,d,o))return d}(u=a.pop())&&(u=u.node)}return null}function $h(t,n){return t.dist-n.dist}function Ch(t,n,e){if(Th(t,e)||Th(n,e))return 0;var r=Vh(t[0],t[1],n[0],n[1],e.minX,e.minY,e.maxX,e.minY);if(0===r)return 0;var i=Vh(t[0],t[1],n[0],n[1],e.minX,e.minY,e.minX,e.maxY);if(0===i)return 0;var s=Vh(t[0],t[1],n[0],n[1],e.maxX,e.minY,e.maxX,e.maxY);if(0===s)return 0;var o=Vh(t[0],t[1],n[0],n[1],e.minX,e.maxY,e.maxX,e.maxY);return 0===o?0:Math.min(r,i,s,o)}function Th(t,n){return t[0]>=n.minX&&t[0]<=n.maxX&&t[1]>=n.minY&&t[1]<=n.maxY}function zh(t,n,e){for(var r,i,s,o,a=Math.min(t[0],n[0]),u=Math.min(t[1],n[1]),l=Math.max(t[0],n[0]),h=Math.max(t[1],n[1]),c=e.search({minX:a,minY:u,maxX:l,maxY:h}),f=0;f<c.length;f++)if(r=c[f].p,i=c[f].next.p,s=t,r!==(o=n)&&i!==s&&Dh(r,i,s)>0!=Dh(r,i,o)>0&&Dh(s,o,r)>0!=Dh(s,o,i)>0)return!1;return!0}function Dh(t,n,e){return Oh(t[0],t[1],n[0],n[1],e[0],e[1])}function jh(t){var n=t.p,e=t.next.p;return t.minX=Math.min(n[0],e[0]),t.minY=Math.min(n[1],e[1]),t.maxX=Math.max(n[0],e[0]),t.maxY=Math.max(n[1],e[1]),t}function Uh(t,n){var e={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return n?(e.next=n.next,e.prev=n,n.next.prev=e,n.next=e):(e.prev=e,e.next=e),e}function Nh(t,n){var e=t[0]-n[0],r=t[1]-n[1];return e*e+r*r}function Lh(t,n,e){var r=n[0],i=n[1],s=e[0]-r,o=e[1]-i;if(0!==s||0!==o){var a=((t[0]-r)*s+(t[1]-i)*o)/(s*s+o*o);a>1?(r=e[0],i=e[1]):a>0&&(r+=s*a,i+=o*a)}return(s=t[0]-r)*s+(o=t[1]-i)*o}function Vh(t,n,e,r,i,s,o,a){var u,l,h,c,f=e-t,d=r-n,p=o-i,y=a-s,m=t-i,g=n-s,v=f*f+d*d,b=f*p+d*y,w=p*p+y*y,M=f*m+d*g,x=p*m+y*g,F=v*w-b*b,A=F,k=F;0===F?(l=0,A=1,c=x,k=w):(c=v*x-b*M,(l=b*x-w*M)<0?(l=0,c=x,k=w):l>A&&(l=A,c=x+b,k=w)),c<0?(c=0,-M<0?l=0:-M>v?l=A:(l=-M,A=v)):c>k&&(c=k,-M+b<0?l=0:-M+b>v?l=A:(l=-M+b,A=v));var P=(1-(h=0===c?0:c/k))*i+h*o-((1-(u=0===l?0:l/A))*t+u*e),S=(1-h)*s+h*a-((1-u)*n+u*r);return P*P+S*S}function Rh(t,n){return t[0]===n[0]?t[1]-n[1]:t[0]-n[0]}class Hh{constructor(t,n){this.x=t,this.y=n}clone(){return new Hh(this.x,this.y)}normalize(){const t=this.length();this.x/=t,this.y/=t}negate(){this.x=-this.x,this.y=-this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}diff(t){return new Hh(this.x-t.x,this.y-t.y)}distance(t){const n=this.x-t.x,e=this.y-t.y;return Math.sqrt(n*n+e*e)}dot(t){return this.x*t.x+this.y*t.y}equals(t){return this.x===t.x&&this.y===t.y}orthogonal(){return new Hh(this.y,-this.x)}}function Wh(t,n,e,r){const i=n.x*r.y-n.y*r.x,s=e.x-t.x,o=e.y-t.y,a=(s*r.y-o*r.x)/i;return new Hh(t.x+a*n.x,t.y+a*n.y)}const qh=[],Gh=[];function Bh(t){if(x(t[0]&&t[0].x)){const n=[];let e=0;for(let r=0;r<t.length;r++)Gh[e]?(Gh[e][0]=t[r].x,Gh[e][1]=t[r].y):Gh[e]=[t[r].x,t[r].y],n.push(Gh[e]),e++;t=n}try{const n=Eh(t,1/0);let e=[1/0,1/0],r=[-1/0,-1/0];for(let t=0;t<n.length;t++)n[t][0]<e[0]&&(e[0]=n[t][0]),n[t][0]>r[0]&&(r[0]=n[t][0]),n[t][1]<e[1]&&(e[1]=n[t][1]),n[t][1]>r[1]&&(r[1]=n[t][1]);const i=[];let s=[],o=0;for(let t=0;t<n.length;t++)t===n.length-1&&n[t][0]===n[0][0]&&n[t][1]===n[0][1]||(Ct(i,n[t],"EPSG:3857"),qh[o]?(qh[o].x=i[0],qh[o].y=i[1]):qh[o]=new Hh(i[0],i[1]),s.push(qh[o]),o++);pl.calculateSignedArea(s)<0&&(s=s.reverse());const a=function(t){let n,e=Number.MAX_VALUE;const r=function(t,r,i,s,o,a,u,l){var h=Wh(t,r,o,a),c=Wh(i,s,o,a),f=Wh(u,l,t,r),d=Wh(u,l,i,s),p=h.distance(c)*h.distance(f);0!==p&&p<e&&(n=[h,f,d,c],e=p)};var i=[];for(let n=0;n<t.length;n++)i.push(t[(n+1)%t.length].diff(t[n])),i[n].normalize();var s,o,a,u,l=new Hh(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new Hh(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let n=0;n<t.length;n++){var c=t[n];c.x<l.x&&(l.x=c.x,s=n),c.x>h.x&&(h.x=c.x,o=n),c.y<l.y&&(l.y=c.y,u=n),c.y>h.y&&(h.y=c.y,a=n)}var f=new Hh(0,-1),d=new Hh(0,1),p=new Hh(-1,0),y=new Hh(1,0);for(let n=0;n<t.length;n++){var m=[Math.acos(f.dot(i[s])),Math.acos(d.dot(i[o])),Math.acos(p.dot(i[a])),Math.acos(y.dot(i[u]))];switch(m.indexOf(Math.min.apply(Math,m))){case 0:(d=(f=i[s].clone()).clone()).negate(),(y=(p=f.orthogonal()).clone()).negate(),s=(s+1)%t.length;break;case 1:(f=(d=i[o].clone()).clone()).negate(),(y=(p=f.orthogonal()).clone()).negate(),o=(o+1)%t.length;break;case 2:(y=(p=i[a].clone()).clone()).negate(),(d=(f=y.orthogonal()).clone()).negate(),a=(a+1)%t.length;break;case 3:(p=(y=i[u].clone()).clone()).negate(),(d=(f=y.orthogonal()).clone()).negate(),u=(u+1)%t.length}r(t[s],f,t[o],d,t[a],p,t[u],y)}return n}(s);if(!a||4!==a.length)return null;const u=a[0].distance(a[1]),l=a[1].distance(a[2]),h=a.map(t=>[t.x,t.y]);return h.push(+(l>u)),h}catch(t){return null}}const Jh=[];function Xh(t,n){const e=Array.isArray(t&&t[0]&&t[0][0]);for(let r=0;r<t.length;r++)e?t[r]=Xh(t[r]):(Ct(Jh,t[r],n),t[r][0]=Jh[0],t[r][1]=Jh[1]);return t}class Yh extends Tl{constructor(t,n,e,r,i,s){super(t,n,e,r,i),(n=n||{}).extent||(n.extent=8192),this.zoomOffset=0,n.tileSize&&(this.zoomOffset=-function(t){if(Math.log2)return Math.log2(t);const n=Math.log(t)*Math.LOG2E,e=Math.round(n);return Math.abs(e-n)<1e-14?e:n}(n.tileSize/256)),this.setData(n.data,s)}setData(t,n){if(delete this.index,!t)return void n();const e={maxZoom:24,tolerance:this.options.simplifyTolerance,extent:this.options.extent,buffer:x(this.options.tileBuffer)?this.options.tileBuffer:64,hasAltitude:!!this.options.hasAltitude,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5,disableFilter:!0};if(this.options.projection&&(e.projection=this.options.projection,"EPSG:4490"===e.projection&&(e.projection="EPSG:4326")),M(t)&&"{"!=t.substring(0,1)||t.url){const r=t.url?t.url:t;O.getJSON(r,t.url?t:{},(t,i)=>{if(t&&(console.error("Failed to fetch geojson:"+r),n(t)),!i)return void n(null,{extent:null,idMap:{}});let s=i;if(this.options.convertFn){s=new Function("data",this.options.convertFn+"\\nreturn convert(data)")(s)}const o=Array.isArray(s)?s:s.features;this.vn(o);const{sample1000:a,idMap:u}=this.bn(o);this.wn(a,u,s,e,n)})}else{"string"==typeof t&&(t=JSON.parse(t));const r=Array.isArray(t)?t:t.features,i=r&&r.length;this.vn(r);let s=r;if(r&&i>1e3){s=[];for(let t=0;t<i;t++)Zh(r[t],s,t,i)}this.wn(s,null,t,e,n)}}vn(t){if(this.options.generateOMBB&&t)for(let n=0;n<t.length;n++){const e=t[n];if(e&&e.geometry&&e.geometry.coordinates)if("Polygon"===e.geometry.type){const t=e.geometry.coordinates[0];if(!t)continue;const n=Bh(t,t.length);e.properties=e.properties||{},e.properties[bl]=n}else if("MultiPolygon"===e.geometry.type){const t=e.geometry.coordinates;for(let n=0;n<t.length;n++){if(!t[n])continue;const r=t[n][0];if(!r)continue;const i=Bh(r,r.length);e.properties=e.properties||{},e.properties[bl]=e.properties[bl]||[],e.properties[bl][n]=i}}}}wn(t,n,e,r,i){try{const s=t&&t.length?function(t){let n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];switch(t.type){case"FeatureCollection":const e=t.features.length;for(let r=0;r<e;r++)Xl(t.features[r],n);break;case"Feature":Xl(t,n);break;default:Yl(t,n)}return n}({type:"FeatureCollection",features:t}):null;this.index=function(t,n){return new it(t,n)}(e,this.options.geojsonvt||r),i(null,{extent:s,idMap:n})}catch(t){console.warn(t),i({error:t.message})}}bn(t){const n=[],e={};let r=0;const i=this.options.featureIdProperty;if(t){const s=t.length;t.forEach((t,o)=>{!function(t,s,o){if(t&&("Feature"!==t.type||t.geometry)){if(x(t.id)||(t.id=r++),i){let n=i;A(i)&&(n=i[t.layer||"0"]),t.id=t.properties[n]}e[t.id]=w({},t),t.geometry?(e[t.id].geometry=w({},t.geometry),e[t.id].geometry.coordinates=null):t.coordinates&&(e[t.id].coordinates=null),Zh(t,n,s,o)}}(t,o,s)})}return{sample1000:n,idMap:e}}getTileFeatures(t,n){const e=t.tileInfo,r=[];if(!this.index)return setTimeout((function(){n({loading:!0})}),1),1;const i=this.index.getTile(e.z+this.zoomOffset,e.x,e.y);if(!i||0===i.features.length)return setTimeout((function(){n(null,r,[])}),1),1;const s=[];for(let t=0,n=i.features.length;t<n;t++){const n=i.features[t];let e=n.layer;void 0===e&&(e="0"),s[e]={types:{}};s[e].types[n.type]=1,n.tags=n.tags||{},n.geometry.converted||(pl.convertGeometry(n),n.geometry.converted=1),r.push({type:n.type,layer:e,id:n.id,geometry:n.geometry,properties:n.tags,extent:this.options.extent})}for(const t in s)s[t].types=Object.keys(s[t].types).map(t=>+t);return setTimeout((function(){n(null,r,s)}),1),1}onRemove(){super.onRemove(),delete this.index}}function Zh(t,n,e,r){const i=Math.floor(r/998);(0===e||e===r-1||(0===i||e%i==0)&&n.length<999)&&n.push(t)}var Kh={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,n,e,r,i){var s,o,a=8*i-r-1,u=(1<<a)-1,l=u>>1,h=-7,c=e?i-1:0,f=e?-1:1,d=t[n+c];for(c+=f,s=d&(1<<-h)-1,d>>=-h,h+=a;h>0;s=256*s+t[n+c],c+=f,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=r;h>0;o=256*o+t[n+c],c+=f,h-=8);if(0===s)s=1-l;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),s-=l}return(d?-1:1)*o*Math.pow(2,s-r)},write:function(t,n,e,r,i,s){var o,a,u,l=8*s-i-1,h=(1<<l)-1,c=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,p=r?1:-1,y=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,o=h):(o=Math.floor(Math.log(n)/Math.LN2),n*(u=Math.pow(2,-o))<1&&(o--,u*=2),(n+=o+c>=1?f/u:f*Math.pow(2,1-c))*u>=2&&(o++,u/=2),o+c>=h?(a=0,o=h):o+c>=1?(a=(n*u-1)*Math.pow(2,i),o+=c):(a=n*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[e+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[e+d]=255&o,d+=p,o/=256,l-=8);t[e+d-p]|=128*y}},Qh=nc,tc=Kh;function nc(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}nc.Varint=0,nc.Fixed64=1,nc.Bytes=2,nc.Fixed32=5;var ec="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function rc(t){return t.type===nc.Bytes?t.readVarint()+t.pos:t.pos+1}function ic(t,n,e){return e?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function sc(t,n,e){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));e.realloc(r);for(var i=e.pos-1;i>=t;i--)e.buf[i+r]=e.buf[i]}function oc(t,n){for(var e=0;e<t.length;e++)n.writeVarint(t[e])}function ac(t,n){for(var e=0;e<t.length;e++)n.writeSVarint(t[e])}function uc(t,n){for(var e=0;e<t.length;e++)n.writeFloat(t[e])}function lc(t,n){for(var e=0;e<t.length;e++)n.writeDouble(t[e])}function hc(t,n){for(var e=0;e<t.length;e++)n.writeBoolean(t[e])}function cc(t,n){for(var e=0;e<t.length;e++)n.writeFixed32(t[e])}function fc(t,n){for(var e=0;e<t.length;e++)n.writeSFixed32(t[e])}function dc(t,n){for(var e=0;e<t.length;e++)n.writeFixed64(t[e])}function pc(t,n){for(var e=0;e<t.length;e++)n.writeSFixed64(t[e])}function yc(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+16777216*t[n+3]}function mc(t,n,e){t[e]=n,t[e+1]=n>>>8,t[e+2]=n>>>16,t[e+3]=n>>>24}function gc(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}nc.prototype={destroy:function(){this.buf=null},readFields:function(t,n,e){for(e=e||this.length;this.pos<e;){var r=this.readVarint(),i=r>>3,s=this.pos;this.type=7&r,t(i,n,this),this.pos===s&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=yc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=gc(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=yc(this.buf,this.pos)+4294967296*yc(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=yc(this.buf,this.pos)+4294967296*gc(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=tc.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=tc.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,e,r=this.buf;return n=127&(e=r[this.pos++]),e<128?n:(n|=(127&(e=r[this.pos++]))<<7,e<128?n:(n|=(127&(e=r[this.pos++]))<<14,e<128?n:(n|=(127&(e=r[this.pos++]))<<21,e<128?n:function(t,n,e){var r,i,s=e.buf;if(i=s[e.pos++],r=(112&i)>>4,i<128)return ic(t,r,n);if(i=s[e.pos++],r|=(127&i)<<3,i<128)return ic(t,r,n);if(i=s[e.pos++],r|=(127&i)<<10,i<128)return ic(t,r,n);if(i=s[e.pos++],r|=(127&i)<<17,i<128)return ic(t,r,n);if(i=s[e.pos++],r|=(127&i)<<24,i<128)return ic(t,r,n);if(i=s[e.pos++],r|=(1&i)<<31,i<128)return ic(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(e=r[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,n=this.pos;return this.pos=t,t-n>=12&&ec?function(t,n,e){return ec.decode(t.subarray(n,e))}(this.buf,n,t):function(t,n,e){var r="",i=n;for(;i<e;){var s,o,a,u=t[i],l=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h>e)break;1===h?u<128&&(l=u):2===h?128==(192&(s=t[i+1]))&&(l=(31&u)<<6|63&s)<=127&&(l=null):3===h?(s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&((l=(15&u)<<12|(63&s)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):4===h&&(s=t[i+1],o=t[i+2],a=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((l=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,h=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=h}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==nc.Bytes)return t.push(this.readVarint(n));var e=rc(this);for(t=t||[];this.pos<e;)t.push(this.readVarint(n));return t},readPackedSVarint:function(t){if(this.type!==nc.Bytes)return t.push(this.readSVarint());var n=rc(this);for(t=t||[];this.pos<n;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==nc.Bytes)return t.push(this.readBoolean());var n=rc(this);for(t=t||[];this.pos<n;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==nc.Bytes)return t.push(this.readFloat());var n=rc(this);for(t=t||[];this.pos<n;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==nc.Bytes)return t.push(this.readDouble());var n=rc(this);for(t=t||[];this.pos<n;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==nc.Bytes)return t.push(this.readFixed32());var n=rc(this);for(t=t||[];this.pos<n;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==nc.Bytes)return t.push(this.readSFixed32());var n=rc(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==nc.Bytes)return t.push(this.readFixed64());var n=rc(this);for(t=t||[];this.pos<n;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==nc.Bytes)return t.push(this.readSFixed64());var n=rc(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed64());return t},skip:function(t){var n=7&t;if(n===nc.Varint)for(;this.buf[this.pos++]>127;);else if(n===nc.Bytes)this.pos=this.readVarint()+this.pos;else if(n===nc.Fixed32)this.pos+=4;else{if(n!==nc.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n<this.pos+t;)n*=2;if(n!==this.length){var e=new Uint8Array(n);e.set(this.buf),this.buf=e,this.length=n}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),mc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),mc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),mc(this.buf,-1&t,this.pos),mc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),mc(this.buf,-1&t,this.pos),mc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,n){var e,r;t>=0?(e=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(e=~(-t%4294967296))?e=e+1|0:(e=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn\'t fit into 10 bytes");n.realloc(10),function(t,n,e){e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos]=127&t}(e,0,n),function(t,n){var e=(7&t)<<4;if(n.buf[n.pos++]|=e|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(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 n=this.pos;this.pos=function(t,n,e){for(var r,i,s=0;s<n.length;s++){if((r=n.charCodeAt(s))>55295&&r<57344){if(!i){r>56319||s+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):i=r;continue}if(r<56320){t[e++]=239,t[e++]=191,t[e++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[e++]=239,t[e++]=191,t[e++]=189,i=null);r<128?t[e++]=r:(r<2048?t[e++]=r>>6|192:(r<65536?t[e++]=r>>12|224:(t[e++]=r>>18|240,t[e++]=r>>12&63|128),t[e++]=r>>6&63|128),t[e++]=63&r|128)}return e}(this.buf,t,this.pos);var e=this.pos-n;e>=128&&sc(n,e,this),this.pos=n-1,this.writeVarint(e),this.pos+=e},writeFloat:function(t){this.realloc(4),tc.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),tc.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var e=0;e<n;e++)this.buf[this.pos++]=t[e]},writeRawMessage:function(t,n){this.pos++;var e=this.pos;t(n,this);var r=this.pos-e;r>=128&&sc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,e){this.writeTag(t,nc.Bytes),this.writeRawMessage(n,e)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,oc,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,ac,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,hc,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,uc,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,lc,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,cc,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,fc,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,dc,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,pc,n)},writeBytesField:function(t,n){this.writeTag(t,nc.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,nc.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,nc.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,nc.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,nc.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,nc.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,nc.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,nc.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,nc.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,nc.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}};var vc=Ut,bc=wc;function wc(t,n,e,r,i){this.properties={},this.extent=e,this.type=0,this.Mn=t,this.xn=-1,this.Fn=r,this.An=i,t.readFields(Mc,this,n)}function Mc(t,n,e){1==t?n.id=e.readVarint():2==t?function(t,n){var e=t.readVarint()+t.pos;for(;t.pos<e;){var r=n.Fn[t.readVarint()],i=n.An[t.readVarint()];n.properties[r]=i}}(e,n):3==t?n.type=e.readVarint():4==t&&(n.xn=e.pos)}function xc(t){for(var n,e,r=0,i=0,s=t.length,o=s-1;i<s;o=i++)n=t[i],r+=((e=t[o]).x-n.x)*(n.y+e.y);return r}wc.types=["Unknown","Point","LineString","Polygon"],wc.prototype.loadGeometry=function(){var t=this.Mn;t.pos=this.xn;for(var n,e=t.readVarint()+t.pos,r=1,i=0,s=0,o=0,a=[];t.pos<e;){if(i<=0){var u=t.readVarint();r=7&u,i=u>>3}if(i--,1===r||2===r)s+=t.readSVarint(),o+=t.readSVarint(),1===r&&(n&&a.push(n),n=[]),n.push(new vc(s,o));else{if(7!==r)throw new Error("unknown command "+r);n&&n.push(n[0].clone())}}return n&&a.push(n),a},wc.prototype.bbox=function(){var t=this.Mn;t.pos=this.xn;for(var n=t.readVarint()+t.pos,e=1,r=0,i=0,s=0,o=1/0,a=-1/0,u=1/0,l=-1/0;t.pos<n;){if(r<=0){var h=t.readVarint();e=7&h,r=h>>3}if(r--,1===e||2===e)(i+=t.readSVarint())<o&&(o=i),i>a&&(a=i),(s+=t.readSVarint())<u&&(u=s),s>l&&(l=s);else if(7!==e)throw new Error("unknown command "+e)}return[o,u,a,l]},wc.prototype.toGeoJSON=function(t,n,e){var r,i,s=this.extent*Math.pow(2,e),o=this.extent*t,a=this.extent*n,u=this.loadGeometry(),l=wc.types[this.type];function h(t){for(var n=0;n<t.length;n++){var e=t[n],r=180-360*(e.y+a)/s;t[n]=[360*(e.x+o)/s-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(r=0;r<u.length;r++)c[r]=u[r][0];h(u=c);break;case 2:for(r=0;r<u.length;r++)h(u[r]);break;case 3:for(u=function(t){var n=t.length;if(n<=1)return[t];for(var e,r,i=[],s=0;s<n;s++){var o=xc(t[s]);0!==o&&(void 0===r&&(r=o<0),r===o<0?(e&&i.push(e),e=[t[s]]):e.push(t[s]))}e&&i.push(e);return i}(u),r=0;r<u.length;r++)for(i=0;i<u[r].length;i++)h(u[r][i])}1===u.length?u=u[0]:l="Multi"+l;var f={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Fc=bc,Ac=kc;function kc(t,n){this.version=1,this.name=null,this.extent=4096,this.length=0,this.Mn=t,this.Fn=[],this.An=[],this.kn=[],t.readFields(Pc,this,n),this.length=this.kn.length}function Pc(t,n,e){15===t?n.version=e.readVarint():1===t?n.name=e.readString():5===t?n.extent=e.readVarint():2===t?n.kn.push(e.pos):3===t?n.Fn.push(e.readString()):4===t&&n.An.push(function(t){var n=null,e=t.readVarint()+t.pos;for(;t.pos<e;){var r=t.readVarint()>>3;n=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return n}(e))}kc.prototype.feature=function(t){if(t<0||t>=this.kn.length)throw new Error("feature index out of bounds");this.Mn.pos=this.kn[t];var n=this.Mn.readVarint()+this.Mn.pos;return new Fc(this.Mn,n,this.extent,this.Fn,this.An)};var Sc=Ac;function _c(t,n,e){if(3===t){var r=new Sc(e,e.readVarint()+e.pos);r.length&&(n[r.name]=r)}}var Oc=function(t,n){this.layers=t.readFields(_c,{},n)};class Ec extends Tl{constructor(t,n,e,r,i,s){super(t,n,e,r,i),n=n||{},s()}getTileFeatures(t,n){const e=t.tileInfo.url,r=t.fetchOptions||{};if(this.Nt.has(e)){const{err:t,data:r}=this.Nt.get(e);return setTimeout(()=>{this.Pn(e,t,r,n)},1)}return r.referrer=t.referrer,O.getArrayBuffer(e,r,(t,r)=>{this.Nt&&(t?t.loading||this.Nt.add(e,{err:t,data:r&&r.data}):r&&r.data&&this.Nt.add(e,{err:null,data:r.data}),this.Pn(e,t,r&&r.data,n))})}Pn(t,n,e,r){if(n)return void r(n);let i;try{i=new Oc(new Qh(e))}catch(n){return void r(n.message,[],[])}const s=[];if(!i.layers)return void r(null,s,[]);const o={};let a;for(const t in i.layers)if(u=i.layers,l=t,Object.prototype.hasOwnProperty.call(u,l)){o[t]={types:{}};const e=o[t].types;for(let r=0,o=i.layers[t].length;r<o;r++)try{a=i.layers[t].feature(r),e[a.type]=1;const n={type:a.type,layer:t,geometry:a.loadGeometry(),properties:a.properties,extent:a.extent};void 0!==a.id&&(n.id=a.id);let o=n.properties[bl];o&&(M(o)&&(o=JSON.parse(o)),n.properties[bl]=Xh(o,"EPSG:3857")),s.push(n)}catch(n){console.warn("error when load vt geometry:",n)}}var u,l;for(const t in o)o[t].types=Object.keys(o[t].types).map(t=>+t);r(null,s,o,{byteLength:e.byteLength})}abortTile(t,n){const e=this.requests[t];delete this.requests[t],e&&e.abort&&e.abort(),this.Xt(t),n()}onRemove(){super.onRemove();for(const t in this.requests){const n=this.requests[t];n&&n.abort&&n.abort()}this.requests={}}}let Ic=0;const $c=new ol(128);class Cc{constructor(t){this.Sn={},this._n={},this.workerId=t}addLayer({actorId:t,mapId:n,layerId:e,params:r},i){if(this.On(n,e))return;const s=this.En(n,e),o=r.type,a=r.options,u=this.send.bind(this,t);this.Sn[s]="GeoJSONVectorTileLayer"===o?new Yh(e,a,u,$c,{},i):new Ec(e,a,u,$c,{},i)}removeLayer({mapId:t,layerId:n},e){const r=this.On(t,n),i=this.En(t,n);delete this.Sn[i],r&&r.onRemove(e)}loadTile({mapId:t,layerId:n,params:e},r){const i=this.On(t,n);i&&i.loadTile(e,r)}abortTile({mapId:t,layerId:n,params:e},r){const i=this.On(t,n);i&&i.abortTile&&i.abortTile(e.url,r)}removeTile({mapId:t,layerId:n,params:e},r){const i=this.On(t,n);i&&i.removeTile(e,r)}updateStyle({mapId:t,layerId:n,params:e},r){const i=this.On(t,n);i&&i.updateStyle(e,r)}updateOptions({mapId:t,layerId:n,params:e},r){const i=this.On(t,n);i&&i.updateOptions(e,r)}setData({mapId:t,layerId:n,params:e},r){const i=this.On(t,n);i&&i.setData(e.data,r)}receive(t){const n=t.callback,e=this._n[n];delete this._n[n],e&&t.error?e(new Error(t.error)):e&&e(null,t.data)}send(t,n,e,r,i){const s=i?`${t}-${Ic++}`:null;i&&(this._n[s]=i),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:n,params:e,callback:String(s)},r||[])}En(t,n){return`${t}-${n}`}On(t,n){const e=this.En(t,n);return this.Sn[e]}In(){$c.reset()}}t.initialize=function(){},t.onmessage=function(t,n){const e=t.data;if(this.dispatcher||(this.dispatcher=new Cc(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const r=e.command;this.dispatcher[r]({actorId:t.actorId,mapId:e.mapId,layerId:e.layerId,params:e.params},(t,e,i)=>{t&&404!==t.status&&204!==t.status&&console.error(r,t),n(t,e,i)})}},Object.defineProperty(t,"$n",{value:!0})}';
37
37
 
38
38
  let J = 0;
39
39
 
40
- function K() {
40
+ function Z() {
41
41
  return J++;
42
42
  }
43
43
 
44
- const Z = "function" == typeof Object.assign;
44
+ const K = "function" == typeof Object.assign;
45
45
 
46
46
  function Q(t, ...e) {
47
- if (Z) return Object.assign(t, ...e), t;
47
+ if (K) return Object.assign(t, ...e), t;
48
48
  for (let n = 0; n < e.length; n++) {
49
49
  const i = e[n];
50
50
  for (const e in i) t[e] = i[e];
@@ -104,7 +104,7 @@ class ut extends t.worker.Actor {
104
104
  constructor(t, e) {
105
105
  super(t);
106
106
  const n = e.getMap().id;
107
- this.t = e, this.i = n, this.s = "vt_" + K();
107
+ this.t = e, this.i = n, this.s = "vt_" + Z();
108
108
  const i = e.getJSONType();
109
109
  this.o = ht.indexOf(i) >= 0, this.l = {}, this.h = new v({
110
110
  iconErrorUrl: e.options.iconErrorUrl,
@@ -342,7 +342,7 @@ class vt {
342
342
  aPosition: yt
343
343
  }, null, yt.length / 2, {
344
344
  positionSize: 2
345
- })).generateBuffers(t), this.D = new n.Scene, this.R = [], this.L = 0, this.N = e,
345
+ })).generateBuffers(t), this.D = new n.Scene, this.N = [], this.L = 0, this.R = e,
346
346
  this.A = i, this.M(t);
347
347
  }
348
348
  start() {
@@ -361,10 +361,10 @@ class vt {
361
361
  }
362
362
  H() {
363
363
  const t = this.L++;
364
- return this.R[t] || (this.R[t] = new n.Mesh(this.C)), this.R[t];
364
+ return this.N[t] || (this.N[t] = new n.Mesh(this.C)), this.N[t];
365
365
  }
366
366
  M(t) {
367
- const e = this.N, i = {
367
+ const e = this.R, i = {
368
368
  viewport: {
369
369
  x: 0,
370
370
  y: 0,
@@ -408,8 +408,8 @@ class vt {
408
408
  }
409
409
  remove() {
410
410
  this.C.dispose();
411
- for (let t = 0; t < this.R.length; t++) this.R[t].dispose();
412
- this.R.length = 0, this.U.dispose();
411
+ for (let t = 0; t < this.N.length; t++) this.N[t].dispose();
412
+ this.N.length = 0, this.U.dispose();
413
413
  }
414
414
  }
415
415
 
@@ -496,7 +496,7 @@ function Dt(t) {
496
496
  return 3 === t.length && (Et[3] = 255), Et;
497
497
  }
498
498
 
499
- function Rt(t, e = 4) {
499
+ function Nt(t, e = 4) {
500
500
  return Lt.bind(this, t, e);
501
501
  }
502
502
 
@@ -510,7 +510,7 @@ function Lt(t, e, n) {
510
510
  return 3 === i.length && 4 === e && i.push(1), t && (t[n] = i), i;
511
511
  }
512
512
 
513
- function Nt(t, e, n, i) {
513
+ function Rt(t, e, n, i) {
514
514
  if (t.fill) t.fill(e, n, i); else for (let r = n; r < i; r++) t[r] = e;
515
515
  }
516
516
 
@@ -544,7 +544,7 @@ const Gt = [], Wt = [ 0, 0, 0, 0 ], Xt = new t.Point(0, 0), Yt = {
544
544
  color: Wt,
545
545
  depth: 1,
546
546
  stencil: 0
547
- }, $t = t => t.isTerrainSkin(), qt = t => t.isTerrainVector();
547
+ }, qt = t => t.isTerrainSkin(), $t = t => t.isTerrainVector();
548
548
 
549
549
  class Jt extends t.renderer.TileLayerCanvasRenderer {
550
550
  supportRenderMode() {
@@ -568,23 +568,23 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
568
568
  }
569
569
  setStyle(t) {
570
570
  if (this.Y && this.Y.update(), this.X) {
571
- this.j++, this.$();
572
- const e = this.layer.q();
571
+ this.j++, this.q();
572
+ const e = this.layer.$();
573
573
  e.styleCounter = this.j, this.X.updateStyle(e, e => {
574
574
  if (e) throw new Error(e);
575
- t || (this.J = !0, this.K(), this.setToRedraw()), this.layer.fire("refreshstyle");
575
+ t || (this.J = !0, this.Z(), this.setToRedraw()), this.layer.fire("refreshstyle");
576
576
  });
577
- } else this.K();
577
+ } else this.Z();
578
578
  }
579
- $() {
580
- if (this.Z) for (const t in this.Z) {
581
- const e = this.Z[t];
579
+ q() {
580
+ if (this.K) for (const t in this.K) {
581
+ const e = this.K[t];
582
582
  e && this.deleteTile(e);
583
583
  }
584
- this.Z = this.tilesInView;
584
+ this.K = this.tilesInView;
585
585
  const t = this.tileCache;
586
- for (const e in this.Z) {
587
- const n = this.Z[e];
586
+ for (const e in this.K) {
587
+ const n = this.K[e];
588
588
  n && n.info && t.getAndRemove(n.info.id);
589
589
  }
590
590
  t.reset(), this.tilesInView = {}, this.tilesLoading = {}, this.B = {}, this._parentTiles = [],
@@ -594,14 +594,14 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
594
594
  this.X && this.X.updateOptions(this.layer.getWorkerOptions(), e => {
595
595
  if (e) throw new Error(e);
596
596
  (t.features || t.pickingGeometry || t.altitudeProperty) && (this.clear(), this.tt(),
597
- this.K()), this.setToRedraw();
597
+ this.Z()), this.setToRedraw();
598
598
  });
599
599
  }
600
600
  updateSceneConfig(t, e, n) {
601
601
  const i = 0 === t ? this.et() : this.nt();
602
602
  if (!i || !i[e]) return;
603
603
  this.J = !0;
604
- const r = this.layer.q(), s = this.layer.it(t, r);
604
+ const r = this.layer.$(), s = this.layer.it(t, r);
605
605
  i[e].config = s[e].renderPlugin, i[e].updateSceneConfig({
606
606
  sceneConfig: n
607
607
  }), this.setToRedraw();
@@ -613,7 +613,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
613
613
  updateSymbol(t, e, n) {
614
614
  const i = 0 === t ? this.et() : this.nt();
615
615
  if (!i || !i[e]) return !1;
616
- const r = this.layer.q(), s = this.layer.it(t, r), o = i[e];
616
+ const r = this.layer.$(), s = this.layer.it(t, r), o = i[e];
617
617
  o.style = s[e];
618
618
  const a = o.updateSymbol(n, s[e].symbol);
619
619
  return !a && function t(e) {
@@ -709,10 +709,10 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
709
709
  return Gt;
710
710
  }
711
711
  _drawTiles(t, e, n, i, r) {
712
- if (super._drawTiles(t, e, n, i, r), this.Z) if (Object.keys(this.Z).length) for (const t in this.Z) {
713
- const e = this.Z[t];
712
+ if (super._drawTiles(t, e, n, i, r), this.K) if (Object.keys(this.K).length) for (const t in this.K) {
713
+ const e = this.K[t];
714
714
  this.tileCache.has(e.id) || this._drawTile(e.info, e.image, r);
715
- } else this.ct(), delete this.Z;
715
+ } else this.ct(), delete this.K;
716
716
  }
717
717
  ct() {
718
718
  const t = this.j, e = [], n = [];
@@ -736,7 +736,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
736
736
  const n = this.layer;
737
737
  if (this.prepareCanvas(), !this.ready || !n.ready) return void this.completeRender();
738
738
  let i = this.G[this.j];
739
- i || (this.K(), this.dt(), i = this.et());
739
+ i || (this.Z(), this.dt(), i = this.et());
740
740
  const r = this.nt();
741
741
  n.isDefaultRender() || i.length || r.length ? (n.options.collision && n.clearCollisionIndex(),
742
742
  this.pt = t, this.yt = this.gt(this.getMap().getGLRes()), this.vt = e || {}, this.xt(t),
@@ -889,7 +889,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
889
889
  }
890
890
  o && i.Dt();
891
891
  const h = s[0].z, u = this.layer.getDataSchema(h);
892
- if (this.Rt(u, n.schema), delete n.features, r && n.data.length !== l.length) {
892
+ if (this.Nt(u, n.schema), delete n.features, r && n.data.length !== l.length) {
893
893
  const t = n.data;
894
894
  n.data = [];
895
895
  for (let e = 0; e < t.length; e++) t[e] && t[e].features && n.data.push(t[e]);
@@ -907,7 +907,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
907
907
  layers: Qt(Object.values(a))
908
908
  });
909
909
  }
910
- const r = 0 === t ? n : Kt(n);
910
+ const r = 0 === t ? n : Zt(n);
911
911
  for (let t = 0; t < r.data.length; t++) {
912
912
  if (!r.data[t]) continue;
913
913
  const n = r.data[t].features;
@@ -915,7 +915,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
915
915
  n[t].tile = e;
916
916
  }
917
917
  }
918
- e.extent = r && r.extent, this.onTileLoad(r, e);
918
+ e.extent = r && r.extent, r.features = Object.values(a), this.onTileLoad(r, e);
919
919
  }
920
920
  this.layer.fire("datareceived", {
921
921
  url: t
@@ -933,7 +933,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
933
933
  } : null
934
934
  };
935
935
  }
936
- Rt(t, e) {
936
+ Nt(t, e) {
937
937
  for (const n in e) {
938
938
  t[n] || (t[n] = {
939
939
  types: e[n].types,
@@ -948,15 +948,15 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
948
948
  const i = this.layer;
949
949
  let r, s = !1;
950
950
  if (i.isDefaultRender() && 0 === t) {
951
- let t = this.Nt;
952
- t || (t = this.Nt = {});
951
+ let t = this.Rt;
952
+ t || (t = this.Rt = {});
953
953
  const e = n.layer, i = n.type;
954
954
  t[e] || (t[e] = []);
955
955
  const o = ("plugin_" + i).trim();
956
956
  t[e][o] ? r = t[e][o] : (r = this.Ht(i), r.filter = n.filter, t[e].push(r), t[e][o] = r,
957
957
  s = !0);
958
958
  } else {
959
- const o = i.q(), a = i.it(t, o), l = this.et();
959
+ const o = i.$(), a = i.it(t, o), l = this.et();
960
960
  if (r = a[e], !r.renderPlugin) {
961
961
  s = !0;
962
962
  const {plugin: t, symbol: i, renderPlugin: o} = this.Ht(n.type);
@@ -971,21 +971,21 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
971
971
  rt(t) {
972
972
  const e = t && t.style;
973
973
  let n = this.et(e) || [];
974
- this.layer.isDefaultRender() && this.Nt && (n = [], t ? t.layers && t.layers.forEach(t => {
974
+ this.layer.isDefaultRender() && this.Rt && (n = [], t ? t.layers && t.layers.forEach(t => {
975
975
  if (!t) return;
976
976
  const e = ("plugin_" + t.type).trim();
977
- n.push(this.Nt[t.layer][e].plugin);
978
- }) : Object.keys(this.Nt).forEach(t => {
979
- for (let e = 0; e < this.Nt[t].length; e++) n.push(this.Nt[t][e].plugin);
977
+ n.push(this.Rt[t.layer][e].plugin);
978
+ }) : Object.keys(this.Rt).forEach(t => {
979
+ for (let e = 0; e < this.Rt[t].length; e++) n.push(this.Rt[t][e].plugin);
980
980
  }));
981
981
  const i = this.nt(e);
982
982
  return i && i.length && (n = n.slice(), st(n, i)), n;
983
983
  }
984
984
  Pt() {
985
- if (this.layer.isDefaultRender() && this.Nt) {
985
+ if (this.layer.isDefaultRender() && this.Rt) {
986
986
  const t = [];
987
- return Object.keys(this.Nt).forEach(e => {
988
- for (let n = 0; n < this.Nt[e].length; n++) t.push(this.Nt[e][n].plugin);
987
+ return Object.keys(this.Rt).forEach(e => {
988
+ for (let n = 0; n < this.Rt[e].length; n++) t.push(this.Rt[e][n].plugin);
989
989
  }), t;
990
990
  }
991
991
  const t = [];
@@ -1000,7 +1000,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1000
1000
  return rt(t) && (t = this.j), this.W[t] || Gt;
1001
1001
  }
1002
1002
  xt(t, e) {
1003
- const n = !!this.zt, i = this.layer.isDefaultRender() && this.Nt, r = this.vt;
1003
+ const n = !!this.zt, i = this.layer.isDefaultRender() && this.Rt, r = this.vt;
1004
1004
  this.Pt().forEach((s, o) => {
1005
1005
  if (!s || e && !e(s)) return;
1006
1006
  if (!this.Tt(o)) return;
@@ -1023,13 +1023,13 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1023
1023
  this.layer.options.collision && !e.isPostProcess ? s.forEach(e => {
1024
1024
  if (!this.Tt(e) || !e.hasMesh()) return;
1025
1025
  if (n && "default" !== n && !e.supportRenderMode(n)) return;
1026
- if (o && !qt(e)) return;
1026
+ if (o && !$t(e)) return;
1027
1027
  const i = this.Vt(e, 0, r, t);
1028
1028
  e.prepareRender(i), e.updateCollision(i);
1029
1029
  }) : s.forEach(e => {
1030
1030
  if (!this.Tt(e) || !e.hasMesh()) return;
1031
1031
  if (n && "default" !== n && !e.supportRenderMode(n)) return;
1032
- if (o && !qt(e)) return;
1032
+ if (o && !$t(e)) return;
1033
1033
  const i = this.Vt(e, 0, r, t);
1034
1034
  e.prepareRender(i);
1035
1035
  });
@@ -1042,7 +1042,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1042
1042
  s.forEach((e, s) => {
1043
1043
  if (!this.Ut(e)) return;
1044
1044
  if (n && "default" !== n && !e.supportRenderMode(n)) return;
1045
- if (o && !qt(e)) return;
1045
+ if (o && !$t(e)) return;
1046
1046
  this.regl.clear({
1047
1047
  stencil: 255,
1048
1048
  framebuffer: i
@@ -1072,7 +1072,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1072
1072
  return !n || !i && !r ? 0 : r ? 2 : 1;
1073
1073
  }
1074
1074
  Vt(t, e, n, i) {
1075
- const r = !!this.zt, s = r && t && $t(t), o = this.regl, a = this.gl, l = {
1075
+ const r = !!this.zt, s = r && t && qt(t), o = this.regl, a = this.gl, l = {
1076
1076
  regl: o,
1077
1077
  layer: this.layer,
1078
1078
  gl: a,
@@ -1097,13 +1097,13 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1097
1097
  i || (i = this.Wt = new vt(this.regl, this.canvas, this.getMap())), i.start();
1098
1098
  const {tiles: r} = this.Xt;
1099
1099
  let {parentTiles: s, childTiles: o} = this.Xt, a = 1;
1100
- o = o.sort(Zt);
1100
+ o = o.sort(Kt);
1101
1101
  for (let t = 0; t < o.length; t++) this.Yt(o[t].info, e ? a : this.getTileLevelValue(o[t].info.z, n)),
1102
1102
  a++;
1103
- s = s.sort(Zt);
1103
+ s = s.sort(Kt);
1104
1104
  for (let t = 0; t < s.length; t++) this.Yt(s[t].info, e ? a : this.getTileLevelValue(s[t].info.z, n)),
1105
1105
  a++;
1106
- const l = r.sort(Zt);
1106
+ const l = r.sort(Kt);
1107
1107
  for (let t = l.length - 1; t >= 0; t--) this.Yt(l[t].info, e ? a : this.getTileLevelValue(l[t].info.z, n)),
1108
1108
  a++;
1109
1109
  i.render(t);
@@ -1144,7 +1144,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1144
1144
  width: n,
1145
1145
  height: i
1146
1146
  });
1147
- this.$t || (this.$t = t.renderbuffer({
1147
+ this.qt || (this.qt = t.renderbuffer({
1148
1148
  width: n,
1149
1149
  height: i,
1150
1150
  format: "depth24 stencil8"
@@ -1156,7 +1156,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1156
1156
  colorFormat: "rgba",
1157
1157
  ignoreStatusCheck: !0
1158
1158
  };
1159
- s.depthStencil = this.$t;
1159
+ s.depthStencil = this.qt;
1160
1160
  const o = t.framebuffer(s);
1161
1161
  return o.colorTex = r, o;
1162
1162
  }
@@ -1172,28 +1172,28 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1172
1172
  renderTarget: {
1173
1173
  fbo: i
1174
1174
  }
1175
- }, Yt.framebuffer = i, t.clear(Yt), this.vt.viewport = te(s), this.qt(n[e].tile, i);
1175
+ }, Yt.framebuffer = i, t.clear(Yt), this.vt.viewport = te(s), this.$t(n[e].tile, i);
1176
1176
  }
1177
1177
  this.Jt(n), this.vt = r;
1178
1178
  }
1179
- qt(t) {
1179
+ $t(t) {
1180
1180
  const {info: e, image: n} = t;
1181
- this.drawTile(e, n, $t);
1181
+ this.drawTile(e, n, qt);
1182
1182
  }
1183
1183
  Jt(t) {
1184
1184
  const e = this.Pt(), n = this.getMap().cameraPosition, i = this.ft || 0;
1185
1185
  this.layer.options.collision ? e.forEach(t => {
1186
1186
  if (!this.Tt(t) || !t.hasMesh()) return;
1187
- if (!$t(t) || !this.layer.options.awareOfTerrain) return;
1187
+ if (!qt(t) || !this.layer.options.awareOfTerrain) return;
1188
1188
  const e = this.Vt(t, 0, n, i);
1189
1189
  e.isRenderingTerrainSkin = !0, t.prepareRender(e), t.updateCollision(e);
1190
1190
  }) : e.forEach(t => {
1191
1191
  if (!this.Tt(t) || !t.hasMesh()) return;
1192
- if (!$t(t) || !this.layer.options.awareOfTerrain) return;
1192
+ if (!qt(t) || !this.layer.options.awareOfTerrain) return;
1193
1193
  const e = this.Vt(t, 0, n, i);
1194
1194
  e.isRenderingTerrainSkin = !0, t.prepareRender(e);
1195
1195
  }), e.forEach((e, n) => {
1196
- if (!this.Ut(e) || !$t(e)) return;
1196
+ if (!this.Ut(e) || !qt(e)) return;
1197
1197
  for (let e = 0; e < t.length; e++) {
1198
1198
  const n = t[e].texture;
1199
1199
  this.regl.clear({
@@ -1213,7 +1213,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1213
1213
  if (!s || n && !n(s)) return;
1214
1214
  if (!u[c]) return;
1215
1215
  if (!r[c]) return;
1216
- const f = i && $t(s), d = this.regl, p = this.gl, m = {
1216
+ const f = i && qt(s), d = this.regl, p = this.gl, m = {
1217
1217
  regl: d,
1218
1218
  layer: this.layer,
1219
1219
  gl: p,
@@ -1236,9 +1236,9 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1236
1236
  const y = s.paintTile(m);
1237
1237
  !this.J && (y.retire || y.redraw) && s.supportRenderMode("taa") && (this.J = !0),
1238
1238
  y.redraw && this.setToRedraw();
1239
- }), e && e.style === this.j && this.Kt(t), this.setCanvasUpdated();
1239
+ }), e && e.style === this.j && this.Zt(t), this.setCanvasUpdated();
1240
1240
  }
1241
- Zt(t, e) {
1241
+ Kt(t, e) {
1242
1242
  if (!e.loadTime || e.Ct) return;
1243
1243
  let n = e.cache;
1244
1244
  n || (n = e.cache = {});
@@ -1247,7 +1247,7 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1247
1247
  this.rt(e).forEach((r, h) => {
1248
1248
  if (!r) return;
1249
1249
  if (!l[h]) return;
1250
- const u = i && $t(r), c = this.regl, f = this.gl;
1250
+ const u = i && qt(r), c = this.regl, f = this.gl;
1251
1251
  n[h] || (n[h] = {});
1252
1252
  const d = {
1253
1253
  regl: c,
@@ -1318,8 +1318,8 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1318
1318
  this.Wt && this.Wt.remove(), this.X && (this.X.removeLayer(t => {
1319
1319
  if (t) throw t;
1320
1320
  }), this.X.remove(), delete this.X), this.pickingFBO && (this.canvas.pickingFBO || this.pickingFBO.destroy(),
1321
- delete this.pickingFBO), this.lt && (this.lt.delete(), delete this.lt), this.$t && (this.$t.destroy(),
1322
- delete this.$t), this.Y && (this.Y.dispose(), delete this.Y), super.onRemove && super.onRemove(),
1321
+ delete this.pickingFBO), this.lt && (this.lt.delete(), delete this.lt), this.qt && (this.qt.destroy(),
1322
+ delete this.qt), this.Y && (this.Y.dispose(), delete this.Y), super.onRemove && super.onRemove(),
1323
1323
  this.tt();
1324
1324
  }
1325
1325
  tt() {
@@ -1332,8 +1332,8 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1332
1332
  const e = this.gl, n = new Uint8Array(4), i = this.canvas.height;
1333
1333
  return e.readPixels(t.x, i - t.y, 1, 1, e.RGBA, e.UNSIGNED_BYTE, n), n[3] > 0;
1334
1334
  }
1335
- K() {
1336
- const {style: t, featureStyle: e} = this.layer.q(), n = t.map((t, e) => {
1335
+ Z() {
1336
+ const {style: t, featureStyle: e} = this.layer.$(), n = t.map((t, e) => {
1337
1337
  const n = t.renderPlugin;
1338
1338
  if (!n) return null;
1339
1339
  if (!n.type) throw new Error("invalid plugin type for style at " + e);
@@ -1518,16 +1518,29 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1518
1518
  return this.setToRedraw(), this.J = !0, super.setZIndex.apply(this, arguments);
1519
1519
  }
1520
1520
  consumeTile(t, e) {
1521
- this.Kt(e), super.consumeTile(t, e), this.Zt(e, t);
1521
+ if (this.Zt(e), super.consumeTile(t, e), "transient" === this.layer.options.features && t.data) {
1522
+ for (let e = 0; e < t.data.length; e++) {
1523
+ if (!t.data[e]) continue;
1524
+ const n = t.data[e].features;
1525
+ if (n) for (const t in n) {
1526
+ const e = n[t] && n[t].feature;
1527
+ e && (e.fnTypeProps ? e.customProps[wt] = e.fnTypeProps : n[t] = null);
1528
+ }
1529
+ }
1530
+ this.layer.fire("_transientfeature", {
1531
+ tileImage: t
1532
+ });
1533
+ }
1534
+ t && t.features && (t.features = []), this.Kt(e, t);
1522
1535
  }
1523
1536
  onTileError(t, e) {
1524
- this.Kt(e), super.onTileError(t, e);
1537
+ this.Zt(e), super.onTileError(t, e);
1525
1538
  }
1526
- Kt(t) {
1539
+ Zt(t) {
1527
1540
  const {id: e} = t;
1528
- if (this.Z && this.Z[e]) {
1529
- const t = this.Z[e];
1530
- this.deleteTile(t), delete this.Z[e];
1541
+ if (this.K && this.K[e]) {
1542
+ const t = this.K[e];
1543
+ this.deleteTile(t), delete this.K[e];
1531
1544
  }
1532
1545
  }
1533
1546
  highlight(t) {
@@ -1557,14 +1570,14 @@ class Jt extends t.renderer.TileLayerCanvasRenderer {
1557
1570
  }
1558
1571
  }
1559
1572
 
1560
- function Kt(t) {
1573
+ function Zt(t) {
1561
1574
  let e;
1562
1575
  Array.isArray(t.data) ? (e = [], st(e, t.data)) : (e = {}, Q(e, t.data));
1563
1576
  const n = Q({}, t);
1564
1577
  return n.data = e, n;
1565
1578
  }
1566
1579
 
1567
- function Zt(t, e) {
1580
+ function Kt(t, e) {
1568
1581
  return e.info.z - t.info.z;
1569
1582
  }
1570
1583
 
@@ -1608,7 +1621,7 @@ function ne(t, e, n) {
1608
1621
  const r = t[i], s = Q({}, r), {renderPlugin: o} = r, a = Q({}, o);
1609
1622
  a.sceneConfig && !Object.keys(a.sceneConfig).length && delete a.sceneConfig;
1610
1623
  let l = -1;
1611
- for (let t = n.length - 1; t >= 0; t--) if (N(a, n[t])) {
1624
+ for (let t = n.length - 1; t >= 0; t--) if (R(a, n[t])) {
1612
1625
  l = t;
1613
1626
  break;
1614
1627
  }
@@ -1644,7 +1657,7 @@ Jt.include({
1644
1657
 
1645
1658
  const ie = "function" == typeof fetch && "function" == typeof AbortController, re = {
1646
1659
  jsonp: function(t, e) {
1647
- const n = "_maptalks_jsonp_" + K();
1660
+ const n = "_maptalks_jsonp_" + Z();
1648
1661
  t.match(/\?/) ? t += "&callback=" + n : t += "?callback=" + n;
1649
1662
  let i = document.createElement("script");
1650
1663
  return i.type = "text/javascript", i.src = t, window[n] = function(t) {
@@ -1824,7 +1837,7 @@ class he extends t.TileLayer {
1824
1837
  style: this.isDefaultRender() ? {
1825
1838
  style: [],
1826
1839
  featureStyle: []
1827
- } : this.q(),
1840
+ } : this.$(),
1828
1841
  features: this.options.debugTileData || this.options.features,
1829
1842
  schema: this.options.schema,
1830
1843
  pickingGeometry: this.options.pickingGeometry,
@@ -2140,15 +2153,15 @@ class he extends t.TileLayer {
2140
2153
  polygonOpacity: 1
2141
2154
  }
2142
2155
  });
2143
- const t = this.q().background || {};
2156
+ const t = this.$().background || {};
2144
2157
  return this.Ie.enable = t.enable, this.Ie.symbol.polygonFill = t.color, this.Ie.symbol.polygonOpacity = t.opacity,
2145
2158
  this.Ie.symbol.polygonPatternFile = t.patternFile, this.Ie.renderPlugin.sceneConfig.depthRange = t.depthRange,
2146
2159
  this.Ie;
2147
2160
  }
2148
2161
  getComputedStyle() {
2149
- return JSON.parse(JSON.stringify(this.q()));
2162
+ return JSON.parse(JSON.stringify(this.$()));
2150
2163
  }
2151
- q() {
2164
+ $() {
2152
2165
  return {
2153
2166
  background: this.be,
2154
2167
  style: this.xe || [],
@@ -2358,17 +2371,17 @@ class ve extends he {
2358
2371
  }
2359
2372
  setData(t) {
2360
2373
  if (this.options.data = t, t && (tt(t) || t.url)) {
2361
- return !!this.getRenderer() && this.Re(), this;
2374
+ return !!this.getRenderer() && this.Ne(), this;
2362
2375
  }
2363
- return this.Le(t), this.Re(), this;
2376
+ return this.Le(t), this.Ne(), this;
2364
2377
  }
2365
2378
  Le(t) {
2366
2379
  if (this.options.convertFn) {
2367
2380
  t = new Function("data", this.options.convertFn + "\nreturn convert(data)")(t);
2368
2381
  }
2369
- return this.features = t, this.Ne(), this;
2382
+ return this.features = t, this.Re(), this;
2370
2383
  }
2371
- Re() {
2384
+ Ne() {
2372
2385
  const t = this.getRenderer();
2373
2386
  if (t) {
2374
2387
  const e = t.getWorkerConnection();
@@ -2410,7 +2423,7 @@ class ve extends he {
2410
2423
  static fromJSON(t) {
2411
2424
  return t && "GeoJSONVectorTileLayer" === t.type ? new ve(t.id, t.options) : null;
2412
2425
  }
2413
- Ne() {
2426
+ Re() {
2414
2427
  if (!this.features) return;
2415
2428
  if (this.features = JSON.parse(JSON.stringify(this.features)), !this.features) return;
2416
2429
  let t = 0;
@@ -2914,11 +2927,15 @@ function Oe(e, n, i) {
2914
2927
  } else if (e instanceof t.Polygon || e instanceof t.MultiPolygon) {
2915
2928
  u = 3, e instanceof t.Circle || e instanceof t.Rectangle || e instanceof t.Ellipse || e instanceof t.Sector ? a = [ [ e.getShell() ] ] : e instanceof t.Polygon && (a = [ a ]);
2916
2929
  let n = 0;
2917
- for (let t = 0; t < a.length; t++) for (let e = 0; e < a[t].length; e++) {
2918
- l[n] = [], h[n] = [];
2919
- for (let i = 0; i < a[t][e].length; i++) s.coordToPointAtRes(a[t][e][i], o, Pe),
2920
- l[n].push([ Pe.x, Pe.y, a[t][e][i].z || 0 ]), h[n].push([ a[t][e][i].x, a[t][e][i].y ]);
2921
- n++;
2930
+ for (let t = 0; t < a.length; t++) {
2931
+ let e = !1;
2932
+ for (let i = 0; i < a[t].length; i++) {
2933
+ if (l[n] = [], h[n] = [], e) for (let e = a[t][i].length - 1; e >= 0; e--) s.coordToPointAtRes(a[t][i][e], o, Pe),
2934
+ l[n].push([ Pe.x, Pe.y, a[t][i][e].z || 0 ]), h[n].push([ a[t][i][e].x, a[t][i][e].y ]); else for (let e = 0; e < a[t][i].length; e++) s.coordToPointAtRes(a[t][i][e], o, Pe),
2935
+ l[n].push([ Pe.x, Pe.y, a[t][i][e].z || 0 ]), h[n].push([ a[t][i][e].x, a[t][i][e].y ]);
2936
+ 0 === i && (e = A.calculateSignedArea(l[n]) < 0, e && (l[n] = l[n].reverse(), h[n] = h[n].reverse())),
2937
+ n++;
2938
+ }
2922
2939
  }
2923
2940
  }
2924
2941
  const c = e.getProperties() ? Object.assign({}, e.getProperties()) : {}, f = e._getInternalSymbol() || function(e) {
@@ -2990,25 +3007,25 @@ const Ce = "_symbol_".trim(), Ee = "__fea_idx".trim();
2990
3007
 
2991
3008
  let De = new Float32Array(1);
2992
3009
 
2993
- const Re = [];
3010
+ const Ne = [];
2994
3011
 
2995
3012
  class Le extends t.renderer.CanvasRenderer {
2996
3013
  constructor(...t) {
2997
3014
  super(...t), this.features = {}, this.Be = {}, this.L = 0, this.Ge = {}, this.We = {},
2998
- this.Xe = {}, this.Ye = {}, this.$e = {}, this.qe = !0, this.Je = {
3015
+ this.Xe = {}, this.Ye = {}, this.qe = {}, this.$e = !0, this.Je = {
2999
3016
  id: 0,
3000
3017
  pickingId: 0
3001
- }, this.Ke = {};
3018
+ }, this.Ze = {};
3002
3019
  }
3003
3020
  hasNoAARendering() {
3004
3021
  return !0;
3005
3022
  }
3006
3023
  needToRedraw() {
3007
3024
  const t = super.needToRedraw();
3008
- return t || (this.painter && this.painter.needToRedraw() || this.Ze && this.Ze.needToRedraw() || this.Qe && this.Qe.needToRedraw());
3025
+ return t || (this.painter && this.painter.needToRedraw() || this.Ke && this.Ke.needToRedraw() || this.Qe && this.Qe.needToRedraw());
3009
3026
  }
3010
3027
  getAnalysisMeshes() {
3011
- return this.painter && this.painter.getAnalysisMeshes() || Re;
3028
+ return this.painter && this.painter.getAnalysisMeshes() || Ne;
3012
3029
  }
3013
3030
  getRayCastData() {
3014
3031
  return null;
@@ -3018,8 +3035,8 @@ class Le extends t.renderer.CanvasRenderer {
3018
3035
  const n = this.layer;
3019
3036
  this.prepareCanvas(), this.yt = this.gt(this.getMap().getGLRes()), this.vt = e || {};
3020
3037
  const i = this.vt.renderMode, r = this.tn();
3021
- if (this.xt(r, i), this.qe) this.buildMesh(), this.en(), this.nn(), this.Ke = {},
3022
- this.in = !1, this.qe = !1, this.rn = !1; else if (this.in) {
3038
+ if (this.xt(r, i), this.$e) this.buildMesh(), this.en(), this.nn(), this.Ze = {},
3039
+ this.in = !1, this.$e = !1, this.rn = !1; else if (this.in) {
3023
3040
  const t = this.atlas, e = this.sn, n = this.an;
3024
3041
  delete this.atlas, delete this.sn, delete this.an, this.buildMesh(t), this.en(e),
3025
3042
  this.nn(n), this.in = !1, this.rn = !1;
@@ -3041,15 +3058,15 @@ class Le extends t.renderer.CanvasRenderer {
3041
3058
  o = this.meshes && this.meshes.length ? o - 1 : o, r.polygonOffsetIndex = (r.polygonOffsetIndex || 0) + o,
3042
3059
  a = this.Qe.render(r).drawCount, r.polygonOffsetIndex = t;
3043
3060
  }
3044
- if (1 === this.layer.options.meshRenderOrder && this.pn(r, a ? o - 1 : o, i), this.ln && (s || this.Ze.supportRenderMode(i))) {
3061
+ if (1 === this.layer.options.meshRenderOrder && this.pn(r, a ? o - 1 : o, i), this.ln && (s || this.Ke.supportRenderMode(i))) {
3045
3062
  const e = !this.vt.timestamp || this.vt.isFinalRender, i = !this.mn || this.mn !== t;
3046
3063
  n.options.collision && i && n.clearCollisionIndex();
3047
3064
  const s = this.layer.options.sceneConfig;
3048
- this.Ze.sceneConfig.collision = !s || (!!rt(s.collision) || s.collision), this.Ze.startFrame(r),
3049
- this.Ze.addMesh(this.ln, null, {
3065
+ this.Ke.sceneConfig.collision = !s || (!!rt(s.collision) || s.collision), this.Ke.startFrame(r),
3066
+ this.Ke.addMesh(this.ln, null, {
3050
3067
  bloom: this.vt.bloom
3051
- }), this.Ze.prepareRender(r), n.options.collision && i && (this.Ze.updateCollision(r),
3052
- e && (this.mn = t)), this.Ze.render(r);
3068
+ }), this.Ke.prepareRender(r), n.options.collision && i && (this.Ke.updateCollision(r),
3069
+ e && (this.mn = t)), this.Ke.render(r);
3053
3070
  }
3054
3071
  (s || e && e.isFinalRender) && (this.completeRender(), this.layer.fire("canvasisdirty"));
3055
3072
  }
@@ -3116,7 +3133,7 @@ class Le extends t.renderer.CanvasRenderer {
3116
3133
  }
3117
3134
  }
3118
3135
  if (n.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
3119
- delete this.meshes), this.ln && (this.Ze.deleteMesh(this.ln), delete this.ln), this.hn && (this.Qe.deleteMesh(this.hn),
3136
+ delete this.meshes), this.ln && (this.Ke.deleteMesh(this.ln), delete this.ln), this.hn && (this.Qe.deleteMesh(this.hn),
3120
3137
  delete this.hn)), i[3] && (i[0] /= i[3], i[1] /= i[3]), isNaN(i[0]) || isNaN(i[1])) throw new Error("invalid geometry coordinates for " + this.layer.getJSONType());
3121
3138
  return {
3122
3139
  features: n,
@@ -3216,14 +3233,14 @@ class Le extends t.renderer.CanvasRenderer {
3216
3233
  }
3217
3234
  en(t) {
3218
3235
  const e = Object.keys(this.Xe), n = Object.keys(this.Ye);
3219
- if (!e.length && !n.length) return void (this.ln && (this.Ze.deleteMesh(this.ln),
3236
+ if (!e.length && !n.length) return void (this.ln && (this.Ke.deleteMesh(this.ln),
3220
3237
  delete this.ln));
3221
3238
  const {features: s, center: o} = this.gn(this.Xe, this.Ye), a = [], l = [];
3222
3239
  for (let t = 0; t < s.length; t++) {
3223
3240
  const e = s[t][Ee];
3224
3241
  this.Xe[e] && a.push(s[t]), this.Ye[e] && l.push(s[t]);
3225
3242
  }
3226
- if (!a.length && !l.length) return void (this.ln && (this.Ze.deleteMesh(this.ln),
3243
+ if (!a.length && !l.length) return void (this.ln && (this.Ke.deleteMesh(this.ln),
3227
3244
  delete this.ln));
3228
3245
  const h = this.un;
3229
3246
  this.Pn = o;
@@ -3231,23 +3248,23 @@ class Le extends t.renderer.CanvasRenderer {
3231
3248
  this.sn = {};
3232
3249
  const c = [], f = [];
3233
3250
  this.kn = !0, Promise.all(u).then(t => {
3234
- if (this.ln && (this.Ze.deleteMesh(this.ln), delete this.ln), !t || !t.length) return void this.setToRedraw();
3235
- const e = this.Ze.createGeometries(t.map(t => (t && t.data && (t.data.isIdUnique = !0),
3251
+ if (this.ln && (this.Ke.deleteMesh(this.ln), delete this.ln), !t || !t.length) return void this.setToRedraw();
3252
+ const e = this.Ke.createGeometries(t.map(t => (t && t.data && (t.data.isIdUnique = !0),
3236
3253
  t && t.data)), this.Ge);
3237
3254
  for (let n = 0; n < e.length; n++) this.bn(e[n].geometry, t[n] && t[n].data);
3238
3255
  const n = t[0] && t[0].data.iconAtlas, s = t[0] && t[0].data.glyphAtlas || t[1] && t[1].data.glyphAtlas;
3239
3256
  n && (this.sn.iconAtlas = n), s && (this.sn.glyphAtlas = s);
3240
3257
  const a = r.identity([]);
3241
3258
  r.translate(a, a, i.set(f, o[0], o[1], 0)), r.scale(a, a, i.set(c, 1, 1, this.yt));
3242
- const l = this.Ze.createMeshes(e, a);
3259
+ const l = this.Ke.createMeshes(e, a);
3243
3260
  for (let t = 0; t < l.length; t++) l[t].geometry.properties.originElements = l[t].geometry.properties.elements.slice(),
3244
3261
  l[t].properties.level = 0, l[t].material.set("flipY", 1), l[t].properties.meshKey = Fe++;
3245
3262
  this.ln = l, h && (this.un = !0), this.kn = !1, this.setToRedraw(), this.layer.fire("buildmarkermesh");
3246
3263
  });
3247
3264
  }
3248
3265
  cn() {
3249
- if (this.ln && (this.On(this.ln[0], this.Xe), this.On(this.ln[1], this.Ye), this.ln[0] && this.Ze.prepareCollideIndex(this.ln[0].geometry),
3250
- this.ln[1] && this.Ze.prepareCollideIndex(this.ln[1].geometry)), this.hn) for (let t = 0; t < this.hn.length; t++) this.On(this.hn[t], this.$e);
3266
+ if (this.ln && (this.On(this.ln[0], this.Xe), this.On(this.ln[1], this.Ye), this.ln[0] && this.Ke.prepareCollideIndex(this.ln[0].geometry),
3267
+ this.ln[1] && this.Ke.prepareCollideIndex(this.ln[1].geometry)), this.hn) for (let t = 0; t < this.hn.length; t++) this.On(this.hn[t], this.qe);
3251
3268
  if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.On(this.meshes[t], this.Ge);
3252
3269
  }
3253
3270
  On(t, e) {
@@ -3318,9 +3335,9 @@ class Le extends t.renderer.CanvasRenderer {
3318
3335
  }), !0;
3319
3336
  }
3320
3337
  Dn(t) {
3321
- return this.Rn(t, this.hn, this.an, this.Ln, this.Qe, M, Me, this.Nn);
3338
+ return this.Nn(t, this.hn, this.an, this.Ln, this.Qe, M, Me, this.Rn);
3322
3339
  }
3323
- Rn(t, e, n, i, r, s, o, a) {
3340
+ Nn(t, e, n, i, r, s, o, a) {
3324
3341
  if (!e) return !1;
3325
3342
  if (!n) return this.En(), this.setToRedraw(), !1;
3326
3343
  const l = t._getInternalSymbol(), h = {
@@ -3376,13 +3393,13 @@ class Le extends t.renderer.CanvasRenderer {
3376
3393
  }
3377
3394
  }
3378
3395
  nn(t) {
3379
- if (!Object.keys(this.$e).length) return void (this.hn && (this.Qe.deleteMesh(this.hn),
3396
+ if (!Object.keys(this.qe).length) return void (this.hn && (this.Qe.deleteMesh(this.hn),
3380
3397
  delete this.hn));
3381
- const {features: e, center: n} = this.gn(this.$e);
3398
+ const {features: e, center: n} = this.gn(this.qe);
3382
3399
  if (!e.length) return;
3383
3400
  const i = this.un;
3384
3401
  this.Ln = n;
3385
- const r = this.Nn(e), s = Q({}, Me), o = r.map((e, i) => this.createMesh(this.Qe, M, s, e, t && t[i], n));
3402
+ const r = this.Rn(e), s = Q({}, Me), o = r.map((e, i) => this.createMesh(this.Qe, M, s, e, t && t[i], n));
3386
3403
  this.zn = !0, Promise.all(o).then(t => {
3387
3404
  this.hn && this.Qe.deleteMesh(this.hn);
3388
3405
  const e = [], n = [];
@@ -3400,7 +3417,7 @@ class Le extends t.renderer.CanvasRenderer {
3400
3417
  this.layer.fire("buildlinemesh");
3401
3418
  });
3402
3419
  }
3403
- Nn(t) {
3420
+ Rn(t) {
3404
3421
  const e = (Ce + "lineDasharray").trim(), n = (Ce + "linePatternFile").trim(), i = [], r = [], s = [];
3405
3422
  for (let o = 0; o < t.length; o++) {
3406
3423
  const a = t[o], l = a.properties && a.properties[e];
@@ -3412,7 +3429,7 @@ class Le extends t.renderer.CanvasRenderer {
3412
3429
  this.in = !0, this.setToRedraw();
3413
3430
  }
3414
3431
  En() {
3415
- this.qe = !0, this.setToRedraw();
3432
+ this.$e = !0, this.setToRedraw();
3416
3433
  }
3417
3434
  Un(t) {
3418
3435
  const e = this.layer.getId();
@@ -3445,14 +3462,14 @@ class Le extends t.renderer.CanvasRenderer {
3445
3462
  const r = {
3446
3463
  feature: t[n]
3447
3464
  };
3448
- (ze(t[n]) || Ve(t[n])) && (this.Xe[i] = r), Ve(t[n]) && (this.Ye[i] = r), Be(t[n]) && (this.$e[i] = r);
3465
+ (ze(t[n]) || Ve(t[n])) && (this.Xe[i] = r), Ve(t[n]) && (this.Ye[i] = r), Be(t[n]) && (this.qe[i] = r);
3449
3466
  } else {
3450
3467
  t[Te] = e;
3451
3468
  const n = {
3452
3469
  feature: t
3453
3470
  }, i = t[Ee];
3454
3471
  if (this.Ge[i] = n, !this.needCheckPointLineSymbols()) return;
3455
- (ze(t) || Ve(t)) && (this.Xe[i] = n), Ve(t) && (this.Ye[i] = n), Be(t) && (this.$e[i] = n);
3472
+ (ze(t) || Ve(t)) && (this.Xe[i] = n), Ve(t) && (this.Ye[i] = n), Be(t) && (this.qe[i] = n);
3456
3473
  }
3457
3474
  }
3458
3475
  needCheckPointLineSymbols() {
@@ -3462,16 +3479,16 @@ class Le extends t.renderer.CanvasRenderer {
3462
3479
  const e = this.features[t];
3463
3480
  if (e) if (Array.isArray(e)) for (let t = 0; t < e.length; t++) {
3464
3481
  const n = e[t][Ee], i = e[t].id;
3465
- delete this.We[i], delete this.Ge[n], delete this.Xe[n], delete this.Ye[n], delete this.$e[n];
3482
+ delete this.We[i], delete this.Ge[n], delete this.Xe[n], delete this.Ye[n], delete this.qe[n];
3466
3483
  } else {
3467
3484
  const t = e[Ee], n = e.id;
3468
- delete this.We[n], delete this.Ge[t], delete this.Xe[t], delete this.Ye[t], delete this.$e[t];
3485
+ delete this.We[n], delete this.Ge[t], delete this.Xe[t], delete this.Ye[t], delete this.qe[t];
3469
3486
  }
3470
3487
  }
3471
3488
  pick(t, e, n) {
3472
3489
  const i = [];
3473
3490
  if (!this.layer.isVisible()) return i;
3474
- return [ this.painter, this.Ze, this.Qe ].forEach(r => {
3491
+ return [ this.painter, this.Ke, this.Qe ].forEach(r => {
3475
3492
  if (!r) return;
3476
3493
  const s = r.pick(t, e, n.tolerance);
3477
3494
  if (s && s.data && s.data.feature) {
@@ -3487,13 +3504,13 @@ class Le extends t.renderer.CanvasRenderer {
3487
3504
  }
3488
3505
  dn() {
3489
3506
  let t = !1;
3490
- for (const e in this.Ke) {
3491
- const n = this.Ke[e], i = this.Gn(n);
3507
+ for (const e in this.Ze) {
3508
+ const n = this.Ze[e], i = this.Gn(n);
3492
3509
  if (!this.kn && (this.Xe[i] || this.Ye[i])) {
3493
3510
  const e = this.Fn(n);
3494
3511
  t = t || e;
3495
3512
  }
3496
- if (!this.zn && this.$e[i]) {
3513
+ if (!this.zn && this.qe[i]) {
3497
3514
  const e = this.Dn(n);
3498
3515
  t = t || e;
3499
3516
  }
@@ -3502,13 +3519,13 @@ class Le extends t.renderer.CanvasRenderer {
3502
3519
  t = t || e;
3503
3520
  }
3504
3521
  }
3505
- this.Ke = {}, t && (Ne(this), this.layer.fire("partialupdate"));
3522
+ this.Ze = {}, t && (Re(this), this.layer.fire("partialupdate"));
3506
3523
  }
3507
3524
  Xn(t) {
3508
- this.Cn(t), this.En(), Ne(this);
3525
+ this.Cn(t), this.En(), Re(this);
3509
3526
  }
3510
3527
  onGeometryAdd(t) {
3511
- this.setToRedraw(), this.canvas && t && t.length && (this.Un(t), this.En(), Ne(this));
3528
+ this.setToRedraw(), this.canvas && t && t.length && (this.Un(t), this.En(), Re(this));
3512
3529
  }
3513
3530
  onGeometryRemove(t) {
3514
3531
  if (t && t.length) {
@@ -3516,7 +3533,7 @@ class Le extends t.renderer.CanvasRenderer {
3516
3533
  const n = t[e][Te];
3517
3534
  void 0 !== n && (delete this.Be[n], this.jn(n), delete this.features[n]);
3518
3535
  }
3519
- this.En(), Ne(this);
3536
+ this.En(), Re(this);
3520
3537
  }
3521
3538
  }
3522
3539
  onGeometrySymbolChange(t) {
@@ -3545,11 +3562,11 @@ class Le extends t.renderer.CanvasRenderer {
3545
3562
  }
3546
3563
  onGeometryShapeChange(t) {
3547
3564
  const e = t.target._getParent() || t.target;
3548
- void 0 !== e[Te] && (this.Un([ e ]), this.Vn(), Ne(this));
3565
+ void 0 !== e[Te] && (this.Un([ e ]), this.Vn(), Re(this));
3549
3566
  }
3550
3567
  onGeometryPositionChange(t) {
3551
3568
  const e = t.target._getParent() || t.target, n = e[Te];
3552
- void 0 !== n && (this.Un([ e ]), this.Ke[n] = e, Ne(this));
3569
+ void 0 !== n && (this.Un([ e ]), this.Ze[n] = e, Re(this));
3553
3570
  }
3554
3571
  onGeometryZIndexChange(t) {
3555
3572
  void 0 !== (t.target._getParent() || t.target)[Te] && this.En();
@@ -3571,16 +3588,16 @@ class Le extends t.renderer.CanvasRenderer {
3571
3588
  if (t === i.visible) return;
3572
3589
  i.visible = t;
3573
3590
  }
3574
- this.$n(), Ne(this);
3591
+ this.qn(), Re(this);
3575
3592
  }
3576
3593
  }
3577
- $n() {
3594
+ qn() {
3578
3595
  this.un = !0;
3579
3596
  }
3580
3597
  onGeometryPropertiesChange(t) {
3581
3598
  const e = t.target._getParent() || t.target, n = e[Te];
3582
3599
  void 0 !== n && (this.features[n] = Oe(e, this.Je), this.Bn(this.features[n], n),
3583
- this.En(), Ne(this));
3600
+ this.En(), Re(this));
3584
3601
  }
3585
3602
  createContext() {
3586
3603
  const t = this.canvas.gl && this.canvas.gl.wrap;
@@ -3591,14 +3608,14 @@ class Le extends t.renderer.CanvasRenderer {
3591
3608
  const e = we.get3DPainterClass("icon");
3592
3609
  let n = e.getBloomSymbol();
3593
3610
  const i = Q({}, _e, Se);
3594
- i.markerPerspectiveRatio = this.layer.options.markerPerspectiveRatio || 0, this.qn(i, n),
3611
+ i.markerPerspectiveRatio = this.layer.options.markerPerspectiveRatio || 0, this.$n(i, n),
3595
3612
  this.In = i;
3596
3613
  const r = Q({}, ft, this.layer.options.sceneConfig || {});
3597
- this.Ze = new e(this.regl, this.layer, i, r, 0), this.Ze.setTextShaderDefines({
3614
+ this.Ke = new e(this.regl, this.layer, i, r, 0), this.Ke.setTextShaderDefines({
3598
3615
  REVERSE_MAP_ROTATION_ON_PITCH: 1
3599
3616
  });
3600
3617
  const s = we.get3DPainterClass("line"), o = Q({}, Me);
3601
- n = s.getBloomSymbol(), this.qn(o, n), this.Jn = o;
3618
+ n = s.getBloomSymbol(), this.$n(o, n), this.Jn = o;
3602
3619
  const a = Q({}, this.layer.options.sceneConfig || {});
3603
3620
  void 0 === a.depthMask && (a.depthMask = !0), this.Qe = new s(this.regl, this.layer, o, a, 0),
3604
3621
  this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
@@ -3606,14 +3623,14 @@ class Le extends t.renderer.CanvasRenderer {
3606
3623
  st() {
3607
3624
  return !!(this.canvas && this.canvas.gl && this.canvas.gl.wrap);
3608
3625
  }
3609
- qn(t, e) {
3626
+ $n(t, e) {
3610
3627
  for (let n = 0; n < e.length; n++) t[e[n]] = this.layer.options.enableBloom;
3611
3628
  }
3612
3629
  updateBloom(t) {
3613
- this.Ze && this.Kn(this.Ze, this.In, t), this.Qe && this.Kn(this.Qe, this.Jn, t),
3614
- this.painter && this.Kn(this.painter, this.painterSymbol, t);
3630
+ this.Ke && this.Zn(this.Ke, this.In, t), this.Qe && this.Zn(this.Qe, this.Jn, t),
3631
+ this.painter && this.Zn(this.painter, this.painterSymbol, t);
3615
3632
  }
3616
- Kn(t, e, n) {
3633
+ Zn(t, e, n) {
3617
3634
  const i = t.constructor.getBloomSymbol().reduce((t, i) => (t[i] = n, e[i] = n, t), {});
3618
3635
  t.updateSymbol(i, e);
3619
3636
  }
@@ -3659,18 +3676,18 @@ class Le extends t.renderer.CanvasRenderer {
3659
3676
  }
3660
3677
  onRemove() {
3661
3678
  super.onRemove(), this.painter && (this.painter.delete(), delete this.painter),
3662
- this.Ze && (this.Ze.delete(), delete this.Ze), this.Qe && (this.Qe.delete(), delete this.Qe);
3679
+ this.Ke && (this.Ke.delete(), delete this.Ke), this.Qe && (this.Qe.delete(), delete this.Qe);
3663
3680
  }
3664
3681
  drawOutline(t) {
3665
- if (this.Mt && (this.painter && this.painter.outlineAll(t), this.Ze.outlineAll(t),
3666
- this.Qe.outlineAll(t)), this.Zn) for (let e = 0; e < this.Zn.length; e++) this.painter && this.painter.outline(t, this.Zn[e]),
3667
- this.Ze.outline(t, this.Zn[e]), this.Qe.outline(t, this.Zn[e]);
3682
+ if (this.Mt && (this.painter && this.painter.outlineAll(t), this.Ke.outlineAll(t),
3683
+ this.Qe.outlineAll(t)), this.Kn) for (let e = 0; e < this.Kn.length; e++) this.painter && this.painter.outline(t, this.Kn[e]),
3684
+ this.Ke.outline(t, this.Kn[e]), this.Qe.outline(t, this.Kn[e]);
3668
3685
  }
3669
3686
  outlineAll() {
3670
3687
  this.Mt = !0, this.setToRedraw();
3671
3688
  }
3672
3689
  outline(t) {
3673
- this.Zn || (this.Zn = []);
3690
+ this.Kn || (this.Kn = []);
3674
3691
  const e = [];
3675
3692
  for (let n = 0; n < t.length; n++) {
3676
3693
  const i = this.layer.getGeometryById(t[n]);
@@ -3679,10 +3696,10 @@ class Le extends t.renderer.CanvasRenderer {
3679
3696
  if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n].id); else e.push(t.id);
3680
3697
  }
3681
3698
  }
3682
- this.Zn.push(e), this.setToRedraw();
3699
+ this.Kn.push(e), this.setToRedraw();
3683
3700
  }
3684
3701
  cancelOutline() {
3685
- delete this.Mt, delete this.Zn, this.setToRedraw();
3702
+ delete this.Mt, delete this.Kn, this.setToRedraw();
3686
3703
  }
3687
3704
  isEnableWorkAround(t) {
3688
3705
  return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] && He(this.gl));
@@ -3700,7 +3717,7 @@ class Le extends t.renderer.CanvasRenderer {
3700
3717
  }
3701
3718
  }
3702
3719
 
3703
- function Ne(t) {
3720
+ function Re(t) {
3704
3721
  t.setToRedraw();
3705
3722
  }
3706
3723
 
@@ -3790,34 +3807,34 @@ Ye.registerRenderer("gl", class extends Le {
3790
3807
  }
3791
3808
  });
3792
3809
 
3793
- class $e extends we {
3810
+ class qe extends we {
3794
3811
  static fromJSON(t) {
3795
- return Xe(t, "LineStringLayer", $e);
3812
+ return Xe(t, "LineStringLayer", qe);
3796
3813
  }
3797
3814
  }
3798
3815
 
3799
- $e.mergeOptions({
3816
+ qe.mergeOptions({
3800
3817
  meshRenderOrder: 1
3801
- }), $e.registerJSONType("LineStringLayer");
3818
+ }), qe.registerJSONType("LineStringLayer");
3802
3819
 
3803
- const qe = "_line_gradient_property".trim();
3820
+ const $e = "_line_gradient_property".trim();
3804
3821
 
3805
- $e.registerRenderer("gl", class extends Le {
3822
+ qe.registerRenderer("gl", class extends Le {
3806
3823
  constructor(...e) {
3807
3824
  super(...e), this.GeometryTypes = [ t.LineString, t.MultiLineString ];
3808
3825
  }
3809
3826
  createPainter() {
3810
3827
  const t = we.get3DPainterClass("line-gradient");
3811
3828
  this.painterSymbol = Q({}, {
3812
- lineGradientProperty: qe
3813
- }, Me), this.qn(this.painterSymbol, t.getBloomSymbol());
3829
+ lineGradientProperty: $e
3830
+ }, Me), this.$n(this.painterSymbol, t.getBloomSymbol());
3814
3831
  const e = Q({}, this.layer.options.sceneConfig || {});
3815
3832
  void 0 === e.depthMask && (e.depthMask = !0);
3816
3833
  return new t(this.regl, this.layer, this.painterSymbol, e, 0);
3817
3834
  }
3818
3835
  buildMesh() {
3819
3836
  let {features: t, center: e} = this.gn();
3820
- if (t = t.filter(t => !!t.properties[qe]), !t.length) return;
3837
+ if (t = t.filter(t => !!t.properties[$e]), !t.length) return;
3821
3838
  const n = this.un;
3822
3839
  this.Qn = e;
3823
3840
  const i = Q({}, this.painterSymbol), r = this.createMesh(this.painter, M, i, t, null, e);
@@ -3831,7 +3848,7 @@ $e.registerRenderer("gl", class extends Le {
3831
3848
  this.meshes = e, n && (this.un = n), this.Wn = !1, this.setToRedraw();
3832
3849
  });
3833
3850
  }
3834
- }), $e.registerRenderer("canvas", null);
3851
+ }), qe.registerRenderer("canvas", null);
3835
3852
 
3836
3853
  class Je extends we {
3837
3854
  static fromJSON(t) {
@@ -3841,7 +3858,7 @@ class Je extends we {
3841
3858
 
3842
3859
  Je.registerJSONType("PolygonLayer");
3843
3860
 
3844
- const Ke = {
3861
+ const Ze = {
3845
3862
  polygonFill: {
3846
3863
  type: "identity",
3847
3864
  default: [ 1, 1, 1, 1 ],
@@ -3894,7 +3911,7 @@ const Ke = {
3894
3911
  }
3895
3912
  };
3896
3913
 
3897
- class Ze extends Le {
3914
+ class Ke extends Le {
3898
3915
  constructor(...e) {
3899
3916
  super(...e), this.GeometryTypes = [ t.Polygon, t.MultiPolygon ];
3900
3917
  }
@@ -3906,7 +3923,7 @@ class Ze extends Le {
3906
3923
  if (!e.length) return;
3907
3924
  const i = this.un;
3908
3925
  this.Qn = n;
3909
- const r = this.ti(e), s = Q({}, Ke), o = r.map((e, i) => this.createMesh(this.painter, k, s, e, t && t[i], n));
3926
+ const r = this.ti(e), s = Q({}, Ze), o = r.map((e, i) => this.createMesh(this.painter, k, s, e, t && t[i], n));
3910
3927
  this.Wn = !0, Promise.all(o).then(t => {
3911
3928
  this.meshes && this.painter.deleteMesh(this.meshes), t = function(t) {
3912
3929
  const e = [];
@@ -3942,12 +3959,12 @@ class Ze extends Le {
3942
3959
  return [ e, n ];
3943
3960
  }
3944
3961
  createPainter() {
3945
- const t = we.get3DPainterClass("fill"), e = this.painterSymbol = Q({}, Ke);
3946
- this.qn(e, t.getBloomSymbol());
3962
+ const t = we.get3DPainterClass("fill"), e = this.painterSymbol = Q({}, Ze);
3963
+ this.$n(e, t.getBloomSymbol());
3947
3964
  return new t(this.regl, this.layer, e, this.layer.options.sceneConfig, 0);
3948
3965
  }
3949
3966
  updateMesh(t) {
3950
- return this.Rn(t, this.meshes, this.atlas, this.Qn, this.painter, k, Ke, this.ti);
3967
+ return this.Nn(t, this.meshes, this.atlas, this.Qn, this.painter, k, Ze, this.ti);
3951
3968
  }
3952
3969
  }
3953
3970
 
@@ -3969,7 +3986,7 @@ function tn(t, e, n, i) {
3969
3986
  return r === o && (r < 0 || r > i) || s === a && (s < 0 || s > i);
3970
3987
  }
3971
3988
 
3972
- Je.registerRenderer("gl", Ze), Je.registerRenderer("canvas", null);
3989
+ Je.registerRenderer("gl", Ke), Je.registerRenderer("canvas", null);
3973
3990
 
3974
3991
  const en = Math.PI / 180, nn = 6378137 * Math.PI / 180;
3975
3992
 
@@ -4074,28 +4091,28 @@ const fn = O.getInstance();
4074
4091
 
4075
4092
  function dn(t, e, n, i, r, s, o, a, l, h, u, c, f, d, m, v) {
4076
4093
  void 0 === e.top && (e.top = !0), void 0 === e.side && (e.side = !0), fn.reset();
4077
- const {altitudeScale: x, altitudeProperty: b, defaultAltitude: w, heightProperty: _, minHeightProperty: S, defaultHeight: M, tangent: P, uv: T, topUVMode: k, sideUVMode: F, sideVerticalUVMode: C, top: E, side: D, textureYOrigin: R, topThickness: L} = e, N = !!v, H = function(t, e, {altitudeScale: n, altitudeProperty: i, defaultAltitude: r, heightProperty: s, minHeightProperty: o, defaultHeight: a}, {center: l, side: h, top: u, topThickness: c, uvOrigin: f, uv: d, uvSize: p, topUVMode: m, sideUVMode: y, sideVerticalUVMode: g, textureYOrigin: v, tileRatio: x, centimeterToPoint: b, verticalCentimeterToPoint: w, positionType: _, res: S, glScale: M, projectionCode: P}, T, k) {
4094
+ const {altitudeScale: x, altitudeProperty: b, defaultAltitude: w, heightProperty: _, minHeightProperty: S, defaultHeight: M, tangent: P, uv: T, topUVMode: k, sideUVMode: F, sideVerticalUVMode: C, top: E, side: D, textureYOrigin: N, topThickness: L} = e, R = !!v, H = function(t, e, {altitudeScale: n, altitudeProperty: i, defaultAltitude: r, heightProperty: s, minHeightProperty: o, defaultHeight: a}, {center: l, side: h, top: u, topThickness: c, uvOrigin: f, uv: d, uvSize: p, topUVMode: m, sideUVMode: y, sideVerticalUVMode: g, textureYOrigin: v, tileRatio: x, centimeterToPoint: b, verticalCentimeterToPoint: w, positionType: _, res: S, glScale: M, projectionCode: P}, T, k) {
4078
4095
  let I = e / t[0].extent;
4079
4096
  e === 1 / 0 && (I = 1);
4080
- const F = e === 1 / 0, C = k.get(), E = k.get(), D = k.get(), R = k.get(), L = k.get(), N = k.get(), H = k.get(), z = !!d, V = !!u, j = !!h, B = z ? k.get() : null;
4097
+ const F = e === 1 / 0, C = k.get(), E = k.get(), D = k.get(), N = k.get(), L = k.get(), R = k.get(), H = k.get(), z = !!d, V = !!u, j = !!h, B = z ? k.get() : null;
4081
4098
  function G(t, n, i, r, s, o) {
4082
4099
  let a = n;
4083
4100
  if (V) {
4084
- const r = U(R, i, 3);
4101
+ const r = U(N, i, 3);
4085
4102
  if (0 === r.length) return n;
4086
- if (st(L, R), n += R.length, o) for (let e = 2, n = r.length; e < n; e += 3) r[e] += t / 3,
4103
+ if (st(L, N), n += N.length, o) for (let e = 2, n = r.length; e < n; e += 3) r[e] += t / 3,
4087
4104
  r[e - 1] += t / 3, r[e - 2] += t / 3; else {
4088
4105
  let e;
4089
4106
  for (let n = 2, i = r.length; n < i; n += 3) e = r[n - 1], r[n - 1] = r[n] + t / 3,
4090
4107
  r[n] = e + t / 3, r[n - 2] += t / 3;
4091
4108
  }
4092
- st(N, r), z && on(m || 0, t, n, B, L, f, b, x, p[0], p[1], s, S, M, P, l), c > 0 && !j && (n = hn(L, R, i, N, n, B, 0, c, e, z, y || 0, g || 0, v, p, x, w, o)),
4109
+ st(R, r), z && on(m || 0, t, n, B, L, f, b, x, p[0], p[1], s, S, M, P, l), c > 0 && !j && (n = hn(L, N, i, R, n, B, 0, c, e, z, y || 0, g || 0, v, p, x, w, o)),
4093
4110
  H.setLength(n / 3), H.fill(1, a / 3, n / 3);
4094
4111
  }
4095
4112
  if (j) {
4096
- V && (c = 0), a = n, n = hn(L, R, i, N, n, B, c, r, e, z, y || 0, g || 0, v, p, x, w, o),
4113
+ V && (c = 0), a = n, n = hn(L, N, i, R, n, B, c, r, e, z, y || 0, g || 0, v, p, x, w, o),
4097
4114
  H.setLength(n / 3);
4098
- const t = R.length / 3;
4115
+ const t = N.length / 3;
4099
4116
  H.fill(1, a / 3, a / 3 + t), H.fill(0, a / 3 + t, a / 3 + 2 * t), H.fill(1, a / 3 + 2 * t, a / 3 + 3 * t),
4100
4117
  H.fill(0, a / 3 + 3 * t, n / 3);
4101
4118
  }
@@ -4103,47 +4120,47 @@ function dn(t, e, n, i, r, s, o, a, l, h, u, c, f, d, m, v) {
4103
4120
  }
4104
4121
  let W = 0, X = 0;
4105
4122
  const Y = [ -1, -1, e + 1, e + 1 ];
4106
- let $ = 0, q = t.length;
4107
- et(T) && ($ = T, q = T + 1);
4108
- let J = 0, K = !1;
4109
- const Z = k.get();
4110
- for (;$ < q; $++) {
4111
- const l = t[$], h = l.id;
4112
- et(h) && (Math.abs(h) > J && (J = Math.abs(h)), h < 0 && (K = !0));
4123
+ let q = 0, $ = t.length;
4124
+ et(T) && (q = T, $ = T + 1);
4125
+ let J = 0, Z = !1;
4126
+ const K = k.get();
4127
+ for (;q < $; q++) {
4128
+ const l = t[q], h = l.id;
4129
+ et(h) && (Math.abs(h) > J && (J = Math.abs(h)), h < 0 && (Z = !0));
4113
4130
  const u = l.geometry, c = l.properties.maptalks_ombb;
4114
4131
  let f = Array.isArray(c && c[0] && c[0][0]) ? c[0] : c;
4115
4132
  const {altitude: d, height: p} = A.getFeaAltitudeAndHeight(l, n, i, r, s, a, o);
4116
4133
  W = Math.max(Math.abs(d), W);
4117
4134
  const m = L.length;
4118
4135
  let y = 0, g = X;
4119
- Z.setLength(0), R.setLength(0);
4136
+ K.setLength(0), N.setLength(0);
4120
4137
  const v = A.calculateSignedArea(u[0]) < 0;
4121
4138
  for (let t = 0, n = u.length; t < n; t++) {
4122
4139
  let i = u[t];
4123
4140
  v && (i = i.reverse()), i = cn(i);
4124
4141
  const r = A.calculateSignedArea(i) < 0;
4125
- if (!r && t > 0 && (y++, f = c && c[y], X = G(g, X, Z, p * I, f, F), R.setLength(0),
4126
- Z.setLength(0), g = X), e !== 1 / 0 && (i = A.clipPolygon(i, Y)), !i.length) {
4127
- t === n - 1 && (X = G(g, X, Z, p * I, f, F));
4142
+ if (!r && t > 0 && (y++, f = c && c[y], X = G(g, X, K, p * I, f, F), N.setLength(0),
4143
+ K.setLength(0), g = X), e !== 1 / 0 && (i = A.clipPolygon(i, Y)), !i.length) {
4144
+ t === n - 1 && (X = G(g, X, K, p * I, f, F));
4128
4145
  continue;
4129
4146
  }
4130
4147
  const s = i.length;
4131
4148
  Array.isArray(i[0]) ? i[0][0] === i[s - 1][0] && i[0][1] === i[s - 1][1] || i.push([ i[0][0], i[0][1] ]) : i[0].x === i[s - 1].x && i[0].y === i[s - 1].y || i.push(i[0]),
4132
- r && Z.push(R.length / 3), Qe(R, R.length, i, I, d, !1, _), t === n - 1 && (X = G(g, X, Z, p * I, f, F));
4149
+ r && K.push(N.length / 3), Qe(N, N.length, i, I, d, !1, _), t === n - 1 && (X = G(g, X, K, p * I, f, F));
4133
4150
  }
4134
4151
  const x = L.length - m, b = "__fea_idx".trim();
4135
- for (let t = 0; t < x / 3; t++) E.push(void 0 === l[b] ? $ : l[b]), C.push($), et(h) && D.push(h);
4152
+ for (let t = 0; t < x / 3; t++) E.push(void 0 === l[b] ? q : l[b]), C.push(q), et(h) && D.push(h);
4136
4153
  }
4137
4154
  const Q = A.getUnsignedArrayType(E.length ? E[E.length - 1] : 0), tt = {
4138
4155
  maxAltitude: W,
4139
4156
  vertices: L,
4140
4157
  verticeTypes: H,
4141
- indices: N,
4158
+ indices: R,
4142
4159
  pickingIds: O.createTypedArray(E, Q),
4143
4160
  featureIndexes: C
4144
4161
  };
4145
4162
  if (D.length) {
4146
- const t = K ? A.getPosArrayType(J) : A.getUnsignedArrayType(J);
4163
+ const t = Z ? A.getPosArrayType(J) : A.getUnsignedArrayType(J);
4147
4164
  tt.featureIds = O.createTypedArray(D, t);
4148
4165
  } else tt.featureIds = [];
4149
4166
  return B && (B.setLength(L.length / 3 * 2), tt.uvs = B), tt;
@@ -4165,7 +4182,7 @@ function dn(t, e, n, i, r, s, o, a, l, h, u, c, f, d, m, v) {
4165
4182
  topUVMode: k,
4166
4183
  sideUVMode: F,
4167
4184
  sideVerticalUVMode: C,
4168
- textureYOrigin: R,
4185
+ textureYOrigin: N,
4169
4186
  tileRatio: a,
4170
4187
  centimeterToPoint: l,
4171
4188
  verticalCentimeterToPoint: h,
@@ -4173,20 +4190,20 @@ function dn(t, e, n, i, r, s, o, a, l, h, u, c, f, d, m, v) {
4173
4190
  res: s,
4174
4191
  glScale: o,
4175
4192
  projectionCode: f
4176
- }, d, fn), W = [], X = H.vertices.length / 3, Y = A.getIndexArrayType(X), $ = O.createTypedArray(H.indices, Y);
4177
- delete H.indices, W.push($.buffer, H.pickingIds.buffer);
4178
- const q = P ? fn.get() : new Float32Array(3 * X);
4179
- q.setLength && q.setLength(3 * X);
4180
- const J = j(H.vertices, $, q);
4181
- let K = !0;
4193
+ }, d, fn), W = [], X = H.vertices.length / 3, Y = A.getIndexArrayType(X), q = O.createTypedArray(H.indices, Y);
4194
+ delete H.indices, W.push(q.buffer, H.pickingIds.buffer);
4195
+ const $ = P ? fn.get() : new Float32Array(3 * X);
4196
+ $.setLength && $.setLength(3 * X);
4197
+ const J = j(H.vertices, q, $);
4198
+ let Z = !0;
4182
4199
  for (let t = 0; t < J.length; t++) {
4183
- N || (J[t] = -J[t]);
4200
+ R || (J[t] = -J[t]);
4184
4201
  const e = J[t] % 1;
4185
- 1 - Math.abs(e) > 1e-6 ? K = !1 : 0 !== e && (J[t] = Math.round(J[t]));
4202
+ 1 - Math.abs(e) > 1e-6 ? Z = !1 : 0 !== e && (J[t] = Math.round(J[t]));
4186
4203
  }
4187
4204
  if (H.normals = J, P) {
4188
4205
  let t = fn.get();
4189
- t.setLength(4 * X), t = B(H.vertices, H.normals, H.uvs, $, t), t = function(t, e) {
4206
+ t.setLength(4 * X), t = B(H.vertices, H.normals, H.uvs, q, t), t = function(t, e) {
4190
4207
  const n = new Float32Array(e.length), i = [], r = [], s = [];
4191
4208
  for (let o = 0; o < e.length; o += 4) {
4192
4209
  const a = o / 4 * 3;
@@ -4196,7 +4213,7 @@ function dn(t, e, n, i, r, s, o, a, l, h, u, c, f, d, m, v) {
4196
4213
  return n;
4197
4214
  }(H.normals, t), H.tangents = t, W.push(t.buffer), delete H.normals;
4198
4215
  }
4199
- if (H.normals && (K && (H.normals = O.createTypedArray(H.normals, Int8Array)), W.push(H.normals.buffer)),
4216
+ if (H.normals && (Z && (H.normals = O.createTypedArray(H.normals, Int8Array)), W.push(H.normals.buffer)),
4200
4217
  H.uvs) {
4201
4218
  const t = H.uvs;
4202
4219
  H.uvs = O.createTypedArray(t, Float32Array), W.push(H.uvs.buffer);
@@ -4205,7 +4222,7 @@ function dn(t, e, n, i, r, s, o, a, l, h, u, c, f, d, m, v) {
4205
4222
  const t = H.vertices;
4206
4223
  for (let e = 0; e < t.length; e += 3) t[e] -= v[0], t[e + 1] -= v[1];
4207
4224
  }
4208
- const Z = m || A.getPosArrayType(Math.max(512, H.maxAltitude)), Q = function(t, e, n, i) {
4225
+ const K = m || A.getPosArrayType(Math.max(512, H.maxAltitude)), Q = function(t, e, n, i) {
4209
4226
  const r = {}, s = {};
4210
4227
  if (ot(e.polygonFill)) {
4211
4228
  let o = y(e.polygonFill);
@@ -4265,13 +4282,13 @@ function dn(t, e, n, i, r, s, o, a, l, h, u, c, f, d, m, v) {
4265
4282
  data: {
4266
4283
  data: {
4267
4284
  aVertexColorType: tt.length <= 252 ? O.createTypedArray(H.verticeTypes, Uint8Array) : O.createTypedArray(H.verticeTypes, Uint16Array),
4268
- aPosition: O.createTypedArray(H.vertices, Z),
4285
+ aPosition: O.createTypedArray(H.vertices, K),
4269
4286
  aNormal: H.normals,
4270
4287
  aTexCoord0: H.uvs,
4271
4288
  aTangent: H.tangents,
4272
4289
  aPickingId: H.pickingIds
4273
4290
  },
4274
- indices: $,
4291
+ indices: q,
4275
4292
  properties: {
4276
4293
  maxAltitude: H.maxAltitude
4277
4294
  },
@@ -4470,13 +4487,13 @@ function In(t, e, n) {
4470
4487
  r.remove(l), s = Hn(l, s), o.push(s);
4471
4488
  }
4472
4489
  var h = new W(16);
4473
- for (a = 0; a < o.length; a++) h.insert(Nn(o[a]));
4490
+ for (a = 0; a < o.length; a++) h.insert(Rn(o[a]));
4474
4491
  for (var u = e * e, c = n * n; o.length; ) {
4475
4492
  var f = o.shift(), d = f.p, p = f.next.p, m = zn(d, p);
4476
4493
  if (!(m < c)) {
4477
4494
  var y = m / u;
4478
4495
  (l = Fn(r, f.prev.p, d, p, f.next.next.p, y, h)) && Math.min(zn(l, d), zn(l, p)) <= y && (o.push(f),
4479
- o.push(Hn(l, f)), r.remove(l), h.remove(f), h.insert(Nn(f)), h.insert(Nn(f.next)));
4496
+ o.push(Hn(l, f)), r.remove(l), h.remove(f), h.insert(Rn(f)), h.insert(Rn(f.next)));
4480
4497
  }
4481
4498
  }
4482
4499
  f = s;
@@ -4498,7 +4515,7 @@ function Fn(t, e, n, i, r, s, o) {
4498
4515
  }
4499
4516
  for (;a.length && !a.peek().node.children; ) {
4500
4517
  var f = a.pop(), d = f.node, p = Vn(d, e, n), m = Vn(d, i, r);
4501
- if (f.dist < p && f.dist < m && Rn(n, d, o) && Rn(i, d, o)) return d;
4518
+ if (f.dist < p && f.dist < m && Nn(n, d, o) && Nn(i, d, o)) return d;
4502
4519
  }
4503
4520
  (l = a.pop()) && (l = l.node);
4504
4521
  }
@@ -4525,7 +4542,7 @@ function Dn(t, e) {
4525
4542
  return t[0] >= e.minX && t[0] <= e.maxX && t[1] >= e.minY && t[1] <= e.maxY;
4526
4543
  }
4527
4544
 
4528
- function Rn(t, e, n) {
4545
+ function Nn(t, e, n) {
4529
4546
  for (var i, r, s, o, a = Math.min(t[0], e[0]), l = Math.min(t[1], e[1]), h = Math.max(t[0], e[0]), u = Math.max(t[1], e[1]), c = n.search({
4530
4547
  minX: a,
4531
4548
  minY: l,
@@ -4539,7 +4556,7 @@ function Ln(t, e, n) {
4539
4556
  return On(t[0], t[1], e[0], e[1], n[0], n[1]);
4540
4557
  }
4541
4558
 
4542
- function Nn(t) {
4559
+ function Rn(t) {
4543
4560
  var e = t.p, n = t.next.p;
4544
4561
  return t.minX = Math.min(e[0], n[0]), t.minY = Math.min(e[1], n[1]), t.maxX = Math.max(e[0], n[0]),
4545
4562
  t.maxY = Math.max(e[1], n[1]), t;
@@ -4697,9 +4714,9 @@ function Yn(t) {
4697
4714
  }
4698
4715
  }
4699
4716
 
4700
- class $n extends we {
4717
+ class qn extends we {
4701
4718
  static fromJSON(t) {
4702
- return Xe(t, "ExtrudePolygonLayer", $n);
4719
+ return Xe(t, "ExtrudePolygonLayer", qn);
4703
4720
  }
4704
4721
  getPolygonOffsetCount() {
4705
4722
  return 0;
@@ -4732,12 +4749,12 @@ class $n extends we {
4732
4749
  }
4733
4750
  }
4734
4751
 
4735
- $n.registerJSONType("ExtrudePolygonLayer"), $n.mergeOptions({
4752
+ qn.registerJSONType("ExtrudePolygonLayer"), qn.mergeOptions({
4736
4753
  cullFace: !1,
4737
4754
  castShadow: !0
4738
4755
  });
4739
4756
 
4740
- const qn = {
4757
+ const $n = {
4741
4758
  polygonFill: {
4742
4759
  type: "identity",
4743
4760
  default: [ 1, 1, 1, 1 ],
@@ -4760,9 +4777,9 @@ const qn = {
4760
4777
  }
4761
4778
  }, Jn = {
4762
4779
  defaultAltitude: 20
4763
- }, Kn = t => 1 === t.properties.top;
4780
+ }, Zn = t => 1 === t.properties.top;
4764
4781
 
4765
- $n.registerRenderer("gl", class extends Ze {
4782
+ qn.registerRenderer("gl", class extends Ke {
4766
4783
  constructor(...e) {
4767
4784
  super(...e), this.GeometryTypes = [ t.Polygon, t.MultiPolygon ];
4768
4785
  }
@@ -4789,7 +4806,7 @@ $n.registerRenderer("gl", class extends Ze {
4789
4806
  this.painter && (this.painter.updateDataConfig(t, e), this.En());
4790
4807
  }
4791
4808
  updateBloom(t) {
4792
- super.updateBloom(t), this.sidePainter && this.Kn(this.sidePainter, this.sidePainterSymbol, t);
4809
+ super.updateBloom(t), this.sidePainter && this.Zn(this.sidePainter, this.sidePainterSymbol, t);
4793
4810
  }
4794
4811
  needCheckPointLineSymbols() {
4795
4812
  return !1;
@@ -4799,7 +4816,7 @@ $n.registerRenderer("gl", class extends Ze {
4799
4816
  }
4800
4817
  createPainter() {
4801
4818
  const t = we.get3DPainterClass("lit");
4802
- this.painterSymbol = Q({}, qn), this.sidePainterSymbol = Q({}, qn), this.qn(this.painterSymbol, t.getBloomSymbol());
4819
+ this.painterSymbol = Q({}, $n), this.sidePainterSymbol = Q({}, $n), this.$n(this.painterSymbol, t.getBloomSymbol());
4803
4820
  const e = Q({}, Jn, this.layer.options.dataConfig || {});
4804
4821
  this.layer.options.material && (this.painterSymbol.material = this.layer.options.material),
4805
4822
  this.layer.options.sideMaterial ? this.sidePainterSymbol.material = this.layer.options.sideMaterial : this.sidePainterSymbol.material = this.layer.options.material;
@@ -4823,9 +4840,9 @@ $n.registerRenderer("gl", class extends Ze {
4823
4840
  }
4824
4841
  pn(...t) {
4825
4842
  const e = t[0], n = e.sceneFilter;
4826
- e.sceneFilter = t => (!n || n(t)) && Kn(t);
4843
+ e.sceneFilter = t => (!n || n(t)) && Zn(t);
4827
4844
  const i = super.pn(...t);
4828
- e.sceneFilter = t => (!n || n(t)) && Kn(t);
4845
+ e.sceneFilter = t => (!n || n(t)) && Zn(t);
4829
4846
  const r = this.painter;
4830
4847
  this.painter = this.sidePainter;
4831
4848
  const s = e.sceneFilter = t => (!n || n(t)) && (t => 1 === t.properties.side)(t);
@@ -4850,7 +4867,7 @@ $n.registerRenderer("gl", class extends Ze {
4850
4867
  }
4851
4868
  oi(e, n, i, r) {
4852
4869
  const s = this.getMap();
4853
- n = qn;
4870
+ n = $n;
4854
4871
  const o = this.si, a = s.getZoom(), l = new t.Point(0, 0), h = new t.Coordinate(0, 0), u = Q({}, Jn, this.layer.options.dataConfig);
4855
4872
  if (u.tangent = 1, u.top && (u.top = i), u.side && (u.side = r), !1 === u.top && !1 === u.side) return null;
4856
4873
  if (!e.length) return null;
@@ -4892,14 +4909,14 @@ $n.registerRenderer("gl", class extends Ze {
4892
4909
  }
4893
4910
  drawOutline(t) {
4894
4911
  if (super.drawOutline(t), this.Mt && this.sidePainter && this.sidePainter.outlineAll(t),
4895
- this.Zn) for (let e = 0; e < this.Zn.length; e++) this.sidePainter && this.sidePainter.outline(t, this.Zn[e]);
4912
+ this.Kn) for (let e = 0; e < this.Kn.length; e++) this.sidePainter && this.sidePainter.outline(t, this.Kn[e]);
4896
4913
  }
4897
4914
  getShadowMeshes() {
4898
4915
  return this.painter ? this.painter.getShadowMeshes() : [];
4899
4916
  }
4900
- }), $n.registerRenderer("canvas", null);
4917
+ }), qn.registerRenderer("canvas", null);
4901
4918
 
4902
- const Zn = {
4919
+ const Kn = {
4903
4920
  redraw: !1,
4904
4921
  retire: !1
4905
4922
  }, Qn = [];
@@ -4907,7 +4924,7 @@ const Zn = {
4907
4924
  let ti = 1;
4908
4925
 
4909
4926
  function ei(t, e) {
4910
- return $.extend(t, {
4927
+ return q.extend(t, {
4911
4928
  init: function() {
4912
4929
  this.ai = {};
4913
4930
  },
@@ -5008,9 +5025,9 @@ function ei(t, e) {
5008
5025
  },
5009
5026
  paintTile: function(t) {
5010
5027
  const {tileCache: e, tileInfo: n, tileZoom: i, sceneConfig: r} = t, s = this.painter;
5011
- if (!s) return Zn;
5028
+ if (!s) return Kn;
5012
5029
  let o = e.geometry;
5013
- if (!o) return Zn;
5030
+ if (!o) return Kn;
5014
5031
  let a = !1;
5015
5032
  const l = this.ci(t);
5016
5033
  let h = this.H(l);
@@ -5018,7 +5035,7 @@ function ei(t, e) {
5018
5035
  const {meshes: e, retire: n} = this.di(o, t);
5019
5036
  a || (a = n), h = e;
5020
5037
  }
5021
- if (!h.length) return Zn;
5038
+ if (!h.length) return Kn;
5022
5039
  const u = s.getTileLevelValue(n, i);
5023
5040
  h.forEach(t => {
5024
5041
  t.properties.tile = n, t.properties.level = u;
@@ -5304,7 +5321,7 @@ function hi(t, e, n, i, r) {
5304
5321
 
5305
5322
  function ui(t, e, n) {
5306
5323
  const i = e[n.symbolName], r = t.xi;
5307
- return !N(i, r[n.symbolName]) && (r[n.symbolName] = i, !0);
5324
+ return !R(i, r[n.symbolName]) && (r[n.symbolName] = i, !0);
5308
5325
  }
5309
5326
 
5310
5327
  function ci(t, e, n) {
@@ -5368,7 +5385,7 @@ function mi(t, e, n, i, r, s, o) {
5368
5385
  for (let e = i * s; e < r * s; e += s) t.set(h, e);
5369
5386
  t.dirty = !0;
5370
5387
  }
5371
- } else t[i] !== h && (Nt(t, h, i, r), t.dirty = !0);
5388
+ } else t[i] !== h && (Rt(t, h, i, r), t.dirty = !0);
5372
5389
  }
5373
5390
 
5374
5391
  function yi(t) {
@@ -5523,7 +5540,7 @@ function ki(t, e, n, i) {
5523
5540
  return t.extent2d.contains(r);
5524
5541
  }
5525
5542
 
5526
- const {loginIBLResOnCanvas: Oi, logoutIBLResOnCanvas: Ii, getIBLResOnCanvas: Fi} = n.pbr.PBRUtils, Ci = [], Ei = [], Di = new t.Point(0, 0), Ri = new t.Point(0, 0), Li = new Float32Array(1), Ni = [], Hi = t => 0 === t.properties.level, zi = t => t.properties.level > 0;
5543
+ const {loginIBLResOnCanvas: Oi, logoutIBLResOnCanvas: Ii, getIBLResOnCanvas: Fi} = n.pbr.PBRUtils, Ci = [], Ei = [], Di = new t.Point(0, 0), Ni = new t.Point(0, 0), Li = new Float32Array(1), Ri = [], Hi = t => 0 === t.properties.level, zi = t => t.properties.level > 0;
5527
5544
 
5528
5545
  class Vi {
5529
5546
  static getBloomSymbol() {
@@ -5532,13 +5549,13 @@ class Vi {
5532
5549
  constructor(t, e, i, r, s, o) {
5533
5550
  this.Di = !0, this.regl = t, this.layer = e, this.canvas = t._gl.canvas, this.sceneConfig = r || {},
5534
5551
  this.dataConfig = o || {}, this.pluginIndex = s, this.scene = new n.Scene, this.pickingFBO = e.getRenderer().pickingFBO,
5535
- this.Ri = new ni, this.level0Filter = Hi, this.levelNFilter = zi, this.loginTextureCache(),
5552
+ this.Ni = new ni, this.level0Filter = Hi, this.levelNFilter = zi, this.loginTextureCache(),
5536
5553
  this.symbolDef = Array.isArray(i) ? i.map(t => Ft(t)) : [ Ft(i) ], this.Li(), this.pickingViewport = {
5537
5554
  x: 0,
5538
5555
  y: 0,
5539
5556
  width: () => this.canvas ? this.canvas.width : 1,
5540
5557
  height: () => this.canvas ? this.canvas.height : 1
5541
- }, this.sortByCommandKey = Ui.bind(this), this.colorCache = {}, this.Ni = this.symbolDef.map(t => !(!t || !1 !== t.visible));
5558
+ }, this.sortByCommandKey = Ui.bind(this), this.colorCache = {}, this.Ri = this.symbolDef.map(t => !(!t || !1 !== t.visible));
5542
5559
  }
5543
5560
  hasMesh() {
5544
5561
  const t = this.scene && this.scene.getMeshes();
@@ -5552,7 +5569,7 @@ class Vi {
5552
5569
  return n.getTileLevelValue && n.getTileLevelValue(t, e) || 0;
5553
5570
  }
5554
5571
  getAnalysisMeshes() {
5555
- return this.getShadowMeshes ? this.getShadowMeshes() : Ni;
5572
+ return this.getShadowMeshes ? this.getShadowMeshes() : Ri;
5556
5573
  }
5557
5574
  isVisible() {
5558
5575
  const {minZoom: t, maxZoom: e} = this.sceneConfig, n = this.getMap().getZoom();
@@ -5616,7 +5633,7 @@ class Vi {
5616
5633
  if (n) for (const i in n) n[i] && e[i].renderUniforms && Tt(t, e[i].renderUniforms);
5617
5634
  }
5618
5635
  createGeometries(t, e) {
5619
- if (!t.length) return Ni;
5636
+ if (!t.length) return Ri;
5620
5637
  const n = [];
5621
5638
  for (let i = 0; i < t.length; i++) if (t[i]) if (void 0 !== t[i].ref) n[t[i].ref] ? n.push({
5622
5639
  geometry: n[t[i].ref].geometry,
@@ -5840,7 +5857,7 @@ class Vi {
5840
5857
  }
5841
5858
  }
5842
5859
  startFrame(t) {
5843
- this.$i || (this.init(t), this.$i = !0), this.ft !== t.timestamp && (this.zi = !1,
5860
+ this.qi || (this.init(t), this.qi = !0), this.ft !== t.timestamp && (this.zi = !1,
5844
5861
  this.J = !1, this.Gi = 0), this.scene.clear();
5845
5862
  }
5846
5863
  resize() {}
@@ -5849,9 +5866,9 @@ class Vi {
5849
5866
  for (let t = 0; t < this.picking.length; t++) this.picking[t].dispose();
5850
5867
  delete this.picking;
5851
5868
  }
5852
- if (this.qi) {
5853
- for (let t = 0; t < this.qi.length; t++) this.qi[t].dispose();
5854
- delete this.qi;
5869
+ if (this.$i) {
5870
+ for (let t = 0; t < this.$i.length; t++) this.$i[t].dispose();
5871
+ delete this.$i;
5855
5872
  }
5856
5873
  delete this.Ji, this.logoutTextureCache();
5857
5874
  }
@@ -5859,22 +5876,22 @@ class Vi {
5859
5876
  Array.isArray(t) || (t = [ t ], e = [ e ]);
5860
5877
  let n = !1;
5861
5878
  for (let i = 0; i < t.length; i++) if (t[i]) {
5862
- const r = this.Ki(i, t[i], e[i]);
5879
+ const r = this.Zi(i, t[i], e[i]);
5863
5880
  r && (n = r);
5864
5881
  }
5865
- return delete this.Zi, this.setToRedraw(!1), n;
5882
+ return delete this.Ki, this.setToRedraw(!1), n;
5866
5883
  }
5867
5884
  Qi(t, e) {
5868
5885
  for (const n in e) if (Vt(e, n)) {
5869
5886
  if (I.isFnTypeSymbol(e[n]) && !this.layer.options.features && (!t[n] || t[n].property !== e[n].property)) return !0;
5870
- if (C[n] && !N(e[n], t[n])) return !0;
5887
+ if (C[n] && !R(e[n], t[n])) return !0;
5871
5888
  }
5872
5889
  return !1;
5873
5890
  }
5874
- Ki(t, e, n) {
5891
+ Zi(t, e, n) {
5875
5892
  if (!this.tr) return !1;
5876
5893
  const i = this.Qi(this.symbolDef[t] || {}, n);
5877
- if (this.Ni[t] && !1 !== n.visible) return this.Ni[t] = !1, !0;
5894
+ if (this.Ri[t] && !1 !== n.visible) return this.Ri[t] = !1, !0;
5878
5895
  this.symbolDef[t] = Ft(n);
5879
5896
  const r = this.tr[t];
5880
5897
  for (const t in r) delete r[t];
@@ -5908,16 +5925,16 @@ class Vi {
5908
5925
  this.symbolDef[t] && p(this.symbolDef[t].visible) && (this.Hi[t] = g(this.symbolDef[t].visible));
5909
5926
  }
5910
5927
  getFnTypeConfig(t) {
5911
- this.Zi || (this.Zi = []);
5928
+ this.Ki || (this.Ki = []);
5912
5929
  const e = t.index;
5913
- if (!this.Zi[e]) {
5930
+ if (!this.Ki[e]) {
5914
5931
  const n = this.getSymbolDef(t), i = this.getMap();
5915
- this.Zi[e] = this.createFnTypeConfig(i, n);
5932
+ this.Ki[e] = this.createFnTypeConfig(i, n);
5916
5933
  }
5917
- return this.Zi[e];
5934
+ return this.Ki[e];
5918
5935
  }
5919
5936
  er() {
5920
- delete this.Zi;
5937
+ delete this.Ki;
5921
5938
  }
5922
5939
  loginTextureCache() {
5923
5940
  const t = "__gl_textures".trim(), e = this.getMap();
@@ -5967,15 +5984,15 @@ class Vi {
5967
5984
  level: t.properties.level,
5968
5985
  mesh: t
5969
5986
  })).sort(this.rr), i = this.getMap().projViewMatrix;
5970
- this.Ri.start(t);
5987
+ this.Ni.start(t);
5971
5988
  const s = {};
5972
5989
  for (let e = 0; e < n.length; e++) {
5973
5990
  const o = n[e].mesh;
5974
5991
  let a = s[o.properties.tile.id];
5975
- void 0 === a && (r.multiply(Ci, i, n[e].transform), a = this.Ri.write(t, Ci), s[o.properties.tile.id] = a),
5992
+ void 0 === a && (r.multiply(Ci, i, n[e].transform), a = this.Ni.write(t, Ci), s[o.properties.tile.id] = a),
5976
5993
  o.setUniform("ref", a);
5977
5994
  }
5978
- this.Ri.end(t), this.regl.sr();
5995
+ this.Ni.end(t), this.regl.sr();
5979
5996
  }
5980
5997
  rr(t, e) {
5981
5998
  return e.level - t.level;
@@ -5986,7 +6003,7 @@ class Vi {
5986
6003
  }
5987
6004
  or(t, e) {
5988
6005
  if (!this.picking) return;
5989
- if (this.ar || (this.ar = new n.Scene), !this.qi && (this.lr(), !this.qi)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
6006
+ if (this.ar || (this.ar = new n.Scene), !this.$i && (this.lr(), !this.$i)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
5990
6007
  const i = this.getUniformValues(this.getMap(), this.Wi);
5991
6008
  this.Xi(i);
5992
6009
  const r = this.hr(e);
@@ -6001,7 +6018,7 @@ class Vi {
6001
6018
  const r = o[n];
6002
6019
  if (!e[r]) {
6003
6020
  e[r] = 1, i.highlightPickingId = r;
6004
- for (let e = 0; e < this.qi.length; e++) this.renderer.render(this.qi[e], i, this.ar, t);
6021
+ for (let e = 0; e < this.$i.length; e++) this.renderer.render(this.$i[e], i, this.ar, t);
6005
6022
  }
6006
6023
  }
6007
6024
  }
@@ -6018,21 +6035,21 @@ class Vi {
6018
6035
  }
6019
6036
  outlineAll(t) {
6020
6037
  if (!this.picking) return;
6021
- if (!this.qi && (this.lr(), !this.qi)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
6038
+ if (!this.$i && (this.lr(), !this.$i)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
6022
6039
  const e = this.getUniformValues(this.getMap(), this.Wi);
6023
6040
  this.Xi(e), e.highlightPickingId = -1;
6024
- for (let n = 0; n < this.qi.length; n++) this.renderer.render(this.qi[n], e, this.scene, t);
6041
+ for (let n = 0; n < this.$i.length; n++) this.renderer.render(this.$i[n], e, this.scene, t);
6025
6042
  }
6026
6043
  lr() {
6027
6044
  if (!this.picking) return;
6028
6045
  const t = this.layer.getRenderer().canvas;
6029
- this.qi = [];
6046
+ this.$i = [];
6030
6047
  for (let e = 0; e < this.picking.length; e++) {
6031
6048
  const i = this.picking[e].getPickingVert(), r = {
6032
6049
  ENABLE_PICKING: 1,
6033
6050
  HAS_PICKING_ID: 1
6034
6051
  }, s = this.picking[e].getUniformDeclares().slice(0);
6035
- void 0 !== s.uPickingId && (r.HAS_PICKING_ID = 2), this.qi[e] = new n.MeshShader({
6052
+ void 0 !== s.uPickingId && (r.HAS_PICKING_ID = 2), this.$i[e] = new n.MeshShader({
6036
6053
  vert: i,
6037
6054
  frag: "precision highp float;\nuniform float highlightPickingId;\nvarying float vPickingId;\nvoid main() {\n if(highlightPickingId < .0 || floor(highlightPickingId + .5) == floor(vPickingId + .5)) {\n gl_FragColor = vec4(1.);\n } else {\n discard;\n }\n}",
6038
6055
  uniforms: s,
@@ -6058,7 +6075,7 @@ class Vi {
6058
6075
  equation: "add"
6059
6076
  }
6060
6077
  }
6061
- }), this.qi[e].filter = this.picking[e].filter;
6078
+ }), this.$i[e].filter = this.picking[e].filter;
6062
6079
  }
6063
6080
  }
6064
6081
  hasIBL() {
@@ -6188,7 +6205,7 @@ class Vi {
6188
6205
  l = y[t];
6189
6206
  break;
6190
6207
  }
6191
- l && (m.getRenderer().isTileCached(l.id) || e[t] === xt) && (Ri.set(i, r), h = this.layer.queryTilePointTerrain(Ri, l, _, a, o)),
6208
+ l && (m.getRenderer().isTileCached(l.id) || e[t] === xt) && (Ni.set(i, r), h = this.layer.queryTilePointTerrain(Ni, l, _, a, o)),
6192
6209
  u = e[t], h && (u = null === h[0] ? xt : h[0], Li[0] = u, u = Li[0]), e[t] !== u && (e[t] = u,
6193
6210
  e.dirty = !0), h && h[1] ? P.set(s, u) : T = !1;
6194
6211
  }
@@ -6291,7 +6308,7 @@ function Wi(t, e, i, r) {
6291
6308
 
6292
6309
  const Xi = [ 0, 0 ], Yi = [];
6293
6310
 
6294
- function $i(t) {
6311
+ function qi(t) {
6295
6312
  if (!t.properties.iconPositions) return Xi;
6296
6313
  let e, n = 0;
6297
6314
  for (const i in t.properties.iconPositions) if (e = i, n++, n > 1) return Xi;
@@ -6300,14 +6317,14 @@ function $i(t) {
6300
6317
  return Yi[0] = r, Yi[1] = s, Yi;
6301
6318
  }
6302
6319
 
6303
- const qi = r.identity([]), Ji = {
6320
+ const $i = r.identity([]), Ji = {
6304
6321
  polygonFill: [ 1, 1, 1, 1 ],
6305
6322
  polygonOpacity: 1,
6306
6323
  uvScale: [ 1, 1 ],
6307
6324
  uvOffset: [ 0, 0 ],
6308
6325
  patternWidth: [ 0, 0 ],
6309
6326
  patternOffset: [ 0, 0 ]
6310
- }, Ki = [], Zi = new t.Coordinate(0, 0), Qi = new t.Coordinate(0, 0), tr = new t.Coordinate(0, 0), er = [];
6327
+ }, Zi = [], Ki = new t.Coordinate(0, 0), Qi = new t.Coordinate(0, 0), tr = new t.Coordinate(0, 0), er = [];
6311
6328
 
6312
6329
  class nr extends Bi {
6313
6330
  static getBloomSymbol() {
@@ -6330,16 +6347,16 @@ class nr extends Bi {
6330
6347
  return !0;
6331
6348
  }
6332
6349
  getAnalysisMeshes() {
6333
- if (!this.isVisible()) return Ki;
6350
+ if (!this.isVisible()) return Zi;
6334
6351
  return this.scene.getMeshes().filter(t => 0 === t.properties.level);
6335
6352
  }
6336
6353
  createMesh(e, i, r) {
6337
- const s = this.getMap(), {tilePoint: o} = r, {geometry: a, symbolIndex: l, ref: u} = e, c = this.layer instanceof t.TileLayer, f = this.layer.getTileSize().width, d = a.properties.tileExtent / f, m = a.properties.tileResolution, y = s.pointAtResToCoord(Zi.set(o[0], o[1]), m), g = {
6354
+ const s = this.getMap(), {tilePoint: o} = r, {geometry: a, symbolIndex: l, ref: u} = e, c = this.layer instanceof t.TileLayer, f = this.layer.getTileSize().width, d = a.properties.tileExtent / f, m = a.properties.tileResolution, y = s.pointAtResToCoord(Ki.set(o[0], o[1]), m), g = {
6338
6355
  tileExtent: a.properties.tileExtent,
6339
6356
  tileRatio: d
6340
6357
  }, v = this.getSymbol(l), x = this.getSymbolDef(l);
6341
6358
  if (p(x.polygonPatternFileOrigin) && this.yr(x, e, c ? [ 0, 0 ] : o, m), (p(x.polygonPatternFileWidth) || p(x.polygonPatternFileWidth)) && this.gr(x, e, c ? d : 1, y, m),
6342
- x.uvOffsetInMeter && p(x.uvOffset) && this.vr(x, e, y, m), Ct(g, "polygonFill", v, "polygonFill", Ji.polygonFill, Rt(this.colorCache)),
6359
+ x.uvOffsetInMeter && p(x.uvOffset) && this.vr(x, e, y, m), Ct(g, "polygonFill", v, "polygonFill", Ji.polygonFill, Nt(this.colorCache)),
6343
6360
  Ct(g, "polygonOpacity", v, "polygonOpacity", Ji.polygonOpacity), Ct(g, "uvScale", v, "uvScale", Ji.uvScale),
6344
6361
  void 0 === u) {
6345
6362
  const t = this.getFnTypeConfig(l);
@@ -6353,7 +6370,7 @@ class nr extends Bi {
6353
6370
  get: () => {
6354
6371
  if (a.data.aPatternOrigin) return o;
6355
6372
  const e = v.polygonPatternFileOrigin;
6356
- return e ? (Zi.set(e[0], e[1]), s.coordToPointAtRes(Zi, m, Qi), h.set(t, o[0] - Qi.x, o[1] - Qi.y)) : o;
6373
+ return e ? (Ki.set(e[0], e[1]), s.coordToPointAtRes(Ki, m, Qi), h.set(t, o[0] - Qi.x, o[1] - Qi.y)) : o;
6357
6374
  }
6358
6375
  });
6359
6376
  const e = [];
@@ -6471,7 +6488,7 @@ class nr extends Bi {
6471
6488
  }
6472
6489
  u = a[t];
6473
6490
  const e = o(null, r[u].feature.properties);
6474
- e ? (Zi.set(e[0], e[1]), s.coordToPointAtRes(Zi, i, Qi), c = h[2 * t] = Qi.x, f = h[2 * t + 1] = Qi.y) : (c = h[2 * t] = n[0],
6491
+ e ? (Ki.set(e[0], e[1]), s.coordToPointAtRes(Ki, i, Qi), c = h[2 * t] = Qi.x, f = h[2 * t + 1] = Qi.y) : (c = h[2 * t] = n[0],
6475
6492
  f = h[2 * t + 1] = n[1]);
6476
6493
  }
6477
6494
  e.data.aPatternOrigin = h;
@@ -6605,7 +6622,7 @@ class nr extends Bi {
6605
6622
  }
6606
6623
  getUniformValues(t, e) {
6607
6624
  const n = e && e.isRenderingTerrainSkin, i = {
6608
- projViewMatrix: n ? qi : t.projViewMatrix,
6625
+ projViewMatrix: n ? $i : t.projViewMatrix,
6609
6626
  glScale: e && e.isRenderingTerrainSkin ? 1 : 1 / t.getGLScale(),
6610
6627
  viewport: n && e && e.viewport,
6611
6628
  hasSSRGround: e && e.hasSSRGround
@@ -6668,9 +6685,9 @@ class or extends Bi {
6668
6685
  tileRatio: r.properties.tileRatio,
6669
6686
  tileExtent: r.properties.tileExtent
6670
6687
  };
6671
- this.setLineUniforms(l, h), Ct(h, "lineColor", l, "lineColor", "#fff", Rt(this.colorCache)),
6672
- Ct(h, "linePatterGapColor", l, "linePatterGapColor", [ 0, 0, 0, 0 ], Rt(this.colorCache)),
6673
- Ct(h, "lineStrokeColor", l, "lineStrokeColor", [ 0, 0, 0, 0 ], Rt(this.colorCache)),
6688
+ this.setLineUniforms(l, h), Ct(h, "lineColor", l, "lineColor", "#fff", Nt(this.colorCache)),
6689
+ Ct(h, "linePatterGapColor", l, "linePatterGapColor", [ 0, 0, 0, 0 ], Nt(this.colorCache)),
6690
+ Ct(h, "lineStrokeColor", l, "lineStrokeColor", [ 0, 0, 0, 0 ], Nt(this.colorCache)),
6674
6691
  Ct(h, "lineDasharray", l, "lineDasharray", [ 0, 0, 0, 0 ], t => {
6675
6692
  let e;
6676
6693
  if (t && t.length) {
@@ -6678,7 +6695,7 @@ class or extends Bi {
6678
6695
  1 === t.length ? e = [ n[0], n[0], n[0], n[0] ] : 2 === t.length ? e = [ n[0], n[1], n[0], n[1] ] : 3 === t.length ? e = [ n[0], n[1], n[2], n[2] ] : 4 === t.length ? e = t : t.length > 4 && (e = t.slice(0, 4));
6679
6696
  }
6680
6697
  return e || [ 0, 0, 0, 0 ];
6681
- }), Ct(h, "lineDashColor", l, "lineDashColor", [ 0, 0, 0, 0 ], Rt(this.colorCache));
6698
+ }), Ct(h, "lineDashColor", l, "lineDashColor", [ 0, 0, 0, 0 ], Nt(this.colorCache));
6682
6699
  const u = r.properties.iconAtlas, c = this.layer instanceof t.TileLayer;
6683
6700
  u && (h.linePatternFile = Wi(this.regl, u, !1, !1), h.atlasSize = u ? [ u.width, u.height ] : [ 0, 0 ],
6684
6701
  h.flipY = c ? -1 : 1, this.drawDebugAtlas(u)), void 0 === o && r.generateBuffers(this.regl);
@@ -7010,13 +7027,13 @@ function ur(t) {
7010
7027
 
7011
7028
  class cr {
7012
7029
  constructor(t) {
7013
- this.R = t || [], this.properties = {};
7030
+ this.N = t || [], this.properties = {};
7014
7031
  }
7015
7032
  set meshes(t) {
7016
- this.R = t;
7033
+ this.N = t;
7017
7034
  }
7018
7035
  get meshes() {
7019
- return this.R;
7036
+ return this.N;
7020
7037
  }
7021
7038
  }
7022
7039
 
@@ -7061,18 +7078,18 @@ class br extends Bi {
7061
7078
  if (this.Tr && n && this.Or) {
7062
7079
  const e = this.getMap();
7063
7080
  this.Cr || (this.Cr = new t.Coordinate(0, 0), this.Er = new t.Coordinate(0, 0)),
7064
- n.anchor0 = e.containerPointToCoord(this.Dr, this.Cr), n.anchor1 = e.containerPointToCoord(this.Rr, this.Er),
7081
+ n.anchor0 = e.containerPointToCoord(this.Dr, this.Cr), n.anchor1 = e.containerPointToCoord(this.Nr, this.Er),
7065
7082
  n.anchor0.z = e.getZoom(), n.anchor0.width = e.width, n.anchor0.height = e.height;
7066
7083
  }
7067
7084
  this.getMap().collisionFrameTime += performance.now() - this.Pr;
7068
7085
  }
7069
7086
  Ir(t) {
7070
7087
  const e = this.getMap(), n = e.getZoom(), [i, r] = this.Lr(t);
7071
- return !i || !r || i.z !== n || i.width !== e.width || i.height !== e.height || i.distanceTo(this.Dr) > 3 || r.distanceTo(this.Rr) > 3;
7088
+ return !i || !r || i.z !== n || i.width !== e.width || i.height !== e.height || i.distanceTo(this.Dr) > 3 || r.distanceTo(this.Nr) > 3;
7072
7089
  }
7073
- Nr() {
7090
+ Rr() {
7074
7091
  const e = this.getMap();
7075
- this.Hr = {}, this.Dr = new t.Point(e.width / 2, e.height / 3), this.Rr = new t.Point(e.width / 2, 2 * e.height / 3),
7092
+ this.Hr = {}, this.Dr = new t.Point(e.width / 2, e.height / 3), this.Nr = new t.Point(e.width / 2, 2 * e.height / 3),
7076
7093
  delete this.Tr, this.Fr || (this.Fr = {
7077
7094
  tags: {}
7078
7095
  }), this.Mr = {
@@ -7155,8 +7172,8 @@ class br extends Bi {
7155
7172
  let y = t && d && 0 === d.collides, g = 1, v = !1;
7156
7173
  if (this.sceneConfig.fading) {
7157
7174
  const t = this.Wr(e);
7158
- if (this.Xr) t[r] = y ? 1 : -1; else if (c && delete e.Yr, g = this.$r(c, y, t, r),
7159
- c ? (g > 0 && (y = !0), v = this.isBoxFading(e, r), v && this.setToRedraw()) : y || (this.qr(t, r),
7175
+ if (this.Xr) t[r] = y ? 1 : -1; else if (c && delete e.Yr, g = this.qr(c, y, t, r),
7176
+ c ? (g > 0 && (y = !0), v = this.isBoxFading(e, r), v && this.setToRedraw()) : y || (this.$r(t, r),
7160
7177
  g = 0), y) {
7161
7178
  const n = e.Yr;
7162
7179
  if (n && 1 === g && t[r] > 0) {
@@ -7170,7 +7187,7 @@ class br extends Bi {
7170
7187
  if (d && s.options.debugCollision && this.addCollisionDebugBox(d.boxes, d.collides ? 0 : 1),
7171
7188
  y || v) {
7172
7189
  const {mesh: t, start: e} = n[0], i = this.getSymbol(t.properties.symbolIndex);
7173
- !this.Jr(i, t, e) && d && d.boxes && this.Kr(d.boxes, t);
7190
+ !this.Jr(i, t, e) && d && d.boxes && this.Zr(d.boxes, t);
7174
7191
  }
7175
7192
  if (y) {
7176
7193
  const t = mr[0] = 255 * g;
@@ -7186,9 +7203,9 @@ class br extends Bi {
7186
7203
  }
7187
7204
  setCollisionOpacity(t, e, n, i, r) {
7188
7205
  const s = e[i], o = e[r - 1];
7189
- this.Zr(t, n, s, o);
7206
+ this.Kr(t, n, s, o);
7190
7207
  }
7191
- Zr(t, e, n, i) {
7208
+ Kr(t, e, n, i) {
7192
7209
  const {aOpacity: r} = t.geometry.properties;
7193
7210
  if (!r) return;
7194
7211
  const s = n;
@@ -7224,10 +7241,10 @@ class br extends Bi {
7224
7241
  const r = i[n], s = r >> 2;
7225
7242
  return r < 2 ? 1 == +t[this.propAllowOverlap] : s % 2;
7226
7243
  }
7227
- Kr(t) {
7244
+ Zr(t) {
7228
7245
  if (Array.isArray(t[0])) for (let e = 0; e < t.length; e++) this.insertCollisionBox(t[e]); else this.insertCollisionBox(t);
7229
7246
  }
7230
- $r(t, e, n, i) {
7247
+ qr(t, e, n, i) {
7231
7248
  let {fadingDuration: r, fadeInDelay: s, fadeOutDelay: o} = this.sceneConfig;
7232
7249
  It(r) && (r = fr), It(s) && (s = dr), It(o) && (o = pr);
7233
7250
  const {frameTimestamp: a} = this.Mr;
@@ -7263,7 +7280,7 @@ class br extends Bi {
7263
7280
  this.ns = t;
7264
7281
  }
7265
7282
  }
7266
- qr(t, e) {
7283
+ $r(t, e) {
7267
7284
  if (!t) return;
7268
7285
  const {frameTimestamp: n} = this.Mr;
7269
7286
  let {fadingDuration: i} = this.sceneConfig;
@@ -7317,7 +7334,7 @@ class br extends Bi {
7317
7334
  n.indices.push(o, o + 1, o + 1, o + 2, o + 2, o + 3, o + 3, o);
7318
7335
  }
7319
7336
  updateCollision(t) {
7320
- super.updateCollision(t), this.Nr(), this.us(), this.cs && this.cs.length && (this.fs(),
7337
+ super.updateCollision(t), this.Rr(), this.us(), this.cs && this.cs.length && (this.fs(),
7321
7338
  this.cs && (this.setToRedraw(), this.scene.addMesh(this.cs)));
7322
7339
  (this.getMap().isZooming() || this.cs && this.cs.length) && (this.ds(), this.ps(this.scene.getMeshes()));
7323
7340
  }
@@ -7549,7 +7566,7 @@ function Er(t, e, n, i, r) {
7549
7566
  return u.set(t, o, -s, s, o);
7550
7567
  }
7551
7568
 
7552
- const Dr = [], Rr = [], Lr = [], Nr = [], Hr = [], zr = [], Vr = [], Ur = [], jr = [ 1, -1 ], Br = [ 1, 1 ];
7569
+ const Dr = [], Nr = [], Lr = [], Rr = [], Hr = [], zr = [], Vr = [], Ur = [], jr = [ 1, -1 ], Br = [ 1, 1 ];
7553
7570
 
7554
7571
  function Gr(t, e, n, r, s) {
7555
7572
  const o = e.material.uniforms, a = s.cameraToCenterDistance, l = e.geometry.properties, u = this.getSymbol(l.symbolIndex), c = e.geometry.desc.positionSize, f = l.aAnchor, d = i.set(Dr, f[n * c], f[n * c + 1], 2 === c ? 0 : f[n * c + 2]), {aTerrainAltitude: p} = l;
@@ -7557,22 +7574,22 @@ function Gr(t, e, n, r, s) {
7557
7574
  const t = 100 * p[2 * n];
7558
7575
  t && (d[2] += t);
7559
7576
  }
7560
- let m = bi(Rr, d, r, s.width, s.height);
7577
+ let m = bi(Nr, d, r, s.width, s.height);
7561
7578
  const y = m[2];
7562
7579
  let g = 1;
7563
7580
  if (o.markerPerspectiveRatio) {
7564
7581
  g = kt(.5 + .5 * (1 - (1 - a / y) * o.markerPerspectiveRatio), 0, 4);
7565
7582
  }
7566
7583
  const {aShape: v, aMarkerDx: x, aMarkerDy: b, aMarkerWidth: A, aMarkerHeight: w, aPitchAlign: _, aRotationAlign: S, aRotation: M} = l, P = x ? x[n] : u.markerDx, T = b ? b[n] : u.markerDy, k = _ ? _[n] : o.pitchWithMap, O = S ? S[n] : o.rotateWithMap, I = h.set(Ur, P || 0, -(T || 0));
7567
- let F = h.set(Nr, v[2 * n] / 10, v[2 * n + 1] / 10), C = h.set(Hr, v[2 * n + 2] / 10, v[2 * n + 3] / 10), E = h.set(zr, v[2 * n + 4] / 10, v[2 * n + 5] / 10), D = h.set(Vr, v[2 * n + 6] / 10, v[2 * n + 7] / 10);
7584
+ let F = h.set(Rr, v[2 * n] / 10, v[2 * n + 1] / 10), C = h.set(Hr, v[2 * n + 2] / 10, v[2 * n + 3] / 10), E = h.set(zr, v[2 * n + 4] / 10, v[2 * n + 5] / 10), D = h.set(Vr, v[2 * n + 6] / 10, v[2 * n + 7] / 10);
7568
7585
  0 === o.flipY && 1 === k && (h.multiply(F, F, jr), h.multiply(C, C, jr), h.multiply(E, E, jr),
7569
7586
  h.multiply(D, D, jr));
7570
- const [R, L] = $i(e.geometry);
7571
- let N = A ? A[n] : u.markerWidth;
7572
- It(N) && (N = R || 15);
7587
+ const [N, L] = qi(e.geometry);
7588
+ let R = A ? A[n] : u.markerWidth;
7589
+ It(R) && (R = N || 15);
7573
7590
  let H = w ? w[n] : u.markerHeight;
7574
7591
  It(H) && (H = L || 15);
7575
- const z = h.set(Br, N / 2048, H / 2048);
7592
+ const z = h.set(Br, R / 2048, H / 2048);
7576
7593
  h.mul(F, F, z), h.mul(C, C, z), h.mul(E, E, z), h.mul(D, D, z);
7577
7594
  const V = -(M ? M[n] / 9362 : -(u.markerRotation || 0) * Math.PI / 180), U = s.getBearing() * Math.PI / 180;
7578
7595
  if (U * O || V) {
@@ -7586,9 +7603,9 @@ function Gr(t, e, n, r, s) {
7586
7603
  return 1 !== j && (t[0] *= j, t[1] *= j, t[2] *= j, t[3] *= j), t;
7587
7604
  }
7588
7605
 
7589
- const Wr = [], Xr = [], Yr = [], $r = [], qr = [], Jr = [], Kr = [ 1, -1 ];
7606
+ const Wr = [], Xr = [], Yr = [], qr = [], $r = [], Jr = [], Zr = [ 1, -1 ];
7590
7607
 
7591
- function Zr(t, e, n, r, s, o, a, l, u) {
7608
+ function Kr(t, e, n, r, s, o, a, l, u) {
7592
7609
  const c = r.material.uniforms, f = u.cameraToCenterDistance, d = r.geometry.properties, p = this.getSymbol(d.symbolIndex), m = "line" === p.textPlacement && !zt(p), y = n[2];
7593
7610
  let g = 1;
7594
7611
  if (c.textPerspectiveRatio) {
@@ -7599,18 +7616,18 @@ function Zr(t, e, n, r, s, o, a, l, u) {
7599
7616
  const {aOffset: r, aShape: s} = d, o = r.length !== s.length;
7600
7617
  let f, p, m, v;
7601
7618
  if (o ? (f = i.set(Xr, r[3 * a] / 10, r[3 * a + 1] / 10, r[3 * a + 2] / 10), p = i.set(Yr, r[3 * a + 3] / 10, r[3 * a + 4] / 10, r[3 * a + 5] / 10),
7602
- m = i.set($r, r[3 * a + 6] / 10, r[3 * a + 7] / 10, r[3 * a + 8] / 10), v = i.set(qr, r[3 * a + 9] / 10, r[3 * a + 10] / 10, r[3 * a + 11] / 10)) : (f = h.set(Xr, r[2 * a] / 10, r[2 * a + 1] / 10),
7603
- p = h.set(Yr, r[2 * a + 2] / 10, r[2 * a + 3] / 10), m = h.set($r, r[2 * a + 4] / 10, r[2 * a + 5] / 10),
7604
- v = h.set(qr, r[2 * a + 6] / 10, r[2 * a + 7] / 10)), 1 === M) {
7619
+ m = i.set(qr, r[3 * a + 6] / 10, r[3 * a + 7] / 10, r[3 * a + 8] / 10), v = i.set($r, r[3 * a + 9] / 10, r[3 * a + 10] / 10, r[3 * a + 11] / 10)) : (f = h.set(Xr, r[2 * a] / 10, r[2 * a + 1] / 10),
7620
+ p = h.set(Yr, r[2 * a + 2] / 10, r[2 * a + 3] / 10), m = h.set(qr, r[2 * a + 4] / 10, r[2 * a + 5] / 10),
7621
+ v = h.set($r, r[2 * a + 6] / 10, r[2 * a + 7] / 10)), 1 === M) {
7605
7622
  const n = lt(u.getResolution(), u);
7606
7623
  Fr(t, e, f, p, m, v, l, T, c, u, y, g, o, n);
7607
- } else h.multiply(f, f, Kr), h.multiply(p, p, Kr), h.multiply(m, m, Kr), h.multiply(v, v, Kr),
7624
+ } else h.multiply(f, f, Zr), h.multiply(p, p, Zr), h.multiply(m, m, Zr), h.multiply(v, v, Zr),
7608
7625
  Cr(t, n, f, p, m, v, T, g);
7609
7626
  } else {
7610
7627
  const {aShape: i} = d;
7611
- let r = h.set(Xr, i[2 * a] / 10, -i[2 * a + 1] / 10), o = h.set(Yr, i[2 * a + 2] / 10, -i[2 * a + 3] / 10), f = h.set($r, i[2 * a + 4] / 10, -i[2 * a + 5] / 10), v = h.set(qr, i[2 * a + 6] / 10, -i[2 * a + 7] / 10);
7612
- 0 === c.flipY && 1 === M && (h.multiply(r, r, Kr), h.multiply(o, o, Kr), h.multiply(f, f, Kr),
7613
- h.multiply(v, v, Kr));
7628
+ let r = h.set(Xr, i[2 * a] / 10, -i[2 * a + 1] / 10), o = h.set(Yr, i[2 * a + 2] / 10, -i[2 * a + 3] / 10), f = h.set(qr, i[2 * a + 4] / 10, -i[2 * a + 5] / 10), v = h.set($r, i[2 * a + 6] / 10, -i[2 * a + 7] / 10);
7629
+ 0 === c.flipY && 1 === M && (h.multiply(r, r, Zr), h.multiply(o, o, Zr), h.multiply(f, f, Zr),
7630
+ h.multiply(v, v, Zr));
7614
7631
  const x = w ? w[a] / 9362 : (p.textRotation || 0) * Math.PI / 180, b = m ? 0 : u.getBearing() * Math.PI / 180;
7615
7632
  if (x || b) {
7616
7633
  const t = Er(Wr, x, b, P, M);
@@ -7784,7 +7801,7 @@ function ns(t, e, n) {
7784
7801
 
7785
7802
  function is(t, e, n) {
7786
7803
  void 0 === e.isHalo && (e.isHalo = 1), Ct(e, "textOpacity", n, "textOpacity", ts.textOpacity),
7787
- Ct(e, "textFill", n, "textFill", ts.textFill, Rt()), Ct(e, "textHaloFill", n, "textHaloFill", ts.textHaloFill, Rt()),
7804
+ Ct(e, "textFill", n, "textFill", ts.textFill, Nt()), Ct(e, "textHaloFill", n, "textHaloFill", ts.textHaloFill, Nt()),
7788
7805
  Ct(e, "textHaloBlur", n, "textHaloBlur", ts.textHaloBlur), Ct(e, "textHaloRadius", n, "textHaloRadius", ts.textHaloRadius),
7789
7806
  Ct(e, "textHaloOpacity", n, "textHaloOpacity", ts.textHaloOpacity), Ct(e, "textPerspectiveRatio", n, "textPerspectiveRatio", ts.textPerspectiveRatio, e => "line" === t.properties.textPlacement ? 1 : e),
7790
7807
  Ct(e, "rotateWithMap", n, "textRotationAlignment", ts.textRotationAlignment, t => +("map" === t)),
@@ -7998,7 +8015,7 @@ function us(t, e, n, i, r, s, o) {
7998
8015
  for (let s = r; s < r + 6 * b; s += 6) {
7999
8016
  const r = A[_] = A[_] || [];
8000
8017
  _++;
8001
- const l = Zr.call(this, r, y, v, e, p, m, n[s], o, a);
8018
+ const l = Kr.call(this, r, y, v, e, p, m, n[s], o, a);
8002
8019
  if (!t) {
8003
8020
  const e = this.isCollides(l);
8004
8021
  1 === e ? t = 1 : -1 === e && i++;
@@ -8010,7 +8027,7 @@ function us(t, e, n, i, r, s, o) {
8010
8027
  for (let h = r; h < s; h += 6) {
8011
8028
  const r = d[2 * n[h] + 1];
8012
8029
  if (l !== r || h === s - 6) {
8013
- const u = n[h === s - 6 ? h : h - 6], c = Zr.call(this, os, y, v, e, p, m, i, o, a), f = Zr.call(this, as, y, v, e, p, m, u, o, a), d = A[_] = A[_] || [];
8030
+ const u = n[h === s - 6 ? h : h - 6], c = Kr.call(this, os, y, v, e, p, m, i, o, a), f = Kr.call(this, as, y, v, e, p, m, u, o, a), d = A[_] = A[_] || [];
8014
8031
  _++, d[0] = Math.min(c[0], f[0]), d[1] = Math.min(c[1], f[1]), d[2] = Math.max(c[2], f[2]),
8015
8032
  d[3] = Math.max(c[3], f[3]), i = n[h], l = r, !t && this.isCollides(d) && (t = 1);
8016
8033
  }
@@ -8021,8 +8038,8 @@ function us(t, e, n, i, r, s, o) {
8021
8038
 
8022
8039
  function cs(t, e) {
8023
8040
  const n = function(t, e) {
8024
- const {aPickingId: n, features: i} = t.geometry.properties, r = n[e];
8025
- return (i && i[r] && i[r].feature).label;
8041
+ const {aPickingId: n, features: i} = t.geometry.properties, r = n[e], s = i && i[r] && i[r].feature;
8042
+ return s && s.label;
8026
8043
  }(t, e);
8027
8044
  return n ? function(t, e, n) {
8028
8045
  if (!n) return null;
@@ -8329,16 +8346,16 @@ function _s(t, e) {
8329
8346
  P || (P = r.aPadOffsetX = new Int8Array(m.length), T = r.aPadOffsetY = new Int8Array(m.length))),
8330
8347
  m && n) {
8331
8348
  const e = Math.abs((f - s) / 10 * M) + (k[1] + k[3] || 0);
8332
- if (ys[0] = e, m[t] !== ys[0] && (Nt(m, ys[0], t, t + 4), m.dirty = !0), P) {
8349
+ if (ys[0] = e, m[t] !== ys[0] && (Rt(m, ys[0], t, t + 4), m.dirty = !0), P) {
8333
8350
  const e = (k[1] + k[3]) / 2 - k[3];
8334
- gs[0] = e, P[t] !== gs[0] && (Nt(P, e, t, t + 4), P.dirty = !0);
8351
+ gs[0] = e, P[t] !== gs[0] && (Rt(P, e, t, t + 4), P.dirty = !0);
8335
8352
  }
8336
8353
  }
8337
8354
  if (v && i) {
8338
8355
  const e = Math.abs((d - c) / 10 * M) + (k[0] + k[2] || 0);
8339
- if (ys[0] = e, v[t] !== ys[0] && (Nt(v, ys[0], t, t + 4), v.dirty = !0), T) {
8356
+ if (ys[0] = e, v[t] !== ys[0] && (Rt(v, ys[0], t, t + 4), v.dirty = !0), T) {
8340
8357
  const e = k[0] - (k[0] + k[2]) / 2;
8341
- gs[0] = e, T[t] !== gs[0] && (Nt(T, e, t, t + 4), T.dirty = !0);
8358
+ gs[0] = e, T[t] !== gs[0] && (Rt(T, e, t, t + 4), T.dirty = !0);
8342
8359
  }
8343
8360
  }
8344
8361
  };
@@ -8386,7 +8403,7 @@ class Es extends br {
8386
8403
  }
8387
8404
  constructor(t, e, n, i, r, s) {
8388
8405
  super(t, e, n, i, r, s), this.propAllowOverlap = "markerAllowOverlap", this.propIgnorePlacement = "markerIgnorePlacement",
8389
- this.Zi = {}, this.isLabelCollides = us.bind(this), this.Is = Ss.bind(this), this.Fs = Ms.bind(this),
8406
+ this.Ki = {}, this.isLabelCollides = us.bind(this), this.Is = Ss.bind(this), this.Fs = Ms.bind(this),
8390
8407
  this.Cs = Ps.bind(this), this.Es = Ts.bind(this), this.Ds = [];
8391
8408
  }
8392
8409
  needToRefreshTerrainTileOnZooming() {
@@ -8403,7 +8420,7 @@ class Es extends br {
8403
8420
  return super.isTerrainSkin() && this.needToRefreshTerrainTileOnZooming();
8404
8421
  }
8405
8422
  setTextShaderDefines(t) {
8406
- this.Rs = t;
8423
+ this.Ns = t;
8407
8424
  }
8408
8425
  createFnTypeConfig(t, e) {
8409
8426
  return {
@@ -8423,7 +8440,7 @@ class Es extends br {
8423
8440
  postCreateGeometry(t, e) {
8424
8441
  const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), s = this.getFnTypeConfig(i);
8425
8442
  if (this.Ls(n)) n.properties.iconAtlas ? this.drawDebugAtlas(n.properties.iconAtlas) : n.properties.isEmpty = !0,
8426
- vs(n, r, s.icon); else if (this.Ns(n) && zt(r)) {
8443
+ vs(n, r, s.icon); else if (this.Rs(n) && zt(r)) {
8427
8444
  const t = e[e.length - 1];
8428
8445
  if (t) {
8429
8446
  const {geometry: e, symbolIndex: s} = t;
@@ -8469,7 +8486,7 @@ class Es extends br {
8469
8486
  e.properties.aAnchor = t, e.properties.aShape = n;
8470
8487
  }
8471
8488
  e.properties.visElemts || (e.properties.elements = e.elements, e.properties.visElemts = new e.elements.constructor(e.elements.length));
8472
- const [c, f] = $i(e);
8489
+ const [c, f] = qi(e);
8473
8490
  Ct(u, "markerOpacity", s, "markerOpacity", 1), Ct(u, "markerPerspectiveRatio", s, "markerPerspectiveRatio", s.markerTextFit ? 0 : 1),
8474
8491
  Ct(u, "markerWidth", s, "markerWidth", c || 15), Ct(u, "markerHeight", s, "markerHeight", f || 15),
8475
8492
  Ct(u, "markerDx", s, "markerDx", 0), Ct(u, "markerDy", s, "markerDy", 0), Ct(u, "markerRotation", s, "markerRotation", 0, t => t * Math.PI / 180),
@@ -8494,7 +8511,7 @@ class Es extends br {
8494
8511
  }(this.regl, a, e, 0, u, c.icon, o.options.collision, !s, this.isEnableUniquePlacement());
8495
8512
  t && (t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.glyphAtlas,
8496
8513
  f.push(t));
8497
- } else if (this.Ns(a)) {
8514
+ } else if (this.Rs(a)) {
8498
8515
  const t = es.call(this, this.regl, a, e, h, u, c.text, o.options.collision, !s, this.isEnableUniquePlacement());
8499
8516
  t.length && (t.forEach(t => {
8500
8517
  t.positionMatrix = this.getAltitudeOffsetMatrix(), delete t.geometry.properties.iconAtlas;
@@ -8512,7 +8529,7 @@ class Es extends br {
8512
8529
  old: n,
8513
8530
  new: i
8514
8531
  };
8515
- } else if (this.Ns(t)) {
8532
+ } else if (this.Rs(t)) {
8516
8533
  const {collideIds: n, aCount: i} = t.properties;
8517
8534
  if (!i) return;
8518
8535
  if (e.markerCollideMap) {
@@ -8681,7 +8698,7 @@ class Es extends br {
8681
8698
  }
8682
8699
  }
8683
8700
  isBoxCollides(t, e, n, i, r, s) {
8684
- if (this.Ns(t.geometry)) return us.call(this, 0, t, e, n, i, r, s);
8701
+ if (this.Rs(t.geometry)) return us.call(this, 0, t, e, n, i, r, s);
8685
8702
  if (t.geometry.properties.isEmpty) return Os;
8686
8703
  const {aTerrainAltitude: o} = t.geometry.properties;
8687
8704
  if (o) {
@@ -8753,7 +8770,7 @@ class Es extends br {
8753
8770
  } ],
8754
8771
  extraCommandProps: i
8755
8772
  }), this.shader.version = 300;
8756
- const {uniforms: s, extraCommandProps: o} = rs.call(this, e, this.sceneConfig), a = this.Rs || {};
8773
+ const {uniforms: s, extraCommandProps: o} = rs.call(this, e, this.sceneConfig), a = this.Ns || {};
8757
8774
  if (this.Vs = new n.MeshShader({
8758
8775
  vert: ps,
8759
8776
  frag: ms,
@@ -8808,7 +8825,7 @@ class Es extends br {
8808
8825
  };
8809
8826
  }
8810
8827
  getUniqueEntryKey(t, e) {
8811
- if (!this.Ns(t.geometry)) return null;
8828
+ if (!this.Rs(t.geometry)) return null;
8812
8829
  const {elements: n} = t.geometry.properties;
8813
8830
  return cs(t, n[e]);
8814
8831
  }
@@ -8816,7 +8833,7 @@ class Es extends br {
8816
8833
  const {symbolIndex: e} = t.properties;
8817
8834
  return 0 === e.type;
8818
8835
  }
8819
- Ns(t) {
8836
+ Rs(t) {
8820
8837
  const {symbolIndex: e} = t.properties;
8821
8838
  return 1 === e.type;
8822
8839
  }
@@ -8826,10 +8843,10 @@ function Ds(t, e) {
8826
8843
  return t.properties.level - e.properties.level || t.properties.meshKey - e.properties.meshKey;
8827
8844
  }
8828
8845
 
8829
- const Rs = [], Ls = [], Ns = [];
8846
+ const Ns = [], Ls = [], Rs = [];
8830
8847
 
8831
8848
  function Hs(t, e, n, r, s, o, a, l, u, c, f, d, p) {
8832
- const {aGlyphOffset: m, aSegment: y, aTextDx: g, aTextDy: v, symbolIndex: x} = e.geometry.properties, b = this.getSymbol(x), A = g ? g[s] : b.textDx, w = v ? v[s] : b.textDy, _ = h.set(Ns, A || 0, w || 0), S = h.set(Rs, m[2 * s], m[2 * s + 1]), M = i.set(Ls, y[3 * s], y[3 * s + 1], y[3 * s + 2]);
8849
+ const {aGlyphOffset: m, aSegment: y, aTextDx: g, aTextDy: v, symbolIndex: x} = e.geometry.properties, b = this.getSymbol(x), A = g ? g[s] : b.textDx, w = v ? v[s] : b.textDy, _ = h.set(Rs, A || 0, w || 0), S = h.set(Ns, m[2 * s], m[2 * s + 1]), M = i.set(Ls, y[3 * s], y[3 * s + 1], y[3 * s + 2]);
8833
8850
  return function(t, e, n, i, r, s, o, a, l, h, u, c, f, d, p, m, y, g) {
8834
8851
  p || (p = i);
8835
8852
  const v = e.geometry.properties.line, x = s[0] * c, b = f ? x - o : x + o;
@@ -8842,18 +8859,18 @@ function Hs(t, e, n, r, s, o, a, l, u, c, f, d, p) {
8842
8859
  T.x = P.x, T.y = P.y, O.x = k.x, O.y = k.y, P.x = n[3 * M], P.y = n[3 * M + 1],
8843
8860
  k.x = v[3 * M], k.y = v[3 * M + 1], I += F, F = T.dist(P) / d;
8844
8861
  }
8845
- const C = (S - I) / F, E = m && m.getRenderer(), D = E && E.getTerrainHelper(), R = e.properties.tile.terrainTileInfos;
8862
+ const C = (S - I) / F, E = m && m.getRenderer(), D = E && E.getTerrainHelper(), N = e.properties.tile.terrainTileInfos;
8846
8863
  if (!g && D) {
8847
8864
  const {extent: n} = e.properties.tile, i = m.getTileSize().width / n, r = m.getMap();
8848
8865
  let s = k.sub(O).mult(C).wi(O);
8849
- P = Ti(Ai, r, e, k, i, m, y, R), T = Ti(wi, r, e, O, i, m, y, R), s = Ti(_i, r, e, s, i, m, y, R);
8866
+ P = Ti(Ai, r, e, k, i, m, y, N), T = Ti(wi, r, e, O, i, m, y, N), s = Ti(_i, r, e, s, i, m, y, N);
8850
8867
  const o = w + Math.atan2(P[1] - T[1], P[0] - T[0]);
8851
8868
  return t[0] = (s[0] - p[0]) / d, t[1] = (s[1] - p[1]) / d, t[2] = o, t;
8852
8869
  }
8853
- const L = P.sub(T), N = L.mult(C).wi(T);
8854
- N.wi(L.Fi().Ci().Pi(a * A));
8870
+ const L = P.sub(T), R = L.mult(C).wi(T);
8871
+ R.wi(L.Fi().Ci().Pi(a * A));
8855
8872
  const H = w + Math.atan2(P.y - T.y, P.x - T.x);
8856
- return t[0] = (N.x - i[0]) / d, t[1] = (N.y - i[1]) / d, t[2] = H, t;
8873
+ return t[0] = (R.x - i[0]) / d, t[1] = (R.y - i[1]) / d, t[2] = H, t;
8857
8874
  }(t, e, r, o, a, S, _[0], _[1], M[0], M[1], M[2], n / 24, u, l, c, f, d, p);
8858
8875
  }
8859
8876
 
@@ -8886,7 +8903,7 @@ const Bs = function(t) {
8886
8903
  }, Xs = function(t) {
8887
8904
  const e = this.layer.getRenderer(), n = t.properties.tile.z, i = e.getCurrentTileZoom();
8888
8905
  return !this.Ts(t) && !e.isForeground(t) && "line" === t.geometry.properties.textPlacement && n < i;
8889
- }, Ys = [ 0, 0, 3 ], $s = [], qs = [], Js = [], Ks = [], Zs = [], Qs = [], to = [], eo = [], no = [ 1, -1 ], io = new Int16Array(3), ro = [], so = [], oo = [], ao = [], lo = [], ho = [], uo = [], co = {}, fo = {}, po = {}, mo = [], yo = [], go = r.identity([]), vo = [];
8906
+ }, Ys = [ 0, 0, 3 ], qs = [], $s = [], Js = [], Zs = [], Ks = [], Qs = [], to = [], eo = [], no = [ 1, -1 ], io = new Int16Array(3), ro = [], so = [], oo = [], ao = [], lo = [], ho = [], uo = [], co = {}, fo = {}, po = {}, mo = [], yo = [], go = r.identity([]), vo = [];
8890
8907
 
8891
8908
  class xo extends br {
8892
8909
  static getBloomSymbol() {
@@ -8894,8 +8911,8 @@ class xo extends br {
8894
8911
  }
8895
8912
  constructor(t, e, n, i, r, s) {
8896
8913
  super(t, e, n, i, r, s), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
8897
- this.colorCache = {}, this.$s = Bs.bind(this), this.qs = Gs.bind(this), this.Js = Ws.bind(this),
8898
- this.Ks = Xs.bind(this), this.isLabelCollides = us.bind(this), this.Zs();
8914
+ this.colorCache = {}, this.qs = Bs.bind(this), this.$s = Gs.bind(this), this.Js = Ws.bind(this),
8915
+ this.Zs = Xs.bind(this), this.isLabelCollides = us.bind(this), this.Ks();
8899
8916
  }
8900
8917
  prepareRender(...t) {
8901
8918
  super.prepareRender(...t);
@@ -8909,7 +8926,7 @@ class xo extends br {
8909
8926
  updateSymbol(...t) {
8910
8927
  this.Qs = void 0, this.to = void 0;
8911
8928
  const e = super.updateSymbol(...t);
8912
- return this.Zs(), e;
8929
+ return this.Ks(), e;
8913
8930
  }
8914
8931
  isTerrainVector() {
8915
8932
  if (!super.isTerrainSkin()) return !1;
@@ -8928,7 +8945,7 @@ class xo extends br {
8928
8945
  }
8929
8946
  return this.to = !1, !1;
8930
8947
  }
8931
- Zs() {
8948
+ Ks() {
8932
8949
  this.eo = [];
8933
8950
  for (let t = 0; t < this.symbolDef.length; t++) {
8934
8951
  const e = this.symbolDef[t];
@@ -8985,12 +9002,12 @@ class xo extends br {
8985
9002
  e && e.length ? (this.ro = {}, this.so(t.timestamp), this.zr()) : this.zr();
8986
9003
  }
8987
9004
  callCurrentTileShader(t, e) {
8988
- this.shader.filter = e.sceneFilter ? [ this.$s, e.sceneFilter ] : this.$s, this.callRenderer(this.shader, t, e),
9005
+ this.shader.filter = e.sceneFilter ? [ this.qs, e.sceneFilter ] : this.qs, this.callRenderer(this.shader, t, e),
8989
9006
  this.oo.filter = e.sceneFilter ? [ this.Js, e.sceneFilter ] : this.Js, this.callRenderer(this.oo, t, e);
8990
9007
  }
8991
9008
  callBackgroundTileShader(t, e) {
8992
- this.shader.filter = e.sceneFilter ? [ this.qs, e.sceneFilter ] : this.qs, this.callRenderer(this.shader, t, e),
8993
- this.oo.filter = e.sceneFilter ? [ this.Ks, e.sceneFilter ] : this.Ks, this.callRenderer(this.oo, t, e);
9009
+ this.shader.filter = e.sceneFilter ? [ this.$s, e.sceneFilter ] : this.$s, this.callRenderer(this.shader, t, e),
9010
+ this.oo.filter = e.sceneFilter ? [ this.Zs, e.sceneFilter ] : this.Zs, this.callRenderer(this.oo, t, e);
8994
9011
  }
8995
9012
  callRenderer(t, e, n) {
8996
9013
  n && n.isRenderingTerrain && p(this.symbolDef.textPitchAlignment) && (n.isRenderingTerrainSkin ? e.textPitchFilter = 1 : e.textPitchFilter = 2),
@@ -9052,7 +9069,7 @@ class xo extends br {
9052
9069
  if (!o) return;
9053
9070
  const a = n.getPitch(), l = n.getBearing(), {lineTextPitch: h, lineTextBearing: u} = t.properties, c = 1 === t.material.uniforms.pitchWithMap, f = s.elements;
9054
9071
  if (!c) {
9055
- const e = r.multiply($s, n.projViewMatrix, t.localTransform), i = o.id + "-" + e.join();
9072
+ const e = r.multiply(qs, n.projViewMatrix, t.localTransform), i = o.id + "-" + e.join();
9056
9073
  let a;
9057
9074
  this.ro[i] ? o = this.ro[i] : (a = s.projectedLine = s.projectedLine || new Array(o.length),
9058
9075
  o = this.lo(a, o, e, n.width, n.height), this.ro[i] = a);
@@ -9081,7 +9098,7 @@ class xo extends br {
9081
9098
  }(t, e, n, i, r);
9082
9099
  }
9083
9100
  forEachBox(t, e) {
9084
- const n = this.getMap(), i = r.multiply($s, n.projViewMatrix, t.properties.tileVectorTransform), {collideIds: s, aCount: o, features: a, elements: l} = t.geometry.properties, h = s;
9101
+ const n = this.getMap(), i = r.multiply(qs, n.projViewMatrix, t.properties.tileVectorTransform), {collideIds: s, aCount: o, features: a, elements: l} = t.geometry.properties, h = s;
9085
9102
  if (!h) return;
9086
9103
  const u = this.isEnableUniquePlacement(), c = this.Ms(1);
9087
9104
  c[0].allElements = l, c[0].mesh = t;
@@ -9089,7 +9106,7 @@ class xo extends br {
9089
9106
  for (let n = 0; n <= l.length; n += 6) if (d = l[n], h[d] !== m || n === l.length) {
9090
9107
  const r = a[m] && a[m].feature;
9091
9108
  if (u && this.isMeshUniquePlaced(t) && r && !r.label) {
9092
- const e = r.properties || {}, {symbolIndex: n} = t.properties, i = n && this.eo[n.index] ? this.eo[n.index](t.properties.z, e) : this.getSymbol(t.properties.symbolIndex).textName, s = R.resolveText(i, e);
9109
+ const e = r.properties || {}, {symbolIndex: n} = t.properties, i = n && this.eo[n.index] ? this.eo[n.index](t.properties.z, e) : this.getSymbol(t.properties.symbolIndex).textName, s = N.resolveText(i, e);
9093
9110
  r.label = s;
9094
9111
  }
9095
9112
  const s = n, y = o[l[p]];
@@ -9104,8 +9121,8 @@ class xo extends br {
9104
9121
  P || (P = v.properties.aProjectedAnchor = new Array(_.length / x * 3));
9105
9122
  const T = v.properties.aTextSize, k = !u, O = e[n], I = O * x;
9106
9123
  let F;
9107
- F = v.data.aAltitude ? i.set(Ks, _[I], _[I + 1], S[O]) : A.unpackPosition(Ks, _[I], _[I + 1], _[I + 2]);
9108
- const C = bi(Zs, F, l, g.width, g.height), E = v.properties.aTerrainAltitude;
9124
+ F = v.data.aAltitude ? i.set(Zs, _[I], _[I + 1], S[O]) : A.unpackPosition(Zs, _[I], _[I + 1], _[I + 2]);
9125
+ const C = bi(Ks, F, l, g.width, g.height), E = v.properties.aTerrainAltitude;
9109
9126
  let D;
9110
9127
  if (E) {
9111
9128
  const t = E[O];
@@ -9113,21 +9130,21 @@ class xo extends br {
9113
9130
  !1;
9114
9131
  t ? (D = i.set(yo, ...F), D[2] = 100 * t, D = bi(D, D, l, g.width, g.height)) : D = C;
9115
9132
  } else D = C;
9116
- const R = g.getDevicePixelRatio();
9117
- if (a.scale(vo, D, 1 / R), g.isOffscreen(vo)) return y || bo(w, e, n, s), P[3 * O] = -999999,
9133
+ const N = g.getDevicePixelRatio();
9134
+ if (a.scale(vo, D, 1 / N), g.isOffscreen(vo)) return y || bo(w, e, n, s), P[3 * O] = -999999,
9118
9135
  P[3 * O + 1] = -999999, P[3 * O + 2] = -999999, !1;
9119
9136
  k && (F = C), P[3 * O] = D[0], P[3 * O + 1] = D[1], P[3 * O + 2] = D[2];
9120
9137
  const L = k ? 1 : v.properties.tileExtent / this.layer.getTileSize().width;
9121
- let N = !0;
9122
- const H = e[n], z = e[s - 1], V = T ? T[H] : t.properties.textSize, U = this.uo(t, V, o, H, z, F, Ks, L, u);
9138
+ let R = !0;
9139
+ const H = e[n], z = e[s - 1], V = T ? T[H] : t.properties.textSize, U = this.uo(t, V, o, H, z, F, Zs, L, u);
9123
9140
  if (null === U) return bo(w, e, n, s), !1;
9124
9141
  const j = z - H <= 3, B = Math.floor(U / 2), G = U % 2;
9125
9142
  for (let a = n; a < s; a += 6) {
9126
9143
  const u = e[a];
9127
9144
  let f;
9128
- if (f = B || a !== n || j || m ? B || a !== s - 6 || j || m ? Hs.call(this, qs, t, V, o, u, F, Ks, L, B, D, this.layer, l, p) : uo : ho,
9145
+ if (f = B || a !== n || j || m ? B || a !== s - 6 || j || m ? Hs.call(this, $s, t, V, o, u, F, Zs, L, B, D, this.layer, l, p) : uo : ho,
9129
9146
  !f) {
9130
- N = !1, y || bo(w, e, n, s);
9147
+ R = !1, y || bo(w, e, n, s);
9131
9148
  break;
9132
9149
  }
9133
9150
  let g = f[2];
@@ -9152,7 +9169,7 @@ class xo extends br {
9152
9169
  w[n] = io[0], w[n + 1] = io[1], x && (w[n + 2] = io[2]));
9153
9170
  }
9154
9171
  }
9155
- return N;
9172
+ return R;
9156
9173
  }
9157
9174
  uo(t, e, n, i, r, s, o, a, l) {
9158
9175
  const h = r - i <= 3, u = this.getMap();
@@ -9279,7 +9296,7 @@ class So extends Bi {
9279
9296
  }
9280
9297
  const a = {};
9281
9298
  Ct(a, "markerOpacity", o, "markerOpacity", 1), Ct(a, "markerSize", o, "markerSize", 10),
9282
- Ct(a, "markerFill", o, "markerFill", "#000", Rt(this.colorCache, 3));
9299
+ Ct(a, "markerFill", o, "markerFill", "#000", Nt(this.colorCache, 3));
9283
9300
  const l = new n.Material(a, _o);
9284
9301
  l.createDefines = () => "square" !== o.markerType ? {
9285
9302
  USE_CIRCLE: 1
@@ -9393,7 +9410,7 @@ class To extends Bi {
9393
9410
  }
9394
9411
  getMeshUniforms(t, e) {
9395
9412
  const n = {};
9396
- return Ct(n, "lineColor", e, "lineColor", "#000", Rt(this.colorCache)), Ct(n, "lineOpacity", e, "lineOpacity", 1),
9413
+ return Ct(n, "lineColor", e, "lineColor", "#000", Nt(this.colorCache)), Ct(n, "lineOpacity", e, "lineOpacity", 1),
9397
9414
  n;
9398
9415
  }
9399
9416
  init(t) {
@@ -9468,7 +9485,7 @@ class To extends Bi {
9468
9485
  }
9469
9486
  }
9470
9487
 
9471
- const ko = [ 0, 0 ], Oo = [ 1, 1, 1 ], Io = [ 1, 1, 1, 1 ], Fo = [ 0, 0 ], Co = [ 1, 1 ], Eo = [], Do = new t.Coordinate(0, 0), Ro = new t.Coordinate(0, 0), Lo = [], No = [];
9488
+ const ko = [ 0, 0 ], Oo = [ 1, 1, 1 ], Io = [ 1, 1, 1, 1 ], Fo = [ 0, 0 ], Co = [ 1, 1 ], Eo = [], Do = new t.Coordinate(0, 0), No = new t.Coordinate(0, 0), Lo = [], Ro = [];
9472
9489
 
9473
9490
  class Ho extends Vi {
9474
9491
  supportRenderMode(t) {
@@ -9493,7 +9510,7 @@ class Ho extends Vi {
9493
9510
  }
9494
9511
  const c = this.getSymbolDef(a), f = this.getFnTypeConfig(a);
9495
9512
  si(o, c, f);
9496
- const d = this.getShader(), p = d.getGeometryDefines ? d.getGeometryDefines(o) : {}, m = this.getSymbol(a), y = Rt(this.colorCache);
9513
+ const d = this.getShader(), p = d.getGeometryDefines ? d.getGeometryDefines(o) : {}, m = this.getSymbol(a), y = Nt(this.colorCache);
9497
9514
  if (o.data.aExtrude) {
9498
9515
  p.IS_LINE_EXTRUSION = 1;
9499
9516
  const {tileResolution: t, tileRatio: e} = o.properties, n = this.getMap();
@@ -9585,7 +9602,7 @@ class Ho extends Vi {
9585
9602
  const o = this.getMap(), a = this.getSymbol(e).material;
9586
9603
  let l = n;
9587
9604
  !this.dataConfig.side && a && a.textureOrigin && (Do.set(a.textureOrigin[0], a.textureOrigin[1]),
9588
- o.coordToPointAtRes(Do, i, Ro), l = h.set(Lo, n[0] - Ro.x, n[1] - Ro.y));
9605
+ o.coordToPointAtRes(Do, i, No), l = h.set(Lo, n[0] - No.x, n[1] - No.y));
9589
9606
  const u = !!a && a.uvOffsetInMeter;
9590
9607
  let c = a && a.uvOffset || Fo;
9591
9608
  const f = this.getUVOffsetAnim();
@@ -9617,7 +9634,7 @@ class Ho extends Vi {
9617
9634
  return t.material && t.material.uvOffsetAnim;
9618
9635
  }
9619
9636
  getUVOffset(t) {
9620
- const e = this.getSymbols()[0], n = e.material && e.material.uvOffset || Fo, i = !!e.material && e.material.uvOffsetInMeter, r = performance.now() / 1e3, s = h.set(No, n[0], n[1]);
9637
+ const e = this.getSymbols()[0], n = e.material && e.material.uvOffset || Fo, i = !!e.material && e.material.uvOffsetInMeter, r = performance.now() / 1e3, s = h.set(Ro, n[0], n[1]);
9621
9638
  return s[0] = r * t[0], s[1] = r * t[0], i || (s[0] %= 1, s[1] %= 1), s;
9622
9639
  }
9623
9640
  needPolygonOffset() {
@@ -10122,7 +10139,7 @@ var Xo = "#include <gl2_vert>\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 6
10122
10139
 
10123
10140
  const {getPBRUniforms: Yo} = n.pbr.PBRUtils;
10124
10141
 
10125
- class $o extends Bi {
10142
+ class qo extends Bi {
10126
10143
  needToRedraw() {
10127
10144
  return super.needToRedraw() || this.isAnimating();
10128
10145
  }
@@ -10154,7 +10171,7 @@ class $o extends Bi {
10154
10171
  tileResolution: u,
10155
10172
  tileRatio: c
10156
10173
  };
10157
- Ct(f, "lineColor", h, "lineColor", "#fff", Rt(this.colorCache)), Ct(f, "linePatternGapColor", h, "linePatternGapColor", [ 1, 1, 1, 1 ], Rt(this.colorCache)),
10174
+ Ct(f, "lineColor", h, "lineColor", "#fff", Nt(this.colorCache)), Ct(f, "linePatternGapColor", h, "linePatternGapColor", [ 1, 1, 1, 1 ], Nt(this.colorCache)),
10158
10175
  Ct(f, "lineWidth", h, "lineWidth", 2, t => I.getTubeSizeScale(this.dataConfig.metric) * t),
10159
10176
  Ct(f, "lineOpacity", h, "lineOpacity", 1), Ct(f, "linePatternAnimSpeed", h, "linePatternAnimSpeed", 0),
10160
10177
  Ct(f, "linePatternGap", h, "linePatternGap", 0), Ct(f, "metallicFactor", h, "metallicFactor", 0),
@@ -10352,7 +10369,7 @@ class $o extends Bi {
10352
10369
  }
10353
10370
  }
10354
10371
 
10355
- const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0, 0 ], na = [ 1, 1, 1 ], ia = [], ra = [ 1, 1, 1, 1 ], sa = [], oa = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], aa = t => class extends t {
10372
+ const $o = [], Jo = [], Zo = [], Ko = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0, 0 ], na = [ 1, 1, 1 ], ia = [], ra = [ 1, 1, 1, 1 ], sa = [], oa = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], aa = t => class extends t {
10356
10373
  constructor(t, e, i, r, s, o) {
10357
10374
  super(t, e, i, r, s, o), this.ko = !1, this.scene.sortFunction = this.sortByCommandKey,
10358
10375
  this.Oo = new n.GLTFManager(t), this.Io(), this.Fo();
@@ -10398,11 +10415,11 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10398
10415
  }),
10399
10416
  divisor: 1
10400
10417
  };
10401
- const A = this.Ro(), w = this.Lo(), _ = r.identity([]);
10418
+ const A = this.No(), w = this.Lo(), _ = r.identity([]);
10402
10419
  r.scale(_, _, [ w, w, w ]);
10403
10420
  const S = [], M = this.getSymbols();
10404
10421
  for (let t = 0; t < M.length; t++) {
10405
- const e = M[t], o = this.No[t];
10422
+ const e = M[t], o = this.Ro[t];
10406
10423
  if (!o) continue;
10407
10424
  const u = this.Co[t][0], {fixSizeOnZoom: c} = e;
10408
10425
  let f = r.identity([]);
@@ -10430,7 +10447,7 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10430
10447
  k.properties.startTime = a, T.HAS_SKIN = 1;
10431
10448
  }
10432
10449
  w && (k.setUniform("morphWeights", w), T.HAS_MORPH = 1), k.setUniform("hasAlpha", S.alphaMode && "BLEND" === S.alphaMode.toUpperCase()),
10433
- Ct(k.uniforms, "polygonFill", e, "markerFill", ra, Rt(this.colorCache)), Ct(k.uniforms, "polygonOpacity", e, "markerOpacity", 1);
10450
+ Ct(k.uniforms, "polygonFill", e, "markerFill", ra, Nt(this.colorCache)), Ct(k.uniforms, "polygonOpacity", e, "markerOpacity", 1);
10434
10451
  const O = [];
10435
10452
  k.setPositionMatrix(() => {
10436
10453
  const e = this.Uo(t, m, M);
@@ -10438,7 +10455,7 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10438
10455
  const n = r.identity(sa);
10439
10456
  if (0 !== d && (r.fromTranslation(n, p), r.multiply(O, n, O)), Ht(c)) {
10440
10457
  const t = l.getGLScale() / l.getGLScale(c);
10441
- return i.set(qo, t, t, t), r.fromScaling(n, qo), r.multiply(n, n, O);
10458
+ return i.set($o, t, t, t), r.fromScaling(n, $o), r.multiply(n, n, O);
10442
10459
  }
10443
10460
  return O;
10444
10461
  });
@@ -10465,7 +10482,7 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10465
10482
  }, S;
10466
10483
  }
10467
10484
  Uo(t, e, n) {
10468
- const i = t, r = this.No[i][e];
10485
+ const i = t, r = this.Ro[i][e];
10469
10486
  return this.Eo(t) && this.jo && this.jo[n] || r.nodeMatrix;
10470
10487
  }
10471
10488
  Vo(t, e, n) {
@@ -10531,13 +10548,13 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10531
10548
  e[0] < v && (v = e[0]), e[0] > w && (w = e[0]), e[1] < x && (x = e[1]), e[1] > _ && (_ = e[1]),
10532
10549
  e[2] < b && (b = e[2]), e[2] > S && (S = e[2]);
10533
10550
  }
10534
- const T = (v + w) / 2, k = (x + _) / 2, O = (b + S) / 2, I = [], F = this.Ro(), C = [ 0, 0, 1 ];
10551
+ const T = (v + w) / 2, k = (x + _) / 2, O = (b + S) / 2, I = [], F = this.No(), C = [ 0, 0, 1 ];
10535
10552
  for (let e = 0; e < p; e++) {
10536
10553
  a ? i.set(P, o[e * u], o[e * u + 1], a[e]) : A.unpackPosition(P, o[e * u], o[e * u + 1], o[e * u + 2]);
10537
10554
  const n = P[0], s = P[1], p = i.set(M, n * m - T, -s * m - k, (P[2] + g) * y - O), v = l && l[e] || 0, x = h && h[e] || 0;
10538
10555
  if (v || x) {
10539
10556
  r.fromRotation(I, x, C);
10540
- const t = i.set(qo, n, s, 0), e = i.normalize(t, i.cross(t, t, C));
10557
+ const t = i.set($o, n, s, 0), e = i.normalize(t, i.cross(t, t, C));
10541
10558
  r.rotate(I, I, v, e);
10542
10559
  const o = r.fromTranslation(sa, p);
10543
10560
  r.multiply(I, o, I);
@@ -10562,12 +10579,12 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10562
10579
  const s = this.getMap(), o = this.symbolDef[0], a = this.Lo();
10563
10580
  let l = o.translationX || 0, h = o.translationY || 0, u = o.translationZ || 0, c = o.rotationX || 0, f = o.rotationY || 0, d = o.rotationZ || 0, p = o.scaleX || 1, m = o.scaleY || 1, y = o.scaleZ || 1;
10564
10581
  const g = n && n[r], v = e && e[g], x = s.getZoom(), b = v && v.feature && v.feature.properties, A = this.Xo(x, b);
10565
- this.Yo && (l = this.Yo(x, b)), this.$o && (h = this.$o(x, b)), this.qo && (u = this.qo(x, b));
10582
+ this.Yo && (l = this.Yo(x, b)), this.qo && (h = this.qo(x, b)), this.$o && (u = this.$o(x, b));
10566
10583
  const w = i.set(Jo, l * a, h * a, u * a);
10567
- this.Jo && (c = this.Jo(x, b)), this.Ko && (f = this.Ko(x, b)), this.Zo && (d = this.Zo(x, b));
10568
- const _ = i.set(Ko, c, f, d);
10584
+ this.Jo && (c = this.Jo(x, b)), this.Zo && (f = this.Zo(x, b)), this.Ko && (d = this.Ko(x, b));
10585
+ const _ = i.set(Zo, c, f, d);
10569
10586
  this.Qo && (p = this.Qo(x, b)), this.ta && (m = this.ta(x, b)), this.ea && (y = this.ea(x, b));
10570
- const S = i.set(Zo, p * A, m * A, y * A);
10587
+ const S = i.set(Ko, p * A, m * A, y * A);
10571
10588
  return this.na(t, w, _, S);
10572
10589
  }
10573
10590
  Xo(t, e) {
@@ -10587,17 +10604,17 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10587
10604
  Io() {
10588
10605
  const t = this.symbolDef[0];
10589
10606
  p(t.modelHeight) && (this.ia = g(t.modelHeight)), p(t.translationX) && (this.Yo = g(t.translationX)),
10590
- p(t.translationY) && (this.$o = g(t.translationY)), p(t.translationZ) && (this.qo = g(t.translationZ)),
10591
- p(t.rotationX) && (this.Jo = g(t.rotationX)), p(t.rotationY) && (this.Ko = g(t.rotationY)),
10592
- p(t.rotationZ) && (this.Zo = g(t.rotationZ)), p(t.scaleX) && (this.Qo = g(t.scaleX)),
10607
+ p(t.translationY) && (this.qo = g(t.translationY)), p(t.translationZ) && (this.$o = g(t.translationZ)),
10608
+ p(t.rotationX) && (this.Jo = g(t.rotationX)), p(t.rotationY) && (this.Zo = g(t.rotationY)),
10609
+ p(t.rotationZ) && (this.Ko = g(t.rotationZ)), p(t.scaleX) && (this.Qo = g(t.scaleX)),
10593
10610
  p(t.scaleY) && (this.ta = g(t.scaleY)), p(t.scaleZ) && (this.ea = g(t.scaleZ));
10594
10611
  }
10595
- Ro() {
10596
- return !!(this.ia && !this.ia.isFeatureConstant || this.Yo && !this.Yo.isFeatureConstant || this.$o && !this.$o.isFeatureConstant || this.qo && !this.qo.isFeatureConstant || this.Jo && !this.Jo.isFeatureConstant || this.Ko && !this.Ko.isFeatureConstant || this.Zo && !this.Zo.isFeatureConstant || this.Qo && !this.Qo.isFeatureConstant || this.ta && !this.ta.isFeatureConstant || this.ea && !this.ea.isFeatureConstant);
10612
+ No() {
10613
+ return !!(this.ia && !this.ia.isFeatureConstant || this.Yo && !this.Yo.isFeatureConstant || this.qo && !this.qo.isFeatureConstant || this.$o && !this.$o.isFeatureConstant || this.Jo && !this.Jo.isFeatureConstant || this.Zo && !this.Zo.isFeatureConstant || this.Ko && !this.Ko.isFeatureConstant || this.Qo && !this.Qo.isFeatureConstant || this.ta && !this.ta.isFeatureConstant || this.ea && !this.ea.isFeatureConstant);
10597
10614
  }
10598
10615
  Fo() {
10599
10616
  if (this.Co) return;
10600
- this.Co = [], this.Go = [], this.ra = [], this.No = [];
10617
+ this.Co = [], this.Go = [], this.ra = [], this.Ro = [];
10601
10618
  const t = this.getSymbols();
10602
10619
  this.sa = 0;
10603
10620
  for (let e = 0; e < t.length; e++) {
@@ -10607,11 +10624,11 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10607
10624
  if (i.then) i.then(n => {
10608
10625
  if (!n.gltfPack) return this.sa++, void (this.sa >= t.length && (this.ko = !0, this.setToRedraw(!0)));
10609
10626
  const {gltfPack: i, json: r, bbox: s} = n;
10610
- this.Co[e] = [ i ], this.No[e] = i.getMeshesInfo(), this.Go[e] = r, this.ra[e] = s,
10627
+ this.Co[e] = [ i ], this.Ro[e] = i.getMeshesInfo(), this.Go[e] = r, this.ra[e] = s,
10611
10628
  this.sa++, this.sa >= t.length && (this.ko = !0), this.setToRedraw(!0);
10612
10629
  }); else {
10613
10630
  const {gltfPack: t, json: n, bbox: r} = i;
10614
- t && (this.Co[e] = [ t ], this.No[e] = t.getMeshesInfo(), this.Go[e] = n, this.ra[e] = r,
10631
+ t && (this.Co[e] = [ t ], this.Ro[e] = t.getMeshesInfo(), this.Go[e] = n, this.ra[e] = r,
10615
10632
  this.sa++);
10616
10633
  }
10617
10634
  }
@@ -10650,7 +10667,7 @@ const qo = [], Jo = [], Ko = [], Zo = [], Qo = [], ta = [ 0, 0, 0 ], ea = [ 0, 0
10650
10667
  delete this.jo;
10651
10668
  }
10652
10669
  na(t, e, n, s) {
10653
- const o = i.set(qo, ...e || ta), a = n || ea, l = s || na, h = c.fromEuler(Qo, a[0], a[1], a[2]);
10670
+ const o = i.set($o, ...e || ta), a = n || ea, l = s || na, h = c.fromEuler(Qo, a[0], a[1], a[2]);
10654
10671
  return r.fromRotationTranslationScale(t, h, o, l);
10655
10672
  }
10656
10673
  };
@@ -10980,7 +10997,7 @@ const Ma = ei("lit", Wo);
10980
10997
 
10981
10998
  Ma.registerAt(he);
10982
10999
 
10983
- const Pa = ei("tube", $o);
11000
+ const Pa = ei("tube", qo);
10984
11001
 
10985
11002
  Pa.registerAt(he);
10986
11003
 
@@ -11062,19 +11079,19 @@ const Ia = ei("water", ma);
11062
11079
 
11063
11080
  Ia.registerAt(he), we.registerPainter("lit", Wo), we.registerPainter("icon", Es),
11064
11081
  we.registerPainter("fill", nr), we.registerPainter("line", or), we.registerPainter("line-gradient", ar),
11065
- we.registerPainter("water", ma), we.registerPainter("tube", $o), n.ShaderLib.register("vt_position_vert", "#ifdef HAS_TERRAIN_ALTITUDE\n attribute float aTerrainAltitude;\n#endif\nuniform float minAltitude;\n#ifdef HAS_ALTITUDE\n vec3 unpackVTPosition() {\n float altitude = aAltitude;\n #ifdef HAS_TERRAIN_ALTITUDE\n altitude += aTerrainAltitude * 100.0;\n #endif\n altitude += minAltitude * 100.0;\n return vec3(aPosition, altitude);\n }\n#else\n float position_modValue = 16384.0;\n float position_delta = 0.00001;\n vec3 unpackVTPosition() {\n float z = aPosition.z;\n vec2 pos = sign(aPosition.xy + position_delta) * mod(abs(aPosition.xy), position_modValue);\n vec2 highs = floor(abs(aPosition.xy) / position_modValue);\n float altitude = sign(z + position_delta) * (highs.x * 2.0 + highs.y) * pow(2.0, 15.0) + z;\n #ifdef HAS_TERRAIN_ALTITUDE\n altitude += aTerrainAltitude * 100.0;\n #endif\n altitude += minAltitude * 100.0;\n return vec3(pos, altitude);\n }\n#endif"),
11066
- he.VERSION = "0.92.3", we.VERSION = "0.92.3";
11082
+ we.registerPainter("water", ma), we.registerPainter("tube", qo), n.ShaderLib.register("vt_position_vert", "#ifdef HAS_TERRAIN_ALTITUDE\n attribute float aTerrainAltitude;\n#endif\nuniform float minAltitude;\n#ifdef HAS_ALTITUDE\n vec3 unpackVTPosition() {\n float altitude = aAltitude;\n #ifdef HAS_TERRAIN_ALTITUDE\n altitude += aTerrainAltitude * 100.0;\n #endif\n altitude += minAltitude * 100.0;\n return vec3(aPosition, altitude);\n }\n#else\n float position_modValue = 16384.0;\n float position_delta = 0.00001;\n vec3 unpackVTPosition() {\n float z = aPosition.z;\n vec2 pos = sign(aPosition.xy + position_delta) * mod(abs(aPosition.xy), position_modValue);\n vec2 highs = floor(abs(aPosition.xy) / position_modValue);\n float altitude = sign(z + position_delta) * (highs.x * 2.0 + highs.y) * pow(2.0, 15.0) + z;\n #ifdef HAS_TERRAIN_ALTITUDE\n altitude += aTerrainAltitude * 100.0;\n #endif\n altitude += minAltitude * 100.0;\n return vec3(pos, altitude);\n }\n#endif"),
11083
+ he.VERSION = "0.93.0", we.VERSION = "0.93.0";
11067
11084
 
11068
11085
  if (e.mat4.create(), e.transcoders) {
11069
11086
  const n = t.Map.VERSION;
11070
11087
  if (n.indexOf("1.0.0-beta") >= 0 || n.indexOf("1.0.0-alpha") >= 0) {
11071
- const n = e.transcoders.inject(q);
11088
+ const n = e.transcoders.inject($);
11072
11089
  t.registerWorkerAdapter("@maptalks/vt", n);
11073
11090
  } else t.registerWorkerAdapter("@maptalks/vt", (function() {
11074
- return e.transcoders.inject(q);
11091
+ return e.transcoders.inject($);
11075
11092
  }));
11076
- } else t.registerWorkerAdapter("@maptalks/vt", q);
11093
+ } else t.registerWorkerAdapter("@maptalks/vt", $);
11077
11094
 
11078
- export { $n as ExtrudePolygonLayer, nr as FillPainter, ga as FillPlugin, Ta as GLTFPhongPlugin, ka as GLTFStandardPlugin, ve as GeoJSONVectorTileLayer, Oa as HeatmapPlugin, Es as IconPainter, ba as IconPlugin, xa as LineGradientPlugin, or as LinePainter, va as LinePlugin, $e as LineStringLayer, Ma as LitPlugin, ye as MapboxVectorTileLayer, To as NativeLinePainter, wa as NativeLinePlugin, So as NativePointPainter, Uo as PhongPainter, _a as PhongPlugin, Ye as PointLayer, Je as PolygonLayer, xo as TextPainter, Aa as TextPlugin, Pa as TubePlugin, we as Vector3DLayer, he as VectorTileLayer, Jt as VectorTileLayerRenderer, Ia as WaterPlugin, Bo as WireframePainter, Sa as WireframePlugin };
11095
+ export { qn as ExtrudePolygonLayer, nr as FillPainter, ga as FillPlugin, Ta as GLTFPhongPlugin, ka as GLTFStandardPlugin, ve as GeoJSONVectorTileLayer, Oa as HeatmapPlugin, Es as IconPainter, ba as IconPlugin, xa as LineGradientPlugin, or as LinePainter, va as LinePlugin, qe as LineStringLayer, Ma as LitPlugin, ye as MapboxVectorTileLayer, To as NativeLinePainter, wa as NativeLinePlugin, So as NativePointPainter, Uo as PhongPainter, _a as PhongPlugin, Ye as PointLayer, Je as PolygonLayer, xo as TextPainter, Aa as TextPlugin, Pa as TubePlugin, we as Vector3DLayer, he as VectorTileLayer, Jt as VectorTileLayerRenderer, Ia as WaterPlugin, Bo as WireframePainter, Sa as WireframePlugin };
11079
11096
 
11080
- "undefined" != typeof console && console.log("@maptalks/vt v0.92.3");
11097
+ "undefined" != typeof console && console.log("@maptalks/vt v0.93.0");