@maptalks/vt 0.63.10 → 0.63.11

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.63.10
2
+ * @maptalks/vt v0.63.11
3
3
  * LICENSE : undefined
4
4
  * (c) 2016-2022 maptalks.org
5
5
  */
@@ -17,22 +17,22 @@ import { IconRequestor as x, GlyphRequestor as b, PointPack as A, VectorPack as
17
17
 
18
18
  export { PackUtil, SYMBOLS_NEED_REBUILD_IN_VECTOR, SYMBOLS_NEED_REBUILD_IN_VT } from "@maptalks/vector-packer";
19
19
 
20
- import O from "fast-deep-equal";
20
+ import I from "fast-deep-equal";
21
21
 
22
- import I from "color";
22
+ import O from "color";
23
23
 
24
24
  import C from "animation-easings";
25
25
 
26
26
  import F from "@maptalks/vt-plugin";
27
27
 
28
- const E = 'function(t){\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 */\nconst n=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function i(t){return new Function("f","var p = (f && f.properties || {}); return "+e(t))}function e(t){if(!t)return"true";const n=t[0];if(t.length<=1)return"any"===n?"false":"true";return`(${"=="===n?s(t[1],t[2],"===",!1):"!="===n?s(t[1],t[2],"!==",!1):"<"===n||">"===n||"<="===n||">="===n?s(t[1],t[2],n,!0):"any"===n?o(t.slice(1),"||"):"all"===n?o(t.slice(1),"&&"):"none"===n?u(o(t.slice(1),"||")):"in"===n?a(t[1],t.slice(2)):"!in"===n?u(a(t[1],t.slice(2))):"has"===n?h(t[1]):"!has"===n?u(h(t[1])):"true"})`}function r(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function s(t,i,e,s){const o=r(t),a="$type"===t?n.indexOf(i):JSON.stringify(i);return(s?`typeof ${o}=== typeof ${a}&&`:"")+o+e+a}function o(t,n){return t.map(e).join(n)}function a(t,i){"$type"===t&&(i=i.map(t=>n.indexOf(t)));const e=JSON.stringify(i.sort(l)),s=r(t);return i.length<=200?`${e}.indexOf(${s}) !== -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; }(${s}, ${e},0,${i.length-1})`}function h(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function u(t){return`!(${t})`}function l(t,n){return t<n?-1:t>n?1:0}function c(t){for(let n=1;n<arguments.length;n++){const i=arguments[n];for(const n in i)t[n]=i[n]}return t}function f(t,n){for(let i=0;i<t.stops.length;i++)if(n===t.stops[i][0])return t.stops[i][1];return t.default}function d(t,n){for(var i=0;i<t.stops.length&&!(n<t.stops[i][0]);i++);return t.stops[Math.max(i-1,0)][1]}function y(t,n){for(var i=void 0!==t.base?t.base:1,e=0;!(e>=t.stops.length||n<=t.stops[e][0]);)e++;return 0===e?t.stops[e][1]:e===t.stops.length?t.stops[e-1][1]:function t(n,i,e,r,s,o){return"function"==typeof s?function(){var a=s.apply(void 0,arguments),h=o.apply(void 0,arguments);return t(n,i,e,r,a,h)}:s.length?function(t,n,i,e,r,s){var o=[];for(let a=0;a<r.length;a++)o[a]=p(t,n,i,e,r[a],s[a]);return o}(n,i,e,r,s,o):p(n,i,e,r,s,o)}(n,i,t.stops[e-1][0],t.stops[e][0],t.stops[e-1][1],t.stops[e][1])}function v(t,n){return function(t,n,i){return void 0!==t?t:void 0!==n?n:void 0!==i?i:null}(n,t.default)}function p(t,n,i,e,r,s){var o,a=e-i,h=t-i;return r*(1-(o=1===n?h/a:(Math.pow(n,h)-1)/(Math.pow(n,a)-1)))+s*o}function m(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function g(t){return b(t,"exponential")}function w(t){return b(t,"interval")}function M(t,n){if(!t)return null;var i=!1;if(Array.isArray(t)){var e,r=[];for(let s=0;s<t.length;s++)(e=M(t[s],n))?(r.push(e),i=!0):r.push(t[s]);return i?r:t}var s,o={__fn_types_loaded:!0},a=[];for(s in t)t.hasOwnProperty(s)&&a.push(s);const h=function(t){Object.defineProperty(o,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=g(this["_"+t])),this["__fn_"+t].apply(this,n())},set:function(n){this["_"+t]=n},configurable:!0,enumerable:!0})};for(let n=0,e=a.length;n<e;n++)m(t[s=a[n]])?(i=!0,o["_"+s]=t[s],h(s)):o[s]=t[s];return i?o:t}function b(t,n){if(!m(t))return function(){return t};let i=!0,e=!0;const r=(t=JSON.parse(JSON.stringify(t))).stops;if(r)for(let t=0;t<r.length;t++)if(m(r[t][1])){const s=b(r[t][1],n);i=i&&s.isZoomConstant,e=e&&s.isFeatureConstant,r[t]=[r[t][0],s]}const s=function t(n,i){var e,r,s;if(m(n)){var o,a=n.stops&&"object"==typeof n.stops[0][0],h=a||void 0!==n.property,u=a||!h,l=n.type||i||"exponential";if("exponential"===l)o=y;else if("interval"===l)o=d;else if("categorical"===l)o=f;else{if("identity"!==l)throw new Error(\'Unknown function type "\'+l+\'"\');o=v}if(a){var c={},p=[];for(let t=0;t<n.stops.length;t++){var g=n.stops[t];void 0===c[g[0].zoom]&&(c[g[0].zoom]={zoom:g[0].zoom,type:n.type,property:n.property,default:n.default,stops:[]}),c[g[0].zoom].stops.push([g[0].value,g[1]])}for(let n in c)p.push([c[n].zoom,t(c[n])]);e=function(t,i){const e=y({stops:p,base:n.base},t)(t,i);return"function"==typeof e?e(t,i):e},r=!1,s=!1}else u?(e=function(t){const i=o(n,t);return"function"==typeof i?i(t):i},r=!0,s=!1):(e=function(t,i){const e=o(n,i?i[n.property]:null);return"function"==typeof e?e(t,i):e},r=!1,s=!0)}else e=function(){return n},r=!0,s=!0;return e.isZoomConstant=s,e.isFeatureConstant=r,e}(t,n);return s.isZoomConstant=i&&s.isZoomConstant,s.isFeatureConstant=e&&s.isFeatureConstant,s}let x=0;const F="function"==typeof Object.assign;function A(t,...n){if(F)return Object.assign(t,...n),t;for(let i=0;i<n.length;i++){const e=n[i];for(const n in e)t[n]=e[n]}return t}function k(t){return!O(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function P(t){return"number"==typeof t&&!isNaN(t)}function S(t){return!O(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function _(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function O(t){return null==t}function I(t){for(let n=1;n<arguments.length;n++){const i=arguments[n];if(i)for(let n=0,e=i.length;n<e;n++)t.push(i[n])}return t.length}function T(t){return t<65536?Uint16Array:Uint32Array}function L(t){return t<256?Uint8Array:t<65536?Uint16Array:Uint32Array}function U(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function z(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}:i(n[t].filter),e.push(c({},n[t],{filter:r}))}return e}(t=t.map(t=>{const n=A({},t);return n.filter&&n.filter.value&&(n.filter=n.filter.value),n}))}function D(t){return m(t)&&t.property}const E="function"==typeof fetch&&"function"==typeof AbortController,C={jsonp:function(t,n){const i="_maptalks_jsonp_"+x++;t.match(/\\?/)?t+="&callback="+i:t+="?callback="+i;let e=document.createElement("script");return e.type="text/javascript",e.src=t,window[i]=function(t){n(null,t),document.getElementsByTagName("head")[0].removeChild(e),e=null,delete window[i]},document.getElementsByTagName("head")[0].appendChild(e),this},get:function(t,n,i){if(S(n)){const t=i;i=n,n=t}(n=n||{}).method&&(n.method=n.method.toUpperCase());const e="POST"===n.method;if(E){const r=new AbortController,s={signal:r.signal,method:n.method||"GET",referrerPolicy:"origin"};return e&&(O(n.body)||(s.body=JSON.stringify(n.body))),O(n.headers)||(s.headers=n.headers),O(n.credentials)||(s.credentials=n.credentials),fetch(t,s).then(t=>{const e=this.t(t,n.returnJSON,n.responseType);e.message?i(e):e.then(e=>{"arraybuffer"===n.responseType?i(null,{data:e,cacheControl:t.headers.get("Cache-Control"),expires:t.headers.get("Expires"),contentType:t.headers.get("Content-Type")}):i(null,e)}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),i(t))})}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),i(t))}),r}{const r=C.s(i);if(r.open(n.method||"GET",t,!0),n){for(const t in n.headers)r.setRequestHeader(t,n.headers[t]);r.withCredentials="include"===n.credentials,n.responseType&&(r.responseType=n.responseType)}return r.send(e?n.body:null),r}},t:(t,n,i)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`}:"arraybuffer"===i?t.arrayBuffer():n?t.json():t.text(),o: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}`})}},s: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=C.o(n,t),n},getArrayBuffer(t,n,i){if(S(n)){const t=i;i=n,n=t}return n||(n={}),n.responseType="arraybuffer",C.get(t,n,i)}};function j(t,n,i,e,r,s){var o=r-i,a=s-e;if(0!==o||0!==a){var h=((t-i)*o+(n-e)*a)/(o*o+a*a);h>1?(i=r,e=s):h>0&&(i+=o*h,e+=a*h)}return(o=t-i)*o+(a=n-e)*a}function N(t,n,i,e){var r={id:void 0===t?null:t,type:n,geometry:i,tags:e,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var n=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)H(t,n);else if("Polygon"===i||"MultiLineString"===i)for(var e=0;e<n.length;e++)H(t,n[e]);else if("MultiPolygon"===i)for(e=0;e<n.length;e++)for(var r=0;r<n[e].length;r++)H(t,n[e][r])}(r),r}function H(t,n){for(var i=0;i<n.length;i+=3)t.minX=Math.min(t.minX,n[i]),t.minY=Math.min(t.minY,n[i+1]),t.maxX=Math.max(t.maxX,n[i]),t.maxY=Math.max(t.maxY,n[i+1])}function V(t,n,i,e){if(n.geometry){var r=n.geometry.coordinates,s=n.geometry.type,o=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),a=[],h=n.id;if(i.promoteId?h=n.properties[i.promoteId]:i.generateId&&(h=e||0),"Point"===s)R(r,a);else if("MultiPoint"===s)for(var u=0;u<r.length;u++)R(r[u],a);else if("LineString"===s)W(r,a,o,!1);else if("MultiLineString"===s){if(i.lineMetrics){for(u=0;u<r.length;u++)a=[],W(r[u],a,o,!1),t.push(N(h,"LineString",a,n.properties));return}$(r,a,o,!1)}else if("Polygon"===s)$(r,a,o,!0);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(u=0;u<n.geometry.geometries.length;u++)V(t,{id:h,geometry:n.geometry.geometries[u],properties:n.properties},i,e);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<r.length;u++){var l=[];$(r[u],l,o,!0),a.push(l)}}t.push(N(h,s,a,n.properties))}}function R(t,n){n.push(B(t[0])),n.push(q(t[1])),n.push(0)}function W(t,n,i,e){for(var r,s,o=0,a=0;a<t.length;a++){var h=B(t[a][0]),u=q(t[a][1]);n.push(h),n.push(u),n.push(0),a>0&&(o+=e?(r*u-h*s)/2:Math.sqrt(Math.pow(h-r,2)+Math.pow(u-s,2))),r=h,s=u}var l=n.length-3;n[2]=1,function t(n,i,e,r){for(var s,o=r,a=e-i>>1,h=e-i,u=n[i],l=n[i+1],c=n[e],f=n[e+1],d=i+3;d<e;d+=3){var y=j(n[d],n[d+1],u,l,c,f);if(y>o)s=d,o=y;else if(y===o){var v=Math.abs(d-a);v<h&&(s=d,h=v)}}o>r&&(s-i>3&&t(n,i,s,r),n[s+2]=o,e-s>3&&t(n,s,e,r))}(n,0,l,i),n[l+2]=1,n.size=Math.abs(o),n.start=0,n.end=n.size}function $(t,n,i,e){for(var r=0;r<t.length;r++){var s=[];W(t[r],s,i,e),n.push(s)}}function B(t){return t/360+.5}function q(t){var n=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return i<0?0:i>1?1:i}function G(t,n,i,e,r,s,o,a){if(e/=n,s>=(i/=n)&&o<e)return t;if(o<i||s>=e)return null;for(var h=[],u=0;u<t.length;u++){var l=t[u],c=l.geometry,f=l.type,d=0===r?l.minX:l.minY,y=0===r?l.maxX:l.maxY;if(d>=i&&y<e)h.push(l);else if(!(y<i||d>=e)){var v=[];if("Point"===f||"MultiPoint"===f)J(c,v,i,e,r);else if("LineString"===f)X(c,v,i,e,r,!1,a.lineMetrics);else if("MultiLineString"===f)Y(c,v,i,e,r,!1);else if("Polygon"===f)Y(c,v,i,e,r,!0);else if("MultiPolygon"===f)for(var p=0;p<c.length;p++){var m=[];Y(c[p],m,i,e,r,!0),m.length&&v.push(m)}if(v.length){if(a.lineMetrics&&"LineString"===f){for(p=0;p<v.length;p++)h.push(N(l.id,f,v[p],l.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===v.length?(f="LineString",v=v[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===v.length?"Point":"MultiPoint"),h.push(N(l.id,f,v,l.tags))}}}return h.length?h:null}function J(t,n,i,e,r){for(var s=0;s<t.length;s+=3){var o=t[s+r];o>=i&&o<=e&&(n.push(t[s]),n.push(t[s+1]),n.push(t[s+2]))}}function X(t,n,i,e,r,s,o){for(var a,h,u=Z(t),l=0===r?Q:tt,c=t.start,f=0;f<t.length-3;f+=3){var d=t[f],y=t[f+1],v=t[f+2],p=t[f+3],m=t[f+4],g=0===r?d:y,w=0===r?p:m,M=!1;o&&(a=Math.sqrt(Math.pow(d-p,2)+Math.pow(y-m,2))),g<i?w>i&&(h=l(u,d,y,p,m,i),o&&(u.start=c+a*h)):g>e?w<e&&(h=l(u,d,y,p,m,e),o&&(u.start=c+a*h)):K(u,d,y,v),w<i&&g>=i&&(h=l(u,d,y,p,m,i),M=!0),w>e&&g<=e&&(h=l(u,d,y,p,m,e),M=!0),!s&&M&&(o&&(u.end=c+a*h),n.push(u),u=Z(t)),o&&(c+=a)}var b=t.length-3;d=t[b],y=t[b+1],v=t[b+2],(g=0===r?d:y)>=i&&g<=e&&K(u,d,y,v),b=u.length-3,s&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&K(u,u[0],u[1],u[2]),u.length&&n.push(u)}function Z(t){var n=[];return n.size=t.size,n.start=t.start,n.end=t.end,n}function Y(t,n,i,e,r,s){for(var o=0;o<t.length;o++)X(t[o],n,i,e,r,s,!1)}function K(t,n,i,e){t.push(n),t.push(i),t.push(e)}function Q(t,n,i,e,r,s){var o=(s-n)/(e-n);return t.push(s),t.push(i+(r-i)*o),t.push(1),o}function tt(t,n,i,e,r,s){var o=(s-i)/(r-i);return t.push(n+(e-n)*o),t.push(s),t.push(1),o}function nt(t,n){for(var i=[],e=0;e<t.length;e++){var r,s=t[e],o=s.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)r=it(s.geometry,n);else if("MultiLineString"===o||"Polygon"===o){r=[];for(var a=0;a<s.geometry.length;a++)r.push(it(s.geometry[a],n))}else if("MultiPolygon"===o)for(r=[],a=0;a<s.geometry.length;a++){for(var h=[],u=0;u<s.geometry[a].length;u++)h.push(it(s.geometry[a][u],n));r.push(h)}i.push(N(s.id,o,r,s.tags))}return i}function it(t,n){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var e=0;e<t.length;e+=3)i.push(t[e]+n,t[e+1],t[e+2]);return i}function et(t,n){if(t.transformed)return t;var i,e,r,s=1<<t.z,o=t.x,a=t.y;for(i=0;i<t.features.length;i++){var h=t.features[i],u=h.geometry,l=h.type;if(h.geometry=[],1===l)for(e=0;e<u.length;e+=2)h.geometry.push(rt(u[e],u[e+1],n,s,o,a));else for(e=0;e<u.length;e++){var c=[];for(r=0;r<u[e].length;r+=2)c.push(rt(u[e][r],u[e][r+1],n,s,o,a));h.geometry.push(c)}}return t.transformed=!0,t}function rt(t,n,i,e,r,s){return[Math.round(i*(t*e-r)),Math.round(i*(n*e-s))]}function st(t,n,i,e,r){for(var s=n===r.maxZoom?0:r.tolerance/((1<<n)*r.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:e,z:n,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){o.numFeatures++,ot(o,t[a],s,r);var h=t[a].minX,u=t[a].minY,l=t[a].maxX,c=t[a].maxY;h<o.minX&&(o.minX=h),u<o.minY&&(o.minY=u),l>o.maxX&&(o.maxX=l),c>o.maxY&&(o.maxY=c)}return o}function ot(t,n,i,e){var r=n.geometry,s=n.type,o=[];if("Point"===s||"MultiPoint"===s)for(var a=0;a<r.length;a+=3)o.push(r[a]),o.push(r[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===s)at(o,r,t,i,!1,!1);else if("MultiLineString"===s||"Polygon"===s)for(a=0;a<r.length;a++)at(o,r[a],t,i,"Polygon"===s,0===a);else if("MultiPolygon"===s)for(var h=0;h<r.length;h++){var u=r[h];for(a=0;a<u.length;a++)at(o,u[a],t,i,!0,0===a)}if(o.length){var l=n.tags||null;if("LineString"===s&&e.lineMetrics){for(var c in l={},n.tags)l[c]=n.tags[c];l.mapbox_clip_start=r.start/r.size,l.mapbox_clip_end=r.end/r.size}var f={geometry:o,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:l};null!==n.id&&(f.id=n.id),t.features.push(f)}}function at(t,n,i,e,r,s){var o=e*e;if(e>0&&n.size<(r?o:e))i.numPoints+=n.length/3;else{for(var a=[],h=0;h<n.length;h+=3)(0===e||n[h+2]>o)&&(i.numSimplified++,a.push(n[h]),a.push(n[h+1])),i.numPoints++;r&&function(t,n){for(var i=0,e=0,r=t.length,s=r-2;e<r;s=e,e+=2)i+=(t[e]-t[s])*(t[e+1]+t[s+1]);if(i>0===n)for(e=0,r=t.length;e<r/2;e+=2){var o=t[e],a=t[e+1];t[e]=t[r-2-e],t[e+1]=t[r-1-e],t[r-2-e]=o,t[r-1-e]=a}}(a,s),t.push(a)}}function ht(t,n){var i=(n=this.options=function(t,n){for(var i in n)t[i]=n[i];return t}(Object.create(this.options),n)).debug;if(i&&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.");var e=function(t,n){var i=[];if("FeatureCollection"===t.type)for(var e=0;e<t.features.length;e++)V(i,t.features[e],n,e);else"Feature"===t.type?V(i,t,n):V(i,{geometry:t},n);return i}(t,n);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",n.indexMaxZoom,n.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(e=function(t,n){var i=n.buffer/n.extent,e=t,r=G(t,1,-1-i,i,0,-1,2,n),s=G(t,1,1-i,2+i,0,-1,2,n);return(r||s)&&(e=G(t,1,-i,1+i,0,-1,2,n)||[],r&&(e=nt(r,1).concat(e)),s&&(e=e.concat(nt(s,-1)))),e}(e,n)).length&&this.splitTile(e,0,0,0),i&&(e.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function ut(t,n,i){return 32*((1<<t)*i+n)+t}function lt(t,n,i,e,r,s){const o=i&&Array.isArray(i[0]);for(let a=0,h=i.length;a<h;a++){t[n]=Math.round((o?i[a][0]:i[a].x)*e),t[n+1]=Math.round((o?i[a][1]:i[a].y)*e);let u=r||0;Array.isArray(r)&&(u=r[a]),u=u?Math.round(e*u):0,t[n+2]=u,n+=3,s&&0!==a&&a!==h-1&&(t[n]=t[n-3],t[n+1]=t[n-2],t[n+2]=t[n-1],n+=3)}return n}function ct(t,n,i,e){const r=t[3*n],s=t[3*n+1],o=t[3*i],a=t[3*i+1];return r===o&&(r<0||r>e)||s===a&&(s<0||s>e)}C.getJSON=function(t,n,i){if(S(n)){const t=i;i=n,n=t}const e=function(t,n){const e="string"==typeof n?JSON.parse(n):n||null;i(t,e)};return n&&n.jsonp?C.jsonp(t,e):((n=n||{}).returnJSON=!0,C.get(t,n,e))},ht.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ht.prototype.splitTile=function(t,n,i,e,r,s,o){for(var a=[t,n,i,e],h=this.options,u=h.debug;a.length;){e=a.pop(),i=a.pop(),n=a.pop(),t=a.pop();var l=1<<n,c=ut(n,i,e),f=this.tiles[c];if(!f&&(u>1&&console.time("creation"),f=this.tiles[c]=st(t,n,i,e,h),this.tileCoords.push({z:n,x:i,y:e}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",n,i,e,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var d="z"+n;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(f.source=t,r){if(n===h.maxZoom||n===r)continue;var y=1<<r-n;if(i!==Math.floor(s/y)||e!==Math.floor(o/y))continue}else if(n===h.indexMaxZoom||f.numPoints<=h.indexMaxPoints)continue;if(f.source=null,0!==t.length){u>1&&console.time("clipping");var v,p,m,g,w,M,b=.5*h.buffer/h.extent,x=.5-b,F=.5+b,A=1+b;v=p=m=g=null,w=G(t,l,i-b,i+F,0,f.minX,f.maxX,h),M=G(t,l,i+x,i+A,0,f.minX,f.maxX,h),t=null,w&&(v=G(w,l,e-b,e+F,1,f.minY,f.maxY,h),p=G(w,l,e+x,e+A,1,f.minY,f.maxY,h),w=null),M&&(m=G(M,l,e-b,e+F,1,f.minY,f.maxY,h),g=G(M,l,e+x,e+A,1,f.minY,f.maxY,h),M=null),u>1&&console.timeEnd("clipping"),a.push(v||[],n+1,2*i,2*e),a.push(p||[],n+1,2*i,2*e+1),a.push(m||[],n+1,2*i+1,2*e),a.push(g||[],n+1,2*i+1,2*e+1)}}},ht.prototype.getTile=function(t,n,i){var e=this.options,r=e.extent,s=e.debug;if(t<0||t>24)return null;var o=1<<t,a=ut(t,n=(n%o+o)%o,i);if(this.tiles[a])return et(this.tiles[a],r);s>1&&console.log("drilling down to z%d-%d-%d",t,n,i);for(var h,u=t,l=n,c=i;!h&&u>0;)u--,l=Math.floor(l/2),c=Math.floor(c/2),h=this.tiles[ut(u,l,c)];return h&&h.source?(s>1&&console.log("found parent tile z%d-%d-%d",u,l,c),s>1&&console.time("drilling down"),this.splitTile(h.source,u,l,c,t,n,i),s>1&&console.timeEnd("drilling down"),this.tiles[a]?et(this.tiles[a],r):null):null};class ft{constructor(t,n){this.x=t,this.y=n}clone(){return new ft(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 ft(this.x-t.x,this.y-t.y)}distance(t){const n=this.x-t.x,i=this.y-t.y;return Math.sqrt(n*n+i*i)}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 ft(this.y,-this.x)}}function dt(t,n,i){const e=(n.x-t.x)*(i.y-t.y)-(n.y-t.y)*(i.x-t.x);return e>1e-5?1:e<-1e-5?2:0}function yt(t,n,i,e){const r=n.x*e.y-n.y*e.x,s=i.x-t.x,o=i.y-t.y,a=(s*e.y-o*e.x)/r;return new ft(t.x+a*n.x,t.y+a*n.y)}const vt=[];function pt(t,n,i){let e=0;const r=[];for(let s=n;s<i;s+=3)vt[e]?(vt[e].x=t[s],vt[e].y=t[s+1]):vt[e]=new ft(t[s],t[s+1]),r.push(vt[e]),e++;const s=function(t){let n;this.UpdateOmbb=function(t,i,e,r,s,o,a,h){const u=yt(t,i,s,o),l=yt(e,r,s,o),c=yt(a,h,t,i),f=yt(a,h,e,r),d=u.distance(l)*u.distance(c);d<this.BestObbArea&&(n=[u,c,f,l],this.BestObbArea=d)},this.BestObbArea=Number.MAX_VALUE;const i=[];for(let n=0;n<t.length;n++)i.push(t[(n+1)%t.length].diff(t[n])),i[n].normalize();const e=new ft(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new ft(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);let s,o,a,h;for(let n=0;n<t.length;n++){const i=t[n];i.x<e.x&&(e.x=i.x,s=n),i.x>r.x&&(r.x=i.x,o=n),i.y<e.y&&(e.y=i.y,h=n),i.y>r.y&&(r.y=i.y,a=n)}let u=new ft(0,-1),l=new ft(0,1),c=new ft(-1,0),f=new ft(1,0);for(let n=0;n<t.length;n++){const n=[Math.acos(u.dot(i[s])),Math.acos(l.dot(i[o])),Math.acos(c.dot(i[a])),Math.acos(f.dot(i[h]))];switch(n.indexOf(Math.min.apply(Math,n))){case 0:u=i[s].clone(),l=u.clone(),l.negate(),c=u.orthogonal(),f=c.clone(),f.negate(),s=(s+1)%t.length;break;case 1:l=i[o].clone(),u=l.clone(),u.negate(),c=u.orthogonal(),f=c.clone(),f.negate(),o=(o+1)%t.length;break;case 2:c=i[a].clone(),f=c.clone(),f.negate(),u=f.orthogonal(),l=u.clone(),l.negate(),a=(a+1)%t.length;break;case 3:f=i[h].clone(),c=f.clone(),c.negate(),u=f.orthogonal(),l=u.clone(),l.negate(),h=(h+1)%t.length}this.UpdateOmbb(t[s],u,t[o],l,t[a],c,t[h],f)}return n}(function(t){if(t.length<3)return t;let n=t[0];const i=[];for(let i=1;i<t.length;i++)(t[i].x<n.x||Math.abs(t[i].x-n.x)<1e-5&&t[i].y<n.y)&&(n=t[i]);let e=t[0];do{i.unshift(n.clone());for(let i=1;i<t.length;i++){const r=dt(n,e,t[i]);(e.equals(n)||1===r||0===r&&n.distance(t[i])>n.distance(e))&&(e=t[i])}n=e}while(!e.equals(i[i.length-1]));return i}(r)),o=s[0].distance(s[1]),a=s[1].distance(s[2]),h=s.map(t=>[t.x,t.y]);return h.push(+(a>o)),h}var mt="undefined"!=typeof Float32Array?Float32Array:Array;function gt(){var t=new mt(3);return mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function wt(t,n,i){var e=new mt(3);return e[0]=t,e[1]=n,e[2]=i,e}function Mt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function bt(t,n,i,e){return t[0]=n,t[1]=i,t[2]=e,t}function xt(t,n,i){return t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function Ft(t,n,i){return t[0]=n[0]/i[0],t[1]=n[1]/i[1],t[2]=n[2]/i[2],t}function At(t,n){var i=n[0],e=n[1],r=n[2],s=i*i+e*e+r*r;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 kt(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Pt(t,n,i){var e=n[0],r=n[1],s=n[2],o=i[0],a=i[1],h=i[2];return t[0]=r*h-s*a,t[1]=s*o-e*h,t[2]=e*a-r*o,t}var St=function(t,n,i){return t[0]=n[0]-i[0],t[1]=n[1]-i[1],t[2]=n[2]-i[2],t};function _t(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function Ot(t,n,i,e,r){return t[0]=n,t[1]=i,t[2]=e,t[3]=r,t}function It(){var t=new mt(4);return mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Tt(t,n){var i=n[0]+n[4]+n[8],e=void 0;if(i>0)e=Math.sqrt(i+1),t[3]=.5*e,e=.5/e,t[0]=(n[5]-n[7])*e,t[1]=(n[6]-n[2])*e,t[2]=(n[1]-n[3])*e;else{var r=0;n[4]>n[0]&&(r=1),n[8]>n[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;e=Math.sqrt(n[3*r+r]-n[3*s+s]-n[3*o+o]+1),t[r]=.5*e,e=.5/e,t[3]=(n[3*s+o]-n[3*o+s])*e,t[s]=(n[3*s+r]+n[3*r+s])*e,t[o]=(n[3*o+r]+n[3*r+o])*e}return t}gt(),function(){var t,n=(t=new mt(4),mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var Lt,Ut=function(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=n[3]*i,t},zt=function(t,n){var i=n[0],e=n[1],r=n[2],s=n[3],o=i*i+e*e+r*r+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=i*o,t[1]=e*o,t[2]=r*o,t[3]=s*o),t};function Dt(t,n){var i=n[0]-t[0],e=n[1]-t[1];return Math.sqrt(i*i+e*e)}function Et(t,n,i,e,r,s,o,a,h,u){0===t?function(t,n,i,e,r,s,o,a,h){const u=[0,0];for(let r=t;r<n;r+=3){const t=r/3*2,n=e[r],l=e[r+1];i[t]=u[0]+n*s*o/a,i[t+1]=u[1]-l*s*o/h}}(n,i,e,r,0,o,a,h,u):1===t&&function(t,n,i,e){const r=pt(e,t,n),s=r[4],o=r[s],a=r[s+1],h=r[s+2],u=(a[1]-o[1])/(a[0]-o[0]),l=(h[1]-a[1])/(h[0]-a[0]),c=Dt(o,a),f=Dt(a,h);for(let r=t;r<n;r+=3){const t=r/3*2,n=e[r],s=e[r+1];i[t]=jt(n,s,o,u,c),i[t+1]=-jt(n,s,a,l,f)}}(n,i,e,r)}gt(),wt(1,0,0),wt(0,1,0),It(),It(),Lt=new mt(9),mt!=Float32Array&&(Lt[1]=0,Lt[2]=0,Lt[3]=0,Lt[5]=0,Lt[6]=0,Lt[7]=0),Lt[0]=1,Lt[4]=1,Lt[8]=1,function(){var t=function(){var t=new mt(2);return mt!=Float32Array&&(t[0]=0,t[1]=0),t}()}();const Ct=[];function jt(t,n,i,e,r){return Ct[0]=(e*e*i[0]+e*(n-i[1])+t)/(e*e+1),Ct[1]=e*(Ct[0]-i[0])+i[1],Dt(i,Ct)/r}function Nt(t,n,i,e,r){const s=3*n[i-1],o=3*n[i-1]+1,a=t[s],h=t[o];return u=e,l=r,c=a,f=h,Math.sqrt((c-u)*(c-u)+(f-l)*(f-l));var u,l,c,f}function Ht(t,n,i){i=i||{},this.w=t||64,this.h=n||64,this.autoResize=!!i.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function Vt(t,n,i){this.x=0,this.y=t,this.w=this.free=n,this.h=i}function Rt(t,n,i,e,r,s,o){this.id=t,this.x=n,this.y=i,this.w=e,this.h=r,this.maxw=s||e,this.maxh=o||r,this.refcount=0}Ht.prototype.pack=function(t,n){t=[].concat(t),n=n||{};for(var i,e,r,s,o=[],a=0;a<t.length;a++)if(i=t[a].w||t[a].width,e=t[a].h||t[a].height,r=t[a].id,i&&e){if(!(s=this.packOne(i,e,r)))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},Ht.prototype.packOne=function(t,n,i){var e,r,s,o,a,h,u,l,c={freebin:-1,shelf:-1,waste:1/0},f=0;if("string"==typeof i||"number"==typeof i){if(e=this.getBin(i))return this.ref(e),e;"number"==typeof i&&(this.maxId=Math.max(i,this.maxId))}else i=++this.maxId;for(o=0;o<this.freebins.length;o++){if(n===(e=this.freebins[o]).maxh&&t===e.maxw)return this.allocFreebin(o,t,n,i);n>e.maxh||t>e.maxw||n<=e.maxh&&t<=e.maxw&&(s=e.maxw*e.maxh-t*n)<c.waste&&(c.waste=s,c.freebin=o)}for(o=0;o<this.shelves.length;o++)if(f+=(r=this.shelves[o]).h,!(t>r.free)){if(n===r.h)return this.allocShelf(o,t,n,i);n>r.h||n<r.h&&(s=(r.h-n)*t)<c.waste&&(c.freebin=-1,c.waste=s,c.shelf=o)}return-1!==c.freebin?this.allocFreebin(c.freebin,t,n,i):-1!==c.shelf?this.allocShelf(c.shelf,t,n,i):n<=this.h-f&&t<=this.w?(r=new Vt(f,this.w,n),this.allocShelf(this.shelves.push(r)-1,t,n,i)):this.autoResize?(a=h=this.h,((u=l=this.w)<=a||t>u)&&(l=2*Math.max(t,u)),(a<u||n>a)&&(h=2*Math.max(n,a)),this.resize(l,h),this.packOne(t,n,i)):null},Ht.prototype.allocFreebin=function(t,n,i,e){var r=this.freebins.splice(t,1)[0];return r.id=e,r.w=n,r.h=i,r.refcount=0,this.bins[e]=r,this.ref(r),r},Ht.prototype.allocShelf=function(t,n,i,e){var r=this.shelves[t].alloc(n,i,e);return this.bins[e]=r,this.ref(r),r},Ht.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,n=0,i=0;i<this.shelves.length;i++){var e=this.shelves[i];n+=e.h,t=Math.max(e.w-e.free,t)}this.resize(t,n)}},Ht.prototype.getBin=function(t){return this.bins[t]},Ht.prototype.ref=function(t){if(1==++t.refcount){var n=t.h;this.stats[n]=1+(0|this.stats[n])}return t.refcount},Ht.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)},Ht.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},Ht.prototype.resize=function(t,n){this.w=t,this.h=n;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(t);return!0},Vt.prototype.alloc=function(t,n,i){if(t>this.free||n>this.h)return null;var e=this.x;return this.x+=t,this.free-=t,new Rt(i,e,this.y,t,n,t,this.h)},Vt.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0};"undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self&&self;var Wt={exports:{}};Wt.exports=function(){function t(t,n,i){var e=t[n];t[n]=t[i],t[i]=e}function n(t,n){return t<n?-1:t>n?1:0}return function(i,e,r,s,o){!function n(i,e,r,s,o){for(;s>r;){if(s-r>600){var a=s-r+1,h=e-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(h-a/2<0?-1:1),f=Math.max(r,Math.floor(e-h*l/a+c)),d=Math.min(s,Math.floor(e+(a-h)*l/a+c));n(i,e,f,d,o)}var y=i[e],v=r,p=s;for(t(i,r,e),o(i[s],y)>0&&t(i,r,s);v<p;){for(t(i,v,p),v++,p--;o(i[v],y)<0;)v++;for(;o(i[p],y)>0;)p--}0===o(i[r],y)?t(i,r,p):(p++,t(i,p,s)),p<=e&&(r=p+1),e<=p&&(s=p-1)}}(i,e,r||0,s||i.length-1,o||n)}}();var $t=Wt.exports,Bt={exports:{}};function qt(t,n){if(!(this instanceof qt))return new qt(t,n);if(this.data=t||[],this.length=this.data.length,this.compare=n||Gt,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this.u(i)}function Gt(t,n){return t<n?-1:t>n?1:0}Bt.exports=qt,Bt.exports.default=qt,qt.prototype={push:function(t){this.data.push(t),this.length++,this.v(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this.u(0)),this.data.pop(),t}},peek:function(){return this.data[0]},v:function(t){for(var n=this.data,i=this.compare,e=n[t];t>0;){var r=t-1>>1,s=n[r];if(i(e,s)>=0)break;n[t]=s,t=r}n[t]=e},u:function(t){for(var n=this.data,i=this.compare,e=this.length>>1,r=n[t];t<e;){var s=1+(t<<1),o=s+1,a=n[s];if(o<this.length&&i(n[o],a)<0&&(s=o,a=n[o]),i(a,r)>=0)break;n[t]=a,t=s}n[t]=r}};var Jt=Bt.exports,Xt={exports:{}},Zt={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]},Yt={exports:{}},Kt=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))},Qt=Array.prototype.concat,tn=Array.prototype.slice,nn=Yt.exports=function(t){for(var n=[],i=0,e=t.length;i<e;i++){var r=t[i];Kt(r)?n=Qt.call(n,tn.call(r)):n.push(r)}return n};nn.wrap=function(t){return function(){return t(nn(arguments))}};var en=Zt,rn=Yt.exports,sn=Object.hasOwnProperty,on={};for(var an in en)sn.call(en,an)&&(on[en[an]]=an);var hn=Xt.exports={to:{},get:{}};function un(t,n,i){return Math.min(Math.max(n,t),i)}function ln(t){var n=Math.round(t).toString(16).toUpperCase();return n.length<2?"0"+n:n}hn.get=function(t){var n,i;switch(t.substring(0,3).toLowerCase()){case"hsl":n=hn.get.hsl(t),i="hsl";break;case"hwb":n=hn.get.hwb(t),i="hwb";break;default:n=hn.get.rgb(t),i="rgb"}return n?{model:i,value:n}:null},hn.get.rgb=function(t){if(!t)return null;var n,i,e,r=[0,0,0,1];if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(e=n[2],n=n[1],i=0;i<3;i++){var s=2*i;r[i]=parseInt(n.slice(s,s+2),16)}e&&(r[3]=parseInt(e,16)/255)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(e=(n=n[1])[3],i=0;i<3;i++)r[i]=parseInt(n[i]+n[i],16);e&&(r[3]=parseInt(e+e,16)/255)}else if(n=t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)){for(i=0;i<3;i++)r[i]=parseInt(n[i+1],0);n[4]&&(n[5]?r[3]=.01*parseFloat(n[4]):r[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]:sn.call(en,n[1])?((r=en[n[1]])[3]=1,r):null:null;for(i=0;i<3;i++)r[i]=Math.round(2.55*parseFloat(n[i+1]));n[4]&&(n[5]?r[3]=.01*parseFloat(n[4]):r[3]=parseFloat(n[4]))}for(i=0;i<3;i++)r[i]=un(r[i],0,255);return r[3]=un(r[3],0,1),r},hn.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 i=parseFloat(n[4]);return[(parseFloat(n[1])%360+360)%360,un(parseFloat(n[2]),0,100),un(parseFloat(n[3]),0,100),un(isNaN(i)?1:i,0,1)]}return null},hn.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 i=parseFloat(n[4]);return[(parseFloat(n[1])%360+360)%360,un(parseFloat(n[2]),0,100),un(parseFloat(n[3]),0,100),un(isNaN(i)?1:i,0,1)]}return null},hn.to.hex=function(){var t=rn(arguments);return"#"+ln(t[0])+ln(t[1])+ln(t[2])+(t[3]<1?ln(Math.round(255*t[3])):"")},hn.to.rgb=function(){var t=rn(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]+")"},hn.to.rgb.percent=function(){var t=rn(arguments),n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),e=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+n+"%, "+i+"%, "+e+"%)":"rgba("+n+"%, "+i+"%, "+e+"%, "+t[3]+")"},hn.to.hsl=function(){var t=rn(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},hn.to.hwb=function(){var t=rn(arguments),n="";return t.length>=4&&1!==t[3]&&(n=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+n+")"},hn.to.keyword=function(t){return on[t.slice(0,3)]};var cn={exports:{}},fn=Zt,dn={};for(var yn in fn)fn.hasOwnProperty(yn)&&(dn[fn[yn]]=yn);var vn=cn.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 pn in vn)if(vn.hasOwnProperty(pn)){if(!("channels"in vn[pn]))throw new Error("missing channels property: "+pn);if(!("labels"in vn[pn]))throw new Error("missing channel labels property: "+pn);if(vn[pn].labels.length!==vn[pn].channels)throw new Error("channel and label counts mismatch: "+pn);var mn=vn[pn].channels,gn=vn[pn].labels;delete vn[pn].channels,delete vn[pn].labels,Object.defineProperty(vn[pn],"channels",{value:mn}),Object.defineProperty(vn[pn],"labels",{value:gn})}function wn(t,n){return Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)+Math.pow(t[2]-n[2],2)}vn.rgb.hsl=function(t){var n,i,e=t[0]/255,r=t[1]/255,s=t[2]/255,o=Math.min(e,r,s),a=Math.max(e,r,s),h=a-o;return a===o?n=0:e===a?n=(r-s)/h:r===a?n=2+(s-e)/h:s===a&&(n=4+(e-r)/h),(n=Math.min(60*n,360))<0&&(n+=360),i=(o+a)/2,[n,100*(a===o?0:i<=.5?h/(a+o):h/(2-a-o)),100*i]},vn.rgb.hsv=function(t){var n,i,e,r,s,o=t[0]/255,a=t[1]/255,h=t[2]/255,u=Math.max(o,a,h),l=u-Math.min(o,a,h),c=function(t){return(u-t)/6/l+.5};return 0===l?r=s=0:(s=l/u,n=c(o),i=c(a),e=c(h),o===u?r=e-i:a===u?r=1/3+n-e:h===u&&(r=2/3+i-n),r<0?r+=1:r>1&&(r-=1)),[360*r,100*s,100*u]},vn.rgb.hwb=function(t){var n=t[0],i=t[1],e=t[2];return[vn.rgb.hsl(t)[0],100*(1/255*Math.min(n,Math.min(i,e))),100*(e=1-1/255*Math.max(n,Math.max(i,e)))]},vn.rgb.cmyk=function(t){var n,i=t[0]/255,e=t[1]/255,r=t[2]/255;return[100*((1-i-(n=Math.min(1-i,1-e,1-r)))/(1-n)||0),100*((1-e-n)/(1-n)||0),100*((1-r-n)/(1-n)||0),100*n]},vn.rgb.keyword=function(t){var n=dn[t];if(n)return n;var i,e=1/0;for(var r in fn)if(fn.hasOwnProperty(r)){var s=wn(t,fn[r]);s<e&&(e=s,i=r)}return i},vn.keyword.rgb=function(t){return fn[t]},vn.rgb.xyz=function(t){var n=t[0]/255,i=t[1]/255,e=t[2]/255;return[100*(.4124*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)),100*(.2126*n+.7152*i+.0722*e),100*(.0193*n+.1192*i+.9505*e)]},vn.rgb.lab=function(t){var n=vn.rgb.xyz(t),i=n[0],e=n[1],r=n[2];return e/=100,r/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116)-16,500*(i-e),200*(e-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},vn.hsl.rgb=function(t){var n,i,e,r,s,o=t[0]/360,a=t[1]/100,h=t[2]/100;if(0===a)return[s=255*h,s,s];n=2*h-(i=h<.5?h*(1+a):h+a-h*a),r=[0,0,0];for(var u=0;u<3;u++)(e=o+1/3*-(u-1))<0&&e++,e>1&&e--,s=6*e<1?n+6*(i-n)*e:2*e<1?i:3*e<2?n+(i-n)*(2/3-e)*6:n,r[u]=255*s;return r},vn.hsl.hsv=function(t){var n=t[0],i=t[1]/100,e=t[2]/100,r=i,s=Math.max(e,.01);return i*=(e*=2)<=1?e:2-e,r*=s<=1?s:2-s,[n,100*(0===e?2*r/(s+r):2*i/(e+i)),100*((e+i)/2)]},vn.hsv.rgb=function(t){var n=t[0]/60,i=t[1]/100,e=t[2]/100,r=Math.floor(n)%6,s=n-Math.floor(n),o=255*e*(1-i),a=255*e*(1-i*s),h=255*e*(1-i*(1-s));switch(e*=255,r){case 0:return[e,h,o];case 1:return[a,e,o];case 2:return[o,e,h];case 3:return[o,a,e];case 4:return[h,o,e];case 5:return[e,o,a]}},vn.hsv.hsl=function(t){var n,i,e,r=t[0],s=t[1]/100,o=t[2]/100,a=Math.max(o,.01);return e=(2-s)*o,i=s*a,[r,100*(i=(i/=(n=(2-s)*a)<=1?n:2-n)||0),100*(e/=2)]},vn.hwb.rgb=function(t){var n,i,e,r,s,o,a,h=t[0]/360,u=t[1]/100,l=t[2]/100,c=u+l;switch(c>1&&(u/=c,l/=c),e=6*h-(n=Math.floor(6*h)),0!=(1&n)&&(e=1-e),r=u+e*((i=1-l)-u),n){default:case 6:case 0:s=i,o=r,a=u;break;case 1:s=r,o=i,a=u;break;case 2:s=u,o=i,a=r;break;case 3:s=u,o=r,a=i;break;case 4:s=r,o=u,a=i;break;case 5:s=i,o=u,a=r}return[255*s,255*o,255*a]},vn.cmyk.rgb=function(t){var n=t[0]/100,i=t[1]/100,e=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r)),255*(1-Math.min(1,e*(1-r)+r))]},vn.xyz.rgb=function(t){var n,i,e,r=t[0]/100,s=t[1]/100,o=t[2]/100;return i=-.9689*r+1.8758*s+.0415*o,e=.0557*r+-.204*s+1.057*o,n=(n=3.2406*r+-1.5372*s+-.4986*o)>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,[255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1)),255*(e=Math.min(Math.max(0,e),1))]},vn.xyz.lab=function(t){var n=t[0],i=t[1],e=t[2];return i/=100,e/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116))]},vn.lab.xyz=function(t){var n,i,e,r=t[0];n=t[1]/500+(i=(r+16)/116),e=i-t[2]/200;var s=Math.pow(i,3),o=Math.pow(n,3),a=Math.pow(e,3);return i=s>.008856?s:(i-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,[n*=95.047,i*=100,e*=108.883]},vn.lab.lch=function(t){var n,i=t[0],e=t[1],r=t[2];return(n=360*Math.atan2(r,e)/2/Math.PI)<0&&(n+=360),[i,Math.sqrt(e*e+r*r),n]},vn.lch.lab=function(t){var n,i=t[0],e=t[1];return n=t[2]/360*2*Math.PI,[i,e*Math.cos(n),e*Math.sin(n)]},vn.rgb.ansi16=function(t){var n=t[0],i=t[1],e=t[2],r=1 in arguments?arguments[1]:vn.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var s=30+(Math.round(e/255)<<2|Math.round(i/255)<<1|Math.round(n/255));return 2===r&&(s+=60),s},vn.hsv.ansi16=function(t){return vn.rgb.ansi16(vn.hsv.rgb(t),t[2])},vn.rgb.ansi256=function(t){var n=t[0],i=t[1],e=t[2];return n===i&&i===e?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(i/255*5)+Math.round(e/255*5)},vn.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 i=.5*(1+~~(t>50));return[(1&n)*i*255,(n>>1&1)*i*255,(n>>2&1)*i*255]},vn.ansi256.rgb=function(t){if(t>=232){var n=10*(t-232)+8;return[n,n,n]}var i;return t-=16,[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},vn.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},vn.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 i=n[0];3===n[0].length&&(i=i.split("").map((function(t){return t+t})).join(""));var e=parseInt(i,16);return[e>>16&255,e>>8&255,255&e]},vn.rgb.hcg=function(t){var n,i=t[0]/255,e=t[1]/255,r=t[2]/255,s=Math.max(Math.max(i,e),r),o=Math.min(Math.min(i,e),r),a=s-o;return n=a<=0?0:s===i?(e-r)/a%6:s===e?2+(r-i)/a:4+(i-e)/a+4,n/=6,[360*(n%=1),100*a,100*(a<1?o/(1-a):0)]},vn.hsl.hcg=function(t){var n=t[1]/100,i=t[2]/100,e=1,r=0;return(e=i<.5?2*n*i:2*n*(1-i))<1&&(r=(i-.5*e)/(1-e)),[t[0],100*e,100*r]},vn.hsv.hcg=function(t){var n=t[1]/100,i=t[2]/100,e=n*i,r=0;return e<1&&(r=(i-e)/(1-e)),[t[0],100*e,100*r]},vn.hcg.rgb=function(t){var n=t[0]/360,i=t[1]/100,e=t[2]/100;if(0===i)return[255*e,255*e,255*e];var r,s=[0,0,0],o=n%1*6,a=o%1,h=1-a;switch(Math.floor(o)){case 0:s[0]=1,s[1]=a,s[2]=0;break;case 1:s[0]=h,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]=h,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]=h}return r=(1-i)*e,[255*(i*s[0]+r),255*(i*s[1]+r),255*(i*s[2]+r)]},vn.hcg.hsv=function(t){var n=t[1]/100,i=n+t[2]/100*(1-n),e=0;return i>0&&(e=n/i),[t[0],100*e,100*i]},vn.hcg.hsl=function(t){var n=t[1]/100,i=t[2]/100*(1-n)+.5*n,e=0;return i>0&&i<.5?e=n/(2*i):i>=.5&&i<1&&(e=n/(2*(1-i))),[t[0],100*e,100*i]},vn.hcg.hwb=function(t){var n=t[1]/100,i=n+t[2]/100*(1-n);return[t[0],100*(i-n),100*(1-i)]},vn.hwb.hcg=function(t){var n=t[1]/100,i=1-t[2]/100,e=i-n,r=0;return e<1&&(r=(i-e)/(1-e)),[t[0],100*e,100*r]},vn.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},vn.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},vn.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},vn.gray.hsl=vn.gray.hsv=function(t){return[0,0,t[0]]},vn.gray.hwb=function(t){return[0,100,t[0]]},vn.gray.cmyk=function(t){return[0,0,0,t[0]]},vn.gray.lab=function(t){return[t[0],0,0]},vn.gray.hex=function(t){var n=255&Math.round(t[0]/100*255),i=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(i.length)+i},vn.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var Mn=cn.exports;function bn(t){var n=function(){for(var t={},n=Object.keys(Mn),i=n.length,e=0;e<i;e++)t[n[e]]={distance:-1,parent:null};return t}(),i=[t];for(n[t].distance=0;i.length;)for(var e=i.pop(),r=Object.keys(Mn[e]),s=r.length,o=0;o<s;o++){var a=r[o],h=n[a];-1===h.distance&&(h.distance=n[e].distance+1,h.parent=e,i.unshift(a))}return n}function xn(t,n){return function(i){return n(t(i))}}function Fn(t,n){for(var i=[n[t].parent,t],e=Mn[n[t].parent][t],r=n[t].parent;n[r].parent;)i.unshift(n[r].parent),e=xn(Mn[n[r].parent][r],e),r=n[r].parent;return e.conversion=i,e}var An=cn.exports,kn=function(t){for(var n=bn(t),i={},e=Object.keys(n),r=e.length,s=0;s<r;s++){var o=e[s];null!==n[o].parent&&(i[o]=Fn(o,n))}return i},Pn={};Object.keys(An).forEach((function(t){Pn[t]={},Object.defineProperty(Pn[t],"channels",{value:An[t].channels}),Object.defineProperty(Pn[t],"labels",{value:An[t].labels});var n=kn(t);Object.keys(n).forEach((function(i){var e=n[i];Pn[t][i]=function(t){var n=function(n){if(null==n)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var i=t(n);if("object"==typeof i)for(var e=i.length,r=0;r<e;r++)i[r]=Math.round(i[r]);return i};return"conversion"in t&&(n.conversion=t.conversion),n}(e),Pn[t][i].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}(e)}))}));var Sn=Pn,_n=Xt.exports,On=Sn,In=[].slice,Tn=["keyword","gray","hex"],Ln={};Object.keys(On).forEach((function(t){Ln[In.call(On[t].labels).sort().join("")]=t}));var Un={};function zn(t,n){if(!(this instanceof zn))return new zn(t,n);if(n&&n in Tn&&(n=null),n&&!(n in On))throw new Error("Unknown model: "+n);var i,e;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof zn)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var r=_n.get(t);if(null===r)throw new Error("Unable to parse color from string: "+t);this.model=r.model,e=On[this.model].channels,this.color=r.value.slice(0,e),this.valpha="number"==typeof r.value[e]?r.value[e]:1}else if(t.length){this.model=n||"rgb",e=On[this.model].channels;var s=In.call(t,0,e);this.color=jn(s,e),this.valpha="number"==typeof t[e]?t[e]: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 Ln))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Ln[a];var h=On[this.model].labels,u=[];for(i=0;i<h.length;i++)u.push(t[h[i]]);this.color=jn(u)}if(Un[this.model])for(e=On[this.model].channels,i=0;i<e;i++){var l=Un[this.model][i];l&&(this.color[i]=l(this.color[i]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function Dn(t,n,i){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(Un[t]||(Un[t]=[]))[n]=i})),t=t[0],function(e){var r;return arguments.length?(i&&(e=i(e)),(r=this[t]()).color[n]=e,r):(r=this[t]().color[n],i&&(r=i(r)),r)}}function En(t){return function(n){return Math.max(0,Math.min(t,n))}}function Cn(t){return Array.isArray(t)?t:[t]}function jn(t,n){for(var i=0;i<n;i++)"number"!=typeof t[i]&&(t[i]=0);return t}zn.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var n=this.model in _n.to?this:this.rgb(),i=1===(n=n.round("number"==typeof t?t:1)).valpha?n.color:n.color.concat(this.valpha);return _n.to[n.model](i)},percentString:function(t){var n=this.rgb().round("number"==typeof t?t:1),i=1===n.valpha?n.color:n.color.concat(this.valpha);return _n.to.rgb.percent(i)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},n=On[this.model].channels,i=On[this.model].labels,e=0;e<n;e++)t[i[e]]=this.color[e];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 zn(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 zn(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:Dn("rgb",0,En(255)),green:Dn("rgb",1,En(255)),blue:Dn("rgb",2,En(255)),hue:Dn(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:Dn("hsl",1,En(100)),lightness:Dn("hsl",2,En(100)),saturationv:Dn("hsv",1,En(100)),value:Dn("hsv",2,En(100)),chroma:Dn("hcg",1,En(100)),gray:Dn("hcg",2,En(100)),white:Dn("hwb",1,En(100)),wblack:Dn("hwb",2,En(100)),cyan:Dn("cmyk",0,En(100)),magenta:Dn("cmyk",1,En(100)),yellow:Dn("cmyk",2,En(100)),black:Dn("cmyk",3,En(100)),x:Dn("xyz",0,En(100)),y:Dn("xyz",1,En(100)),z:Dn("xyz",2,En(100)),l:Dn("lab",0,En(100)),a:Dn("lab",1),b:Dn("lab",2),keyword:function(t){return arguments.length?new zn(t):On[this.model].keyword(this.color)},hex:function(t){return arguments.length?new zn(t):_n.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=[],i=0;i<t.length;i++){var e=t[i]/255;n[i]=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}return.2126*n[0]+.7152*n[1]+.0722*n[2]},contrast:function(t){var n=this.luminosity(),i=t.luminosity();return n>i?(n+.05)/(i+.05):(i+.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 zn.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(),i=n.color[0];return i=(i=(i+t)%360)<0?360+i:i,n.color[0]=i,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 i=t.rgb(),e=this.rgb(),r=void 0===n?.5:n,s=2*r-1,o=i.alpha()-e.alpha(),a=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,h=1-a;return zn.rgb(a*i.red()+h*e.red(),a*i.green()+h*e.green(),a*i.blue()+h*e.blue(),i.alpha()*r+e.alpha()*(1-r))}},Object.keys(On).forEach((function(t){if(-1===Tn.indexOf(t)){var n=On[t].channels;zn.prototype[t]=function(){if(this.model===t)return new zn(this);if(arguments.length)return new zn(arguments,t);var i="number"==typeof arguments[n]?n:this.valpha;return new zn(Cn(On[this.model][t].raw(this.color)).concat(i),t)},zn[t]=function(i){return"number"==typeof i&&(i=jn(In.call(arguments),n)),new zn(i,t)}}}));var Nn=zn;class Hn{constructor(t,n){this.position=t,this.index=n,this.faces=[],this.neighbors=[]}addUniqueNeighbor(t){-1===this.neighbors.indexOf(t)&&this.neighbors.push(t)}}class Vn{constructor(t,n,i,e){this.a=e.a,this.b=e.b,this.c=e.c,this.v1=t,this.v2=n,this.v3=i,this.normal=[],this.computeNormal(),t.faces.push(this),t.addUniqueNeighbor(n),t.addUniqueNeighbor(i),n.faces.push(this),n.addUniqueNeighbor(t),n.addUniqueNeighbor(i),i.faces.push(this),i.addUniqueNeighbor(t),i.addUniqueNeighbor(n)}computeNormal(){const t=this.v1.position,n=this.v2.position,i=this.v3.position,e=Pt([],St([],i,n),St([],t,n));At(this.normal,e)}hasVertex(t){return t===this.v1||t===this.v2||t===this.v3}}\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */const Rn=[],Wn=[],$n=[],Bn=[];function qn(t,n,i){const e=Pt(Wn,n,i);t=Tt(t,function(t,n,i,e,r,s,o,a,h,u){return t[0]=n,t[1]=i,t[2]=e,t[3]=r,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}(Rn,i[0],i[1],i[2],...e,...n));if((t=function(t){return t[3]<0?Ut(t,t,-1):t}(t=zt(t,t)))[3]<1/32767){t[3]=1/32767;const n=Math.sqrt(.9999999990686206);t[0]*=n,t[1]*=n,t[2]*=n}const r=i[3]>0?Pt($n,i,n):Pt($n,n,i);return kt(Pt(Bn,i,n),r)<0&&Ut(t,t,-1),t}function Gn(t,n){const i=[],e=[];let r=0;for(r=0;r<t.length;r+=3){const n=new Hn([t[r],t[r+1],t[r+2]],r/3);i.push(n)}if(!n.length){const t=n;n=[];for(let i=0;i<t;i++)n.push(i)}for(r=0;r<n.length/3;r++){const t={a:n[3*r],b:n[3*r+1],c:n[3*r+2]};new Vn(i[t.a],i[t.b],i[t.c],t)}const s=[],o=[0,0,0];for(r=0;r<i.length;r++){const t=i[r],n=t.index;bt(o,0,0,0);let a=t.faces.length;for(let n=0;n<a;n++)xt(o,o,t.faces[n].normal);a=a||1,bt(s,a,a,a),Ft(o,o,s),e[3*n]=o[0],e[3*n+1]=o[1],e[3*n+2]=o[2]}return e}\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 Jn(t,n,i){return t[0]=n[i],t[1]=n[i+1],t[2]=n[i+2],t}function Xn(t,n,i){return t[0]=n[i],t[1]=n[i+1],t}var Zn={exports:{}};function Yn(t,n,i){i=i||2;var e,r,s,o,a,h,u,l=n&&n.length,c=l?n[0]*i:t.length,f=Kn(t,0,c,i,!0),d=[];if(!f||f.next===f.prev)return d;if(l&&(f=function(t,n,i,e){var r,s,o,a,h,u=[];for(r=0,s=n.length;r<s;r++)o=n[r]*e,a=r<s-1?n[r+1]*e:t.length,(h=Kn(t,o,a,e,!1))===h.next&&(h.steiner=!0),u.push(ui(h));for(u.sort(si),r=0;r<u.length;r++)i=Qn(i=oi(u[r],i),i.next);return i}(t,n,f,i)),t.length>80*i){e=s=t[0],r=o=t[1];for(var y=i;y<c;y+=i)(a=t[y])<e&&(e=a),(h=t[y+1])<r&&(r=h),a>s&&(s=a),h>o&&(o=h);u=0!==(u=Math.max(s-e,o-r))?1/u:0}return ti(f,d,i,e,r,u),d}function Kn(t,n,i,e,r){var s,o;if(r===xi(t,n,i,e)>0)for(s=n;s<i;s+=e)o=wi(s,t[s],t[s+1],o);else for(s=i-e;s>=n;s-=e)o=wi(s,t[s],t[s+1],o);return o&&di(o,o.next)&&(Mi(o),o=o.next),o}function Qn(t,n){if(!t)return t;n||(n=t);var i,e=t;do{if(i=!1,e.steiner||!di(e,e.next)&&0!==fi(e.prev,e,e.next))e=e.next;else{if(Mi(e),(e=n=e.prev)===e.next)break;i=!0}}while(i||e!==n);return n}function ti(t,n,i,e,r,s,o){if(t){!o&&s&&function(t,n,i,e){var r=t;do{null===r.z&&(r.z=hi(r.x,r.y,n,i,e)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,i,e,r,s,o,a,h,u=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,e=i,a=0,n=0;n<u&&(a++,e=e.nextZ);n++);for(h=u;a>0||h>0&&e;)0!==a&&(0===h||!e||i.z<=e.z)?(r=i,i=i.nextZ,a--):(r=e,e=e.nextZ,h--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=e}s.nextZ=null,u*=2}while(o>1)}(r)}(t,e,r,s);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,s?ii(t,e,r,s):ni(t))n.push(a.i/i),n.push(t.i/i),n.push(h.i/i),Mi(t),t=h.next,u=h.next;else if((t=h)===u){o?1===o?ti(t=ei(Qn(t),n,i),n,i,e,r,s,2):2===o&&ri(t,n,i,e,r,s):ti(Qn(t),n,i,e,r,s,1);break}}}function ni(t){var n=t.prev,i=t,e=t.next;if(fi(n,i,e)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(li(n.x,n.y,i.x,i.y,e.x,e.y,r.x,r.y)&&fi(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function ii(t,n,i,e){var r=t.prev,s=t,o=t.next;if(fi(r,s,o)>=0)return!1;for(var a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,h=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,u=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,l=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,c=hi(a,h,n,i,e),f=hi(u,l,n,i,e),d=t.prevZ,y=t.nextZ;d&&d.z>=c&&y&&y.z<=f;){if(d!==t.prev&&d!==t.next&&li(r.x,r.y,s.x,s.y,o.x,o.y,d.x,d.y)&&fi(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,y!==t.prev&&y!==t.next&&li(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&fi(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&li(r.x,r.y,s.x,s.y,o.x,o.y,d.x,d.y)&&fi(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;y&&y.z<=f;){if(y!==t.prev&&y!==t.next&&li(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&fi(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function ei(t,n,i){var e=t;do{var r=e.prev,s=e.next.next;!di(r,s)&&yi(r,e,e.next,s)&&mi(r,s)&&mi(s,r)&&(n.push(r.i/i),n.push(e.i/i),n.push(s.i/i),Mi(e),Mi(e.next),e=t=s),e=e.next}while(e!==t);return Qn(e)}function ri(t,n,i,e,r,s){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&ci(o,a)){var h=gi(o,a);return o=Qn(o,o.next),h=Qn(h,h.next),ti(o,n,i,e,r,s),void ti(h,n,i,e,r,s)}a=a.next}o=o.next}while(o!==t)}function si(t,n){return t.x-n.x}function oi(t,n){var i=function(t,n){var i,e=n,r=t.x,s=t.y,o=-1/0;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var a=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=r&&a>o){if(o=a,a===r){if(s===e.y)return e;if(s===e.next.y)return e.next}i=e.x<e.next.x?e:e.next}}e=e.next}while(e!==n);if(!i)return null;if(r===o)return i;var h,u=i,l=i.x,c=i.y,f=1/0;e=i;do{r>=e.x&&e.x>=l&&r!==e.x&&li(s<c?r:o,s,l,c,s<c?o:r,s,e.x,e.y)&&(h=Math.abs(s-e.y)/(r-e.x),mi(e,t)&&(h<f||h===f&&(e.x>i.x||e.x===i.x&&ai(i,e)))&&(i=e,f=h)),e=e.next}while(e!==u);return i}(t,n);if(!i)return n;var e=gi(i,t),r=Qn(i,i.next);return Qn(e,e.next),n===i?r:n}function ai(t,n){return fi(t.prev,t,n.prev)<0&&fi(n.next,t,t.next)<0}function hi(t,n,i,e,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-e)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function ui(t){var n=t,i=t;do{(n.x<i.x||n.x===i.x&&n.y<i.y)&&(i=n),n=n.next}while(n!==t);return i}function li(t,n,i,e,r,s,o,a){return(r-o)*(n-a)-(t-o)*(s-a)>=0&&(t-o)*(e-a)-(i-o)*(n-a)>=0&&(i-o)*(s-a)-(r-o)*(e-a)>=0}function ci(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==n.i&&i.next.i!==n.i&&yi(i,i.next,t,n))return!0;i=i.next}while(i!==t);return!1}(t,n)&&(mi(t,n)&&mi(n,t)&&function(t,n){var i=t,e=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(e=!e),i=i.next}while(i!==t);return e}(t,n)&&(fi(t.prev,t,n.prev)||fi(t,n.prev,n))||di(t,n)&&fi(t.prev,t,t.next)>0&&fi(n.prev,n,n.next)>0)}function fi(t,n,i){return(n.y-t.y)*(i.x-n.x)-(n.x-t.x)*(i.y-n.y)}function di(t,n){return t.x===n.x&&t.y===n.y}function yi(t,n,i,e){var r=pi(fi(t,n,i)),s=pi(fi(t,n,e)),o=pi(fi(i,e,t)),a=pi(fi(i,e,n));return r!==s&&o!==a||(!(0!==r||!vi(t,i,n))||(!(0!==s||!vi(t,e,n))||(!(0!==o||!vi(i,t,e))||!(0!==a||!vi(i,n,e)))))}function vi(t,n,i){return n.x<=Math.max(t.x,i.x)&&n.x>=Math.min(t.x,i.x)&&n.y<=Math.max(t.y,i.y)&&n.y>=Math.min(t.y,i.y)}function pi(t){return t>0?1:t<0?-1:0}function mi(t,n){return fi(t.prev,t,t.next)<0?fi(t,n,t.next)>=0&&fi(t,t.prev,n)>=0:fi(t,n,t.prev)<0||fi(t,t.next,n)<0}function gi(t,n){var i=new bi(t.i,t.x,t.y),e=new bi(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,i.next=r,r.prev=i,e.next=i,i.prev=e,s.next=e,e.prev=s,e}function wi(t,n,i,e){var r=new bi(t,n,i);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function Mi(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 bi(t,n,i){this.i=t,this.x=n,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function xi(t,n,i,e){for(var r=0,s=n,o=i-e;s<i;s+=e)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}Zn.exports=Yn,Zn.exports.default=Yn,Yn.deviation=function(t,n,i,e){var r=n&&n.length,s=r?n[0]*i:t.length,o=Math.abs(xi(t,0,s,i));if(r)for(var a=0,h=n.length;a<h;a++){var u=n[a]*i,l=a<h-1?n[a+1]*i:t.length;o-=Math.abs(xi(t,u,l,i))}var c=0;for(a=0;a<e.length;a+=3){var f=e[a]*i,d=e[a+1]*i,y=e[a+2]*i;c+=Math.abs((t[f]-t[y])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[y+1]-t[f+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},Yn.flatten=function(t){for(var n=t[0][0].length,i={vertices:[],holes:[],dimensions:n},e=0,r=0;r<t.length;r++){for(var s=0;s<t[r].length;s++)for(var o=0;o<n;o++)i.vertices.push(t[r][s][o]);r>0&&(e+=t[r-1].length,i.holes.push(e))}return i};var Fi=Zn.exports,Ai=ki;\n/*!\n * @maptalks/vector-packer v0.63.10\n * LICENSE : UNLICENSED\n * (c) 2016-2022 maptalks.com\n */function ki(t,n){this.x=t,this.y=n}ki.prototype={clone:function(){return new ki(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().T()},round:function(){return this.clone().L()},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,i=t.y-this.y;return n*n+i*i},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[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=n,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},T:function(){var t=this.y;return this.y=this.x,this.x=-t,this},S:function(t){var n=Math.cos(t),i=Math.sin(t),e=i*this.x+n*this.y;return this.x=n*this.x-i*this.y,this.y=e,this},_:function(t,n){var i=Math.cos(t),e=Math.sin(t),r=n.y+e*(this.x-n.x)+i*(this.y-n.y);return this.x=n.x+i*(this.x-n.x)-e*(this.y-n.y),this.y=r,this},L:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ki.convert=function(t){return t instanceof ki?t:Array.isArray(t)?new ki(t[0],t[1]):t};const Pi={Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6};function Si(t,n={}){var i=[];if("FeatureCollection"===t.type)for(var e=0;e<t.features.length;e++)_i(i,t.features[e],n,e);else _i(i,"Feature"===t.type?t:{geometry:t},n);return i}function _i(t,n,i,e){if(n.geometry&&n.geometry.geometry){var r=n.geometry.coordinates,s=n.geometry.type,o=[],a=n.id;if(i.promoteId?a=n.properties[i.promoteId]:i.generateId&&(a=e||0),"Point"===s)Oi(r,o);else if("MultiPoint"===s)for(var h=0;h<r.length;h++)Oi(r[h],o);else if("LineString"===s)Ti([r],o);else if("MultiLineString"===s){if(i.lineMetrics){for(h=0;h<r.length;h++)Ii(r[h],o=[]),t.push(Li(a,"LineString",o,n.properties));return}Ti(r,o)}else if("Polygon"===s)Ti(r,o);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(h=0;h<n.geometry.geometries.length;h++)_i(t,{id:a,geometry:n.geometry.geometries[h],properties:n.properties},i,e);return}return void console.warn(`Input data type(${s}) is not a valid GeoJSON geometry type.`)}for(h=0;h<r.length;h++){var u=[];Ti(r[h],u),o.push(u)}}t.push(Li(a,s,o,n.properties))}}function Oi(t,n){n.push([new Ai(t[0],t[1])])}function Ii(t,n){for(var i=0;i<t.length;i++)n.push(new Ai(t[i][0],t[i][1]))}function Ti(t,n,i,e){for(var r=0;r<t.length;r++){var s=[];Ii(t[r],s),n.push(s)}}function Li(t,n,i,e){return{id:void 0===t?null:t,type:Pi[n],geometry:i,properties:e}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */function Ui(t,{width:n,height:i},e,r){if(r){if(r.length!==n*i*e)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*i*e);return t.width=n,t.height=i,t.data=r,t}function zi(t,{width:n,height:i},e){if(n===t.width&&i===t.height)return;const r=Ui({},{width:n,height:i},e);Di(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},e),t.width=n,t.height=i,t.data=r.data}function Di(t,n,i,e,r,s){if(0===r.width||0===r.height)return n;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>n.width||r.height>n.height||e.x>n.width-r.width||e.y>n.height-r.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 h=0;h<r.height;h++){const u=((i.y+h)*t.width+i.x)*s,l=((e.y+h)*n.width+e.x)*s;for(let t=0;t<r.width*s;t++)a[l+t]=o[u+t]}return n}class Ei{constructor(t,n){Ui(this,t,1,n)}resize(t){zi(this,t,1)}clone(){return new Ei({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,i,e,r){Di(t,n,i,e,r,1)}}class Ci{constructor(t,n){Ui(this,t,4,n)}resize(t){zi(this,t,4)}clone(){return new Ci({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,i,e,r){Di(t,n,i,e,r,4)}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */class ji{constructor(t,{pixelRatio:n}){this.paddedRect=t,this.pixelRatio=n||1}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Ni{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,n={},i=new Ht(0,0,{autoResize:!0}),e=[];for(const i in t){const r=t[i],s={x:0,y:0,w:r.data.width+2,h:r.data.height+2};e.push(s),n[i]=new ji(s,r)}if(i.pack(e,{inPlace:!0}),!Hi(i.w)||!Hi(i.h)){const t=Vi(i.w),n=Vi(i.h);i.resize(t,n)}const r=new Ci({width:i.w,height:i.h});for(const i in t){const e=t[i],s=n[i].paddedRect;Ci.copy(e.data,r,{x:0,y:0},{x:s.x+1,y:s.y+1},e.data)}this.image=r,this.positions=n}}function Hi(t){return 0==(t&t-1)&&0!==t}function Vi(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 Ri{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,n={},i=new Ht(0,0,{autoResize:!0}),e=[];for(const i in t){const r=t[i],s=n[i]={};for(const t in r){const n=r[+t];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;const i={x:0,y:0,w:n.bitmap.width+2,h:n.bitmap.height+2};e.push(i),s[t]={rect:i,metrics:n.metrics}}}i.pack(e,{inPlace:!0});const r=new Ei({width:i.w,height:i.h});for(const i in t){const e=t[i];for(const t in e){const s=e[+t];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const o=n[i][t].rect;Ei.copy(s.bitmap,r,{x:0,y:0},{x:o.x+1,y:o.y+1},s.bitmap)}}this.image=r,this.positions=n}}function Wi(t){return t<65536?Uint16Array:Uint32Array}function $i(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function Bi(t){return t<256?Uint8Array:t<65536?Uint16Array:Float32Array}function qi(t){const n=t.type,i=[];if(1===n||4===n)for(let n=0;n<t.geometry.length;n++)Oi(t.geometry[n],i);else if(2===n)Ti(t.geometry,i);else if(3===n)Ti(t.geometry,i);else if(5===n)Ti(t.geometry,i);else if(6===n)for(let n=0;n<t.geometry.length;n++){const e=[];Ti(t.geometry[n],e),i.push(e)}return t.geometry=i,t}function Gi(t){for(let n=1;n<arguments.length;n++){const i=arguments[n];for(const n in i)t[n]=i[n]}return t}function Ji(t){return null==t}function Xi(t){return"number"==typeof t&&!isNaN(t)}function Zi(t){return"object"==typeof t&&!!t}function Yi(t){return!Ji(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}const Ki=Object.prototype.hasOwnProperty;function Qi(t,n){return Ki.call(t,n)}function te(t){return m(t)&&t.property}function ne(t){let n=0;for(let i,e,r=0,s=t.length,o=s-1;r<s;o=r++)i=t[r],e=t[o],n+=void 0!==i.x?(e.x-i.x)*(i.y+e.y):(e[0]-i[0])*(i[1]+e[1]);return n}function ie(t,n,i,e,r){const s=t[n*e],o=t[n*e+1],a=t[i*e],h=t[i*e+1];return s===a&&(s<0||s>r)&&o!==h||o===h&&(o<0||o>r)&&s!==a}function ee(t,n,i){let e=i;return n&&t&&(e=t[n]),void 0===e&&(e=i),10*(e||0)}function re(t,n,i,e,r,s,o){n||0===n||(n=1);const a=ee(t.properties,i,e),h=a*n;let u=a;return r?u=ee(t.properties,r,s):o&&(u=a-ee(t.properties,o,0)),u*=n,{altitude:h,height:u}}function se(t,n){return n<1/0&&(t.x<0||t.x>n||t.y<0||t.y>n)}function oe(t){return null==t}function ae(t,n,i){if(t===i||t===n)return t;const e=i-n;return((t-n)%e+e)%e+n}class he{constructor(t,n,i,e){this.feature=t,this.symbol=n,this.fnTypes=i,this.options=e}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}}const ue={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};class le{static isAtlasLoaded(t,n={}){const{iconAtlas:i}=n;return!!(!t||i&&i.positions[t])}static genFnTypes(t){const n={};for(const i in t)if(te(t[i])){const e=(i+"_Fn_0").trim(),r=(i+"Fn").trim();ue[i]?(n[e]=g(t[i]),n[r]=(t,i)=>{const r=n[e](t,i);return te(r)?g(r)(t,i):r}):(n[e]=w(t[i]),n[r]=(t,i)=>{const r=n[e](t,i);return te(r)?w(r)(t,i):r})}return n}constructor(t,n,i){this.options=i,this.features=this.D(t),this.symbolDef=n,this.symbol=M(n,()=>[i.zoom]),this.styledVectors=[],this.properties={},this.C=le.genFnTypes(this.symbolDef),te(this.symbolDef.visible)&&(this.j=g(this.symbolDef.visible)),i.atlas&&(this.iconAtlas=i.atlas.iconAtlas,this.glyphAtlas=i.atlas.glyphAtlas)}D(t){if(!t.length)return t;const n="__fea_idx".trim();let e,r=0,s=t[r];for(;!s.geometry;)r++,s=t[r];if(Array.isArray(s.geometry)&&s.properties){let n=s.geometry[0];for(;Array.isArray(n);)n=n[0];n instanceof Ai&&(e=t)}if(!e)if(e=[],Array.isArray(s.geometry))for(let n=0;n<t.length;n++){const i=Gi({},t[n]);e.push(qi(i))}else for(let i=0;i<t.length;i++){const r=t[i],s=Si(r);for(let t=0;t<s.length;t++){const i=s[t];i[n]=r[n],e.push(i)}}const o=this.options.order;if(o){const t=[];for(let n=0;n<o.length;n++)o[n]&&t.push(i(o[n]));e=e.sort((n,i)=>{const e=t.length;let r=e,s=e;for(let o=0;o<e&&(t[o](n)&&(r=o),t[o](i)&&(s=o),!(r<e&&s<e));o++);return r-s})}return e}load(t=1){const n="__fea_idx".trim(),i="_debug_info".trim(),e=this.C,r=this.styledVectors;this.count=0;const s=this.features;if(!s||!s.length)return Promise.resolve(null);const o={},a={},h={zoom:this.options.zoom},u=M(this.symbolDef,()=>[h.zoom]);let l=0,c=s.length;const f=this.options.debugIndex;try{for(;l<c;l++){const t=s[l];if(!t||!t.geometry)continue;if(void 0!==f&&t[i].index!==f)continue;t.properties||(t.properties={}),t.properties.$layer=t.layer,t.properties.$type=t.type;const c=this.createStyledVector(t,u,e,h,o,a);c&&c.feature.geometry&&(c.featureIdx=void 0===t[n]?l:t[n],this.count++,r.push(c))}}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((i,e)=>{this.fetchAtlas(t,n,(t,n)=>{if(t)e(t);else{if(n){const{icons:t,glyphs:i}=n;if(t&&Object.keys(t).length){for(const n in t){const i=t[n],{width:e,height:r,data:s}=i.data;i.data=new Ci({width:e,height:r},s)}this.iconAtlas=new Ni(t)}if(i&&Object.keys(i).length){for(const t in i){const n=i[t];for(const t in n){const i=n[t],{width:e,height:r,data:s}=i.bitmap;i.bitmap=new Ei({width:e,height:r},s)}}this.glyphAtlas=new Ri(i)}}i({glyphAtlas:this.glyphAtlas,iconAtlas:this.iconAtlas})}})})}fetchAtlas(t,n,i){Object.keys(t).length>0||Object.keys(n).length>0?this.options.requestor(t,n,i):i()}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 i=n.buffers;delete n.buffers;const e={data:n,buffers:i};if(this.iconAtlas){const t=e.data.iconAtlas=ce(this.iconAtlas);if(t.glyphMap)for(const n in t.glyphMap)i.push(t.glyphMap[n].data.data.buffer);i.push(e.data.iconAtlas.image.data.buffer)}return this.glyphAtlas&&(e.data.glyphAtlas=ce(this.glyphAtlas),i.push(e.data.glyphAtlas.image.data.buffer)),e}createStyledVector(t,n,i,e){return new he(t,n,i,e)}createDataPack(t,n){if(!t||!t.length)return null;this.maxIndex=0,this.maxPos=0,this.maxAltitude=0;const i=this.data={};let e=this.elements=[];const r=this.getFormat(Array.isArray(t[0])?t[0][0].symbol:t[0].symbol);for(let t=0;t<r.length;t++)i[r[t].name]=[];let s=[],o=0;const a=[];let h=0,u=!1;for(let e=0,r=t.length;e<r;e++){if(!t[e].feature.geometry)continue;const r=Array.isArray(t[e])?t[e][0].feature.id:t[e].feature.id;Xi(r)&&(Math.abs(r)>h&&(h=Math.abs(r)),r<0&&(u=!0));const l=this.data.aPosition.length;if(Array.isArray(t[e]))for(let i=0;i<t[e].length;i++)this.N(t[e][i],n);else this.N(t[e],n);const c=(i.aPosition.length-l)/3;for(let n=0;n<c;n++)s.push(t[e].featureIdx),Xi(r)&&a.push(r);o=Math.max(o,t[e].featureIdx)}if(this.hasElements()&&!e.length)return null;s=new(Bi(o))(s),r[0].type=this.options.positionType?this.options.positionType:$i(Math.max(this.maxPos,this.maxAltitude));const l=this.options.center;if(l&&(l[0]||l[1])){const t=i.aPosition;for(let n=0;n<t.length;n+=3)t[n]-=l[0],t[n+1]-=l[1]}const c=function(t,n){const i={};for(let e=0;e<t.length;e++){const r=t[e],s=r.type,o=r.name;i[o]=s===Array?n[o]:new s(n[o])}return i}(r,i);c.aPickingId=s;const f=[];for(const t in c)f.push(c[t].buffer);e=new(Wi(this.maxIndex))(e),f.push(e.buffer);const d={data:c,indices:this.hasElements()?e:null,positionSize:3,\n//!this.maxAltitude ? 2 : 3,\nbuffers:f,symbolIndex:this.symbolDef.index||{index:0}};if(a.length){const t=u?$i(h):Bi(h);d.featureIds=new t(a),f.push(d.featureIds.buffer)}else d.featureIds=[];return d}N(t,n){this.j&&this.j.isZoomConstant&&!this.j(null,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:i,altitudeScale:e}=this.options;let r=ee(t,n,i);return e&&(r*=e),this.maxAltitude=Math.max(this.maxAltitude,Math.abs(r)),r}getIconAtlasMaxValue(){const t=this.iconAtlas.positions;let n=0;for(const i in t)if(Qi(t,i)){const{tl:e,displaySize:r}=t[i],s=Math.max(e[0],e[1],r[0]-1,r[1]-1);s>n&&(n=s)}return n}}function ce(t){let n=t.positions,i=t.image&&t.image.format||"alpha";if(t instanceof Ni){n={};for(const i in t.positions){const e=t.positions[i];n[i]={paddedRect:e.paddedRect,pixelRatio:e.pixelRatio,tl:e.tl,br:e.br,displaySize:e.displaySize}}i="rgba"}const e=t.image;return{image:{width:e.width,height:e.height,data:e.data,format:i},glyphMap:t.glyphMap,positions:n}}function fe(t,n,i,e){const r="__fn_textSize".trim();let s=t.textSize;if(Ji(n.textSize))return[16,16];t[r]&&(s=t[r]);const o=[];var a;return o[0]=Ji(a=s)||"function"!=typeof a&&(null===a.constructor||a.constructor!==Function)?s:s(e,i),o[1]=o[0],o}function de(t){const n=t.stops;let i=-1/0;for(let t=0;t<n.length;t++){let e=n[t][1];Zi(n[t][1])&&(e=de(n[t][1])),e>i&&(i=e)}return i}const ye=/\\{([\\w_]+)\\}/g;function ve(t,n){return Yi(t)?t.replace(ye,(function(t,i){if(!n)return"";const e=n[i];return Ji(e)?"":Array.isArray(e)?e.join():e})):t}const pe=t=>t>=11904&&t<=12031,me=t=>t>=12032&&t<=12255,ge=t=>t>=12272&&t<=12287,we=t=>t>=12288&&t<=12351,Me=t=>t>=12352&&t<=12447,be=t=>t>=12448&&t<=12543,xe=t=>t>=12544&&t<=12591,Fe=t=>t>=12704&&t<=12735,Ae=t=>t>=12736&&t<=12783,ke=t=>t>=12784&&t<=12799,Pe=t=>t>=12800&&t<=13055,Se=t=>t>=13056&&t<=13311,_e=t=>t>=13312&&t<=19903,Oe=t=>t>=19968&&t<=40959,Ie=t=>t>=40960&&t<=42127,Te=t=>t>=42128&&t<=42191,Le=t=>t>=63744&&t<=64255,Ue=t=>t>=64336&&t<=65023,ze=t=>t>=65040&&t<=65055,De=t=>t>=65072&&t<=65103,Ee=t=>t>=65104&&t<=65135,Ce=t=>t>=65136&&t<=65279,je=t=>t>=65280&&t<=65519;function Ne(t){return!((t=>t>=1536&&t<=1791)(t)||(t=>t>=1872&&t<=1919)(t)||(t=>t>=2208&&t<=2303)(t)||Ue(t)||Ce(t))}function He(t){return!!(746===t||747===t||!(t<4352)&&(Fe(t)||xe(t)||De(t)&&!(t>=65097&&t<=65103)||Le(t)||Se(t)||pe(t)||Ae(t)||!(!we(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||_e(t)||Oe(t)||Pe(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)||Me(t)||ge(t)||(t=>t>=12688&&t<=12703)(t)||me(t)||ke(t)||be(t)&&12540!==t||!(!je(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)||!(!Ee(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||ze(t)||(t=>t>=19904&&t<=19967)(t)||Ie(t)||Te(t)))}function Ve(t){return!(He(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)||we(t)||be(t)||(t=>t>=57344&&t<=63743)(t)||De(t)||Ee(t)||je(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Re(t){return t>=1424&&t<=2303||Ue(t)||Ce(t)}const We=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]];function $e(t){for(const n of We)if(t>=n[0]&&t<=n[1])return!0;return!1}const Be={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",H:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function qe(t,n,i,e,r,s,o,a,h,u){let l=t.trim();2===u&&(l=function(t){let n="";for(let i=0;i<t.length;i++){const e=t.charCodeAt(i+1)||null,r=t.charCodeAt(i-1)||null;n+=e&&Ve(e)&&!Be[t[i+1]]||r&&Ve(r)&&!Be[t[i-1]]||!Be[t[i]]?t[i]:Be[t[i]]}return n}(l));const c=[],f={positionedGlyphs:c,text:l,top:a[1],bottom:a[1],left:a[0],right:a[0],writingMode:u};let d;return d=function(t,n){const i=[];let e=0;for(let r=0;r<n.length;r++){const s=n[r];i.push(t.substring(e,s)),e=s}return e<t.length&&i.push(t.substring(e,t.length)),i}(l,function(t,n,i,e){if(!i)return[];if(!t)return[];const r=[],s=function(t,n,i,e){let r=0;for(let i=0;i<t.length;i++){const s=e[t.charCodeAt(i)];s&&(r+=s.metrics.advance+n)}return r/Math.max(1,Math.ceil(r/i))}(t,n,i,e);let o=0;for(let i=0;i<t.length;i++){const h=t.charCodeAt(i),u=e[h];u&&!Ge[h]&&(o+=u.metrics.advance+n),i<t.length-1&&(Je[h]||!((a=h)<11904)&&(Fe(a)||xe(a)||De(a)||Le(a)||Se(a)||pe(a)||Ae(a)||we(a)||_e(a)||Oe(a)||Pe(a)||je(a)||Me(a)||ge(a)||me(a)||ke(a)||be(a)||ze(a)||Te(a)||Ie(a)))&&r.push(Ye(i+1,o,s,r,Ze(h,t.charCodeAt(i+1)),!1))}var a;return function t(n){return n?t(n.priorBreak).concat(n.index):[]}(Ye(t.length,o,s,r,0,!0))}(l,o,i,n)),function(t,n,i,e,r,s,o,a,h){let u=0,l=8,c=0;const f=t.positionedGlyphs,d="right"===s?1:"left"===s?0:.5;for(let t=0;t<i.length;t++){let r=i[t];if(r=r.trim(),!r.length){l-=e;continue}const s=f.length;for(let t=0;t<r.length;t++){const i=r.charCodeAt(t),e=n[i];e&&(He(i)&&1!==o?(32!==i&&f.push({glyph:i,x:u,y:0,vertical:!0}),u+=h+a):(32!==i&&f.push({glyph:i,x:u,y:l,vertical:!1}),u+=e.metrics.advance+a))}f.length!==s&&(c=Math.max(u-a,c),Qe(f,n,s,f.length-1,d)),u=0,l-=e}const{horizontalAlign:y,verticalAlign:v}=Ke(r);!function(t,n,i,e,r,s,o){const a=(n-i)*r,h=-(-e*o+.5)*s;if(a||h)for(let n=0;n<t.length;n++)t[n].x+=a,t[n].y+=h}(f,d,y,v,c,e,i.length);const p=i.length*e;t.top+=-v*p,t.bottom=t.top+p,t.left+=-y*c,t.right=t.left+c}(f,n,d,e,r,s,u,o,h),!!c.length&&f}const Ge={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Je={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 Xe(t,n,i,e){const r=Math.pow(t-n,2);return e?t<n?r/2:2*r:r+Math.abs(i)*i}function Ze(t,n){let i=0;return 10===t&&(i-=1e4),40!==t&&65288!==t||(i+=50),41!==n&&65289!==n||(i+=50),i}function Ye(t,n,i,e,r,s){let o=null,a=Xe(n,i,r,s);for(let t=0;t<e.length;t++){const h=e[t],u=Xe(n-h.x,i,r,s)+h.badness;u<=a&&(o=h,a=u)}return{index:t,x:n,priorBreak:o,badness:a}}function Ke(t){let n=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":n=1;break;case"left":case"top-left":case"bottom-left":n=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:n,verticalAlign:i}}function Qe(t,n,i,e,r){if(!r)return;const s=n[t[e].glyph];if(s){const n=(t[e].x+s.metrics.advance)*r;if(!n)return;for(let r=i;r<=e;r++)t[r].x-=n}}function tr(t){if(!function(t){for(const n of t)if(Re(n.charCodeAt(0)))return!0;return!1}(t))return t;const n=[],i=[],e=[];let r=0,s=0,o=1,a=1;for(const h of t){const t=h.codePointAt(0);$e(t)?(e.push(h),r++):(o=Re(t)?-1:1,a!==o?(s=r,i.length&&(a>0&&i.reverse(),n.push(...i)),e.length&&(n.splice(s,0,...e),e.length=0),a=o,i.length=0):e.length&&(i.push(...e),e.length=0),i.push(h),r++)}return e.length&&i.push(...e),i.length&&(a>0&&i.reverse(),n.push(...i)),n.reverse().join("")}const nr=/\\{ *([\\w_]+) *\\}/g;class ir{constructor(t,n,i,e,r){this.feature=t,this.symbolDef=n,this.symbol=i,this.options=r,this.V=this.R.bind(this),this.C=e}R(t,n){return this.feature.properties[n]||"default"}getShape(t,n){if(this.W)return this.W;const{textHorizontalAlignmentFn:i,textVerticalAlignmentFn:e,markerHorizontalAlignmentFn:r,markerVerticalAlignmentFn:s,textWrapWidthFn:o}=this.C;let a;const h=this.symbol,u=this.getIconAndGlyph(),l=this.feature.properties;if(u&&u.glyph){const{font:t,text:r}=u.glyph;if(""===r)return null;const s=this.size[0]/24,c=24,f=h.textKeepUpright,d="map"===h.textRotationAlignment&&"line"===h.textPlacement&&!h.isIconText,y=n.glyphMap[t],v=er(i?i(null,l):h.textHorizontalAlignment,e?e(null,l):h.textVerticalAlignment),p=1.2*c,m=function(t){for(let n=0;n<t.length;n++)if(!Ne(t.charAt(n).charCodeAt(0)))return!1;return!0}(r),g=m&&h.textLetterSpacing/s||0,w=[h.textDx/s||0,h.textDy/s||0],M=((o?o(null,l):h.textWrapWidth)||10*c)/s;a={},a.horizontal=qe(r,y,M,p,v,"center",g,w,c,1),m&&d&&f&&(a.vertical=qe(r,y,M,p,v,"center",g,w,c,2))}else if(u&&u.icon){if(!t.positions[u.icon.url])return null;const n=er(r?r(null,l):h.markerHorizontalAlignment,s?s(null,l):h.markerVerticalAlignment);a=function(t,n){const{horizontalAlign:i,verticalAlign:e}=Ke(n),r=-24*i,s=-24*e;return{image:t,top:s,bottom:s+24,left:r,right:r+24}}(t.positions[u.icon.url],n),this.size||(this.size=a.image.displaySize)}return this.W=a,a}getIconAndGlyph(){if(this.iconGlyph)return this.iconGlyph;const{markerFileFn:t,markerTypeFn:n,markerPathFn:i,markerWidthFn:e,markerHeightFn:r,markerFillFn:s,markerFillPatternFileFn:o,markerFillOpacityFn:a,markerTextFitFn:h,markerTextFitPaddingFn:u,markerLineColorFn:l,markerLineWidthFn:c,markerLineOpacityFn:f,markerLineDasharrayFn:d,markerLinePatternFileFn:y,markerPathWidthFn:v,markerPathHeightFn:p,textNameFn:w,textFaceNameFn:M,textStyleFn:b,textWeightFn:x}=this.C,{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,I=!Ji(this.symbolDef.textName);let T;if(O){T=function(t,n,i,e,r,s){if(Ji(n.markerWidth)&&Ji(n.markerHeight))return null;const o="__fn_markerWidth".trim(),a="__fn_markerHeight".trim();let h=n.markerWidth||0,u=n.markerHeight||0;return Zi(h)&&("identity"!==h.type?h=de(h):(h=t.markerWidth,t[o]&&(h=t[o](e,i)),Zi(h)&&(h="identity"===h.type?r(e,i):de(h)))),Zi(u)&&("identity"!==u.type?u=de(u):(u=t.markerHeight,t[a]&&(u=t[a](e,i)),Zi(u)&&(u="identity"===u.type?s(e,i):de(u)))),[h,u]}(k,this.symbolDef,P,F,e,r)||[0,0];let t=k.markerTextFit;if(h&&(t=h(F,P)),t&&t&&"none"!==t){const n=k.text.textSize;let i=k.text.textName;m(i)&&(i=g(i)(F,P));const e=ve(i,P);if(e){const i="__fn_textSize".trim(),r="__fn_textSize_0".trim();m(n)&&!k.text[i]&&(k.text[r]=g(n),k.text[i]=(t,n)=>{const i=k.text[r](t,n);return m(i)?g(i)(t,n):i});const s=fe(k.text,k.text,P,F);if("width"!==t&&"both"!==t||(T[0]=s[0]*e.length),"height"!==t&&"both"!==t||(T[1]=s[1]),s[0]&&s[1]){let t=k.markerTextFitPadding||[0,0,0,0];u&&(t=u(F,P)),T[0]+=t[1]+t[3],T[1]+=t[0]+t[2]}}else T[0]=T[1]=-1}}if(I&&(T=fe(k,this.symbolDef,P,F)),!T)return A;if(T[0]=Math.ceil(T[0]),T[1]=Math.ceil(T[1]),this.size=T,O&&T[0]>=0&&T[1]>=0){let t;if(_){const n={};if(n.markerType=_,"path"===_&&(n.markerPath=i?i(null,P):k.markerPath,n.markerPathWidth=v?v(null,P):k.markerPathWidth,n.markerPathHeight=p?p(null,P):k.markerPathHeight),e){const t=e(null,P);Ji(t)||(n.markerWidth=t)}else k.markerWidth>=0&&(n.markerWidth=k.markerWidth);if(r){const t=r(null,P);Ji(t)||(n.markerHeight=t)}else k.markerHeight>=0&&(n.markerHeight=k.markerHeight);if(s){const t=s(null,P);Ji(t)||(n.markerFill=t)}else k.markerFill&&(n.markerFill=k.markerFill);if(o){const t=o(null,P);Ji(t)||(n.markerFillPatternFile=t)}else k.markerFillPatternFile&&(n.markerFillPatternFile=k.markerFillPatternFile);if(a){const t=a(null,P);Ji(t)||(n.markerFillOpacity=t)}else k.markerFillOpacity>=0&&(n.markerFillOpacity=k.markerFillOpacity);if(l){const t=l(null,P);Ji(t)||(n.markerLineColor=t)}else k.markerLineColor&&(n.markerLineColor=k.markerLineColor);if(c){const t=c(null,P);Ji(t)||(n.markerLineWidth=t)}else k.markerLineWidth>=0&&(n.markerLineWidth=k.markerLineWidth);if(f){const t=f(null,P);Ji(t)||(n.markerLineOpacity=t)}else k.markerLineOpacity>=0&&(n.markerLineOpacity=k.markerLineOpacity);if(d){const t=d(null,P);Ji(t)||(n.markerLineDasharray=t)}else k.markerLineDasharray&&(n.markerLineDasharray=k.markerLineDasharray);if(y){const t=y(null,P);Ji(t)||(n.markerLinePatternFile=t)}else k.markerLinePatternFile&&(n.markerLinePatternFile=k.markerLinePatternFile);t="vector://"+JSON.stringify(n)}else t=S?S.replace(nr,this.V):k.markerPath?function(t,n,i){if(!t.markerPath)return null;let e=1;const r=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);Xi(t.markerOpacity)&&(e=t.markerOpacity),Xi(t.opacity)&&(e*=t.opacity);const s={};if(r){for(const t in r.stroke)Qi(r.stroke,t)&&(Ji(r.stroke[t])||(s[t]=r.stroke[t]));for(const t in r.fill)Qi(r.fill,t)&&(Ji(r.fill[t])||(s[t]=r.fill[t]))}const o=Array.isArray(t.markerPath)?t.markerPath:[t.markerPath];let a;const h=[];for(let t=0;t<o.length;t++)a=Yi(o[t])?{path:o[t]}:o[t],a=Gi({},a,s),a.d=a.path,delete a.path,h.push(a);const u=[\'<svg version="1.1"\',\'xmlns="http://www.w3.org/2000/svg"\'];e<1&&u.push(\'opacity="\'+e+\'"\'),t.markerPathWidth&&t.markerPathHeight&&u.push(\'viewBox="0 0 \'+t.markerPathWidth+" "+t.markerPathHeight+\'"\'),u.push(\'preserveAspectRatio="none"\'),n&&u.push(\'width="\'+n+\'"\'),i&&u.push(\'height="\'+i+\'"\'),u.push("><defs></defs>");for(let t=0;t<h.length;t++){let n="<path ";for(const i in h[t])Qi(h[t],i)&&(n+=" "+i+\'="\'+h[t][i]+\'"\');n+="></path>",u.push(n)}return u.push("</svg>"),"data:image/svg+xml;base64,"+btoa(u.join(" "))}(k,T[0],T[1]):null;A.icon={url:t,size:T}}if(I){const t=w?w(null,P):k.textName;if(t||0===t){const n=function(t,n,i){return[n||"normal",i||"normal","24px",t||"monospace"].join(" ")}(M?M(null,P):k.textFaceName,b?b(null,P):k.textStyle,x?x(null,P):k.textWeight);let i=ve(t,P);i&&i.length&&(i=tr(i),A.glyph={font:n,text:i})}}return this.iconGlyph=A,A}}function er(t,n){n&&"middle"!==n||(n="center"),t&&"middle"!==t||(t="center");let i="center"!==n?n:"";return i+="center"!==t?(i.length?"-":"")+t:"",i\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */}function rr(t,n,i,e,r){const s=[];for(let o=0;o<t.length;o++){const a=t[o];let h;for(let t=0;t<a.length-1;t++){let o=a[t],u=a[t+1];o.x<n&&u.x<n||(o.x<n?o=new Ai(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y)).L():u.x<n&&(u=new Ai(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y)).L()),o.y<i&&u.y<i||(o.y<i?o=new Ai(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i).L():u.y<i&&(u=new Ai(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i).L()),o.x>=e&&u.x>=e||(o.x>=e?o=new Ai(e,o.y+(e-o.x)/(u.x-o.x)*(u.y-o.y)).L():u.x>=e&&(u=new Ai(e,o.y+(e-o.x)/(u.x-o.x)*(u.y-o.y)).L()),o.y>=r&&u.y>=r||(o.y>=r?o=new Ai(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r).L():u.y>=r&&(u=new Ai(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r).L()),h&&o.equals(h[h.length-1])||(h=[o],s.push(h)),h.push(u)))))}}return s}class sr extends Ai{constructor(t,n,i,e){super(t,n),this.angle=i,void 0!==e&&(this.segment=e)}clone(){return new sr(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 or(t,n,i,e,r){if(void 0===n.segment)return!0;let s=n,o=n.segment+1,a=0;for(;a>-i/2;){if(o--,o<0)return!1;a-=t[o].dist(s),s=t[o]}a+=t[o].dist(t[o+1]),o++;const h=[];let u=0;for(;a<i/2;){const n=t[o],i=t[o+1];if(!i)return!1;let s=t[o-1].angleTo(n)-n.angleTo(i);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),h.push({distance:a,angleDelta:s}),u+=s;a-h[0].distance>e;)u-=h.shift().angleDelta;if(u>r)return!1;o++,a+=n.dist(i)}return!0}function ar(t,n,i,e,r,s,o,a,h){const u=function(t,n,i){return t?.6*n*i:0}(e,s,o),l=function(t,n){return Math.max(t?t.right-t.left:0,n?n.right-n.left:0)}(e,r),c=0===t[0].x||t[0].x===h||0===t[0].y||t[0].y===h;return n-l*o<n/4&&(n=l*o+n/4),function t(n,i,e,r,s,o,a,h,u){const l=o/2,c=function(t){let n=0;for(let i=0;i<t.length-1;i++)n+=t[i].dist(t[i+1]);return n}(n);let f=0,d=i-e,y=[];for(let t=0;t<n.length-1;t++){const i=n[t],a=n[t+1],h=i.dist(a),v=a.angleTo(i);for(;d+e<f+h;){d+=e;const p=(d-f)/h,m=hr(i.x,a.x,p),g=hr(i.y,a.y,p);if(m>=0&&m<u&&g>=0&&g<u&&d-l>=0&&d+l<=c){const i=new sr(m,g,v,t);i.line=n,i.L(),r&&!or(n,i,o,r,s)||y.push(i)}}f+=h}return h||y.length||a||(y=t(n,f/2,e,r,s,o,a,!0,u)),y}(t,c?n/2*a%n:(l/2+2*s)*o*a%n,n,u,i,l*o,c,!1,h)}function hr(t,n,i){return t*(1-i)+n*i}function ur(t,n){const i=t.length;if(i<=1)return[t];const e=[];let r,s;for(let n=0;n<i;n++){const i=ne(t[n]);0!==i&&(t[n].area=Math.abs(i),void 0===s&&(s=i<0),s===i<0?(r&&e.push(r),r=[t[n]]):r.push(t[n]))}if(r&&e.push(r),n>1)for(let t=0;t<e.length;t++)e[t].length<=n||($t(e[t],n,1,e[t].length-1,lr),e[t]=e[t].slice(0,n));return e}function lr(t,n){return n.area-t.area}function cr(t,n,i){const e=n.distSqr(i);if(0===e)return t.distSqr(n);const r=((t.x-n.x)*(i.x-n.x)+(t.y-n.y)*(i.y-n.y))/e;return t.distSqr(r<0?n:r>1?i:i.sub(n).k(r).m(n))}function fr(t,n=1,i=!1){let e=1/0,r=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<e)&&(e=n.x),(!t||n.y<r)&&(r=n.y),(!t||n.x>s)&&(s=n.x),(!t||n.y>o)&&(o=n.y)}const h=Math.min(s-e,o-r);let u=h/2;const l=new Jt(null,dr);if(0===h)return new Ai(e,r);for(let n=e;n<s;n+=h)for(let i=r;i<o;i+=h)l.push(new yr(n+u,i+u,u,t));let c=function(t){let n=0,i=0,e=0;const r=t[0];for(let t=0,s=r.length,o=s-1;t<s;o=t++){const s=r[t],a=r[o],h=s.x*a.y-a.x*s.y;i+=(s.x+a.x)*h,e+=(s.y+a.y)*h,n+=3*h}return new yr(i/n,e/n,0,t)}(t),f=l.length;for(;l.length;){const e=l.pop();(e.d>c.d||!c.d)&&(c=e,i&&console.log("found best %d after %d probes",Math.round(1e4*e.d)/1e4,f)),e.max-c.d<=n||(u=e.h/2,l.push(new yr(e.p.x-u,e.p.y-u,u,t)),l.push(new yr(e.p.x+u,e.p.y-u,u,t)),l.push(new yr(e.p.x-u,e.p.y+u,u,t)),l.push(new yr(e.p.x+u,e.p.y+u,u,t)),f+=4)}return i&&(console.log("num probes: "+f),console.log("best distance: "+c.d)),c.p}function dr(t,n){return n.max-t.max}function yr(t,n,i,e){this.p=new Ai(t,n),this.h=i,this.d=function(t,n){let i=!1,e=1/0;for(let r=0;r<n.length;r++){const s=n[r];for(let n=0,r=s.length,o=r-1;n<r;o=n++){const r=s[n],a=s[o];r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(i=!i),e=Math.min(e,cr(t,r,a))}}return(i?1:-1)*Math.sqrt(e)}(this.p,e),this.max=this.d+this.h*Math.SQRT2}const vr=45*Math.PI/100;function pr(t,n){const i={},e={},r=[];let s=0;function o(n){r.push(t[n]),s++}function a(t,n,i){const s=e[t];return delete e[t],e[n]=s,r[s].geometry[0].pop(),r[s].geometry[0]=r[s].geometry[0].concat(i[0]),s}function h(t,n,e){const s=i[n];return delete i[n],i[t]=s,r[s].geometry[0].shift(),r[s].geometry[0]=e[0].concat(r[s].geometry[0]),s}function u(t,n,i){const e=i?n[0][n[0].length-1]:n[0][0];return`${t}:${e.x}:${e.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 y=u(d,f),v=u(d,f,!0);if(y in e&&v in i&&e[y]!==i[v]){const t=h(y,v,f),n=a(y,v,r[t].geometry);delete i[y],delete e[v],e[u(d,r[n].geometry,!0)]=n,r[t].geometry=null}else y in e?a(y,v,f):v in i?h(y,v,f):(o(l),i[y]=s-1,e[v]=s-1)}return r.filter(t=>t.geometry)}class mr extends le{static needMerge(t){return t.mergeOnProperty&&("line"===t.textPlacement||"line"===t.markerPlacement)}static mergeLineFeatures(t,n,i){const e="__index".trim(),r=function(t,n,i){const e="__index".trim(),r=le.genFnTypes(n),{mergeOnPropertyFn:s}=r;if(!n.mergeOnProperty||"line"!==n.textPlacement&&"line"!==n.markerPlacement)return[];if(!(oe(o=n.mergeOnProperty)||"string"!=typeof o&&(null===o.constructor||o.constructor!==String)||"line"!==n.textPlacement&&"line"!==n.markerPlacement))return[{features:t,property:n.mergeOnProperty}];var o;const a=[],h={},u=[];for(let r=0;r<t.length;r++){t[r][e]=r;const o=t[r].properties=t[r].properties||{};o.$layer=t[r].layer,o.$type=t[r].type;let l=n.markerPlacement;"line"!==l&&(l=n.textPlacement);const c=s?s(i,o):n.mergeOnProperty;"line"!==l||oe(c)?u.push(t[r]):(void 0===h[c]&&(h[c]=a.length,a.push({features:[],property:c})),a[h[c]].features.push(t[r]))}return u.length&&a.push({features:u}),a}(t,n,i);if(r.length){const n=[];for(let i=0;i<r.length;i++)n.push(r[i].property?pr(r[i].features,r[i].property):t);if(1===n.length)return n[0];{let t=[];for(let i=0;i<n.length;i++)t=t.concat(n[i]);return t.sort((t,n)=>t[e]-n[e]),t}}}static splitPointSymbol(t,n=0){const i=[];if(Array.isArray(t)){const n=t;for(let t=0;t<n.length;t++)n[t]&&i.push(...mr.splitPointSymbol(n[t],t));return i}let e=null,r=null;for(const n in t)0===n.indexOf("marker")?(e=e||{},e[n]=t[n]):0===n.indexOf("text")&&(r=r||{},r[n]=t[n]);return e&&(e.isIconText=!0,t.mergeOnProperty&&(e.mergeOnProperty=t.mergeOnProperty),i.push(e)),r&&(e&&(r.textPlacement=e.markerPlacement,r.textSpacing=e.markerSpacing,r.isIconText=!0),t.mergeOnProperty&&(r.mergeOnProperty=t.mergeOnProperty),i.push(r)),void 0!==t.visible&&(e&&(e.visible=t.visible),r&&(r.visible=t.visible)),e&&(e.markerTextFit&&r&&(e.text={},e.text.textName=r.textName,e.text.textSize=r.textSize),e.index={index:n,type:0}),r&&(r.index={index:n,type:1}),i}static isAtlasLoaded(t,n){const{icon:i,glyph:e}=t,{iconAtlas:r,glyphAtlas:s}=n;if(i&&(!r||!r.positions[i.url]))return!1;if(e){if(!s||!s.positions[e.font])return!1;const t=s.positions[e.font],{text:n}=e;for(let i=0;i<n.length;i++)if(!t[n.charCodeAt(i)])return!1}return!0}constructor(t,n,i){super(t,n,i)}createStyledVector(t,n,i,e,r,s){const o=new ir(t,this.symbolDef,n,i,e),a=o.getIconAndGlyph();if(a.icon&&!this.options.atlas){const{url:t,size:n}=a.icon;r[t]||(r[t]=a.icon.size),r[t][0]<n[0]&&(r[t][0]=n[0]),r[t][1]<n[1]&&(r[t][1]=n[1])}if(a.glyph&&!this.options.atlas){const{font:t,text:i}=a.glyph,e=s[t]=s[t]||{};for(let t=0;t<i.length;t++)e[i.charCodeAt(t)]=1;"line"===n.textPlacement&&(s.options={isCharsCompact:!1})}return this.options.allowEmptyPack||a.icon||a.glyph?o:null}getFormat(t){const n=void 0!==t.textName,i=n?function(t){return"line"!==t.textPlacement||t.isIconText?[{type:Int16Array,width:3,name:"aPosition"},{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"}]:[{type:Int16Array,width:3,name:"aPosition"},{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"}]}(t):[{type:Int16Array,width:3,name:"aPosition"},{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"}];n?i.push(...this.B()):i.push(...this.q());const{markerOpacityFn:e,textOpacityFn:r,markerPitchAlignmentFn:s,textPitchAlignmentFn:o,markerRotationAlignmentFn:a,textRotationAlignmentFn:h,markerRotationFn:u,textRotationFn:l,markerAllowOverlapFn:c,textAllowOverlapFn:f,markerIgnorePlacementFn:d,textIgnorePlacementFn:y}=this.C;return(e||r)&&i.push({type:Uint8Array,width:1,name:"aColorOpacity"}),(s||o)&&i.push({type:Uint8Array,width:1,name:"aPitchAlign"}),(a||h)&&i.push({type:Uint8Array,width:1,name:"aRotationAlign"}),(u||l)&&i.push({type:Uint16Array,width:1,name:"aRotation"}),(c||f||d||y)&&i.push({type:Uint8Array,width:1,name:"aOverlap"}),i}B(){const{textFillFn:t,textSizeFn:n,textHaloFillFn:i,textHaloRadiusFn:e,textHaloOpacityFn:r,textDxFn:s,textDyFn:o}=this.C,a=[];return t&&a.push({type:Uint8Array,width:4,name:"aTextFill"}),n&&a.push({type:Uint8Array,width:1,name:"aTextSize"}),i&&a.push({type:Uint8Array,width:4,name:"aTextHaloFill"}),e&&a.push({type:Uint8Array,width:1,name:"aTextHaloRadius"}),r&&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}q(){const{markerWidthFn:t,markerHeightFn:n,markerDxFn:i,markerDyFn:e}=this.C,r=[];return t&&r.push({type:Uint8Array,width:1,name:"aMarkerWidth"}),n&&r.push({type:Uint8Array,width:1,name:"aMarkerHeight"}),i&&r.push({type:Int8Array,width:1,name:"aMarkerDx"}),e&&r.push({type:Int8Array,width:1,name:"aMarkerDy"}),r}createDataPack(){if(!this.iconAtlas&&!this.glyphAtlas){if(!this.options.allowEmptyPack)return null;this.empty=!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 i=t.getShape(this.iconAtlas,this.glyphAtlas);if(!this.options.allowEmptyPack&&!i)return;const e=this.G(t,i,n);if(0===e.length)return;const r=this.data;let s=this.data.aPosition.length/3;const o=t.symbol,a=t.feature.properties,h="line"===o.textPlacement&&!o.isIconText,u=void 0!==o.textName,l=u&&h&&function(t){let n=0;for(let i=0;i<t.length;i++)if(He(t.charAt(i).charCodeAt(0)))n=0;else if(n++,n>=1)return!1;return!0}(t.getIconAndGlyph().glyph.text)?1:0,{textFillFn:c,textSizeFn:f,textHaloFillFn:d,textHaloRadiusFn:y,textHaloOpacityFn:v,textDxFn:p,textDyFn:g,textPitchAlignmentFn:w,textRotationAlignmentFn:M,textRotationFn:b,textAllowOverlapFn:x,textIgnorePlacementFn:F,textOpacityFn:A,markerWidthFn:k,markerHeightFn:P,markerDxFn:S,markerDyFn:_,markerPitchAlignmentFn:O,markerRotationAlignmentFn:I,markerRotationFn:T,markerAllowOverlapFn:L,markerIgnorePlacementFn:U,markerOpacityFn:z}=this.C;let D,E,C,j,N,H,V,R,W,$,B,q,G,J,X,Z,Y;if(u){const n=t.getIconAndGlyph().glyph.font;D=function(t,n,i){const e=t.positionedGlyphs,r=[];for(let s=0;s<e.length;s++){const o=e[s],a=i[o.glyph];if(!a)continue;const h=a.rect;if(!h)continue;const u=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],y=a.metrics.left-u-l+d[0],v=a.metrics.top-u+d[1],p=y+h.w,m=v+h.h,g=new Ai(y,v),w=new Ai(p,v),M=new Ai(y,m),b=new Ai(p,m);if(n&&o.vertical){const t=new Ai(-l,l),n=-Math.PI/2,i=new Ai(5,0);g._(n,t).m(i),w._(n,t).m(i),M._(n,t).m(i),b._(n,t).m(i)}r.push({tl:g,tr:w,bl:M,br:b,tex:h,writingMode:t.writingMode,glyphOffset:f})}return r}(i.horizontal,h,this.glyphAtlas.positions[n]),c&&(E=c(null,a),m(E)?E=[0,0,0,0]:(E=Array.isArray(E)?E.map(t=>255*t):Nn(E).array(),3===E.length&&E.push(255))),f&&(C=f(this.options.zoom,a),oe(C)&&(C=14)),d&&(j=d(null,a),j=Array.isArray(j)?j.map(t=>255*t):Nn(j).array(),3===j.length&&j.push(255)),y&&(N=y(null,a)),v&&(H=255*v(null,a)),p&&(V=p(null,a)||0),g&&(R=g(null,a)||0),w&&(G=+("map"===w(null,a))),M&&(J=+("map"===M(null,a))),b&&(X=ae(b(null,a),0,360)*Math.PI/180)}else D=i?function(t){const n=t.image,i=t.top-1/n.pixelRatio,e=t.left-1/n.pixelRatio,r=t.bottom+1/n.pixelRatio,s=t.right+1/n.pixelRatio;let o,a,h,u;return o=new Ai(e,i),a=new Ai(s,i),h=new Ai(s,r),u=new Ai(e,r),[{tl:o,tr:a,bl:u,br:h,tex:{x:n.tl[0],y:n.tl[1],w:n.displaySize[0],h:n.displaySize[1]},writingMode:void 0,glyphOffset:[0,0]}]}(i):function(){const t=new Ai(0,0),n=new Ai(0,0),i=new Ai(0,0);return[{tl:t,tr:n,bl:new Ai(0,0),br:i,tex:{x:0,y:0,w:0,h:0},writingMode:void 0,glyphOffset:[0,0]}]}(),k&&(W=k(null,a)),P&&($=P(null,a)),S&&(B=S(null,a)),_&&(q=_(null,a)),O&&(G=+("map"===O(null,a))),I&&(J=+("map"===I(null,a))),T&&(X=ae(T(null,a),0,360)*Math.PI/180);const K=L||x;K&&(Z=K(null,a)||0);const Q=U||F;let tt;Q&&(Y=Q(null,a)||0);const nt=A||z;nt&&(tt=255*nt(this.options.zoom,a));const it=this.options.EXTENT,et=D.length,rt=this.getAltitude(t.feature.properties);for(let t=0;t<e.length;t++){const n=e[t];if(it!==1/0&&se(n,it))continue;const i=n.x,o=n.y,a=D.length;for(let t=0;t<a;t++){const e=D[t],{tl:a,tr:c,bl:f,br:d,tex:y}=e;this.J(r,i,o,rt,10*a.x,10*a.y,y.x,y.y+y.h),u&&this.X(r,h,et,e.glyphOffset,n,l),this.Z(r,E,C,j,N,H,V,R,W,$,B,q,tt,G,J,X,Z,Y),this.J(r,i,o,rt,10*c.x,10*c.y,y.x+y.w,y.y+y.h),u&&this.X(r,h,et,e.glyphOffset,n,l),this.Z(r,E,C,j,N,H,V,R,W,$,B,q,tt,G,J,X,Z,Y),this.J(r,i,o,rt,10*f.x,10*f.y,y.x,y.y),u&&this.X(r,h,et,e.glyphOffset,n,l),this.Z(r,E,C,j,N,H,V,R,W,$,B,q,tt,G,J,X,Z,Y),this.J(r,i,o,rt,10*d.x,10*d.y,y.x+y.w,y.y),u&&this.X(r,h,et,e.glyphOffset,n,l),this.Z(r,E,C,j,N,H,V,R,W,$,B,q,tt,G,J,X,Z,Y),this.addElements(s,s+1,s+2),this.addElements(s+1,s+2,s+3),s+=4;const v=Math.max(Math.abs(i),Math.abs(o),Math.abs(rt));v>this.maxPos&&(this.maxPos=v)}}}J(t,n,i,e,r,s,o,a){t.aPosition.push(n,i,e),t.aShape.push(r,s),t.aTexCoord.push(o,a)}X(t,n,i,e,r,s){if(t.aCount.push(i),n){t.aGlyphOffset.push(e[0],e[1]);const n=r.startIndex;t.aSegment.push(r.segment+n,n,r.line.length),t.aVertical.push(s)}}Z(t,n,i,e,r,s,o,a,h,u,l,c,f,d,y,v,p,m){const{textFillFn:g,textSizeFn:w,textHaloFillFn:M,textHaloRadiusFn:b,textHaloOpacityFn:x,textDxFn:F,textDyFn:A,textPitchAlignmentFn:k,textRotationAlignmentFn:P,textRotationFn:S,textAllowOverlapFn:_,textIgnorePlacementFn:O,textOpacityFn:I,markerWidthFn:T,markerHeightFn:L,markerDxFn:U,markerDyFn:z,markerPitchAlignmentFn:D,markerRotationAlignmentFn:E,markerRotationFn:C,markerAllowOverlapFn:j,markerIgnorePlacementFn:N,markerOpacityFn:H}=this.C;g&&t.aTextFill.push(...n),w&&t.aTextSize.push(i),M&&t.aTextHaloFill.push(...e),b&&t.aTextHaloRadius.push(r),x&&t.aTextHaloOpacity.push(s),F&&t.aTextDx.push(o),A&&t.aTextDy.push(a),T&&t.aMarkerWidth.push(h),L&&t.aMarkerHeight.push(u),U&&t.aMarkerDx.push(l),z&&t.aMarkerDy.push(c),(H||I)&&t.aColorOpacity.push(f),(k||D)&&t.aPitchAlign.push(d),(E||P)&&t.aRotationAlign.push(y),(C||S)&&t.aRotation.push(9362*v);const V=j||_,R=N||O;(V||R)&&t.aOverlap.push((V?8:0)+4*p+((R?2:0)+m)),r>0&&(this.properties.hasHalo=1)}G(t,n,i){const{feature:e,symbol:r}=t,s=this.Y(t,r),o=e.properties,{markerSpacingFn:a,textSpacingFn:h}=this.C,u=((a?a(null,o):r.markerSpacing)||(h?h(null,o):r.textSpacing)||250)*i;return function(t,n,i,e,r,s,o){const{feature:a,size:h,symbol:u}=t,l=h?24:0,c=e*(h?h[0]/l:1),f=[];if("line"===s){let t=a.geometry;r&&(t=rr(a.geometry,0,0,r,r));for(let e=0;e<t.length;e++){const s=ar(t[e],o,vr,u.isIconText?null:i.vertical||i.horizontal||i,null,l,u.isIconText?1:c,1,r||1/0);if(u.textPlacement&&!u.isIconText)for(let t=0;t<s.length;t++)s[t].startIndex=n.length/3;if(f.push.apply(f,s),u.textPlacement&&!u.isIconText)for(let i=0;i<t[e].length;i++)n.push(t[e][i].x,t[e][i].y,0)}}else if(3===a.type){const t=ur(a.geometry,0);for(let n=0;n<t.length;n++){const i=t[n];if("vertex"===s)for(let t=0;t<i.length;t++){const n=i[t];for(let t=0;t<n.length;t++)se(n[t],r)||f.push(n[t])}else{const t=fr(i,16);se(t,r)||f.push(t)}}}else if(2===a.type)for(let t=0;t<a.geometry.length;t++){const n=a.geometry[t];if("vertex"===s)for(let t=0;t<n.length;t++)se(n[t],r)||f.push(n[t]);else se(n[0],r)||f.push(n[0])}else if(1===a.type)for(let t=0;t<a.geometry.length;t++){const n=a.geometry[t];for(let t=0;t<n.length;t++){const i=n[t];se(i,r)||f.push(i)}}return f}(t,this.lineVertex,n,i,this.options.EXTENT,s,u)}Y(t,n){return this.C.markerPlacementFn?this.C.markerPlacementFn(this.options.zoom,t.feature.properties):n.markerPlacement||n.textPlacement}}const gr=Math.cos(Math.PI/180*37.5),wr=Math.pow(2,16)/1;class Mr extends le{constructor(t,n,i){super(t,n,i);let e=!1;const{lineDasharrayFn:r,lineDashColorFn:s}=this.C;r&&(e=function(t,n,i){for(let e=0;e<t.length;e++)if(i(n,t[e].properties))return!0;return!1}(t,this.options.zoom,r),e&&(this.dasharrayFn=r)),(Fr(this.symbol.lineDasharray)||e)&&s&&(this.dashColorFn=s)}createStyledVector(t,n,i,e,r){const s=new he(t,n,i,e),o=s.getLineResource();return!this.options.atlas&&o&&(r[o]=[0,0]),s}getFormat(){const{lineWidthFn:t,lineStrokeWidthFn:n,lineStrokeColorFn:i,lineColorFn:e,lineOpacityFn:r,lineDxFn:s,lineDyFn:o,linePatternAnimSpeedFn:a,linePatternGapFn:h}=this.C,u=[{type:Int16Array,width:3,name:"aPosition"}];if(u.push(this.options.center||this.iconAtlas?{type:Int8Array,width:3,name:"aExtrude"}:{type:Int8Array,width:2,name:"aExtrude"}),u.push({type:Uint16Array,width:1,name:"aLinesofar"}),t&&u.push({type:Uint8Array,width:1,name:"aLineWidth"}),n&&u.push({type:Uint8Array,width:1,name:"aLineStrokeWidth"}),e&&u.push({type:Uint8Array,width:4,name:"aColor"}),i&&u.push({type:Uint8Array,width:4,name:"aStrokeColor"}),r&&u.push({type:Uint8Array,width:1,name:"aOpacity"}),this.symbol.lineOffset&&u.push({type:Int8Array,width:2,name:"aExtrudeOffset"}),this.dasharrayFn&&u.push({type:Uint8Array,width:4,name:"aDasharray"}),this.dashColorFn&&u.push({type:Uint8Array,width:4,name:"aDashColor"}),this.iconAtlas){const t=this.getIconAtlasMaxValue();u.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return s&&u.push({type:Int8Array,width:1,name:"aLineDx"}),o&&u.push({type:Int8Array,width:1,name:"aLineDy"}),a&&u.push({type:Int8Array,width:1,name:"aLinePatternAnimSpeed"}),h&&u.push({type:Uint8Array,width:1,name:"aLinePatternGap"}),u}placeVector(t){const{lineJoinFn:n,lineCapFn:i,lineWidthFn:e,lineStrokeWidthFn:r,lineStrokeColorFn:s,lineColorFn:o,lineOpacityFn:a,lineJoinPatternModeFn:h,lineDxFn:u,lineDyFn:l,linePatternAnimSpeedFn:c,linePatternGapFn:f}=this.C,d=this.symbol,y=t.feature,v=3===y.type,p=y.properties,g=this.elements;v&&(this.elements=[]);let w=d.lineJoin||"miter",M=d.lineCap||"butt";if(n&&(w=n(this.options.zoom,p)||"miter"),i&&(M=i(this.options.zoom,p)||"butt"),e){let t=e(this.options.zoom,p);Ji(t)&&(t=4),this.feaLineWidth=t}else this.feaLineWidth=d.lineWidth;if(r){let t=r(this.options.zoom,p);Ji(t)&&(t=0),this.feaLineStrokeWidth=t}else this.feaLineStrokeWidth=d.lineStrokeWidth||0;if(o&&(this.feaColor=o(this.options.zoom,p)||[0,0,0,255],m(this.feaColor)?this.feaColor=[0,0,0,0]:(this.feaColor=Array.isArray(this.feaColor)?this.feaColor.map(t=>255*t):Nn(this.feaColor).array(),3===this.feaColor.length&&this.feaColor.push(255))),s&&(this.feaStrokeColor=s(this.options.zoom,p)||[0,0,0,255],m(this.feaStrokeColor)?this.feaStrokeColor=[0,0,0,0]:(this.feaStrokeColor=Array.isArray(this.feaStrokeColor)?this.feaStrokeColor.map(t=>255*t):Nn(this.feaStrokeColor).array(),3===this.feaStrokeColor.length&&this.feaStrokeColor.push(255))),a){let t=a(this.options.zoom,p);Ji(t)&&(t=1),this.feaOpacity=255*t}if(this.dasharrayFn){let t=this.dasharrayFn(this.options.zoom,p)||[0,0,0,0];if(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,p):this.symbol.lineDashColor)||[0,0,0,0];t=Array.isArray(t)?t.map(t=>255*t):Nn(t).array(),3===t.length&&t.push(255),this.feaDashColor=t}if(this.iconAtlas){const n=t.getLineResource(),i=this.iconAtlas.glyphMap[n];if(this.feaTexInfo=this.feaTexInfo||[0,0,0,0],i){const{tl:t,displaySize:i}=this.iconAtlas.positions[n];this.feaTexInfo[0]=t[0]+1,this.feaTexInfo[1]=t[1]+1,this.feaTexInfo[2]=i[0]-3,this.feaTexInfo[3]=i[1]-3}else this.feaTexInfo[0]=this.feaTexInfo[1]=this.feaTexInfo[2]=this.feaTexInfo[3]=0;this.feaJoinPatternMode=h?h(this.options.zoom,p)||0:d.lineJoinPatternMode||0}if(u){let t=u(this.options.zoom,p);Ji(t)&&(t=0),this.feaLineDx=t}if(l){let t=l(this.options.zoom,p);Ji(t)&&(t=0),this.feaLineDy=t}if(c){let t=c(this.options.zoom,p);Ji(t)&&(t=0),0!==t&&(this.properties.hasPatternAnim=1),this.feaPatternAnimSpeed=t}if(f){let t=f(this.options.zoom,p);Ji(t)&&(t=0),this.feaLinePatternGap=t}const b=this.options.EXTENT;let x=y.geometry;b!==1/0&&3!==y.type&&(x=rr(y.geometry,-1,-1,b+1,b+1));for(let t=0;t<x.length;t++)this.offset=this.data.aPosition.length/3,this.K(x[t],y,w,M,2,1.05),v&&(this.tt(g),this.elements=[]);v&&(this.elements=g)}nt(){return this.iconAtlas&&this.feaTexInfo[2]&&this.feaTexInfo[3]}K(t,n,i,e,r,s){const o=this.nt()||Fr(this.feaDash)||Fr(this.symbol.lineDasharray);this.overscaling=1;const a=this.options.EXTENT;if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.symbol.lineGradientProperty&&n.properties&&Qi(n.properties,"mapbox_clip_start")&&Qi(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;let u=t.length;for(;u>=2&&t[u-1].equals(t[u-2]);)u--;let l=0;for(;l<u-1&&t[l].equals(t[l+1]);)l++;if(u<(h?3:2))return;"bevel"===i&&(r=1.05);const c=this.overscaling<=16?15*a/(512*this.overscaling):0,f={vertexLength:0,primitiveLength:0};let d,y,v,p,m;this.e1=this.e2=-1,h&&(d=t[u-2],m=t[l].sub(d).I().T());for(let n=l;n<u;n++){if(v=n===u-1?h?t[l+1]:void 0:t[n+1],v&&t[n].equals(v))continue;m&&(p=m),d&&(y=d),d=t[n],m=v?v.sub(d).I().T():p,p=p||m;let a=p.add(m);0===a.x&&0===a.y||a.I();const g=p.x*m.x+p.y*m.y,w=a.x*m.x+a.y*m.y,M=0!==w?1/w:1/0,b=2*Math.sqrt(2-2*w),x=w<gr&&y&&v,F=p.x*m.y-p.y*m.x>0;if(!o&&x&&n>l){const t=d.dist(y);if(t>2*c){const n=d.sub(d.sub(y).k(c/t).L());this.updateDistance(y,n),this.addCurrentVertex(n,p,0,0,f),y=n}}const A=y&&v;let k=A?i:h?"butt":e;if(A&&"round"===k&&(M<s?k="miter":M<=2&&(k="fakeround")),"miter"===k&&M>r&&(k="bevel"),"bevel"===k&&(M>2&&(k="flipbevel"),M<r&&(k="miter")),y&&this.updateDistance(y,d),(n>l&&n<u-1||h&&n===u-1)&&o){const t=this.feaJoinPatternMode?0:-p.mag()*w;this.addCurrentVertex(d,p,t,t,f),this.it=1}if("miter"===k)a.k(M),this.addCurrentVertex(d,a,0,0,f);else if("flipbevel"===k){if(M>100)a=m.mult(-1);else{const t=M*p.add(m).mag()/p.sub(m).mag();a.T().k(t*(F?-1:1))}this.addCurrentVertex(d,a,0,0,f),this.addCurrentVertex(d,a.mult(-1),0,0,f)}else if("bevel"===k||"fakeround"===k){const t=-Math.sqrt(M*M-1),n=F?t:0,i=F?0:t;if(y&&this.addCurrentVertex(d,p,n,i,f),"fakeround"===k){const t=Math.round(180*b/Math.PI/20);for(let n=1;n<t;n++){let i=n/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+g*(g*(3.55645-1.43519*g)-3.2452))*t*t+(.848013+g*(.215638*g-1.06021)))}const e=m.sub(p).k(i).m(p).I().k(F?-1:1);this.addHalfVertex(d,e.x,e.y,!1,F,0,f)}}v&&this.addCurrentVertex(d,m,-n,-i,f)}else if("butt"===k)this.addCurrentVertex(d,a,0,0,f);else if("square"===k){const t=y?1:-1;this.addCurrentVertex(d,a,t,t,f)}else"round"===k&&(y&&(this.addCurrentVertex(d,p,0,0,f),this.addCurrentVertex(d,p,1,1,f,!0)),v&&(this.addCurrentVertex(d,m,-1,-1,f,!0),this.addCurrentVertex(d,m,0,0,f)));if(!o&&x&&n<u-1){const t=d.dist(v);if(t>2*c){const n=d.add(v.sub(d).k(c/t).L());this.updateDistance(d,n),this.addCurrentVertex(n,m,0,0,f),d=n}}if((n>l&&n<u-1||h&&n===l)&&o){delete this.it;const t=this.feaJoinPatternMode?0:m.mag()*w;this.addCurrentVertex(d,m,t,t,f)}}}addCurrentVertex(t,n,i,e,r,s=!1){const o=n.y*e-n.x,a=-n.y-n.x*e;this.addHalfVertex(t,n.x+n.y*i,n.y-n.x*i,s,!1,i,r),this.addHalfVertex(t,o,a,s,!0,-e,r),this.distance>wr/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,n,i,e,r,s))}addHalfVertex({x:t,y:n},i,e,r,s,o,a){this.fillData(this.data,t,n,i,e,r,s,1*this.scaledDistance);const h=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.addElements(this.e1,this.e2,h),a.primitiveLength++),s?this.e2=h:this.e1=h}fillData(t,n,i,e,r,s,o,a){const{lineWidthFn:h,lineStrokeWidthFn:u,lineStrokeColorFn:l,lineColorFn:c,lineOpacityFn:f,lineDxFn:d,lineDyFn:y,linePatternAnimSpeedFn:v,linePatternGapFn:p}=this.C;if(this.options.center?t.aPosition.push(n,i,0):t.aPosition.push(n=(n<<1)+(s?1:0),i=(i<<1)+(o?1:0),0),t.aExtrude.push(63*e,63*r),this.options.center||this.iconAtlas){let n=0;this.options.center&&(n+=2*s+o),this.iconAtlas&&(n+=4*(this.it&&this.feaJoinPatternMode?1:0)),t.aExtrude.push(n)}t.aLinesofar.push(a),h&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),u&&t.aLineStrokeWidth.push(Math.round(2*this.feaLineStrokeWidth)),c&&t.aColor.push(...this.feaColor),l&&t.aStrokeColor.push(...this.feaStrokeColor),f&&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),d&&t.aLineDx.push(this.feaLineDx),y&&t.aLineDy.push(this.feaLineDy),v&&t.aLinePatternAnimSpeed.push(127*this.feaPatternAnimSpeed),p&&t.aLinePatternGap.push(10*this.feaLinePatternGap),this.maxPos=Math.max(this.maxPos,Math.abs(n)+1,Math.abs(i)+1)}addElements(t,n,i){super.addElements(this.offset+t,this.offset+n,this.offset+i)}tt(t){const n=this.options.EXTENT,i=this.elements;for(let e=0;e<i.length;e+=3)n!==1/0&&(xr(this.data.aPosition,i[e],i[e+1],3,n)||xr(this.data.aPosition,i[e+1],i[e+2],3,n))||t.push(i[e],i[e+1],i[e+2])}et(t){if(t.length<=1)return t;const n=[],i=this.options.EXTENT;let e,r=!0;for(e=0;e<t.length-1;e++){const s=br(t[e],t[e+1],i);s&&r||(n.push(t[e]),r=s)}return r||n.push(t[e]),n}updateDistance(t,n){this.distance+=t.dist(n),this.updateScaledDistance()}updateScaledDistance(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(wr-1):this.distance}}function br(t,n,i){return i!==1/0&&(t.x<0&&n.x<0||t.x>i&&n.x>i||t.y<0&&n.y<0||t.y>i&&n.y>i)}function xr(t,n,i,e,r){if(r===1/0)return!1;const s=Math.floor(.5*t[n*e]),o=Math.floor(.5*t[n*e+1]),a=Math.floor(.5*t[i*e]),h=Math.floor(.5*t[i*e+1]);return s===a&&(s<0||s>r)&&o!==h||o===h&&(o<0||o>r)&&s!==a}function Fr(t){if(!Array.isArray(t))return!1;for(let n=0;n<t.length;n++)if(t[n])return!0;return!1}class Ar extends Mr{constructor(t,n,i){super(t,n,i),this.rt=i.altitudeProperty}getFormat(){const{lineColorFn:t,lineWidthFn:n}=this.C,i=[{type: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&&i.push({type:Uint8Array,width:4,name:"aColor"}),n&&i.push({type:Uint8Array,width:1,name:"aLineWidth"}),this.rt&&i.push({type:Array,width:1,name:"aLineHeight"}),i}placeVector(t){const n=t.feature;if(this.rt){const{altitudeScale:t,altitudeProperty:i,defaultAltitude:e,heightProperty:r,defaultHeight:s,minHeightProperty:o}=this.options,{altitude:a,height:h}=re(n,t,i,e,r,s,o);this.feaAltitude=a,this.feaMinHeight=(a-h)/a*32767,a>this.maxAltitude&&(this.maxAltitude=a)}return super.placeVector(t)}K(t,n,i,e,r,s){const o=this.data.aPosition.length/3;super.K(t,n,i,e,r,s);const a=this.data.aPosition.length/3,h=this.data.aPosition.length/3-this.offset;if(3!==n.type&&h>0&&!1!==this.options.side){const t=!1!==this.options.top?1:0,n=t+4;let i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],e=n.length/i;for(let t=0;t<e;t++)n.push(n[o*e+3*e+t])}i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],r=e.length/i;for(let t=0;t<r;t++)e.push(e[o*r+r*n+t])}i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],r=e.length/i;for(let t=0;t<r;t++)e.push(e[o*r+r*(n+3)+t])}super.addElements(t+1,h+1,h),super.addElements(h,h+1,h+2);const e=this.data.aPosition.length/3-this.offset;i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],e=n.length/i;for(let t=0;t<e;t++)n.push(n[a*e-e+t])}i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],r=e.length/i;for(let t=0;t<r;t++)e.push(e[a*r-n*r-r+t])}i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],r=e.length/i;for(let t=0;t<r;t++)e.push(e[a*r-n*r-3*r+t])}super.addElements(e,h-3,e+1),super.addElements(h-3,e+2,e+1)}}fillData(t,n,i,e,r,s,o,a){const h=!1!==this.options.top,u=!1!==this.options.side,l=this.feaLineWidth||this.symbol.lineWidth/2*(this.options.EXTENT/this.options.tileSize),c=63*e,f=63*r,d=l*e+n,y=l*r+i;this.st(t,n,i,e,r,s,o,a,d,y,c,f),u&&(h&&this.st(t,n,i,e,r,s,o,a,d,y,c,f),this.st(t,n,i,e,r,s,o,a,d,y,c,f),this.ot(t,n,i,e,r,s,o,a,d,y,c,f),this.ot(t,n,i,e,r,s,o,a,d,y,c,f)),this.maxPos=Math.max(this.maxPos,Math.abs(n),Math.abs(i))}st(t,n,i,e,r,s,o,a,h,u,l,c){const{lineColorFn:f,lineWidthFn:d}=this.C;t.aPosition.push(n,i,32767),t.aLinesofar.push(a),t.aUp.push(+o),t.aExtrudedPosition.push(h,u,1),t.aExtrude.push(l,c),f&&t.aColor.push(...this.feaColor),d&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.rt&&t.aLineHeight.push(this.feaAltitude)}ot(t,n,i,e,r,s,o,a,h,u,l,c){const{lineColorFn:f,lineWidthFn:d}=this.C;t.aPosition.push(n,i,this.feaMinHeight||0),t.aLinesofar.push(a),t.aUp.push(+o),t.aExtrudedPosition.push(h,u,1),t.aExtrude.push(l,c),f&&t.aColor.push(...this.feaColor),d&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.rt&&t.aLineHeight.push(this.feaAltitude)}addElements(t,n,i){const e=!1!==this.options.top,r=!1!==this.options.side,s=(e?1:0)+(r?4:0);if(t*=s,n*=s,this.data.aUp[this.offset+(i*=s)+4]){if(e&&super.addElements(n,t,i),r){const t=e?1:0;super.addElements(n+t,i+t,i+t+2),super.addElements(n+t+1,i+t+1+2,n+t+1+2)}}else if(e&&super.addElements(t,i,n),r){const n=e?1:0;super.addElements(t+n,t+n+2,i+n),super.addElements(t+n+1+2,i+n+1+2,i+n+1)}}createDataPack(t,n){this.maxAltitude=0;const i=super.createDataPack(t,n);if(!i)return i;const{data:e,indices:r}=i;this.getFormat().reduce((t,n)=>(t[n.name]={size:n.width},t),{}).aPickingId={size:1};const{aExtrudedPosition:s,aPosition:o,aLinesofar:a,aUp:h,aExtrude:u,aColor:l,aLineHeight:c,aLineWidth:f}=e,d={},y=Gn(s,r);let v,p=!0;for(let t=0;t<y.length;t++)y[t]=-y[t],y[t]%1!=0&&(p=!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)&&(v=function(t,n,i){const e=[];for(let r=0;r<t.length;r+=3){const t=n[r/3];e.push(t/256,i[r/3]?1:0)}return e}(s,a,h)),d.aPosition=o,v&&(d.aTexCoord0=new Float32Array(v)),d.aNormal=p?new Int8Array(y):new Float32Array(y),d.aPickingId=e.aPickingId,d.aExtrude=u,l&&(d.aColor=l),f&&(d.aLineWidth=f),c){const t=$i(this.maxAltitude);d.aLineHeight=new t(c)}const m=[];for(const t in d)m.push(d[t].buffer);return i.data=d,i.buffers=m,i}}const kr=Math.pow(2,16)/1;class Pr extends le{getFormat(){return[{type:Int16Array,width:3,name:"aPosition"}]}placeVector(t){const n=t.feature,i=3===n.type,e=n.geometry,r=this.elements;i&&(this.elements=[]);for(let t=0;t<e.length;t++)this.offset=this.data.aPosition.length/3,this.K(e[t],n),i&&(this.tt(r),this.elements=[]);i&&(this.elements=r)}K(t,n){const i=3===n.type;let e=t.length;for(;e>=2&&t[e-1].equals(t[e-2]);)e--;let r,s,o,a=0;for(;a<e-1&&t[a].equals(t[a+1]);)a++;if(!(e<(i?3:2))){this.distance=0,this.vertexLength=0,this.primitiveLength=0,this.e1=this.e2=this.e3=-1,i&&(r=t[e-2]);for(let n=a;n<e;n++)o=i&&n===e-1?t[a+1]:t[n+1],o&&t[n].equals(o)||(r&&(s=r),r=t[n],s&&(this.distance+=r.dist(s)),this.addCurrentVertex(r,this.distance))}}addCurrentVertex(t,n){const i=this.vertexLength++;this.addLineVertex(this.data,t,n),i>=1&&this.addElements(i-1,i),n>kr&&(this.distance=0,this.addCurrentVertex(t,this.distance))}addLineVertex(t,n){t.aPosition.push(n.x,n.y,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)}tt(t){const n=this.options.EXTENT,i=this.elements;for(let e=0;e<i.length;e+=2)ie(this.data.aPosition,i[e],i[e+1],3,n)||t.push(i[e],i[e+1])}}const Sr=45*Math.PI/100;class _r extends le{getFormat(){return[{type:Int16Array,width:3,name:"aPosition"}]}placeVector(t){const n=this.G(t,this.symbol.markerSpacing||250,this.symbol.markerPlacement||"point"),i=this.getAltitude(t.feature.properties);for(let t=0;t<n.length;t++){const e=n[t];this.data.aPosition.push(e.x,e.y),this.data.aPosition.push(i);const r=Math.max(Math.abs(e.x),Math.abs(e.y));r>this.maxPos&&(this.maxPos=r)}}G(t,n,i){const e=t.feature,r=t.feature.type,s=this.options.EXTENT,o=[];if("line"===i){let t=e.geometry;s&&(t=rr(e.geometry,0,0,s,s));for(let i=0;i<t.length;i++){const e=ar(t[i],n,Sr,null,null,24,1,1,s||1/0);o.push.apply(o,e)}}else if(3===r){const t=ur(e.geometry,0);for(let n=0;n<t.length;n++){const i=fr(t[n],16);se(i,s)||o.push(i)}}else if(2===e.type)for(let t=0;t<e.geometry.length;t++){const n=e.geometry[t];se(n[0],s)||o.push(n[0])}else if(1===e.type)for(let t=0;t<e.geometry.length;t++){const n=e.geometry[t];for(let t=0;t<n.length;t++){const i=n[t];se(i,s)||o.push(i)}}return o}hasElements(){return!1}}\n/*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */const Or=[],Ir=[];function Tr(t,n){var i,e,r,s,o,a,h;for(e=1;e<=8;e*=2){for(i=[],s=!(Ur(r=t[t.length-1],n)&e),o=0;o<t.length;o++){if((h=!(Ur(a=t[o],n)&e))!==s){const t=Lr(r,a,e,n);i.push(void 0!==a.x?new Ai(t[0],t[1]):t)}h&&i.push(a),r=a,s=h}if(!(t=i).length)break}return i}function Lr(t,n,i,e){return Or[0]=void 0===t.x?t[0]:t.x,Or[1]=void 0===t.y?t[1]:t.y,t=Or,Ir[0]=void 0===n.x?n[0]:n.x,Ir[1]=void 0===n.y?n[1]:n.y,n=Ir,8&i?[t[0]+(n[0]-t[0])*(e[3]-t[1])/(n[1]-t[1]),e[3]]:4&i?[t[0]+(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1]),e[1]]:2&i?[e[2],t[1]+(n[1]-t[1])*(e[2]-t[0])/(n[0]-t[0])]:1&i?[e[0],t[1]+(n[1]-t[1])*(e[0]-t[0])/(n[0]-t[0])]:null}function Ur(t,n){Or[0]=void 0===t.x?t[0]:t.x,Or[1]=void 0===t.y?t[1]:t.y;var i=0;return(t=Or)[0]<n[0]?i|=1:t[0]>n[2]&&(i|=2),t[1]<n[1]?i|=4:t[1]>n[3]&&(i|=8),i}class zr extends le{constructor(...t){super(...t),this.lineElements=[]}createStyledVector(t,n,i,e,r){const s=new he(t,n,i,e),o=s.getPolygonResource();return!this.options.atlas&&o&&(r[o]=[0,0]),s}getFormat(){const t=[{type:Int16Array,width:3,name:"aPosition"}],{polygonFillFn:n,polygonOpacityFn:i,uvScaleFn:e,uvOffsetFn:r}=this.C;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"}),i&&t.push({type:Uint8Array,width:1,name:"aOpacity"}),e&&t.push({type:Uint16Array,width:2,name:"aUVScale"}),r&&t.push({type:Uint8Array,width:2,name:"aUVOffset"}),t}createDataPack(...t){this.maxLineIndex=0,this.lineElements=[];const n=super.createDataPack(...t);if(!n)return n;let i=this.lineElements;return i=new(Wi(this.maxLineIndex))(this.lineElements),n.lineIndices=i,n.buffers.push(i.buffer),n}placeVector(t,n){const i=t.feature;this.at(i.geometry,i,n)}at(t,n){let i,e,r,s;const{polygonFillFn:o,polygonOpacityFn:a,uvScaleFn:h,uvOffsetFn:u}=this.C,l=n.properties;o&&(i=o(this.options.zoom,l)||[255,255,255,255],m(i)?i=[0,0,0,0]:(i=Array.isArray(i)?i.map(t=>255*t):Nn(i).array(),3===i.length&&i.push(255))),a&&(e=a(this.options.zoom,l),Ji(e)&&(e=1),e*=255),h&&(r=h(this.options.zoom,l),Ji(r)&&(r=[1,1]),r=[255*r[0],255*r[1]]),u&&(s=u(this.options.zoom,l),Ji(s)&&(s=[0,0]),s=[255*s[0],255*s[1]]);const c=!!this.iconAtlas,f=ur(t,500),d=this.getAltitude(l),y=[0,0],v=[0,0];if(c){const{polygonPatternFileFn:t}=this.C,n=t?t(null,l):this.symbol.polygonPatternFile;if(this.iconAtlas.glyphMap[n]){const t=this.iconAtlas.positions[n];y[0]=t.tl[0]+1,y[1]=t.tl[1]+1,v[0]=t.displaySize[0]-3,v[1]=t.displaySize[1]-3}}const p=[-1,-1,n.extent+1,n.extent+1];for(let t=0;t<f.length;t++){const n=f[t],o=this.data.aPosition.length/3,a=[],h=[];for(let t=0;t<n.length;t++){let o=n[t];if(this.options.EXTENT!==1/0&&(o=Tr(o,p)),0===o.length)continue;0!==t&&h.push(a.length/2);const u=this.lineElements.length;this.data.aPosition.push(o[0].x,o[0].y,d),c&&this.data.aTexInfo.push(...y,...v),void 0!==i&&this.data.aColor.push(...i),void 0!==e&&this.data.aOpacity.push(e),void 0!==r&&this.data.aUVScale.push(...r),void 0!==s&&this.data.aUVOffset.push(...s),this.maxPos=Math.max(this.maxPos,Math.abs(o[0].x),Math.abs(o[0].y)),this.addLineElements(u+o.length-1,u),a.push(o[0].x),a.push(o[0].y);for(let t=1;t<o.length;t++)this.data.aPosition.push(o[t].x,o[t].y,d),c&&this.data.aTexInfo.push(...y,...v),void 0!==i&&this.data.aColor.push(...i),void 0!==e&&this.data.aOpacity.push(e),void 0!==r&&this.data.aUVScale.push(...r),void 0!==s&&this.data.aUVOffset.push(...s),this.maxPos=Math.max(this.maxPos,Math.abs(o[t].x),Math.abs(o[t].y)),this.addLineElements(u+t-1,u+t),a.push(o[t].x),a.push(o[t].y)}const u=Fi(a,h);for(let t=0;t<u.length;t+=3)this.addElements(o+u[t],o+u[t+1],o+u[t+2])}}addLineElements(...t){this.maxLineIndex=Math.max(this.maxLineIndex,...t),this.lineElements.push(...t)}}var Dr=Object.freeze({__proto__:null,clipPolygon:Tr,calculateSignedArea:ne,getFeaAltitudeAndHeight:re,convertRTLText:tr});const Er={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},Er),Object.assign({lineDasharray:1},Er);function Cr(t,n,i,e,r,s,o,a,h,u,l,c,f,d,y){const v=n.length,p=r/3;for(let i=2,e=v;i<e;i+=3)t[r+i-2]=n[i-2],t[r+i-1]=n[i-1],t[r+i-0]=n[i]-s;r+=v;for(let i=2,e=v;i<e;i+=3)t[r+i-2]=n[i-2],t[r+i-1]=n[i-1],t[r+i-0]=n[i]-o;r+=v;for(let i=2,e=v;i<e;i+=3)t[r+i-2]=n[i-2],t[r+i-1]=n[i-1],t[r+i-0]=n[i]-s;r+=v;for(let i=2,e=v;i<e;i+=3)t[r+i-2]=n[i-2],t[r+i-1]=n[i-1],t[r+i-0]=n[i]-o;r+=v,(i=i||[]).push(v/3);for(let n=0;n<i.length;n++){jr(p+(i[n-1]||0),p+i[n],t,v/3,a,e,h,u,l,c,f,d,y)}return r}function jr(t,n,i,e,r,s,o,a,h,u,l,c,f){const d=s.length;let y,v;for(let o=t,a=n;o<a-1;o++)y=o,v=o+1,ct(i,y,v,r)||((o-t)%2==1&&(y+=2*e,v+=2*e),s.push(y+e,y,v),s.push(v,v+e,y+e));o&&function(t,n,i,e,r,s,o,a,h){let u,l=0,c=0,f=0,d=0;for(let y=e.length-1;y>=0;y--){const v=3*e[y],p=3*e[y]+1,m=3*e[y]+2,g=i[v],w=i[p],M=i[m];l||c||(l=Math.max(i[m],i[3*e[y-2]+2]),c=Math.min(i[m],i[3*e[y-2]+2]),u=l-c);let b=f;const x=y%6;0===t?(5===x&&(d=Nt(i,e,y,g,w)),b=2===x||3===x||4===x?f:f+d):1===t&&(2===x||3===x||4===x?b=0:5===x?(d=Nt(i,e,y,g,w),b=d):b=d);const F=b*o*a/r,A=M===l?0:u*h/s;n[v/3*2]=F,n[v/3*2+1]=-A,0===x&&(f+=d)}}(a,h,i,s.slice(d,s.length),u[0],u[1],l,c,f)}function Nr(t,n,i,e,r,s,o,a,h,u){void 0===n.top&&(n.top=!0),void 0===n.side&&(n.side=!0);const{altitudeScale:l,altitudeProperty:c,defaultAltitude:f,heightProperty:d,minHeightProperty:y,defaultHeight:v,tangent:p,uv:m,uvScale:M,topUVMode:b,sideUVMode:x,top:F,side:A,topThickness:k}=n,S=function(t,n,{altitudeScale:i,altitudeProperty:e,defaultAltitude:r,heightProperty:s,minHeightProperty:o,defaultHeight:a},{side:h,top:u,topThickness:l,uvOrigin:c,uv:f,uvSize:d,topUVMode:y,sideUVMode:v,glScale:p,localScale:m,vScale:g},w){const M=n/t[0].extent,b=[],x=[],F=[],A=[],k=[],S=[],_=!!f,O=!!u,T=!!h,z=_?[]:null;function D(t,i,e,r){if(O){const r=Fi(A,e,3);if(0===r.length)return i;let s;I(k,A),i+=A.length;for(let n=2,i=r.length;n<i;n+=3)s=r[n-1],r[n-1]=r[n]+t/3,r[n]=s+t/3,r[n-2]+=t/3;I(S,r),_&&Et(y||0,t,i,z,k,0,p,m,d[0],d[1]),l>0&&!T&&(i=Cr(k,A,e,S,i,0,l,n,_,v||0,z,d,p,m,g))}return T&&(O&&(l=0),i=Cr(k,A,e,S,i,l,r,n,_,v||0,z,d,p,m,g)),i}let E=0,C=0;const j=[-1,-1,n+1,n+1];let N=0,H=t.length;void 0!==w&&(N=w,H=w+1);let V=0,R=!1;for(;N<H;N++){const h=t[N],u=h.id;P(u)&&(Math.abs(u)>V&&(V=Math.abs(u)),u<0&&(R=!0));const l=h.geometry,{altitude:c,height:f}=Dr.getFeaAltitudeAndHeight(h,i,e,r,s,a,o);E=Math.max(Math.abs(c),E);const d=k.length;let y=C,v=[];A.length=0;for(let t=0,i=l.length;t<i;t++){const e=Dr.calculateSignedArea(l[t])<0;!e&&t>0&&(C=D(y,C,v,f*M),A.length=0,v=[],y=C);let r=l[t];if(n!==1/0&&(r=Dr.clipPolygon(r,j)),!r.length){t===i-1&&(C=D(y,C,v,f*M));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]),e&&v.push(A.length/3),lt(A,A.length,r,M,c),t===i-1&&(C=D(y,C,v,f*M))}const p=k.length-d,m="__fea_idx".trim();for(let t=0;t<p/3;t++)x.push(void 0===h[m]?N:h[m]),b.push(N),P(u)&&F.push(u)}const W=L(x.length?x[x.length-1]:0),$={maxAltitude:E,vertices:new(U(Math.max(512,E)))(k),indices:S,pickingIds:new W(x),featureIndexes:b};if(F.length){const t=R?U(V):L(V);$.featureIds=new t(F)}else $.featureIds=[];return z&&(z.length=k.length/3*2,$.uvs=z),$}(t,i,{altitudeScale:l,altitudeProperty:c,defaultAltitude:f||0,heightProperty:d,minHeightProperty:y,defaultHeight:v||0},{top:F,side:A,topThickness:10*k||0,uv:m||p,uvSize:M?[.5*M[0],.5*M[1]]:[.5,.5],uvOrigin:e,topUVMode:b,sideUVMode:x,glScale:r,localScale:o,vScale:s},u),_=[],O=new(T(S.vertices.length/3))(S.indices);delete S.indices,_.push(O.buffer,S.vertices.buffer,S.pickingIds.buffer);const z=Gn(S.vertices,O);let E=!0;for(let t=0;t<z.length;t++)z[t]=-z[t],z[t]%1!=0&&(E=!1);if(S.normals=z,p){let t=function(t,n,i,e){const r=t.length/3,s=new Array(4*r),o=[],a=[];for(let t=0;t<r;t++)o[t]=[0,0,0],a[t]=[0,0,0];const h=[0,0,0],u=[0,0,0],l=[0,0,0],c=[0,0],f=[0,0],d=[0,0],y=[0,0,0],v=[0,0,0];function p(n,e,r){Jn(h,t,3*n),Jn(u,t,3*e),Jn(l,t,3*r),Xn(c,i,2*n),Xn(f,i,2*e),Xn(d,i,2*r);const s=u[0]-h[0],p=l[0]-h[0],m=u[1]-h[1],g=l[1]-h[1],w=u[2]-h[2],M=l[2]-h[2],b=f[0]-c[0],x=d[0]-c[0],F=f[1]-c[1],A=d[1]-c[1],k=1/(b*A-x*F);bt(y,(A*s-F*p)*k,(A*m-F*g)*k,(A*w-F*M)*k),bt(v,(b*p-x*s)*k,(b*g-x*m)*k,(b*M-x*w)*k),xt(o[n],o[n],y),xt(o[e],o[e],y),xt(o[r],o[r],y),xt(a[n],a[n],v),xt(a[e],a[e],v),xt(a[r],a[r],v)}for(let t=0,n=e.length;t<n;t+=3)p(e[t+0],e[t+1],e[t+2]);const m=[],g=[],w=[],M=[];let b,x,F;function A(t){Jn(w,n,3*t),Mt(M,w),x=o[t],Mt(m,x),St(m,m,function(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}(w,w,kt(w,x))),At(m,m),Pt(g,M,x),F=kt(g,a[t]),b=F<0?-1:1,s[4*t]=m[0],s[4*t+1]=m[1],s[4*t+2]=m[2],s[4*t+3]=b}for(let t=0,n=e.length;t<n;t+=3)A(e[t+0]),A(e[t+1]),A(e[t+2]);return s}(S.vertices,S.normals,S.uvs,O);t=function(t,n){const i=new Float32Array(n.length),e=[],r=[],s=[];for(let o=0;o<n.length;o+=4){const a=o/4*3;bt(r,t[a]||0,t[a+1]||0,t[a+2]||0),Ot(e,n[o]||0,n[o+1]||0,n[o+2]||0,n[o+3]||0),qn(s,r,e),_t(i.subarray(o,o+4),s)}return i}(S.normals,t),S.tangents=t,_.push(t.buffer),delete S.normals}if(S.normals&&(S.normals=E?new Int8Array(S.normals):new Float32Array(S.normals),_.push(S.normals.buffer)),S.uvs){const t=S.uvs;S.uvs=new Float32Array(t),_.push(S.uvs.buffer)}const C=function(t,n,i,e){const r={};if(D(n.polygonFill)){const s={},o=w(n.polygonFill),a=new Uint8Array(4*e.length);for(let n=0;n<e.length;n++){const r=t[e[n]],h=r.properties||{};h.$layer=r.layer,h.$type=r.type;let u=o(i,h);if(delete h.$layer,delete h.$type,Array.isArray(u)||(u=s[u]=s[u]||Nn(u).array()),Array.isArray(u)){for(let t=0;t<u.length;t++)Hr[t]=255*u[t];3===u.length&&(Hr[3]=255)}a[4*n]=Hr[0],a[4*n+1]=Hr[1],a[4*n+2]=Hr[2],a[4*n+3]=Hr[3]}r.aColor=a}if(D(n.polygonOpacity)){const s=g(n.polygonOpacity),o=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const r=t[e[n]],a=r.properties||{};a.$layer=r.layer,a.$type=r.type;const h=s(i,a);delete a.$layer,delete a.$type,o[n]=255*h}r.aOpacity=o}return r}(t,a,h,S.featureIndexes),j={data:{data:{aPosition:S.vertices,aNormal:S.normals,aTexCoord0:S.uvs,aTangent:S.tangents,aPickingId:S.pickingIds},indices:O,properties:{maxAltitude:S.maxAltitude}},buffers:_};return S.featureIds.length?(j.data.featureIds=S.featureIds,_.push(j.data.featureIds.buffer)):j.data.featureIds=[],C.aColor&&(j.data.data.aColor=C.aColor,j.buffers.push(C.aColor.buffer)),C.aOpacity&&(j.data.data.aOpacity=C.aOpacity,j.buffers.push(C.aOpacity.buffer)),j}const Hr=[];function Vr(t,n,{altitudeScale:i,altitudeProperty:e,defaultAltitude:r,heightProperty:s,minHeightProperty:o,defaultHeight:a,bottom:h}){const u=h,l=n/t[0].extent,c=2*function(t,n){let i=0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(P(r.geometry[0][0])){const t=3*r.geometry.length;i+=n?2*t-6:t}else for(let t=0,e=r.geometry.length;t<e;t++){let e=3*r.geometry[t].length;3===r.type&&(e-=3),i+=n?2*e-6:e}}return i}(t)+3*t.length*2,f=[],d=new Int16Array(c),y=[];function v(t,i,e){const r=i-t,s=d.subarray(t,i),o=d.subarray(i,i+r);o.set(s);for(let t=2,n=o.length;t<n;t+=3)o[t]=s[t]-e;const a=t/3,h=r/3;let l,c;for(let t=a,i=h+a;t<i;t++)t<i-1?(l=t,c=t+1):(l=t,c=a),ct(d,l,c,n)||(y.push(l,c),u&&y.push(l+h,c+h),Rr(d,l,n)||y.push(l,l+h));return i+r}let p=0,m=0;const g="__fea_idx".trim();for(let n=0,h=t.length;n<h;n++){const h=t[n],u=h.geometry,{altitude:c,height:w}=Dr.getFeaAltitudeAndHeight(h,i,e,r,s,a,o);m=Math.max(Math.abs(c),m);let M=p;for(let t=0,n=u.length;t<n;t++){let n=u[t];const i=n.length;n[0][0]===n[i-1][0]&&n[0][1]===n[i-1][1]&&(n=n.slice(0,i-1)),p=lt(d,M,n,l,c),p=v(M,p,w*l),M=p}const b=y.length-f.length;for(let t=0;t<b;t++)f.push(h[g])}const w=new(T(y.reduce((t,n)=>Math.max(t,n),0)))(y),M=L(t.length);return{aPosition:new(U(Math.max(512,m)))(d),indices:w,aPickingId:new M(f)}}function Rr(t,n,i){const e=t[3*n],r=t[3*n+1];return e<0||e>i||r<0||r>i}function Wr(t,n,i){const e=Vr(t,i,n),r=[e.aPosition.buffer,e.indices.buffer,e.aPickingId.buffer],s=e.indices;return delete e.indices,{data:{data:e,indices:s},buffers:r}}class $r{constructor(t,n,i,e,r){this.id=t,this.options=n,this.upload=i,this.ht(n.style),this.requests={},this.ut=0,this.lt=e,this.loadings=r}updateStyle(t,n){this.options.style=t,this.ht(t),this.ut++,n()}updateOptions(t,n){this.options=A(this.options,t),n()}loadTile(t,n){const i=this.loadings,e=t.tileInfo.url,r=this.options.debugTile;if(r){const{x:i,y:e,z:s}=t.tileInfo;if(s!==r.z||i!==r.x||e!==r.y)return void n()}if(this.lt.has(e)){const{features:r,layers:s}=this.lt.get(e),o=i[e];if(delete i[e],!r||!r.length)return this.ct(o),void n();if(o)for(let n=0;n<o.length;n++)this.ft.call(o[n].ref,t,o[n].callback,e,s,r);this.ft(t,n,e,s,r)}else i[e]?i[e].push({callback:n,ref:this}):(i[e]=[{callback:n,ref:this}],this.requests[e]=this.getTileFeatures(t.tileInfo,(n,r,s,o)=>{const a=i[e];if(delete i[e],this.checkIfCanceled(e))return delete this.requests[e],void this.ct(a,null,{canceled:!0});if(delete this.requests[e],this.options.debug&&r)for(let n=0;n<r.length;n++)r[n]._debug_info={index:n,tileId:t.tileInfo.id};if(n)return n.loading||this.lt.add(e,{features:[],layers:[]}),void this.ct(a,n);if(!r||!r.length)return this.lt.add(e,{features:[],layers:[]}),void this.ct(a);if(this.lt.add(e,{features:r,layers:s}),a)for(let n=0;n<a.length;n++)this.ft.call(a[n].ref,t,a[n].callback,e,s,r,o)}))}ft(t,n,i,e,r,s){this.dt(e,r,t).then(t=>{t.canceled?n(null,{canceled:!0}):(t.data.style=this.ut,s&&A(t.data,s),n(null,t.data,t.buffers))}).catch(t=>{n(t)})}abortTile(t,n){delete this.requests[t],this.yt(t),n()}yt(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]}ct(t,n,i){if(t)for(let e=0;e<t.length;e++)t[e].callback(n,i)}checkIfCanceled(t){return!this.requests[t]}fetchIconGlyphs(t,n,i){this.upload("fetchIconGlyphs",{icons:t,glyphs:n},null,i)}dt(t,n,{glScale:i,zScale:e,tileInfo:r}){if(!n.length)return Promise.resolve({data:null,buffers:[]});const s=!this.options.style.style.length&&!this.options.style.featureStyle.length;let o=this.pluginConfig.slice(0);s&&(o=this.vt(t)),this.featurePlugins&&I(o,this.featurePlugins);const a=n[0].extent,h=r.z,u={x:r.extent2d.xmin*i,y:r.extent2d.ymax*i},l=[],c=[],f=[],d=this.options,y=[],v={},p=[Promise.resolve(this.ut)];let m=0,g=-1;for(let t=0;t<o.length;t++){g++;const r=o[t];r.type!==m&&(g=0,m=r.type);const d=0===r.type?l:c;if(r.symbol&&!1===r.symbol.visible){d[g]=null;continue}const{tileFeatures:w,tileFeaIndexes:M}=this.pt(r.type,r.filter,n,v,t);if(!w.length){d[g]=null;continue}const b=T(M[M.length-1]);d[g]={styledFeatures:new b(M)},f.push({idx:t,typeIdx:g}),y.push(d[g].styledFeatures.buffer);let x=this.gt(w,r,{extent:a,tilePoint:u,glScale:i,zScale:e,zoom:h});s&&(x=x.then(t=>{if(!t)return null;if(t.data)t.data.layer=w[0].layer;else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]&&t[n].data&&(t[n].data.layer=w[0].layer);return t})),p.push(x)}return Promise.all(p).then(([i,...e])=>{function r(t,n){if(void 0===t.data.ref&&(t.data.type=o[f[n].idx].renderPlugin.dataConfig.type,t.data.filter=o[f[n].idx].filter.def,t.buffers&&t.buffers.length))for(let n=0;n<t.buffers.length;n++)y.push(t.buffers[n])}if(i!==this.ut)return{canceled:!0};for(let t=0;t<e.length;t++){if(!e[t])continue;const n=e[t],i=0===o[f[t].idx].type?l:c;if(Array.isArray(n)){const e=[];for(let i=0;i<n.length;i++)n[i]&&(r(n[i],t),(void 0===n[i].data.ref||n[n[i].data.ref])&&e.push(n[i].data));e.length&&(i[f[t].typeIdx].data=e)}else r(n,t),i[f[t].typeIdx].data=n.data}const s={},h=t;if(d.features||d.schema){let t;for(let i=0,e=n.length;i<e;i++)if(t=n[i],h[t.layer].properties||(h[t.layer].properties=Gr(t.properties)),d.features&&t&&v[i])if("id"===d.features)s[i]=t.id;else{const n=A({},t);d.pickingGeometry||delete n.geometry,delete n.extent,delete n.properties.$layer,delete n.properties.$type,delete n.__index,s[i]=n}}return{data:{schema:h,data:l,featureData:c,extent:a,features:s},buffers:y}})}gt(t,n,i){const e=n.renderPlugin.dataConfig,r=n.symbol,s=this.options.tileSize[0],{extent:o,glScale:a,zScale:h,zoom:u,tilePoint:l}=i,c=o/s,f=e.type,d=this.options.debugTile&&this.options.debugTile.index;if("3d-extrusion"===f){const n=Jr(r);return n&&(e.uv=1,2===n&&(e.tangent=1)),Promise.all([Promise.resolve(Nr(t,e,o,l,a,h,this.options.tileSize[1]/o,r,u,d))])}if("3d-wireframe"===f)return Promise.all([Promise.resolve(Wr(t,e,o))]);if("point"===f){const n=A({},e,{EXTENT:o,requestor:this.fetchIconGlyphs.bind(this),zoom:u,debugIndex:d}),i=mr.splitPointSymbol(r);return mr.needMerge(i[0])&&(t=mr.mergeLineFeatures(t,i[0],u)),Promise.all(i.map(i=>new mr(t,i,n).load(c)))}if("native-point"===f){const n=A({},e,{EXTENT:o,zoom:u,debugIndex:d});return Xr(t,r,n,_r,o/s)}if("line"===f){const n=A({},e,{EXTENT:o,requestor:this.fetchIconGlyphs.bind(this),tileRatio:c,zoom:u,debugIndex:d});return Xr(t,r,n,Mr)}if("native-line"===f){const n=A({},e,{EXTENT:o,zoom:u,debugIndex:d});return Xr(t,r,n,Pr)}if("fill"===f){const n=A({},e,{EXTENT:o,requestor:this.fetchIconGlyphs.bind(this),zoom:u,debugIndex:d});return Xr(t,r,n,zr)}if("line-extrusion"===f){delete r.lineGradientProperty,r.lineJoin="miter",r.lineCap="butt";const n=Jr(r);n&&(e.uv=1,2===n&&(e.tangent=1));const i=A({},e,{EXTENT:o,tileSize:s,zScale:h,glScale:a,zoom:u,debugIndex:d});if(n){const n=[];if(!1!==e.top){const e=A({},i);e.side=!1,n.push(new Ar(t,r,e))}return!1!==e.side&&(i.side=!0,i.top=!1,n.push(new Ar(t,r,i))),Promise.all(n.map(t=>t.load()))}return Promise.all([new Ar(t,r,i).load()])}return Promise.resolve([])}pt(t,n,i,e){const r="__fea_idx".trim(),s=[],o=[],a=i.length;for(let h=0;h<a;h++)if((1===t||void 0===i[h].id||!this.styledFeatures[i[h].id])&&((!n.def||"default"===n.def)&&!e[h]||!0===n.def||Array.isArray(n.def)&&n(i[h]))){e[h]=1;const n=A({},i[h]);if(n[r]=h,o.push(n),s.push(h),1===t)break}return{tileFeatures:o,tileFeaIndexes:s}}ht(t){const{style:n,featureStyle:i}=t,e={};i.forEach(t=>{Array.isArray(t.id)?(t.id.forEach(t=>{e[t]=1}),t.filter=["in","$id",...t.id]):(e[t.id]=1,t.filter=["==","$id",t.id])});const r=z(n);for(let t=0;t<n.length;t++)r[t].filter&&(r[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0),r[t].type=0;const s=[],o=z(i);for(let t=0;t<i.length;t++)o[t].type=1,o[t].filter.def=i[t].filter?i[t].filter.value||i[t].filter:void 0,o[t].renderPlugin&&s.push(o[t]);this.pluginConfig=r,this.featurePlugins=s,this.styledFeatures=e}vt(t){let n=this.wt;this.wt||(n=this.wt={});const e=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],r=[];for(const s in t){const o=s;if(!n[s]){const r=[];for(let n=0;n<t[s].types.length;n++){const a=t[s].types[n],h=["all",["==","$layer",o],["==","$type",e[a]]],u={filter:i(h),renderPlugin:Br(a),symbol:qr(a)};u.filter.def=h,u.type=0,r.push(u)}n[o]=r}r.push(...n[o])}return r}}function Br(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 qr(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 Gr(t){if(Array.isArray(t)||!_(t))return{};const n={};for(const i in t){const e=t[i];k(e)?n[i]="string":P(e)?n[i]="number":!0===e||!1===e?n[i]="boolean":Array.isArray(e)?n[i]="array":n[i]="object"}return n}function Jr(t){if(!t)return 0;let n=0;for(const i in t){if(("normalTexture"===i||"bumpTexture"===i)&&t[i])return 2;if(i.indexOf("Texture")>0&&t[i])n=1;else if(_(t[i])){const e=Jr(t[i]);if(2===e)return e;1===e&&(n=1)}}return n}function Xr(t,n,i,e,r){const s={},o=Array.isArray(n)?n:[n];let a=-1;for(let t=0;t<o.length;t++)s[t]=Zr(o[t]),!s[t]&&o[t]&&-1===a&&(a=t);const h=[];for(let n=0;n<o.length;n++)o[n]&&(o[n].index={index:n},s[n]||n===a?h.push(new e(t,o[n],i).load(r)):h.push({data:{ref:a,symbolIndex:{index:n}}}));return Promise.all(h)}function Zr(t){if(!t)return 0;for(const n in t)if(D(t[n]))return 1;return 0}function Yr(t,n){Kr(t.geometry,n)}function Kr(t,n){if(t)switch(t.type){case"Point":Qr(t.coordinates,n);break;case"MultiPoint":case"LineString":ts(t.coordinates,n);break;case"MultiLineString":case"Polygon":ns(t.coordinates,n);break;case"MultiPolygon":!function(t,n){for(let i=0;i<t.length;i++)ns(t[i],n)}(t.coordinates,n);break;case"GeometryCollection":for(let i=0;i<t.geometries.length;i++)Kr(t.geometries[i],n)}}function Qr(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 ts(t,n){for(let i=0;i<t.length;i++)Qr(t[i],n)}function ns(t,n){for(let i=0;i<t.length;i++)ts(t[i],n)}class is extends $r{constructor(t,n,i,e,r,s){super(t,n,i,e,r),(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,i=Math.round(n);return Math.abs(i-n)<1e-14?i:n}(n.tileSize[0]/256)),this.setData(n.data,s)}setData(t,n){if(delete this.index,!t)return void n();const i={maxZoom:24,tolerance:this.options.extent/this.options.tileSize[0]*1,extent:this.options.extent,buffer:this.options.tileBuffer||64,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5};if(k(t)&&"{"!=t.substring(0,1)||t.url)C.getJSON(t.url?t.url:t,t.url?t:{},(t,e)=>{if(t&&n(t),!e)return void n(null,{extent:null,idMap:{}});const r=e,{first1000:s,idMap:o}=this.Mt(r);this.bt(s,o,r,i,n)});else{"string"==typeof t&&(t=JSON.parse(t));const e=Array.isArray(t)?t:t.features;let r=e;e&&e.length>1e3&&(r=e.slice(0,1e3)),this.bt(r,null,t,i,n)}}bt(t,n,i,e,r){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":for(let i=0;i<t.features.length;i++)Yr(t.features[i],n);break;case"Feature":Yr(t,n);break;default:Kr(t,n)}return n}({type:"FeatureCollection",features:t}):null;this.index=function(t,n){return new ht(t,n)}(i,this.options.geojsonvt||e),r(null,{extent:s,idMap:n})}catch(t){console.warn(t),r({error:t.message})}}Mt(t){const n=[],i={};let e=0;function r(t){t&&("Feature"!==t.type||t.geometry)&&(void 0!==t.id&&null!==t.id||(t.id=e++),i[t.id]=A({},t),t.geometry?(i[t.id].geometry=A({},t.geometry),i[t.id].geometry.coordinates=null):t.coordinates&&(i[t.id].coordinates=null),n.length<1e3&&n.push(t))}return Array.isArray(t)?t.forEach(t=>{r(t)}):t.features&&t.features.forEach(t=>{r(t)}),{first1000:n,idMap:i}}getTileFeatures(t,n){const i=[];if(!this.index)return setTimeout((function(){n({loading:!0})}),1),1;const e=this.index.getTile(t.z+this.zoomOffset,t.x,t.y);if(!e||0===e.features.length)return setTimeout((function(){n(null,i,[])}),1),1;const r=[];for(let t=0,n=e.features.length;t<n;t++){const n=e.features[t];let s=n.layer;void 0===s&&(s="0"),r[s]={types:{}};r[s].types[n.type]=1,n.tags=n.tags||{},i.push({type:n.type,layer:s,id:n.id,geometry:n.geometry,properties:n.tags,extent:this.options.extent})}for(const t in r)r[t].types=Object.keys(r[t].types).map(t=>+t);return setTimeout((function(){n(null,i,r)}),1),1}onRemove(){delete this.index}}var es={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,n,i,e,r){var s,o,a=8*r-e-1,h=(1<<a)-1,u=h>>1,l=-7,c=i?r-1:0,f=i?-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+=e;l>0;o=256*o+t[n+c],c+=f,l-=8);if(0===s)s=1-u;else{if(s===h)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,e),s-=u}return(d?-1:1)*o*Math.pow(2,s-e)},write:function(t,n,i,e,r,s){var o,a,h,u=8*s-r-1,l=(1<<u)-1,c=l>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=e?0:s-1,y=e?1:-1,v=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*(h=Math.pow(2,-o))<1&&(o--,h*=2),(n+=o+c>=1?f/h:f*Math.pow(2,1-c))*h>=2&&(o++,h/=2),o+c>=l?(a=0,o=l):o+c>=1?(a=(n*h-1)*Math.pow(2,r),o+=c):(a=n*Math.pow(2,c-1)*Math.pow(2,r),o=0));r>=8;t[i+d]=255&a,d+=y,a/=256,r-=8);for(o=o<<r|a,u+=r;u>0;t[i+d]=255&o,d+=y,o/=256,u-=8);t[i+d-y]|=128*v}},rs=os,ss=es;function os(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}os.Varint=0,os.Fixed64=1,os.Bytes=2,os.Fixed32=5;var as="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function hs(t){return t.type===os.Bytes?t.readVarint()+t.pos:t.pos+1}function us(t,n,i){return i?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function ls(t,n,i){var e=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(e);for(var r=i.pos-1;r>=t;r--)i.buf[r+e]=i.buf[r]}function cs(t,n){for(var i=0;i<t.length;i++)n.writeVarint(t[i])}function fs(t,n){for(var i=0;i<t.length;i++)n.writeSVarint(t[i])}function ds(t,n){for(var i=0;i<t.length;i++)n.writeFloat(t[i])}function ys(t,n){for(var i=0;i<t.length;i++)n.writeDouble(t[i])}function vs(t,n){for(var i=0;i<t.length;i++)n.writeBoolean(t[i])}function ps(t,n){for(var i=0;i<t.length;i++)n.writeFixed32(t[i])}function ms(t,n){for(var i=0;i<t.length;i++)n.writeSFixed32(t[i])}function gs(t,n){for(var i=0;i<t.length;i++)n.writeFixed64(t[i])}function ws(t,n){for(var i=0;i<t.length;i++)n.writeSFixed64(t[i])}function Ms(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+16777216*t[n+3]}function bs(t,n,i){t[i]=n,t[i+1]=n>>>8,t[i+2]=n>>>16,t[i+3]=n>>>24}function xs(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}os.prototype={destroy:function(){this.buf=null},readFields:function(t,n,i){for(i=i||this.length;this.pos<i;){var e=this.readVarint(),r=e>>3,s=this.pos;this.type=7&e,t(r,n,this),this.pos===s&&this.skip(e)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=Ms(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=xs(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ms(this.buf,this.pos)+4294967296*Ms(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ms(this.buf,this.pos)+4294967296*xs(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ss.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ss.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,i,e=this.buf;return n=127&(i=e[this.pos++]),i<128?n:(n|=(127&(i=e[this.pos++]))<<7,i<128?n:(n|=(127&(i=e[this.pos++]))<<14,i<128?n:(n|=(127&(i=e[this.pos++]))<<21,i<128?n:function(t,n,i){var e,r,s=i.buf;if(r=s[i.pos++],e=(112&r)>>4,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(127&r)<<3,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(127&r)<<10,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(127&r)<<17,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(127&r)<<24,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(1&r)<<31,r<128)return us(t,e,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(i=e[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&&as?function(t,n,i){return as.decode(t.subarray(n,i))}(this.buf,n,t):function(t,n,i){var e="",r=n;for(;r<i;){var s,o,a,h=t[r],u=null,l=h>239?4:h>223?3:h>191?2:1;if(r+l>i)break;1===l?h<128&&(u=h):2===l?128==(192&(s=t[r+1]))&&(u=(31&h)<<6|63&s)<=127&&(u=null):3===l?(s=t[r+1],o=t[r+2],128==(192&s)&&128==(192&o)&&((u=(15&h)<<12|(63&s)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===l&&(s=t[r+1],o=t[r+2],a=t[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((u=(15&h)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,l=1):u>65535&&(u-=65536,e+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),e+=String.fromCharCode(u),r+=l}return e}(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!==os.Bytes)return t.push(this.readVarint(n));var i=hs(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(n));return t},readPackedSVarint:function(t){if(this.type!==os.Bytes)return t.push(this.readSVarint());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==os.Bytes)return t.push(this.readBoolean());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==os.Bytes)return t.push(this.readFloat());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==os.Bytes)return t.push(this.readDouble());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==os.Bytes)return t.push(this.readFixed32());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==os.Bytes)return t.push(this.readSFixed32());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==os.Bytes)return t.push(this.readFixed64());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==os.Bytes)return t.push(this.readSFixed64());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed64());return t},skip:function(t){var n=7&t;if(n===os.Varint)for(;this.buf[this.pos++]>127;);else if(n===os.Bytes)this.pos=this.readVarint()+this.pos;else if(n===os.Fixed32)this.pos+=4;else{if(n!==os.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 i=new Uint8Array(n);i.set(this.buf),this.buf=i,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),bs(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),bs(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),bs(this.buf,-1&t,this.pos),bs(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),bs(this.buf,-1&t,this.pos),bs(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 i,e;t>=0?(i=t%4294967296|0,e=t/4294967296|0):(e=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,e=e+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn\'t fit into 10 bytes");n.realloc(10),function(t,n,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,n),function(t,n){var i=(7&t)<<4;if(n.buf[n.pos++]|=i|((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}(e,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,i){for(var e,r,s=0;s<n.length;s++){if((e=n.charCodeAt(s))>55295&&e<57344){if(!r){e>56319||s+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=e;continue}if(e<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);e<128?t[i++]=e:(e<2048?t[i++]=e>>6|192:(e<65536?t[i++]=e>>12|224:(t[i++]=e>>18|240,t[i++]=e>>12&63|128),t[i++]=e>>6&63|128),t[i++]=63&e|128)}return i}(this.buf,t,this.pos);var i=this.pos-n;i>=128&&ls(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),ss.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ss.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 i=0;i<n;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,n){this.pos++;var i=this.pos;t(n,this);var e=this.pos-i;e>=128&&ls(i,e,this),this.pos=i-1,this.writeVarint(e),this.pos+=e},writeMessage:function(t,n,i){this.writeTag(t,os.Bytes),this.writeRawMessage(n,i)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,cs,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,fs,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,vs,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,ds,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,ys,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,ps,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,ms,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,gs,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,ws,n)},writeBytesField:function(t,n){this.writeTag(t,os.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,os.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,os.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,os.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,os.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,os.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,os.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,os.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,os.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,os.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}};var Fs=As;function As(t,n){this.x=t,this.y=n}As.prototype={clone:function(){return new As(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().T()},round:function(){return this.clone().L()},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,i=t.y-this.y;return n*n+i*i},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,i=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=i,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},T:function(){var t=this.y;return this.y=this.x,this.x=-t,this},S:function(t){var n=Math.cos(t),i=Math.sin(t),e=n*this.x-i*this.y,r=i*this.x+n*this.y;return this.x=e,this.y=r,this},_:function(t,n){var i=Math.cos(t),e=Math.sin(t),r=n.x+i*(this.x-n.x)-e*(this.y-n.y),s=n.y+e*(this.x-n.x)+i*(this.y-n.y);return this.x=r,this.y=s,this},L:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},As.convert=function(t){return t instanceof As?t:Array.isArray(t)?new As(t[0],t[1]):t};var ks=Fs,Ps=Ss;function Ss(t,n,i,e,r){this.properties={},this.extent=i,this.type=0,this.xt=t,this.Ft=-1,this.At=e,this.kt=r,t.readFields(_s,this,n)}function _s(t,n,i){1==t?n.id=i.readVarint():2==t?function(t,n){var i=t.readVarint()+t.pos;for(;t.pos<i;){var e=n.At[t.readVarint()],r=n.kt[t.readVarint()];n.properties[e]=r}}(i,n):3==t?n.type=i.readVarint():4==t&&(n.Ft=i.pos)}function Os(t){for(var n,i,e=0,r=0,s=t.length,o=s-1;r<s;o=r++)n=t[r],e+=((i=t[o]).x-n.x)*(n.y+i.y);return e}Ss.types=["Unknown","Point","LineString","Polygon"],Ss.prototype.loadGeometry=function(){var t=this.xt;t.pos=this.Ft;for(var n,i=t.readVarint()+t.pos,e=1,r=0,s=0,o=0,a=[];t.pos<i;){if(r<=0){var h=t.readVarint();e=7&h,r=h>>3}if(r--,1===e||2===e)s+=t.readSVarint(),o+=t.readSVarint(),1===e&&(n&&a.push(n),n=[]),n.push(new ks(s,o));else{if(7!==e)throw new Error("unknown command "+e);n&&n.push(n[0].clone())}}return n&&a.push(n),a},Ss.prototype.bbox=function(){var t=this.xt;t.pos=this.Ft;for(var n=t.readVarint()+t.pos,i=1,e=0,r=0,s=0,o=1/0,a=-1/0,h=1/0,u=-1/0;t.pos<n;){if(e<=0){var l=t.readVarint();i=7&l,e=l>>3}if(e--,1===i||2===i)(r+=t.readSVarint())<o&&(o=r),r>a&&(a=r),(s+=t.readSVarint())<h&&(h=s),s>u&&(u=s);else if(7!==i)throw new Error("unknown command "+i)}return[o,h,a,u]},Ss.prototype.toGeoJSON=function(t,n,i){var e,r,s=this.extent*Math.pow(2,i),o=this.extent*t,a=this.extent*n,h=this.loadGeometry(),u=Ss.types[this.type];function l(t){for(var n=0;n<t.length;n++){var i=t[n],e=180-360*(i.y+a)/s;t[n]=[360*(i.x+o)/s-180,360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(e=0;e<h.length;e++)c[e]=h[e][0];l(h=c);break;case 2:for(e=0;e<h.length;e++)l(h[e]);break;case 3:for(h=function(t){var n=t.length;if(n<=1)return[t];for(var i,e,r=[],s=0;s<n;s++){var o=Os(t[s]);0!==o&&(void 0===e&&(e=o<0),e===o<0?(i&&r.push(i),i=[t[s]]):i.push(t[s]))}i&&r.push(i);return r}(h),e=0;e<h.length;e++)for(r=0;r<h[e].length;r++)l(h[e][r])}1===h.length?h=h[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:h},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Is=Ps,Ts=Ls;function Ls(t,n){this.version=1,this.name=null,this.extent=4096,this.length=0,this.xt=t,this.At=[],this.kt=[],this.Pt=[],t.readFields(Us,this,n),this.length=this.Pt.length}function Us(t,n,i){15===t?n.version=i.readVarint():1===t?n.name=i.readString():5===t?n.extent=i.readVarint():2===t?n.Pt.push(i.pos):3===t?n.At.push(i.readString()):4===t&&n.kt.push(function(t){var n=null,i=t.readVarint()+t.pos;for(;t.pos<i;){var e=t.readVarint()>>3;n=1===e?t.readString():2===e?t.readFloat():3===e?t.readDouble():4===e?t.readVarint64():5===e?t.readVarint():6===e?t.readSVarint():7===e?t.readBoolean():null}return n}(i))}Ls.prototype.feature=function(t){if(t<0||t>=this.Pt.length)throw new Error("feature index out of bounds");this.xt.pos=this.Pt[t];var n=this.xt.readVarint()+this.xt.pos;return new Is(this.xt,n,this.extent,this.At,this.kt)};var zs=Ts;function Ds(t,n,i){if(3===t){var e=new zs(i,i.readVarint()+i.pos);e.length&&(n[e.name]=e)}}var Es=function(t,n){this.layers=t.readFields(Ds,{},n)};class Cs extends $r{constructor(t,n,i,e,r,s){super(t,n,i,e,r),n=n||{},s()}getTileFeatures(t,n){const i=t.url;return C.getArrayBuffer(i,(t,i)=>{if(t)return void n(t);const e=new Es(new rs(i.data)),r=[];if(!e.layers)return void n(null,r,[]);const s={};let o;for(const n in e.layers)if(a=e.layers,h=n,Object.prototype.hasOwnProperty.call(a,h)){s[n]={types:{}};const i=s[n].types;for(let s=0,a=e.layers[n].length;s<a;s++)try{o=e.layers[n].feature(s),i[o.type]=1,r.push({type:o.type,layer:n,geometry:o.loadGeometry(),properties:o.properties,extent:o.extent})}catch(t){console.warn("error when load vt geometry:",t)}}var a,h;for(const t in s)s[t].types=Object.keys(s[t].types).map(t=>+t);n(null,r,s,{byteLength:i.data.byteLength})})}abortTile(t,n){const i=this.requests[t];delete this.requests[t],i&&i.abort&&i.abort(),this.yt(t),n()}onRemove(){for(const t in this.requests)this.requests[t].abort();this.requests={}}}let js=0;const Ns=new class{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}}(128),Hs={};class Vs{constructor(t){this.St={},this._t={},this.workerId=t}addLayer({actorId:t,mapId:n,layerId:i,params:e},r){if(this.Ot(n,i))return;const s=this.It(n,i),o=e.type,a=e.options,h=this.send.bind(this,t);this.St[s]="GeoJSONVectorTileLayer"===o?new is(i,a,h,Ns,Hs,r):new Cs(i,a,h,Ns,Hs,r)}removeLayer({mapId:t,layerId:n},i){const e=this.Ot(t,n),r=this.It(t,n);delete this.St[r],e&&(e.onRemove(i),this.Tt())}loadTile({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&r.loadTile(i,e)}abortTile({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&r.abortTile&&r.abortTile(i.url,e)}removeTile({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&r.removeTile(i,e)}updateStyle({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&(r.updateStyle(i,e),this.Tt())}updateOptions({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&(r.updateOptions(i,e),this.Tt())}setData({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&(r.setData(i.data,e),this.Tt())}receive(t){const n=t.callback,i=this._t[n];delete this._t[n],i&&t.error?i(new Error(t.error)):i&&i(null,t.data)}send(t,n,i,e,r){const s=r?`${t}-${js++}`:null;r&&(this._t[s]=r),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:n,params:i,callback:String(s)},e||[])}It(t,n){return`${t}-${n}`}Ot(t,n){const i=this.It(t,n);return this.St[i]}Tt(){const t=Object.keys(Hs);for(let n=0;n<t.length;n++)delete Hs[t[n]];Ns.reset()}}t.initialize=function(){},t.onmessage=function(t,n){const i=t.data;if(this.dispatcher||(this.dispatcher=new Vs(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const e=i.command;this.dispatcher[e]({actorId:t.actorId,mapId:i.mapId,layerId:i.layerId,params:i.params},(t,i,r)=>{t&&console.error(e,t),n(t,i,r)})}},Object.defineProperty(t,"Lt",{value:!0})}';
28
+ const E = 'function(t){\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 */\nconst n=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function i(t){return new Function("f","var p = (f && f.properties || {}); return "+e(t))}function e(t){if(!t)return"true";const n=t[0];if(t.length<=1)return"any"===n?"false":"true";return`(${"=="===n?s(t[1],t[2],"===",!1):"!="===n?s(t[1],t[2],"!==",!1):"<"===n||">"===n||"<="===n||">="===n?s(t[1],t[2],n,!0):"any"===n?o(t.slice(1),"||"):"all"===n?o(t.slice(1),"&&"):"none"===n?u(o(t.slice(1),"||")):"in"===n?a(t[1],t.slice(2)):"!in"===n?u(a(t[1],t.slice(2))):"has"===n?h(t[1]):"!has"===n?u(h(t[1])):"true"})`}function r(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function s(t,i,e,s){const o=r(t),a="$type"===t?n.indexOf(i):JSON.stringify(i);return(s?`typeof ${o}=== typeof ${a}&&`:"")+o+e+a}function o(t,n){return t.map(e).join(n)}function a(t,i){"$type"===t&&(i=i.map(t=>n.indexOf(t)));const e=JSON.stringify(i.sort(l)),s=r(t);return i.length<=200?`${e}.indexOf(${s}) !== -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; }(${s}, ${e},0,${i.length-1})`}function h(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function u(t){return`!(${t})`}function l(t,n){return t<n?-1:t>n?1:0}function c(t){for(let n=1;n<arguments.length;n++){const i=arguments[n];for(const n in i)t[n]=i[n]}return t}function f(t,n){for(let i=0;i<t.stops.length;i++)if(n===t.stops[i][0])return t.stops[i][1];return t.default}function d(t,n){for(var i=0;i<t.stops.length&&!(n<t.stops[i][0]);i++);return t.stops[Math.max(i-1,0)][1]}function y(t,n){for(var i=void 0!==t.base?t.base:1,e=0;!(e>=t.stops.length||n<=t.stops[e][0]);)e++;return 0===e?t.stops[e][1]:e===t.stops.length?t.stops[e-1][1]:function t(n,i,e,r,s,o){return"function"==typeof s?function(){var a=s.apply(void 0,arguments),h=o.apply(void 0,arguments);return t(n,i,e,r,a,h)}:s.length?function(t,n,i,e,r,s){var o=[];for(let a=0;a<r.length;a++)o[a]=p(t,n,i,e,r[a],s[a]);return o}(n,i,e,r,s,o):p(n,i,e,r,s,o)}(n,i,t.stops[e-1][0],t.stops[e][0],t.stops[e-1][1],t.stops[e][1])}function v(t,n){return function(t,n,i){return void 0!==t?t:void 0!==n?n:void 0!==i?i:null}(n,t.default)}function p(t,n,i,e,r,s){var o,a=e-i,h=t-i;return r*(1-(o=1===n?h/a:(Math.pow(n,h)-1)/(Math.pow(n,a)-1)))+s*o}function m(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function g(t){return b(t,"exponential")}function w(t){return b(t,"interval")}function M(t,n){if(!t)return null;var i=!1;if(Array.isArray(t)){var e,r=[];for(let s=0;s<t.length;s++)(e=M(t[s],n))?(r.push(e),i=!0):r.push(t[s]);return i?r:t}var s,o={__fn_types_loaded:!0},a=[];for(s in t)t.hasOwnProperty(s)&&a.push(s);const h=function(t){Object.defineProperty(o,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=g(this["_"+t])),this["__fn_"+t].apply(this,n())},set:function(n){this["_"+t]=n},configurable:!0,enumerable:!0})};for(let n=0,e=a.length;n<e;n++)m(t[s=a[n]])?(i=!0,o["_"+s]=t[s],h(s)):o[s]=t[s];return i?o:t}function b(t,n){if(!m(t))return function(){return t};let i=!0,e=!0;const r=(t=JSON.parse(JSON.stringify(t))).stops;if(r)for(let t=0;t<r.length;t++)if(m(r[t][1])){const s=b(r[t][1],n);i=i&&s.isZoomConstant,e=e&&s.isFeatureConstant,r[t]=[r[t][0],s]}const s=function t(n,i){var e,r,s;if(m(n)){var o,a=n.stops&&"object"==typeof n.stops[0][0],h=a||void 0!==n.property,u=a||!h,l=n.type||i||"exponential";if("exponential"===l)o=y;else if("interval"===l)o=d;else if("categorical"===l)o=f;else{if("identity"!==l)throw new Error(\'Unknown function type "\'+l+\'"\');o=v}if(a){var c={},p=[];for(let t=0;t<n.stops.length;t++){var g=n.stops[t];void 0===c[g[0].zoom]&&(c[g[0].zoom]={zoom:g[0].zoom,type:n.type,property:n.property,default:n.default,stops:[]}),c[g[0].zoom].stops.push([g[0].value,g[1]])}for(let n in c)p.push([c[n].zoom,t(c[n])]);e=function(t,i){const e=y({stops:p,base:n.base},t)(t,i);return"function"==typeof e?e(t,i):e},r=!1,s=!1}else u?(e=function(t){const i=o(n,t);return"function"==typeof i?i(t):i},r=!0,s=!1):(e=function(t,i){const e=o(n,i?i[n.property]:null);return"function"==typeof e?e(t,i):e},r=!1,s=!0)}else e=function(){return n},r=!0,s=!0;return e.isZoomConstant=s,e.isFeatureConstant=r,e}(t,n);return s.isZoomConstant=i&&s.isZoomConstant,s.isFeatureConstant=e&&s.isFeatureConstant,s}let x=0;const F="function"==typeof Object.assign;function A(t,...n){if(F)return Object.assign(t,...n),t;for(let i=0;i<n.length;i++){const e=n[i];for(const n in e)t[n]=e[n]}return t}function k(t){return!O(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function P(t){return"number"==typeof t&&!isNaN(t)}function S(t){return!O(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function _(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function O(t){return null==t}function I(t){for(let n=1;n<arguments.length;n++){const i=arguments[n];if(i)for(let n=0,e=i.length;n<e;n++)t.push(i[n])}return t.length}function T(t){return t<65536?Uint16Array:Uint32Array}function L(t){return t<256?Uint8Array:t<65536?Uint16Array:Uint32Array}function U(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function z(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}:i(n[t].filter),e.push(c({},n[t],{filter:r}))}return e}(t=t.map(t=>{const n=A({},t);return n.filter&&n.filter.value&&(n.filter=n.filter.value),n}))}function D(t){return m(t)&&t.property}const E="function"==typeof fetch&&"function"==typeof AbortController,C={jsonp:function(t,n){const i="_maptalks_jsonp_"+x++;t.match(/\\?/)?t+="&callback="+i:t+="?callback="+i;let e=document.createElement("script");return e.type="text/javascript",e.src=t,window[i]=function(t){n(null,t),document.getElementsByTagName("head")[0].removeChild(e),e=null,delete window[i]},document.getElementsByTagName("head")[0].appendChild(e),this},get:function(t,n,i){if(S(n)){const t=i;i=n,n=t}(n=n||{}).method&&(n.method=n.method.toUpperCase());const e="POST"===n.method;if(E){const r=new AbortController,s={signal:r.signal,method:n.method||"GET",referrerPolicy:"origin"};return e&&(O(n.body)||(s.body=JSON.stringify(n.body))),O(n.headers)||(s.headers=n.headers),O(n.credentials)||(s.credentials=n.credentials),fetch(t,s).then(t=>{const e=this.t(t,n.returnJSON,n.responseType);e.message?i(e):e.then(e=>{"arraybuffer"===n.responseType?i(null,{data:e,cacheControl:t.headers.get("Cache-Control"),expires:t.headers.get("Expires"),contentType:t.headers.get("Content-Type")}):i(null,e)}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),i(t))})}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),i(t))}),r}{const r=C.s(i);if(r.open(n.method||"GET",t,!0),n){for(const t in n.headers)r.setRequestHeader(t,n.headers[t]);r.withCredentials="include"===n.credentials,n.responseType&&(r.responseType=n.responseType)}return r.send(e?n.body:null),r}},t:(t,n,i)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`}:"arraybuffer"===i?t.arrayBuffer():n?t.json():t.text(),o: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}`})}},s: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=C.o(n,t),n},getArrayBuffer(t,n,i){if(S(n)){const t=i;i=n,n=t}return n||(n={}),n.responseType="arraybuffer",C.get(t,n,i)}};function j(t,n,i,e,r,s){var o=r-i,a=s-e;if(0!==o||0!==a){var h=((t-i)*o+(n-e)*a)/(o*o+a*a);h>1?(i=r,e=s):h>0&&(i+=o*h,e+=a*h)}return(o=t-i)*o+(a=n-e)*a}function N(t,n,i,e){var r={id:void 0===t?null:t,type:n,geometry:i,tags:e,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var n=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)H(t,n);else if("Polygon"===i||"MultiLineString"===i)for(var e=0;e<n.length;e++)H(t,n[e]);else if("MultiPolygon"===i)for(e=0;e<n.length;e++)for(var r=0;r<n[e].length;r++)H(t,n[e][r])}(r),r}function H(t,n){for(var i=0;i<n.length;i+=3)t.minX=Math.min(t.minX,n[i]),t.minY=Math.min(t.minY,n[i+1]),t.maxX=Math.max(t.maxX,n[i]),t.maxY=Math.max(t.maxY,n[i+1])}function V(t,n,i,e){if(n.geometry){var r=n.geometry.coordinates,s=n.geometry.type,o=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),a=[],h=n.id;if(i.promoteId?h=n.properties[i.promoteId]:i.generateId&&(h=e||0),"Point"===s)R(r,a);else if("MultiPoint"===s)for(var u=0;u<r.length;u++)R(r[u],a);else if("LineString"===s)$(r,a,o,!1);else if("MultiLineString"===s){if(i.lineMetrics){for(u=0;u<r.length;u++)a=[],$(r[u],a,o,!1),t.push(N(h,"LineString",a,n.properties));return}W(r,a,o,!1)}else if("Polygon"===s)W(r,a,o,!0);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(u=0;u<n.geometry.geometries.length;u++)V(t,{id:h,geometry:n.geometry.geometries[u],properties:n.properties},i,e);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<r.length;u++){var l=[];W(r[u],l,o,!0),a.push(l)}}t.push(N(h,s,a,n.properties))}}function R(t,n){n.push(q(t[0])),n.push(B(t[1])),n.push(0)}function $(t,n,i,e){for(var r,s,o=0,a=0;a<t.length;a++){var h=q(t[a][0]),u=B(t[a][1]);n.push(h),n.push(u),n.push(0),a>0&&(o+=e?(r*u-h*s)/2:Math.sqrt(Math.pow(h-r,2)+Math.pow(u-s,2))),r=h,s=u}var l=n.length-3;n[2]=1,function t(n,i,e,r){for(var s,o=r,a=e-i>>1,h=e-i,u=n[i],l=n[i+1],c=n[e],f=n[e+1],d=i+3;d<e;d+=3){var y=j(n[d],n[d+1],u,l,c,f);if(y>o)s=d,o=y;else if(y===o){var v=Math.abs(d-a);v<h&&(s=d,h=v)}}o>r&&(s-i>3&&t(n,i,s,r),n[s+2]=o,e-s>3&&t(n,s,e,r))}(n,0,l,i),n[l+2]=1,n.size=Math.abs(o),n.start=0,n.end=n.size}function W(t,n,i,e){for(var r=0;r<t.length;r++){var s=[];$(t[r],s,i,e),n.push(s)}}function q(t){return t/360+.5}function B(t){var n=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return i<0?0:i>1?1:i}function G(t,n,i,e,r,s,o,a){if(e/=n,s>=(i/=n)&&o<e)return t;if(o<i||s>=e)return null;for(var h=[],u=0;u<t.length;u++){var l=t[u],c=l.geometry,f=l.type,d=0===r?l.minX:l.minY,y=0===r?l.maxX:l.maxY;if(d>=i&&y<e)h.push(l);else if(!(y<i||d>=e)){var v=[];if("Point"===f||"MultiPoint"===f)J(c,v,i,e,r);else if("LineString"===f)X(c,v,i,e,r,!1,a.lineMetrics);else if("MultiLineString"===f)Y(c,v,i,e,r,!1);else if("Polygon"===f)Y(c,v,i,e,r,!0);else if("MultiPolygon"===f)for(var p=0;p<c.length;p++){var m=[];Y(c[p],m,i,e,r,!0),m.length&&v.push(m)}if(v.length){if(a.lineMetrics&&"LineString"===f){for(p=0;p<v.length;p++)h.push(N(l.id,f,v[p],l.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===v.length?(f="LineString",v=v[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===v.length?"Point":"MultiPoint"),h.push(N(l.id,f,v,l.tags))}}}return h.length?h:null}function J(t,n,i,e,r){for(var s=0;s<t.length;s+=3){var o=t[s+r];o>=i&&o<=e&&(n.push(t[s]),n.push(t[s+1]),n.push(t[s+2]))}}function X(t,n,i,e,r,s,o){for(var a,h,u=Z(t),l=0===r?Q:tt,c=t.start,f=0;f<t.length-3;f+=3){var d=t[f],y=t[f+1],v=t[f+2],p=t[f+3],m=t[f+4],g=0===r?d:y,w=0===r?p:m,M=!1;o&&(a=Math.sqrt(Math.pow(d-p,2)+Math.pow(y-m,2))),g<i?w>i&&(h=l(u,d,y,p,m,i),o&&(u.start=c+a*h)):g>e?w<e&&(h=l(u,d,y,p,m,e),o&&(u.start=c+a*h)):K(u,d,y,v),w<i&&g>=i&&(h=l(u,d,y,p,m,i),M=!0),w>e&&g<=e&&(h=l(u,d,y,p,m,e),M=!0),!s&&M&&(o&&(u.end=c+a*h),n.push(u),u=Z(t)),o&&(c+=a)}var b=t.length-3;d=t[b],y=t[b+1],v=t[b+2],(g=0===r?d:y)>=i&&g<=e&&K(u,d,y,v),b=u.length-3,s&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&K(u,u[0],u[1],u[2]),u.length&&n.push(u)}function Z(t){var n=[];return n.size=t.size,n.start=t.start,n.end=t.end,n}function Y(t,n,i,e,r,s){for(var o=0;o<t.length;o++)X(t[o],n,i,e,r,s,!1)}function K(t,n,i,e){t.push(n),t.push(i),t.push(e)}function Q(t,n,i,e,r,s){var o=(s-n)/(e-n);return t.push(s),t.push(i+(r-i)*o),t.push(1),o}function tt(t,n,i,e,r,s){var o=(s-i)/(r-i);return t.push(n+(e-n)*o),t.push(s),t.push(1),o}function nt(t,n){for(var i=[],e=0;e<t.length;e++){var r,s=t[e],o=s.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)r=it(s.geometry,n);else if("MultiLineString"===o||"Polygon"===o){r=[];for(var a=0;a<s.geometry.length;a++)r.push(it(s.geometry[a],n))}else if("MultiPolygon"===o)for(r=[],a=0;a<s.geometry.length;a++){for(var h=[],u=0;u<s.geometry[a].length;u++)h.push(it(s.geometry[a][u],n));r.push(h)}i.push(N(s.id,o,r,s.tags))}return i}function it(t,n){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var e=0;e<t.length;e+=3)i.push(t[e]+n,t[e+1],t[e+2]);return i}function et(t,n){if(t.transformed)return t;var i,e,r,s=1<<t.z,o=t.x,a=t.y;for(i=0;i<t.features.length;i++){var h=t.features[i],u=h.geometry,l=h.type;if(h.geometry=[],1===l)for(e=0;e<u.length;e+=2)h.geometry.push(rt(u[e],u[e+1],n,s,o,a));else for(e=0;e<u.length;e++){var c=[];for(r=0;r<u[e].length;r+=2)c.push(rt(u[e][r],u[e][r+1],n,s,o,a));h.geometry.push(c)}}return t.transformed=!0,t}function rt(t,n,i,e,r,s){return[Math.round(i*(t*e-r)),Math.round(i*(n*e-s))]}function st(t,n,i,e,r){for(var s=n===r.maxZoom?0:r.tolerance/((1<<n)*r.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:e,z:n,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){o.numFeatures++,ot(o,t[a],s,r);var h=t[a].minX,u=t[a].minY,l=t[a].maxX,c=t[a].maxY;h<o.minX&&(o.minX=h),u<o.minY&&(o.minY=u),l>o.maxX&&(o.maxX=l),c>o.maxY&&(o.maxY=c)}return o}function ot(t,n,i,e){var r=n.geometry,s=n.type,o=[];if("Point"===s||"MultiPoint"===s)for(var a=0;a<r.length;a+=3)o.push(r[a]),o.push(r[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===s)at(o,r,t,i,!1,!1);else if("MultiLineString"===s||"Polygon"===s)for(a=0;a<r.length;a++)at(o,r[a],t,i,"Polygon"===s,0===a);else if("MultiPolygon"===s)for(var h=0;h<r.length;h++){var u=r[h];for(a=0;a<u.length;a++)at(o,u[a],t,i,!0,0===a)}if(o.length){var l=n.tags||null;if("LineString"===s&&e.lineMetrics){for(var c in l={},n.tags)l[c]=n.tags[c];l.mapbox_clip_start=r.start/r.size,l.mapbox_clip_end=r.end/r.size}var f={geometry:o,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:l};null!==n.id&&(f.id=n.id),t.features.push(f)}}function at(t,n,i,e,r,s){var o=e*e;if(e>0&&n.size<(r?o:e))i.numPoints+=n.length/3;else{for(var a=[],h=0;h<n.length;h+=3)(0===e||n[h+2]>o)&&(i.numSimplified++,a.push(n[h]),a.push(n[h+1])),i.numPoints++;r&&function(t,n){for(var i=0,e=0,r=t.length,s=r-2;e<r;s=e,e+=2)i+=(t[e]-t[s])*(t[e+1]+t[s+1]);if(i>0===n)for(e=0,r=t.length;e<r/2;e+=2){var o=t[e],a=t[e+1];t[e]=t[r-2-e],t[e+1]=t[r-1-e],t[r-2-e]=o,t[r-1-e]=a}}(a,s),t.push(a)}}function ht(t,n){var i=(n=this.options=function(t,n){for(var i in n)t[i]=n[i];return t}(Object.create(this.options),n)).debug;if(i&&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.");var e=function(t,n){var i=[];if("FeatureCollection"===t.type)for(var e=0;e<t.features.length;e++)V(i,t.features[e],n,e);else"Feature"===t.type?V(i,t,n):V(i,{geometry:t},n);return i}(t,n);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",n.indexMaxZoom,n.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(e=function(t,n){var i=n.buffer/n.extent,e=t,r=G(t,1,-1-i,i,0,-1,2,n),s=G(t,1,1-i,2+i,0,-1,2,n);return(r||s)&&(e=G(t,1,-i,1+i,0,-1,2,n)||[],r&&(e=nt(r,1).concat(e)),s&&(e=e.concat(nt(s,-1)))),e}(e,n)).length&&this.splitTile(e,0,0,0),i&&(e.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function ut(t,n,i){return 32*((1<<t)*i+n)+t}function lt(t,n,i,e,r,s){const o=i&&Array.isArray(i[0]);for(let a=0,h=i.length;a<h;a++){t[n]=Math.round((o?i[a][0]:i[a].x)*e),t[n+1]=Math.round((o?i[a][1]:i[a].y)*e);let u=r||0;Array.isArray(r)&&(u=r[a]),u=u?Math.round(e*u):0,t[n+2]=u,n+=3,s&&0!==a&&a!==h-1&&(t[n]=t[n-3],t[n+1]=t[n-2],t[n+2]=t[n-1],n+=3)}return n}function ct(t,n,i,e){const r=t[3*n],s=t[3*n+1],o=t[3*i],a=t[3*i+1];return r===o&&(r<0||r>e)||s===a&&(s<0||s>e)}C.getJSON=function(t,n,i){if(S(n)){const t=i;i=n,n=t}const e=function(t,n){const e="string"==typeof n?JSON.parse(n):n||null;i(t,e)};return n&&n.jsonp?C.jsonp(t,e):((n=n||{}).returnJSON=!0,C.get(t,n,e))},ht.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ht.prototype.splitTile=function(t,n,i,e,r,s,o){for(var a=[t,n,i,e],h=this.options,u=h.debug;a.length;){e=a.pop(),i=a.pop(),n=a.pop(),t=a.pop();var l=1<<n,c=ut(n,i,e),f=this.tiles[c];if(!f&&(u>1&&console.time("creation"),f=this.tiles[c]=st(t,n,i,e,h),this.tileCoords.push({z:n,x:i,y:e}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",n,i,e,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var d="z"+n;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(f.source=t,r){if(n===h.maxZoom||n===r)continue;var y=1<<r-n;if(i!==Math.floor(s/y)||e!==Math.floor(o/y))continue}else if(n===h.indexMaxZoom||f.numPoints<=h.indexMaxPoints)continue;if(f.source=null,0!==t.length){u>1&&console.time("clipping");var v,p,m,g,w,M,b=.5*h.buffer/h.extent,x=.5-b,F=.5+b,A=1+b;v=p=m=g=null,w=G(t,l,i-b,i+F,0,f.minX,f.maxX,h),M=G(t,l,i+x,i+A,0,f.minX,f.maxX,h),t=null,w&&(v=G(w,l,e-b,e+F,1,f.minY,f.maxY,h),p=G(w,l,e+x,e+A,1,f.minY,f.maxY,h),w=null),M&&(m=G(M,l,e-b,e+F,1,f.minY,f.maxY,h),g=G(M,l,e+x,e+A,1,f.minY,f.maxY,h),M=null),u>1&&console.timeEnd("clipping"),a.push(v||[],n+1,2*i,2*e),a.push(p||[],n+1,2*i,2*e+1),a.push(m||[],n+1,2*i+1,2*e),a.push(g||[],n+1,2*i+1,2*e+1)}}},ht.prototype.getTile=function(t,n,i){var e=this.options,r=e.extent,s=e.debug;if(t<0||t>24)return null;var o=1<<t,a=ut(t,n=(n%o+o)%o,i);if(this.tiles[a])return et(this.tiles[a],r);s>1&&console.log("drilling down to z%d-%d-%d",t,n,i);for(var h,u=t,l=n,c=i;!h&&u>0;)u--,l=Math.floor(l/2),c=Math.floor(c/2),h=this.tiles[ut(u,l,c)];return h&&h.source?(s>1&&console.log("found parent tile z%d-%d-%d",u,l,c),s>1&&console.time("drilling down"),this.splitTile(h.source,u,l,c,t,n,i),s>1&&console.timeEnd("drilling down"),this.tiles[a]?et(this.tiles[a],r):null):null};class ft{constructor(t,n){this.x=t,this.y=n}clone(){return new ft(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 ft(this.x-t.x,this.y-t.y)}distance(t){const n=this.x-t.x,i=this.y-t.y;return Math.sqrt(n*n+i*i)}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 ft(this.y,-this.x)}}function dt(t,n,i){const e=(n.x-t.x)*(i.y-t.y)-(n.y-t.y)*(i.x-t.x);return e>1e-5?1:e<-1e-5?2:0}function yt(t,n,i,e){const r=n.x*e.y-n.y*e.x,s=i.x-t.x,o=i.y-t.y,a=(s*e.y-o*e.x)/r;return new ft(t.x+a*n.x,t.y+a*n.y)}const vt=[];function pt(t,n,i){let e=0;const r=[];for(let s=n;s<i;s+=3)vt[e]?(vt[e].x=t[s],vt[e].y=t[s+1]):vt[e]=new ft(t[s],t[s+1]),r.push(vt[e]),e++;const s=function(t){let n;this.UpdateOmbb=function(t,i,e,r,s,o,a,h){const u=yt(t,i,s,o),l=yt(e,r,s,o),c=yt(a,h,t,i),f=yt(a,h,e,r),d=u.distance(l)*u.distance(c);d<this.BestObbArea&&(n=[u,c,f,l],this.BestObbArea=d)},this.BestObbArea=Number.MAX_VALUE;const i=[];for(let n=0;n<t.length;n++)i.push(t[(n+1)%t.length].diff(t[n])),i[n].normalize();const e=new ft(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new ft(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);let s,o,a,h;for(let n=0;n<t.length;n++){const i=t[n];i.x<e.x&&(e.x=i.x,s=n),i.x>r.x&&(r.x=i.x,o=n),i.y<e.y&&(e.y=i.y,h=n),i.y>r.y&&(r.y=i.y,a=n)}let u=new ft(0,-1),l=new ft(0,1),c=new ft(-1,0),f=new ft(1,0);for(let n=0;n<t.length;n++){const n=[Math.acos(u.dot(i[s])),Math.acos(l.dot(i[o])),Math.acos(c.dot(i[a])),Math.acos(f.dot(i[h]))];switch(n.indexOf(Math.min.apply(Math,n))){case 0:u=i[s].clone(),l=u.clone(),l.negate(),c=u.orthogonal(),f=c.clone(),f.negate(),s=(s+1)%t.length;break;case 1:l=i[o].clone(),u=l.clone(),u.negate(),c=u.orthogonal(),f=c.clone(),f.negate(),o=(o+1)%t.length;break;case 2:c=i[a].clone(),f=c.clone(),f.negate(),u=f.orthogonal(),l=u.clone(),l.negate(),a=(a+1)%t.length;break;case 3:f=i[h].clone(),c=f.clone(),c.negate(),u=f.orthogonal(),l=u.clone(),l.negate(),h=(h+1)%t.length}this.UpdateOmbb(t[s],u,t[o],l,t[a],c,t[h],f)}return n}(function(t){if(t.length<3)return t;let n=t[0];const i=[];for(let i=1;i<t.length;i++)(t[i].x<n.x||Math.abs(t[i].x-n.x)<1e-5&&t[i].y<n.y)&&(n=t[i]);let e=t[0];do{i.unshift(n.clone());for(let i=1;i<t.length;i++){const r=dt(n,e,t[i]);(e.equals(n)||1===r||0===r&&n.distance(t[i])>n.distance(e))&&(e=t[i])}n=e}while(!e.equals(i[i.length-1]));return i}(r)),o=s[0].distance(s[1]),a=s[1].distance(s[2]),h=s.map(t=>[t.x,t.y]);return h.push(+(a>o)),h}var mt="undefined"!=typeof Float32Array?Float32Array:Array;function gt(){var t=new mt(3);return mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function wt(t,n,i){var e=new mt(3);return e[0]=t,e[1]=n,e[2]=i,e}function Mt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function bt(t,n,i,e){return t[0]=n,t[1]=i,t[2]=e,t}function xt(t,n,i){return t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function Ft(t,n,i){return t[0]=n[0]/i[0],t[1]=n[1]/i[1],t[2]=n[2]/i[2],t}function At(t,n){var i=n[0],e=n[1],r=n[2],s=i*i+e*e+r*r;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 kt(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Pt(t,n,i){var e=n[0],r=n[1],s=n[2],o=i[0],a=i[1],h=i[2];return t[0]=r*h-s*a,t[1]=s*o-e*h,t[2]=e*a-r*o,t}var St=function(t,n,i){return t[0]=n[0]-i[0],t[1]=n[1]-i[1],t[2]=n[2]-i[2],t};function _t(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function Ot(t,n,i,e,r){return t[0]=n,t[1]=i,t[2]=e,t[3]=r,t}function It(){var t=new mt(4);return mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Tt(t,n){var i=n[0]+n[4]+n[8],e=void 0;if(i>0)e=Math.sqrt(i+1),t[3]=.5*e,e=.5/e,t[0]=(n[5]-n[7])*e,t[1]=(n[6]-n[2])*e,t[2]=(n[1]-n[3])*e;else{var r=0;n[4]>n[0]&&(r=1),n[8]>n[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;e=Math.sqrt(n[3*r+r]-n[3*s+s]-n[3*o+o]+1),t[r]=.5*e,e=.5/e,t[3]=(n[3*s+o]-n[3*o+s])*e,t[s]=(n[3*s+r]+n[3*r+s])*e,t[o]=(n[3*o+r]+n[3*r+o])*e}return t}gt(),function(){var t,n=(t=new mt(4),mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var Lt,Ut=function(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=n[3]*i,t},zt=function(t,n){var i=n[0],e=n[1],r=n[2],s=n[3],o=i*i+e*e+r*r+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=i*o,t[1]=e*o,t[2]=r*o,t[3]=s*o),t};function Dt(t,n){var i=n[0]-t[0],e=n[1]-t[1];return Math.sqrt(i*i+e*e)}function Et(t,n,i,e,r,s,o,a,h,u){0===t?function(t,n,i,e,r,s,o,a,h){const u=[0,0];for(let r=t;r<n;r+=3){const t=r/3*2,n=e[r],l=e[r+1];i[t]=u[0]+n*s*o/a,i[t+1]=u[1]-l*s*o/h}}(n,i,e,r,0,o,a,h,u):1===t&&function(t,n,i,e){const r=pt(e,t,n),s=r[4],o=r[s],a=r[s+1],h=r[s+2],u=(a[1]-o[1])/(a[0]-o[0]),l=(h[1]-a[1])/(h[0]-a[0]),c=Dt(o,a),f=Dt(a,h);for(let r=t;r<n;r+=3){const t=r/3*2,n=e[r],s=e[r+1];i[t]=jt(n,s,o,u,c),i[t+1]=-jt(n,s,a,l,f)}}(n,i,e,r)}gt(),wt(1,0,0),wt(0,1,0),It(),It(),Lt=new mt(9),mt!=Float32Array&&(Lt[1]=0,Lt[2]=0,Lt[3]=0,Lt[5]=0,Lt[6]=0,Lt[7]=0),Lt[0]=1,Lt[4]=1,Lt[8]=1,function(){var t=function(){var t=new mt(2);return mt!=Float32Array&&(t[0]=0,t[1]=0),t}()}();const Ct=[];function jt(t,n,i,e,r){return Ct[0]=(e*e*i[0]+e*(n-i[1])+t)/(e*e+1),Ct[1]=e*(Ct[0]-i[0])+i[1],Dt(i,Ct)/r}function Nt(t,n,i,e,r){const s=3*n[i-1],o=3*n[i-1]+1,a=t[s],h=t[o];return u=e,l=r,c=a,f=h,Math.sqrt((c-u)*(c-u)+(f-l)*(f-l));var u,l,c,f}"undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self&&self;var Ht=Vt;function Vt(t,n){this.x=t,this.y=n}function Rt(t,n,i){i=i||{},this.w=t||64,this.h=n||64,this.autoResize=!!i.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function $t(t,n,i){this.x=0,this.y=t,this.w=this.free=n,this.h=i}function Wt(t,n,i,e,r,s,o){this.id=t,this.x=n,this.y=i,this.w=e,this.h=r,this.maxw=s||e,this.maxh=o||r,this.refcount=0}Vt.prototype={clone:function(){return new Vt(this.x,this.y)},add:function(t){return this.clone().u(t)},sub:function(t){return this.clone().v(t)},multByPoint:function(t){return this.clone().m(t)},divByPoint:function(t){return this.clone().M(t)},mult:function(t){return this.clone().F(t)},div:function(t){return this.clone().A(t)},rotate:function(t){return this.clone().k(t)},rotateAround:function(t,n){return this.clone().P(t,n)},matMult:function(t){return this.clone().S(t)},unit:function(){return this.clone()._()},perp:function(){return this.clone().O()},round:function(){return this.clone().I()},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,i=t.y-this.y;return n*n+i*i},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)},S:function(t){var n=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=i,this},u:function(t){return this.x+=t.x,this.y+=t.y,this},v:function(t){return this.x-=t.x,this.y-=t.y,this},F:function(t){return this.x*=t,this.y*=t,this},A:function(t){return this.x/=t,this.y/=t,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},_:function(){return this.A(this.mag()),this},O:function(){var t=this.y;return this.y=this.x,this.x=-t,this},k:function(t){var n=Math.cos(t),i=Math.sin(t),e=n*this.x-i*this.y,r=i*this.x+n*this.y;return this.x=e,this.y=r,this},P:function(t,n){var i=Math.cos(t),e=Math.sin(t),r=n.x+i*(this.x-n.x)-e*(this.y-n.y),s=n.y+e*(this.x-n.x)+i*(this.y-n.y);return this.x=r,this.y=s,this},I:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Vt.convert=function(t){return t instanceof Vt?t:Array.isArray(t)?new Vt(t[0],t[1]):t},Rt.prototype.pack=function(t,n){t=[].concat(t),n=n||{};for(var i,e,r,s,o=[],a=0;a<t.length;a++)if(i=t[a].w||t[a].width,e=t[a].h||t[a].height,r=t[a].id,i&&e){if(!(s=this.packOne(i,e,r)))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},Rt.prototype.packOne=function(t,n,i){var e,r,s,o,a,h,u,l,c={freebin:-1,shelf:-1,waste:1/0},f=0;if("string"==typeof i||"number"==typeof i){if(e=this.getBin(i))return this.ref(e),e;"number"==typeof i&&(this.maxId=Math.max(i,this.maxId))}else i=++this.maxId;for(o=0;o<this.freebins.length;o++){if(n===(e=this.freebins[o]).maxh&&t===e.maxw)return this.allocFreebin(o,t,n,i);n>e.maxh||t>e.maxw||n<=e.maxh&&t<=e.maxw&&(s=e.maxw*e.maxh-t*n)<c.waste&&(c.waste=s,c.freebin=o)}for(o=0;o<this.shelves.length;o++)if(f+=(r=this.shelves[o]).h,!(t>r.free)){if(n===r.h)return this.allocShelf(o,t,n,i);n>r.h||n<r.h&&(s=(r.h-n)*t)<c.waste&&(c.freebin=-1,c.waste=s,c.shelf=o)}return-1!==c.freebin?this.allocFreebin(c.freebin,t,n,i):-1!==c.shelf?this.allocShelf(c.shelf,t,n,i):n<=this.h-f&&t<=this.w?(r=new $t(f,this.w,n),this.allocShelf(this.shelves.push(r)-1,t,n,i)):this.autoResize?(a=h=this.h,((u=l=this.w)<=a||t>u)&&(l=2*Math.max(t,u)),(a<u||n>a)&&(h=2*Math.max(n,a)),this.resize(l,h),this.packOne(t,n,i)):null},Rt.prototype.allocFreebin=function(t,n,i,e){var r=this.freebins.splice(t,1)[0];return r.id=e,r.w=n,r.h=i,r.refcount=0,this.bins[e]=r,this.ref(r),r},Rt.prototype.allocShelf=function(t,n,i,e){var r=this.shelves[t].alloc(n,i,e);return this.bins[e]=r,this.ref(r),r},Rt.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,n=0,i=0;i<this.shelves.length;i++){var e=this.shelves[i];n+=e.h,t=Math.max(e.w-e.free,t)}this.resize(t,n)}},Rt.prototype.getBin=function(t){return this.bins[t]},Rt.prototype.ref=function(t){if(1==++t.refcount){var n=t.h;this.stats[n]=1+(0|this.stats[n])}return t.refcount},Rt.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)},Rt.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},Rt.prototype.resize=function(t,n){this.w=t,this.h=n;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(t);return!0},$t.prototype.alloc=function(t,n,i){if(t>this.free||n>this.h)return null;var e=this.x;return this.x+=t,this.free-=t,new Wt(i,e,this.y,t,n,t,this.h)},$t.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0};var qt={exports:{}};qt.exports=function(){function t(t,n,i){var e=t[n];t[n]=t[i],t[i]=e}function n(t,n){return t<n?-1:t>n?1:0}return function(i,e,r,s,o){!function n(i,e,r,s,o){for(;s>r;){if(s-r>600){var a=s-r+1,h=e-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(h-a/2<0?-1:1),f=Math.max(r,Math.floor(e-h*l/a+c)),d=Math.min(s,Math.floor(e+(a-h)*l/a+c));n(i,e,f,d,o)}var y=i[e],v=r,p=s;for(t(i,r,e),o(i[s],y)>0&&t(i,r,s);v<p;){for(t(i,v,p),v++,p--;o(i[v],y)<0;)v++;for(;o(i[p],y)>0;)p--}0===o(i[r],y)?t(i,r,p):(p++,t(i,p,s)),p<=e&&(r=p+1),e<=p&&(s=p-1)}}(i,e,r||0,s||i.length-1,o||n)}}();var Bt=qt.exports,Gt={exports:{}};function Jt(t,n){if(!(this instanceof Jt))return new Jt(t,n);if(this.data=t||[],this.length=this.data.length,this.compare=n||Xt,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this.T(i)}function Xt(t,n){return t<n?-1:t>n?1:0}Gt.exports=Jt,Gt.exports.default=Jt,Jt.prototype={push:function(t){this.data.push(t),this.length++,this.L(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this.T(0)),this.data.pop(),t}},peek:function(){return this.data[0]},L:function(t){for(var n=this.data,i=this.compare,e=n[t];t>0;){var r=t-1>>1,s=n[r];if(i(e,s)>=0)break;n[t]=s,t=r}n[t]=e},T:function(t){for(var n=this.data,i=this.compare,e=this.length>>1,r=n[t];t<e;){var s=1+(t<<1),o=s+1,a=n[s];if(o<this.length&&i(n[o],a)<0&&(s=o,a=n[o]),i(a,r)>=0)break;n[t]=a,t=s}n[t]=r}};var Zt=Gt.exports,Yt={exports:{}},Kt={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:{}},tn=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))},nn=Array.prototype.concat,en=Array.prototype.slice,rn=Qt.exports=function(t){for(var n=[],i=0,e=t.length;i<e;i++){var r=t[i];tn(r)?n=nn.call(n,en.call(r)):n.push(r)}return n};rn.wrap=function(t){return function(){return t(rn(arguments))}};var sn=Kt,on=Qt.exports,an=Object.hasOwnProperty,hn={};for(var un in sn)an.call(sn,un)&&(hn[sn[un]]=un);var ln=Yt.exports={to:{},get:{}};function cn(t,n,i){return Math.min(Math.max(n,t),i)}function fn(t){var n=Math.round(t).toString(16).toUpperCase();return n.length<2?"0"+n:n}ln.get=function(t){var n,i;switch(t.substring(0,3).toLowerCase()){case"hsl":n=ln.get.hsl(t),i="hsl";break;case"hwb":n=ln.get.hwb(t),i="hwb";break;default:n=ln.get.rgb(t),i="rgb"}return n?{model:i,value:n}:null},ln.get.rgb=function(t){if(!t)return null;var n,i,e,r=[0,0,0,1];if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(e=n[2],n=n[1],i=0;i<3;i++){var s=2*i;r[i]=parseInt(n.slice(s,s+2),16)}e&&(r[3]=parseInt(e,16)/255)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(e=(n=n[1])[3],i=0;i<3;i++)r[i]=parseInt(n[i]+n[i],16);e&&(r[3]=parseInt(e+e,16)/255)}else if(n=t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)){for(i=0;i<3;i++)r[i]=parseInt(n[i+1],0);n[4]&&(n[5]?r[3]=.01*parseFloat(n[4]):r[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]:an.call(sn,n[1])?((r=sn[n[1]])[3]=1,r):null:null;for(i=0;i<3;i++)r[i]=Math.round(2.55*parseFloat(n[i+1]));n[4]&&(n[5]?r[3]=.01*parseFloat(n[4]):r[3]=parseFloat(n[4]))}for(i=0;i<3;i++)r[i]=cn(r[i],0,255);return r[3]=cn(r[3],0,1),r},ln.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 i=parseFloat(n[4]);return[(parseFloat(n[1])%360+360)%360,cn(parseFloat(n[2]),0,100),cn(parseFloat(n[3]),0,100),cn(isNaN(i)?1:i,0,1)]}return null},ln.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 i=parseFloat(n[4]);return[(parseFloat(n[1])%360+360)%360,cn(parseFloat(n[2]),0,100),cn(parseFloat(n[3]),0,100),cn(isNaN(i)?1:i,0,1)]}return null},ln.to.hex=function(){var t=on(arguments);return"#"+fn(t[0])+fn(t[1])+fn(t[2])+(t[3]<1?fn(Math.round(255*t[3])):"")},ln.to.rgb=function(){var t=on(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]+")"},ln.to.rgb.percent=function(){var t=on(arguments),n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),e=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+n+"%, "+i+"%, "+e+"%)":"rgba("+n+"%, "+i+"%, "+e+"%, "+t[3]+")"},ln.to.hsl=function(){var t=on(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},ln.to.hwb=function(){var t=on(arguments),n="";return t.length>=4&&1!==t[3]&&(n=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+n+")"},ln.to.keyword=function(t){return hn[t.slice(0,3)]};var dn={exports:{}},yn=Kt,vn={};for(var pn in yn)yn.hasOwnProperty(pn)&&(vn[yn[pn]]=pn);var mn=dn.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 gn in mn)if(mn.hasOwnProperty(gn)){if(!("channels"in mn[gn]))throw new Error("missing channels property: "+gn);if(!("labels"in mn[gn]))throw new Error("missing channel labels property: "+gn);if(mn[gn].labels.length!==mn[gn].channels)throw new Error("channel and label counts mismatch: "+gn);var wn=mn[gn].channels,Mn=mn[gn].labels;delete mn[gn].channels,delete mn[gn].labels,Object.defineProperty(mn[gn],"channels",{value:wn}),Object.defineProperty(mn[gn],"labels",{value:Mn})}function bn(t,n){return Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)+Math.pow(t[2]-n[2],2)}mn.rgb.hsl=function(t){var n,i,e=t[0]/255,r=t[1]/255,s=t[2]/255,o=Math.min(e,r,s),a=Math.max(e,r,s),h=a-o;return a===o?n=0:e===a?n=(r-s)/h:r===a?n=2+(s-e)/h:s===a&&(n=4+(e-r)/h),(n=Math.min(60*n,360))<0&&(n+=360),i=(o+a)/2,[n,100*(a===o?0:i<=.5?h/(a+o):h/(2-a-o)),100*i]},mn.rgb.hsv=function(t){var n,i,e,r,s,o=t[0]/255,a=t[1]/255,h=t[2]/255,u=Math.max(o,a,h),l=u-Math.min(o,a,h),c=function(t){return(u-t)/6/l+.5};return 0===l?r=s=0:(s=l/u,n=c(o),i=c(a),e=c(h),o===u?r=e-i:a===u?r=1/3+n-e:h===u&&(r=2/3+i-n),r<0?r+=1:r>1&&(r-=1)),[360*r,100*s,100*u]},mn.rgb.hwb=function(t){var n=t[0],i=t[1],e=t[2];return[mn.rgb.hsl(t)[0],100*(1/255*Math.min(n,Math.min(i,e))),100*(e=1-1/255*Math.max(n,Math.max(i,e)))]},mn.rgb.cmyk=function(t){var n,i=t[0]/255,e=t[1]/255,r=t[2]/255;return[100*((1-i-(n=Math.min(1-i,1-e,1-r)))/(1-n)||0),100*((1-e-n)/(1-n)||0),100*((1-r-n)/(1-n)||0),100*n]},mn.rgb.keyword=function(t){var n=vn[t];if(n)return n;var i,e=1/0;for(var r in yn)if(yn.hasOwnProperty(r)){var s=bn(t,yn[r]);s<e&&(e=s,i=r)}return i},mn.keyword.rgb=function(t){return yn[t]},mn.rgb.xyz=function(t){var n=t[0]/255,i=t[1]/255,e=t[2]/255;return[100*(.4124*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)),100*(.2126*n+.7152*i+.0722*e),100*(.0193*n+.1192*i+.9505*e)]},mn.rgb.lab=function(t){var n=mn.rgb.xyz(t),i=n[0],e=n[1],r=n[2];return e/=100,r/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116)-16,500*(i-e),200*(e-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},mn.hsl.rgb=function(t){var n,i,e,r,s,o=t[0]/360,a=t[1]/100,h=t[2]/100;if(0===a)return[s=255*h,s,s];n=2*h-(i=h<.5?h*(1+a):h+a-h*a),r=[0,0,0];for(var u=0;u<3;u++)(e=o+1/3*-(u-1))<0&&e++,e>1&&e--,s=6*e<1?n+6*(i-n)*e:2*e<1?i:3*e<2?n+(i-n)*(2/3-e)*6:n,r[u]=255*s;return r},mn.hsl.hsv=function(t){var n=t[0],i=t[1]/100,e=t[2]/100,r=i,s=Math.max(e,.01);return i*=(e*=2)<=1?e:2-e,r*=s<=1?s:2-s,[n,100*(0===e?2*r/(s+r):2*i/(e+i)),100*((e+i)/2)]},mn.hsv.rgb=function(t){var n=t[0]/60,i=t[1]/100,e=t[2]/100,r=Math.floor(n)%6,s=n-Math.floor(n),o=255*e*(1-i),a=255*e*(1-i*s),h=255*e*(1-i*(1-s));switch(e*=255,r){case 0:return[e,h,o];case 1:return[a,e,o];case 2:return[o,e,h];case 3:return[o,a,e];case 4:return[h,o,e];case 5:return[e,o,a]}},mn.hsv.hsl=function(t){var n,i,e,r=t[0],s=t[1]/100,o=t[2]/100,a=Math.max(o,.01);return e=(2-s)*o,i=s*a,[r,100*(i=(i/=(n=(2-s)*a)<=1?n:2-n)||0),100*(e/=2)]},mn.hwb.rgb=function(t){var n,i,e,r,s,o,a,h=t[0]/360,u=t[1]/100,l=t[2]/100,c=u+l;switch(c>1&&(u/=c,l/=c),e=6*h-(n=Math.floor(6*h)),0!=(1&n)&&(e=1-e),r=u+e*((i=1-l)-u),n){default:case 6:case 0:s=i,o=r,a=u;break;case 1:s=r,o=i,a=u;break;case 2:s=u,o=i,a=r;break;case 3:s=u,o=r,a=i;break;case 4:s=r,o=u,a=i;break;case 5:s=i,o=u,a=r}return[255*s,255*o,255*a]},mn.cmyk.rgb=function(t){var n=t[0]/100,i=t[1]/100,e=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r)),255*(1-Math.min(1,e*(1-r)+r))]},mn.xyz.rgb=function(t){var n,i,e,r=t[0]/100,s=t[1]/100,o=t[2]/100;return i=-.9689*r+1.8758*s+.0415*o,e=.0557*r+-.204*s+1.057*o,n=(n=3.2406*r+-1.5372*s+-.4986*o)>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,[255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1)),255*(e=Math.min(Math.max(0,e),1))]},mn.xyz.lab=function(t){var n=t[0],i=t[1],e=t[2];return i/=100,e/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116))]},mn.lab.xyz=function(t){var n,i,e,r=t[0];n=t[1]/500+(i=(r+16)/116),e=i-t[2]/200;var s=Math.pow(i,3),o=Math.pow(n,3),a=Math.pow(e,3);return i=s>.008856?s:(i-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,[n*=95.047,i*=100,e*=108.883]},mn.lab.lch=function(t){var n,i=t[0],e=t[1],r=t[2];return(n=360*Math.atan2(r,e)/2/Math.PI)<0&&(n+=360),[i,Math.sqrt(e*e+r*r),n]},mn.lch.lab=function(t){var n,i=t[0],e=t[1];return n=t[2]/360*2*Math.PI,[i,e*Math.cos(n),e*Math.sin(n)]},mn.rgb.ansi16=function(t){var n=t[0],i=t[1],e=t[2],r=1 in arguments?arguments[1]:mn.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var s=30+(Math.round(e/255)<<2|Math.round(i/255)<<1|Math.round(n/255));return 2===r&&(s+=60),s},mn.hsv.ansi16=function(t){return mn.rgb.ansi16(mn.hsv.rgb(t),t[2])},mn.rgb.ansi256=function(t){var n=t[0],i=t[1],e=t[2];return n===i&&i===e?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(i/255*5)+Math.round(e/255*5)},mn.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 i=.5*(1+~~(t>50));return[(1&n)*i*255,(n>>1&1)*i*255,(n>>2&1)*i*255]},mn.ansi256.rgb=function(t){if(t>=232){var n=10*(t-232)+8;return[n,n,n]}var i;return t-=16,[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},mn.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},mn.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 i=n[0];3===n[0].length&&(i=i.split("").map((function(t){return t+t})).join(""));var e=parseInt(i,16);return[e>>16&255,e>>8&255,255&e]},mn.rgb.hcg=function(t){var n,i=t[0]/255,e=t[1]/255,r=t[2]/255,s=Math.max(Math.max(i,e),r),o=Math.min(Math.min(i,e),r),a=s-o;return n=a<=0?0:s===i?(e-r)/a%6:s===e?2+(r-i)/a:4+(i-e)/a+4,n/=6,[360*(n%=1),100*a,100*(a<1?o/(1-a):0)]},mn.hsl.hcg=function(t){var n=t[1]/100,i=t[2]/100,e=1,r=0;return(e=i<.5?2*n*i:2*n*(1-i))<1&&(r=(i-.5*e)/(1-e)),[t[0],100*e,100*r]},mn.hsv.hcg=function(t){var n=t[1]/100,i=t[2]/100,e=n*i,r=0;return e<1&&(r=(i-e)/(1-e)),[t[0],100*e,100*r]},mn.hcg.rgb=function(t){var n=t[0]/360,i=t[1]/100,e=t[2]/100;if(0===i)return[255*e,255*e,255*e];var r,s=[0,0,0],o=n%1*6,a=o%1,h=1-a;switch(Math.floor(o)){case 0:s[0]=1,s[1]=a,s[2]=0;break;case 1:s[0]=h,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]=h,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]=h}return r=(1-i)*e,[255*(i*s[0]+r),255*(i*s[1]+r),255*(i*s[2]+r)]},mn.hcg.hsv=function(t){var n=t[1]/100,i=n+t[2]/100*(1-n),e=0;return i>0&&(e=n/i),[t[0],100*e,100*i]},mn.hcg.hsl=function(t){var n=t[1]/100,i=t[2]/100*(1-n)+.5*n,e=0;return i>0&&i<.5?e=n/(2*i):i>=.5&&i<1&&(e=n/(2*(1-i))),[t[0],100*e,100*i]},mn.hcg.hwb=function(t){var n=t[1]/100,i=n+t[2]/100*(1-n);return[t[0],100*(i-n),100*(1-i)]},mn.hwb.hcg=function(t){var n=t[1]/100,i=1-t[2]/100,e=i-n,r=0;return e<1&&(r=(i-e)/(1-e)),[t[0],100*e,100*r]},mn.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},mn.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},mn.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},mn.gray.hsl=mn.gray.hsv=function(t){return[0,0,t[0]]},mn.gray.hwb=function(t){return[0,100,t[0]]},mn.gray.cmyk=function(t){return[0,0,0,t[0]]},mn.gray.lab=function(t){return[t[0],0,0]},mn.gray.hex=function(t){var n=255&Math.round(t[0]/100*255),i=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(i.length)+i},mn.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var xn=dn.exports;function Fn(t){var n=function(){for(var t={},n=Object.keys(xn),i=n.length,e=0;e<i;e++)t[n[e]]={distance:-1,parent:null};return t}(),i=[t];for(n[t].distance=0;i.length;)for(var e=i.pop(),r=Object.keys(xn[e]),s=r.length,o=0;o<s;o++){var a=r[o],h=n[a];-1===h.distance&&(h.distance=n[e].distance+1,h.parent=e,i.unshift(a))}return n}function An(t,n){return function(i){return n(t(i))}}function kn(t,n){for(var i=[n[t].parent,t],e=xn[n[t].parent][t],r=n[t].parent;n[r].parent;)i.unshift(n[r].parent),e=An(xn[n[r].parent][r],e),r=n[r].parent;return e.conversion=i,e}var Pn=dn.exports,Sn=function(t){for(var n=Fn(t),i={},e=Object.keys(n),r=e.length,s=0;s<r;s++){var o=e[s];null!==n[o].parent&&(i[o]=kn(o,n))}return i},_n={};Object.keys(Pn).forEach((function(t){_n[t]={},Object.defineProperty(_n[t],"channels",{value:Pn[t].channels}),Object.defineProperty(_n[t],"labels",{value:Pn[t].labels});var n=Sn(t);Object.keys(n).forEach((function(i){var e=n[i];_n[t][i]=function(t){var n=function(n){if(null==n)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var i=t(n);if("object"==typeof i)for(var e=i.length,r=0;r<e;r++)i[r]=Math.round(i[r]);return i};return"conversion"in t&&(n.conversion=t.conversion),n}(e),_n[t][i].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}(e)}))}));var On=_n,In=Yt.exports,Tn=On,Ln=[].slice,Un=["keyword","gray","hex"],zn={};Object.keys(Tn).forEach((function(t){zn[Ln.call(Tn[t].labels).sort().join("")]=t}));var Dn={};function En(t,n){if(!(this instanceof En))return new En(t,n);if(n&&n in Un&&(n=null),n&&!(n in Tn))throw new Error("Unknown model: "+n);var i,e;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof En)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var r=In.get(t);if(null===r)throw new Error("Unable to parse color from string: "+t);this.model=r.model,e=Tn[this.model].channels,this.color=r.value.slice(0,e),this.valpha="number"==typeof r.value[e]?r.value[e]:1}else if(t.length){this.model=n||"rgb",e=Tn[this.model].channels;var s=Ln.call(t,0,e);this.color=Hn(s,e),this.valpha="number"==typeof t[e]?t[e]: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 zn))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=zn[a];var h=Tn[this.model].labels,u=[];for(i=0;i<h.length;i++)u.push(t[h[i]]);this.color=Hn(u)}if(Dn[this.model])for(e=Tn[this.model].channels,i=0;i<e;i++){var l=Dn[this.model][i];l&&(this.color[i]=l(this.color[i]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function Cn(t,n,i){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(Dn[t]||(Dn[t]=[]))[n]=i})),t=t[0],function(e){var r;return arguments.length?(i&&(e=i(e)),(r=this[t]()).color[n]=e,r):(r=this[t]().color[n],i&&(r=i(r)),r)}}function jn(t){return function(n){return Math.max(0,Math.min(t,n))}}function Nn(t){return Array.isArray(t)?t:[t]}function Hn(t,n){for(var i=0;i<n;i++)"number"!=typeof t[i]&&(t[i]=0);return t}En.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var n=this.model in In.to?this:this.rgb(),i=1===(n=n.round("number"==typeof t?t:1)).valpha?n.color:n.color.concat(this.valpha);return In.to[n.model](i)},percentString:function(t){var n=this.rgb().round("number"==typeof t?t:1),i=1===n.valpha?n.color:n.color.concat(this.valpha);return In.to.rgb.percent(i)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},n=Tn[this.model].channels,i=Tn[this.model].labels,e=0;e<n;e++)t[i[e]]=this.color[e];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 En(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 En(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:Cn("rgb",0,jn(255)),green:Cn("rgb",1,jn(255)),blue:Cn("rgb",2,jn(255)),hue:Cn(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:Cn("hsl",1,jn(100)),lightness:Cn("hsl",2,jn(100)),saturationv:Cn("hsv",1,jn(100)),value:Cn("hsv",2,jn(100)),chroma:Cn("hcg",1,jn(100)),gray:Cn("hcg",2,jn(100)),white:Cn("hwb",1,jn(100)),wblack:Cn("hwb",2,jn(100)),cyan:Cn("cmyk",0,jn(100)),magenta:Cn("cmyk",1,jn(100)),yellow:Cn("cmyk",2,jn(100)),black:Cn("cmyk",3,jn(100)),x:Cn("xyz",0,jn(100)),y:Cn("xyz",1,jn(100)),z:Cn("xyz",2,jn(100)),l:Cn("lab",0,jn(100)),a:Cn("lab",1),b:Cn("lab",2),keyword:function(t){return arguments.length?new En(t):Tn[this.model].keyword(this.color)},hex:function(t){return arguments.length?new En(t):In.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=[],i=0;i<t.length;i++){var e=t[i]/255;n[i]=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}return.2126*n[0]+.7152*n[1]+.0722*n[2]},contrast:function(t){var n=this.luminosity(),i=t.luminosity();return n>i?(n+.05)/(i+.05):(i+.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 En.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(),i=n.color[0];return i=(i=(i+t)%360)<0?360+i:i,n.color[0]=i,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 i=t.rgb(),e=this.rgb(),r=void 0===n?.5:n,s=2*r-1,o=i.alpha()-e.alpha(),a=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,h=1-a;return En.rgb(a*i.red()+h*e.red(),a*i.green()+h*e.green(),a*i.blue()+h*e.blue(),i.alpha()*r+e.alpha()*(1-r))}},Object.keys(Tn).forEach((function(t){if(-1===Un.indexOf(t)){var n=Tn[t].channels;En.prototype[t]=function(){if(this.model===t)return new En(this);if(arguments.length)return new En(arguments,t);var i="number"==typeof arguments[n]?n:this.valpha;return new En(Nn(Tn[this.model][t].raw(this.color)).concat(i),t)},En[t]=function(i){return"number"==typeof i&&(i=Hn(Ln.call(arguments),n)),new En(i,t)}}}));var Vn=En;class Rn{constructor(t,n){this.position=t,this.index=n,this.faces=[],this.neighbors=[]}addUniqueNeighbor(t){-1===this.neighbors.indexOf(t)&&this.neighbors.push(t)}}class $n{constructor(t,n,i,e){this.a=e.a,this.b=e.b,this.c=e.c,this.v1=t,this.v2=n,this.v3=i,this.normal=[],this.computeNormal(),t.faces.push(this),t.addUniqueNeighbor(n),t.addUniqueNeighbor(i),n.faces.push(this),n.addUniqueNeighbor(t),n.addUniqueNeighbor(i),i.faces.push(this),i.addUniqueNeighbor(t),i.addUniqueNeighbor(n)}computeNormal(){const t=this.v1.position,n=this.v2.position,i=this.v3.position,e=Pt([],St([],i,n),St([],t,n));At(this.normal,e)}hasVertex(t){return t===this.v1||t===this.v2||t===this.v3}}\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */const Wn=[],qn=[],Bn=[],Gn=[];function Jn(t,n,i){const e=Pt(qn,n,i);t=Tt(t,function(t,n,i,e,r,s,o,a,h,u){return t[0]=n,t[1]=i,t[2]=e,t[3]=r,t[4]=s,t[5]=o,t[6]=a,t[7]=h,t[8]=u,t}(Wn,i[0],i[1],i[2],...e,...n));if((t=function(t){return t[3]<0?Ut(t,t,-1):t}(t=zt(t,t)))[3]<1/32767){t[3]=1/32767;const n=Math.sqrt(.9999999990686206);t[0]*=n,t[1]*=n,t[2]*=n}const r=i[3]>0?Pt(Bn,i,n):Pt(Bn,n,i);return kt(Pt(Gn,i,n),r)<0&&Ut(t,t,-1),t}function Xn(t,n){const i=[],e=[];let r=0;for(r=0;r<t.length;r+=3){const n=new Rn([t[r],t[r+1],t[r+2]],r/3);i.push(n)}if(!n.length){const t=n;n=[];for(let i=0;i<t;i++)n.push(i)}for(r=0;r<n.length/3;r++){const t={a:n[3*r],b:n[3*r+1],c:n[3*r+2]};new $n(i[t.a],i[t.b],i[t.c],t)}const s=[],o=[0,0,0];for(r=0;r<i.length;r++){const t=i[r],n=t.index;bt(o,0,0,0);let a=t.faces.length;for(let n=0;n<a;n++)xt(o,o,t.faces[n].normal);a=a||1,bt(s,a,a,a),Ft(o,o,s),e[3*n]=o[0],e[3*n+1]=o[1],e[3*n+2]=o[2]}return e}\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 Zn(t,n,i){return t[0]=n[i],t[1]=n[i+1],t[2]=n[i+2],t}function Yn(t,n,i){return t[0]=n[i],t[1]=n[i+1],t}var Kn={exports:{}};function Qn(t,n,i){i=i||2;var e,r,s,o,a,h,u,l=n&&n.length,c=l?n[0]*i:t.length,f=ti(t,0,c,i,!0),d=[];if(!f||f.next===f.prev)return d;if(l&&(f=function(t,n,i,e){var r,s,o,a,h,u=[];for(r=0,s=n.length;r<s;r++)o=n[r]*e,a=r<s-1?n[r+1]*e:t.length,(h=ti(t,o,a,e,!1))===h.next&&(h.steiner=!0),u.push(ci(h));for(u.sort(ai),r=0;r<u.length;r++)i=ni(i=hi(u[r],i),i.next);return i}(t,n,f,i)),t.length>80*i){e=s=t[0],r=o=t[1];for(var y=i;y<c;y+=i)(a=t[y])<e&&(e=a),(h=t[y+1])<r&&(r=h),a>s&&(s=a),h>o&&(o=h);u=0!==(u=Math.max(s-e,o-r))?1/u:0}return ii(f,d,i,e,r,u),d}function ti(t,n,i,e,r){var s,o;if(r===Ai(t,n,i,e)>0)for(s=n;s<i;s+=e)o=bi(s,t[s],t[s+1],o);else for(s=i-e;s>=n;s-=e)o=bi(s,t[s],t[s+1],o);return o&&vi(o,o.next)&&(xi(o),o=o.next),o}function ni(t,n){if(!t)return t;n||(n=t);var i,e=t;do{if(i=!1,e.steiner||!vi(e,e.next)&&0!==yi(e.prev,e,e.next))e=e.next;else{if(xi(e),(e=n=e.prev)===e.next)break;i=!0}}while(i||e!==n);return n}function ii(t,n,i,e,r,s,o){if(t){!o&&s&&function(t,n,i,e){var r=t;do{null===r.z&&(r.z=li(r.x,r.y,n,i,e)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,i,e,r,s,o,a,h,u=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,e=i,a=0,n=0;n<u&&(a++,e=e.nextZ);n++);for(h=u;a>0||h>0&&e;)0!==a&&(0===h||!e||i.z<=e.z)?(r=i,i=i.nextZ,a--):(r=e,e=e.nextZ,h--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=e}s.nextZ=null,u*=2}while(o>1)}(r)}(t,e,r,s);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,s?ri(t,e,r,s):ei(t))n.push(a.i/i),n.push(t.i/i),n.push(h.i/i),xi(t),t=h.next,u=h.next;else if((t=h)===u){o?1===o?ii(t=si(ni(t),n,i),n,i,e,r,s,2):2===o&&oi(t,n,i,e,r,s):ii(ni(t),n,i,e,r,s,1);break}}}function ei(t){var n=t.prev,i=t,e=t.next;if(yi(n,i,e)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(fi(n.x,n.y,i.x,i.y,e.x,e.y,r.x,r.y)&&yi(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function ri(t,n,i,e){var r=t.prev,s=t,o=t.next;if(yi(r,s,o)>=0)return!1;for(var a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,h=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,u=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,l=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,c=li(a,h,n,i,e),f=li(u,l,n,i,e),d=t.prevZ,y=t.nextZ;d&&d.z>=c&&y&&y.z<=f;){if(d!==t.prev&&d!==t.next&&fi(r.x,r.y,s.x,s.y,o.x,o.y,d.x,d.y)&&yi(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,y!==t.prev&&y!==t.next&&fi(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&yi(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&fi(r.x,r.y,s.x,s.y,o.x,o.y,d.x,d.y)&&yi(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;y&&y.z<=f;){if(y!==t.prev&&y!==t.next&&fi(r.x,r.y,s.x,s.y,o.x,o.y,y.x,y.y)&&yi(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function si(t,n,i){var e=t;do{var r=e.prev,s=e.next.next;!vi(r,s)&&pi(r,e,e.next,s)&&wi(r,s)&&wi(s,r)&&(n.push(r.i/i),n.push(e.i/i),n.push(s.i/i),xi(e),xi(e.next),e=t=s),e=e.next}while(e!==t);return ni(e)}function oi(t,n,i,e,r,s){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&di(o,a)){var h=Mi(o,a);return o=ni(o,o.next),h=ni(h,h.next),ii(o,n,i,e,r,s),void ii(h,n,i,e,r,s)}a=a.next}o=o.next}while(o!==t)}function ai(t,n){return t.x-n.x}function hi(t,n){var i=function(t,n){var i,e=n,r=t.x,s=t.y,o=-1/0;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var a=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=r&&a>o){if(o=a,a===r){if(s===e.y)return e;if(s===e.next.y)return e.next}i=e.x<e.next.x?e:e.next}}e=e.next}while(e!==n);if(!i)return null;if(r===o)return i;var h,u=i,l=i.x,c=i.y,f=1/0;e=i;do{r>=e.x&&e.x>=l&&r!==e.x&&fi(s<c?r:o,s,l,c,s<c?o:r,s,e.x,e.y)&&(h=Math.abs(s-e.y)/(r-e.x),wi(e,t)&&(h<f||h===f&&(e.x>i.x||e.x===i.x&&ui(i,e)))&&(i=e,f=h)),e=e.next}while(e!==u);return i}(t,n);if(!i)return n;var e=Mi(i,t),r=ni(i,i.next);return ni(e,e.next),n===i?r:n}function ui(t,n){return yi(t.prev,t,n.prev)<0&&yi(n.next,t,t.next)<0}function li(t,n,i,e,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-e)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function ci(t){var n=t,i=t;do{(n.x<i.x||n.x===i.x&&n.y<i.y)&&(i=n),n=n.next}while(n!==t);return i}function fi(t,n,i,e,r,s,o,a){return(r-o)*(n-a)-(t-o)*(s-a)>=0&&(t-o)*(e-a)-(i-o)*(n-a)>=0&&(i-o)*(s-a)-(r-o)*(e-a)>=0}function di(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==n.i&&i.next.i!==n.i&&pi(i,i.next,t,n))return!0;i=i.next}while(i!==t);return!1}(t,n)&&(wi(t,n)&&wi(n,t)&&function(t,n){var i=t,e=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(e=!e),i=i.next}while(i!==t);return e}(t,n)&&(yi(t.prev,t,n.prev)||yi(t,n.prev,n))||vi(t,n)&&yi(t.prev,t,t.next)>0&&yi(n.prev,n,n.next)>0)}function yi(t,n,i){return(n.y-t.y)*(i.x-n.x)-(n.x-t.x)*(i.y-n.y)}function vi(t,n){return t.x===n.x&&t.y===n.y}function pi(t,n,i,e){var r=gi(yi(t,n,i)),s=gi(yi(t,n,e)),o=gi(yi(i,e,t)),a=gi(yi(i,e,n));return r!==s&&o!==a||(!(0!==r||!mi(t,i,n))||(!(0!==s||!mi(t,e,n))||(!(0!==o||!mi(i,t,e))||!(0!==a||!mi(i,n,e)))))}function mi(t,n,i){return n.x<=Math.max(t.x,i.x)&&n.x>=Math.min(t.x,i.x)&&n.y<=Math.max(t.y,i.y)&&n.y>=Math.min(t.y,i.y)}function gi(t){return t>0?1:t<0?-1:0}function wi(t,n){return yi(t.prev,t,t.next)<0?yi(t,n,t.next)>=0&&yi(t,t.prev,n)>=0:yi(t,n,t.prev)<0||yi(t,t.next,n)<0}function Mi(t,n){var i=new Fi(t.i,t.x,t.y),e=new Fi(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,i.next=r,r.prev=i,e.next=i,i.prev=e,s.next=e,e.prev=s,e}function bi(t,n,i,e){var r=new Fi(t,n,i);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function xi(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 Fi(t,n,i){this.i=t,this.x=n,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ai(t,n,i,e){for(var r=0,s=n,o=i-e;s<i;s+=e)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}Kn.exports=Qn,Kn.exports.default=Qn,Qn.deviation=function(t,n,i,e){var r=n&&n.length,s=r?n[0]*i:t.length,o=Math.abs(Ai(t,0,s,i));if(r)for(var a=0,h=n.length;a<h;a++){var u=n[a]*i,l=a<h-1?n[a+1]*i:t.length;o-=Math.abs(Ai(t,u,l,i))}var c=0;for(a=0;a<e.length;a+=3){var f=e[a]*i,d=e[a+1]*i,y=e[a+2]*i;c+=Math.abs((t[f]-t[y])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[y+1]-t[f+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},Qn.flatten=function(t){for(var n=t[0][0].length,i={vertices:[],holes:[],dimensions:n},e=0,r=0;r<t.length;r++){for(var s=0;s<t[r].length;s++)for(var o=0;o<n;o++)i.vertices.push(t[r][s][o]);r>0&&(e+=t[r-1].length,i.holes.push(e))}return i};var ki=Kn.exports;\n/*!\n * @maptalks/vector-packer v0.63.11\n * LICENSE : UNLICENSED\n * (c) 2016-2022 maptalks.com\n */const Pi={Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6};function Si(t,n={}){var i=[];if("FeatureCollection"===t.type)for(var e=0;e<t.features.length;e++)_i(i,t.features[e],n,e);else _i(i,"Feature"===t.type?t:{geometry:t},n);return i}function _i(t,n,i,e){if(n.geometry&&n.geometry.geometry){var r=n.geometry.coordinates,s=n.geometry.type,o=[],a=n.id;if(i.promoteId?a=n.properties[i.promoteId]:i.generateId&&(a=e||0),"Point"===s)Oi(r,o);else if("MultiPoint"===s)for(var h=0;h<r.length;h++)Oi(r[h],o);else if("LineString"===s)Ti([r],o);else if("MultiLineString"===s){if(i.lineMetrics){for(h=0;h<r.length;h++)Ii(r[h],o=[]),t.push(Li(a,"LineString",o,n.properties));return}Ti(r,o)}else if("Polygon"===s)Ti(r,o);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(h=0;h<n.geometry.geometries.length;h++)_i(t,{id:a,geometry:n.geometry.geometries[h],properties:n.properties},i,e);return}return void console.warn(`Input data type(${s}) is not a valid GeoJSON geometry type.`)}for(h=0;h<r.length;h++){var u=[];Ti(r[h],u),o.push(u)}}t.push(Li(a,s,o,n.properties))}}function Oi(t,n){n.push([new Ht(t[0],t[1])])}function Ii(t,n){for(var i=0;i<t.length;i++)n.push(new Ht(t[i][0],t[i][1]))}function Ti(t,n,i,e){for(var r=0;r<t.length;r++){var s=[];Ii(t[r],s),n.push(s)}}function Li(t,n,i,e){return{id:void 0===t?null:t,type:Pi[n],geometry:i,properties:e}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */function Ui(t,{width:n,height:i},e,r){if(r){if(r.length!==n*i*e)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*i*e);return t.width=n,t.height=i,t.data=r,t}function zi(t,{width:n,height:i},e){if(n===t.width&&i===t.height)return;const r=Ui({},{width:n,height:i},e);Di(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},e),t.width=n,t.height=i,t.data=r.data}function Di(t,n,i,e,r,s){if(0===r.width||0===r.height)return n;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>n.width||r.height>n.height||e.x>n.width-r.width||e.y>n.height-r.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 h=0;h<r.height;h++){const u=((i.y+h)*t.width+i.x)*s,l=((e.y+h)*n.width+e.x)*s;for(let t=0;t<r.width*s;t++)a[l+t]=o[u+t]}return n}class Ei{constructor(t,n){Ui(this,t,1,n)}resize(t){zi(this,t,1)}clone(){return new Ei({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,i,e,r){Di(t,n,i,e,r,1)}}class Ci{constructor(t,n){Ui(this,t,4,n)}resize(t){zi(this,t,4)}clone(){return new Ci({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,n,i,e,r){Di(t,n,i,e,r,4)}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */class ji{constructor(t,{pixelRatio:n}){this.paddedRect=t,this.pixelRatio=n||1}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Ni{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,n={},i=new Rt(0,0,{autoResize:!0}),e=[];for(const i in t){const r=t[i],s={x:0,y:0,w:r.data.width+2,h:r.data.height+2};e.push(s),n[i]=new ji(s,r)}if(i.pack(e,{inPlace:!0}),!Hi(i.w)||!Hi(i.h)){const t=Vi(i.w),n=Vi(i.h);i.resize(t,n)}const r=new Ci({width:i.w,height:i.h});for(const i in t){const e=t[i],s=n[i].paddedRect;Ci.copy(e.data,r,{x:0,y:0},{x:s.x+1,y:s.y+1},e.data)}this.image=r,this.positions=n}}function Hi(t){return 0==(t&t-1)&&0!==t}function Vi(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 Ri{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,n={},i=new Rt(0,0,{autoResize:!0}),e=[];for(const i in t){const r=t[i],s=n[i]={};for(const t in r){const n=r[+t];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;const i={x:0,y:0,w:n.bitmap.width+2,h:n.bitmap.height+2};e.push(i),s[t]={rect:i,metrics:n.metrics}}}i.pack(e,{inPlace:!0});const r=new Ei({width:i.w,height:i.h});for(const i in t){const e=t[i];for(const t in e){const s=e[+t];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const o=n[i][t].rect;Ei.copy(s.bitmap,r,{x:0,y:0},{x:o.x+1,y:o.y+1},s.bitmap)}}this.image=r,this.positions=n}}function $i(t){return t<65536?Uint16Array:Uint32Array}function Wi(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function qi(t){return t<256?Uint8Array:t<65536?Uint16Array:Float32Array}function Bi(t){const n=t.type,i=[];if(1===n||4===n)for(let n=0;n<t.geometry.length;n++)Oi(t.geometry[n],i);else if(2===n)Ti(t.geometry,i);else if(3===n)Ti(t.geometry,i);else if(5===n)Ti(t.geometry,i);else if(6===n)for(let n=0;n<t.geometry.length;n++){const e=[];Ti(t.geometry[n],e),i.push(e)}return t.geometry=i,t}function Gi(t){for(let n=1;n<arguments.length;n++){const i=arguments[n];for(const n in i)t[n]=i[n]}return t}function Ji(t){return null==t}function Xi(t){return"number"==typeof t&&!isNaN(t)}function Zi(t){return"object"==typeof t&&!!t}function Yi(t){return!Ji(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}const Ki=Object.prototype.hasOwnProperty;function Qi(t,n){return Ki.call(t,n)}function te(t){return m(t)&&t.property}function ne(t){let n=0;for(let i,e,r=0,s=t.length,o=s-1;r<s;o=r++)i=t[r],e=t[o],n+=void 0!==i.x?(e.x-i.x)*(i.y+e.y):(e[0]-i[0])*(i[1]+e[1]);return n}function ie(t,n,i,e,r){const s=t[n*e],o=t[n*e+1],a=t[i*e],h=t[i*e+1];return s===a&&(s<0||s>r)&&o!==h||o===h&&(o<0||o>r)&&s!==a}function ee(t,n,i){let e=i;return n&&t&&(e=t[n]),void 0===e&&(e=i),10*(e||0)}function re(t,n,i,e,r,s,o){n||0===n||(n=1);const a=ee(t.properties,i,e),h=a*n;let u=a;return r?u=ee(t.properties,r,s):o&&(u=a-ee(t.properties,o,0)),u*=n,{altitude:h,height:u}}function se(t,n){return n<1/0&&(t.x<0||t.x>n||t.y<0||t.y>n)}function oe(t){return null==t}function ae(t,n,i){if(t===i||t===n)return t;const e=i-n;return((t-n)%e+e)%e+n}class he{constructor(t,n,i,e){this.feature=t,this.symbol=n,this.fnTypes=i,this.options=e}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}}const ue={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};class le{static isAtlasLoaded(t,n={}){const{iconAtlas:i}=n;return!!(!t||i&&i.positions[t])}static genFnTypes(t){const n={};for(const i in t)if(te(t[i])){const e=(i+"_Fn_0").trim(),r=(i+"Fn").trim();ue[i]?(n[e]=g(t[i]),n[r]=(t,i)=>{const r=n[e](t,i);return te(r)?g(r)(t,i):r}):(n[e]=w(t[i]),n[r]=(t,i)=>{const r=n[e](t,i);return te(r)?w(r)(t,i):r})}return n}constructor(t,n,i){this.options=i,this.features=this.D(t),this.symbolDef=n,this.symbol=M(n,()=>[i.zoom]),this.styledVectors=[],this.properties={},this.C=le.genFnTypes(this.symbolDef),te(this.symbolDef.visible)&&(this.j=g(this.symbolDef.visible)),i.atlas&&(this.iconAtlas=i.atlas.iconAtlas,this.glyphAtlas=i.atlas.glyphAtlas)}D(t){if(!t.length)return t;const n="__fea_idx".trim();let e,r=0,s=t[r];for(;!s.geometry;)r++,s=t[r];if(Array.isArray(s.geometry)&&s.properties){let n=s.geometry[0];for(;Array.isArray(n);)n=n[0];n instanceof Ht&&(e=t)}if(!e)if(e=[],Array.isArray(s.geometry))for(let n=0;n<t.length;n++){const i=Gi({},t[n]);e.push(Bi(i))}else for(let i=0;i<t.length;i++){const r=t[i],s=Si(r);for(let t=0;t<s.length;t++){const i=s[t];i[n]=r[n],e.push(i)}}const o=this.options.order;if(o){const t=[];for(let n=0;n<o.length;n++)o[n]&&t.push(i(o[n]));e=e.sort((n,i)=>{const e=t.length;let r=e,s=e;for(let o=0;o<e&&(t[o](n)&&(r=o),t[o](i)&&(s=o),!(r<e&&s<e));o++);return r-s})}return e}load(t=1){const n="__fea_idx".trim(),i="_debug_info".trim(),e=this.C,r=this.styledVectors;this.count=0;const s=this.features;if(!s||!s.length)return Promise.resolve(null);const o={},a={},h={zoom:this.options.zoom},u=M(this.symbolDef,()=>[h.zoom]);let l=0,c=s.length;const f=this.options.debugIndex;try{for(;l<c;l++){const t=s[l];if(!t||!t.geometry)continue;if(void 0!==f&&t[i].index!==f)continue;t.properties||(t.properties={}),t.properties.$layer=t.layer,t.properties.$type=t.type;const c=this.createStyledVector(t,u,e,h,o,a);c&&c.feature.geometry&&(c.featureIdx=void 0===t[n]?l:t[n],this.count++,r.push(c))}}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((i,e)=>{this.fetchAtlas(t,n,(t,n)=>{if(t)e(t);else{if(n){const{icons:t,glyphs:i}=n;if(t&&Object.keys(t).length){for(const n in t){const i=t[n],{width:e,height:r,data:s}=i.data;i.data=new Ci({width:e,height:r},s)}this.iconAtlas=new Ni(t)}if(i&&Object.keys(i).length){for(const t in i){const n=i[t];for(const t in n){const i=n[t],{width:e,height:r,data:s}=i.bitmap;i.bitmap=new Ei({width:e,height:r},s)}}this.glyphAtlas=new Ri(i)}}i({glyphAtlas:this.glyphAtlas,iconAtlas:this.iconAtlas})}})})}fetchAtlas(t,n,i){Object.keys(t).length>0||Object.keys(n).length>0?this.options.requestor(t,n,i):i()}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 i=n.buffers;delete n.buffers;const e={data:n,buffers:i};if(this.iconAtlas){const t=e.data.iconAtlas=ce(this.iconAtlas);if(t.glyphMap)for(const n in t.glyphMap)i.push(t.glyphMap[n].data.data.buffer);i.push(e.data.iconAtlas.image.data.buffer)}return this.glyphAtlas&&(e.data.glyphAtlas=ce(this.glyphAtlas),i.push(e.data.glyphAtlas.image.data.buffer)),e}createStyledVector(t,n,i,e){return new he(t,n,i,e)}createDataPack(t,n){if(!t||!t.length)return null;this.maxIndex=0,this.maxPos=0,this.maxAltitude=0;const i=this.data={};let e=this.elements=[];const r=this.getFormat(Array.isArray(t[0])?t[0][0].symbol:t[0].symbol);for(let t=0;t<r.length;t++)i[r[t].name]=[];let s=[],o=0;const a=[];let h=0,u=!1;for(let e=0,r=t.length;e<r;e++){if(!t[e].feature.geometry)continue;const r=Array.isArray(t[e])?t[e][0].feature.id:t[e].feature.id;Xi(r)&&(Math.abs(r)>h&&(h=Math.abs(r)),r<0&&(u=!0));const l=this.data.aPosition.length;if(Array.isArray(t[e]))for(let i=0;i<t[e].length;i++)this.N(t[e][i],n);else this.N(t[e],n);const c=(i.aPosition.length-l)/3;for(let n=0;n<c;n++)s.push(t[e].featureIdx),Xi(r)&&a.push(r);o=Math.max(o,t[e].featureIdx)}if(this.hasElements()&&!e.length)return null;s=new(qi(o))(s),r[0].type=this.options.positionType?this.options.positionType:Wi(Math.max(this.maxPos,this.maxAltitude));const l=this.options.center;if(l&&(l[0]||l[1])){const t=i.aPosition;for(let n=0;n<t.length;n+=3)t[n]-=l[0],t[n+1]-=l[1]}const c=function(t,n){const i={};for(let e=0;e<t.length;e++){const r=t[e],s=r.type,o=r.name;i[o]=s===Array?n[o]:new s(n[o])}return i}(r,i);c.aPickingId=s;const f=[];for(const t in c)f.push(c[t].buffer);e=new($i(this.maxIndex))(e),f.push(e.buffer);const d={data:c,indices:this.hasElements()?e:null,positionSize:3,\n//!this.maxAltitude ? 2 : 3,\nbuffers:f,symbolIndex:this.symbolDef.index||{index:0}};if(a.length){const t=u?Wi(h):qi(h);d.featureIds=new t(a),f.push(d.featureIds.buffer)}else d.featureIds=[];return d}N(t,n){this.j&&this.j.isZoomConstant&&!this.j(null,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:i,altitudeScale:e}=this.options;let r=ee(t,n,i);return e&&(r*=e),this.maxAltitude=Math.max(this.maxAltitude,Math.abs(r)),r}getIconAtlasMaxValue(){const t=this.iconAtlas.positions;let n=0;for(const i in t)if(Qi(t,i)){const{tl:e,displaySize:r}=t[i],s=Math.max(e[0],e[1],r[0]-1,r[1]-1);s>n&&(n=s)}return n}}function ce(t){let n=t.positions,i=t.image&&t.image.format||"alpha";if(t instanceof Ni){n={};for(const i in t.positions){const e=t.positions[i];n[i]={paddedRect:e.paddedRect,pixelRatio:e.pixelRatio,tl:e.tl,br:e.br,displaySize:e.displaySize}}i="rgba"}const e=t.image;return{image:{width:e.width,height:e.height,data:e.data,format:i},glyphMap:t.glyphMap,positions:n}}function fe(t,n,i,e){const r="__fn_textSize".trim();let s=t.textSize;if(Ji(n.textSize))return[16,16];t[r]&&(s=t[r]);const o=[];var a;return o[0]=Ji(a=s)||"function"!=typeof a&&(null===a.constructor||a.constructor!==Function)?s:s(e,i),o[1]=o[0],o}function de(t){const n=t.stops;let i=-1/0;for(let t=0;t<n.length;t++){let e=n[t][1];Zi(n[t][1])&&(e=de(n[t][1])),e>i&&(i=e)}return i}const ye=/\\{([\\w_]+)\\}/g;function ve(t,n){return Yi(t)?t.replace(ye,(function(t,i){if(!n)return"";const e=n[i];return Ji(e)?"":Array.isArray(e)?e.join():e})):t}const pe=t=>t>=11904&&t<=12031,me=t=>t>=12032&&t<=12255,ge=t=>t>=12272&&t<=12287,we=t=>t>=12288&&t<=12351,Me=t=>t>=12352&&t<=12447,be=t=>t>=12448&&t<=12543,xe=t=>t>=12544&&t<=12591,Fe=t=>t>=12704&&t<=12735,Ae=t=>t>=12736&&t<=12783,ke=t=>t>=12784&&t<=12799,Pe=t=>t>=12800&&t<=13055,Se=t=>t>=13056&&t<=13311,_e=t=>t>=13312&&t<=19903,Oe=t=>t>=19968&&t<=40959,Ie=t=>t>=40960&&t<=42127,Te=t=>t>=42128&&t<=42191,Le=t=>t>=63744&&t<=64255,Ue=t=>t>=64336&&t<=65023,ze=t=>t>=65040&&t<=65055,De=t=>t>=65072&&t<=65103,Ee=t=>t>=65104&&t<=65135,Ce=t=>t>=65136&&t<=65279,je=t=>t>=65280&&t<=65519;function Ne(t){return!((t=>t>=1536&&t<=1791)(t)||(t=>t>=1872&&t<=1919)(t)||(t=>t>=2208&&t<=2303)(t)||Ue(t)||Ce(t))}function He(t){return!!(746===t||747===t||!(t<4352)&&(Fe(t)||xe(t)||De(t)&&!(t>=65097&&t<=65103)||Le(t)||Se(t)||pe(t)||Ae(t)||!(!we(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||_e(t)||Oe(t)||Pe(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)||Me(t)||ge(t)||(t=>t>=12688&&t<=12703)(t)||me(t)||ke(t)||be(t)&&12540!==t||!(!je(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)||!(!Ee(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||ze(t)||(t=>t>=19904&&t<=19967)(t)||Ie(t)||Te(t)))}function Ve(t){return!(He(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)||we(t)||be(t)||(t=>t>=57344&&t<=63743)(t)||De(t)||Ee(t)||je(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Re(t){return t>=1424&&t<=2303||Ue(t)||Ce(t)}const $e=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]];function We(t){for(const n of $e)if(t>=n[0]&&t<=n[1])return!0;return!1}const qe={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",H:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Be(t,n,i,e,r,s,o,a,h,u){let l=t.trim();2===u&&(l=function(t){let n="";for(let i=0;i<t.length;i++){const e=t.charCodeAt(i+1)||null,r=t.charCodeAt(i-1)||null;n+=e&&Ve(e)&&!qe[t[i+1]]||r&&Ve(r)&&!qe[t[i-1]]||!qe[t[i]]?t[i]:qe[t[i]]}return n}(l));const c=[],f={positionedGlyphs:c,text:l,top:a[1],bottom:a[1],left:a[0],right:a[0],writingMode:u};let d;return d=function(t,n){const i=[];let e=0;for(let r=0;r<n.length;r++){const s=n[r];i.push(t.substring(e,s)),e=s}return e<t.length&&i.push(t.substring(e,t.length)),i}(l,function(t,n,i,e){if(!i)return[];if(!t)return[];const r=[],s=function(t,n,i,e){let r=0;for(let i=0;i<t.length;i++){const s=e[t.charCodeAt(i)];s&&(r+=s.metrics.advance+n)}return r/Math.max(1,Math.ceil(r/i))}(t,n,i,e);let o=0;for(let i=0;i<t.length;i++){const h=t.charCodeAt(i),u=e[h];u&&!Ge[h]&&(o+=u.metrics.advance+n),i<t.length-1&&(Je[h]||!((a=h)<11904)&&(Fe(a)||xe(a)||De(a)||Le(a)||Se(a)||pe(a)||Ae(a)||we(a)||_e(a)||Oe(a)||Pe(a)||je(a)||Me(a)||ge(a)||me(a)||ke(a)||be(a)||ze(a)||Te(a)||Ie(a)))&&r.push(Ye(i+1,o,s,r,Ze(h,t.charCodeAt(i+1)),!1))}var a;return function t(n){return n?t(n.priorBreak).concat(n.index):[]}(Ye(t.length,o,s,r,0,!0))}(l,o,i,n)),function(t,n,i,e,r,s,o,a,h){let u=0,l=8,c=0;const f=t.positionedGlyphs,d="right"===s?1:"left"===s?0:.5;for(let t=0;t<i.length;t++){let r=i[t];if(r=r.trim(),!r.length){l-=e;continue}const s=f.length;for(let t=0;t<r.length;t++){const i=r.charCodeAt(t),e=n[i];e&&(He(i)&&1!==o?(32!==i&&f.push({glyph:i,x:u,y:0,vertical:!0}),u+=h+a):(32!==i&&f.push({glyph:i,x:u,y:l,vertical:!1}),u+=e.metrics.advance+a))}f.length!==s&&(c=Math.max(u-a,c),Qe(f,n,s,f.length-1,d)),u=0,l-=e}const{horizontalAlign:y,verticalAlign:v}=Ke(r);!function(t,n,i,e,r,s,o){const a=(n-i)*r,h=-(-e*o+.5)*s;if(a||h)for(let n=0;n<t.length;n++)t[n].x+=a,t[n].y+=h}(f,d,y,v,c,e,i.length);const p=i.length*e;t.top+=-v*p,t.bottom=t.top+p,t.left+=-y*c,t.right=t.left+c}(f,n,d,e,r,s,u,o,h),!!c.length&&f}const Ge={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Je={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 Xe(t,n,i,e){const r=Math.pow(t-n,2);return e?t<n?r/2:2*r:r+Math.abs(i)*i}function Ze(t,n){let i=0;return 10===t&&(i-=1e4),40!==t&&65288!==t||(i+=50),41!==n&&65289!==n||(i+=50),i}function Ye(t,n,i,e,r,s){let o=null,a=Xe(n,i,r,s);for(let t=0;t<e.length;t++){const h=e[t],u=Xe(n-h.x,i,r,s)+h.badness;u<=a&&(o=h,a=u)}return{index:t,x:n,priorBreak:o,badness:a}}function Ke(t){let n=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":n=1;break;case"left":case"top-left":case"bottom-left":n=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:n,verticalAlign:i}}function Qe(t,n,i,e,r){if(!r)return;const s=n[t[e].glyph];if(s){const n=(t[e].x+s.metrics.advance)*r;if(!n)return;for(let r=i;r<=e;r++)t[r].x-=n}}function tr(t){if(!function(t){for(const n of t)if(Re(n.charCodeAt(0)))return!0;return!1}(t))return t;const n=[],i=[],e=[];let r=0,s=0,o=1,a=1;for(const h of t){const t=h.codePointAt(0);We(t)?(e.push(h),r++):(o=Re(t)?-1:1,a!==o?(s=r,i.length&&(a>0&&i.reverse(),n.push(...i)),e.length&&(n.splice(s,0,...e),e.length=0),a=o,i.length=0):e.length&&(i.push(...e),e.length=0),i.push(h),r++)}return e.length&&i.push(...e),i.length&&(a>0&&i.reverse(),n.push(...i)),n.reverse().join("")}const nr=/\\{ *([\\w_]+) *\\}/g;class ir{constructor(t,n,i,e,r){this.feature=t,this.symbolDef=n,this.symbol=i,this.options=r,this.V=this.R.bind(this),this.C=e}R(t,n){return this.feature.properties[n]||"default"}getShape(t,n){if(this.W)return this.W;const{textHorizontalAlignmentFn:i,textVerticalAlignmentFn:e,markerHorizontalAlignmentFn:r,markerVerticalAlignmentFn:s,textWrapWidthFn:o}=this.C;let a;const h=this.symbol,u=this.getIconAndGlyph(),l=this.feature.properties;if(u&&u.glyph){const{font:t,text:r}=u.glyph;if(""===r)return null;const s=this.size[0]/24,c=24,f=h.textKeepUpright,d="map"===h.textRotationAlignment&&"line"===h.textPlacement&&!h.isIconText,y=n.glyphMap[t],v=er(i?i(null,l):h.textHorizontalAlignment,e?e(null,l):h.textVerticalAlignment),p=1.2*c,m=function(t){for(let n=0;n<t.length;n++)if(!Ne(t.charAt(n).charCodeAt(0)))return!1;return!0}(r),g=m&&h.textLetterSpacing/s||0,w=[h.textDx/s||0,h.textDy/s||0],M=((o?o(null,l):h.textWrapWidth)||10*c)/s;a={},a.horizontal=Be(r,y,M,p,v,"center",g,w,c,1),m&&d&&f&&(a.vertical=Be(r,y,M,p,v,"center",g,w,c,2))}else if(u&&u.icon){if(!t.positions[u.icon.url])return null;const n=er(r?r(null,l):h.markerHorizontalAlignment,s?s(null,l):h.markerVerticalAlignment);a=function(t,n){const{horizontalAlign:i,verticalAlign:e}=Ke(n),r=-24*i,s=-24*e;return{image:t,top:s,bottom:s+24,left:r,right:r+24}}(t.positions[u.icon.url],n),this.size||(this.size=a.image.displaySize)}return this.W=a,a}getIconAndGlyph(){if(this.iconGlyph)return this.iconGlyph;const{markerFileFn:t,markerTypeFn:n,markerPathFn:i,markerWidthFn:e,markerHeightFn:r,markerFillFn:s,markerFillPatternFileFn:o,markerFillOpacityFn:a,markerTextFitFn:h,markerTextFitPaddingFn:u,markerLineColorFn:l,markerLineWidthFn:c,markerLineOpacityFn:f,markerLineDasharrayFn:d,markerLinePatternFileFn:y,markerPathWidthFn:v,markerPathHeightFn:p,textNameFn:w,textFaceNameFn:M,textStyleFn:b,textWeightFn:x}=this.C,{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,I=!Ji(this.symbolDef.textName);let T;if(O){T=function(t,n,i,e,r,s){if(Ji(n.markerWidth)&&Ji(n.markerHeight))return null;const o="__fn_markerWidth".trim(),a="__fn_markerHeight".trim();let h=n.markerWidth||0,u=n.markerHeight||0;return Zi(h)&&("identity"!==h.type?h=de(h):(h=t.markerWidth,t[o]&&(h=t[o](e,i)),Zi(h)&&(h="identity"===h.type?r(e,i):de(h)))),Zi(u)&&("identity"!==u.type?u=de(u):(u=t.markerHeight,t[a]&&(u=t[a](e,i)),Zi(u)&&(u="identity"===u.type?s(e,i):de(u)))),[h,u]}(k,this.symbolDef,P,F,e,r)||[0,0];let t=k.markerTextFit;if(h&&(t=h(F,P)),t&&t&&"none"!==t){const n=k.text.textSize;let i=k.text.textName;m(i)&&(i=g(i)(F,P));const e=ve(i,P);if(e){const i="__fn_textSize".trim(),r="__fn_textSize_0".trim();m(n)&&!k.text[i]&&(k.text[r]=g(n),k.text[i]=(t,n)=>{const i=k.text[r](t,n);return m(i)?g(i)(t,n):i});const s=fe(k.text,k.text,P,F);if("width"!==t&&"both"!==t||(T[0]=s[0]*e.length),"height"!==t&&"both"!==t||(T[1]=s[1]),s[0]&&s[1]){let t=k.markerTextFitPadding||[0,0,0,0];u&&(t=u(F,P)),T[0]+=t[1]+t[3],T[1]+=t[0]+t[2]}}else T[0]=T[1]=-1}}if(I&&(T=fe(k,this.symbolDef,P,F)),!T)return A;if(T[0]=Math.ceil(T[0]),T[1]=Math.ceil(T[1]),this.size=T,O&&T[0]>=0&&T[1]>=0){let t;if(_){const n={};if(n.markerType=_,"path"===_&&(n.markerPath=i?i(null,P):k.markerPath,n.markerPathWidth=v?v(null,P):k.markerPathWidth,n.markerPathHeight=p?p(null,P):k.markerPathHeight),e){const t=e(null,P);Ji(t)||(n.markerWidth=t)}else k.markerWidth>=0&&(n.markerWidth=k.markerWidth);if(r){const t=r(null,P);Ji(t)||(n.markerHeight=t)}else k.markerHeight>=0&&(n.markerHeight=k.markerHeight);if(s){const t=s(null,P);Ji(t)||(n.markerFill=t)}else k.markerFill&&(n.markerFill=k.markerFill);if(o){const t=o(null,P);Ji(t)||(n.markerFillPatternFile=t)}else k.markerFillPatternFile&&(n.markerFillPatternFile=k.markerFillPatternFile);if(a){const t=a(null,P);Ji(t)||(n.markerFillOpacity=t)}else k.markerFillOpacity>=0&&(n.markerFillOpacity=k.markerFillOpacity);if(l){const t=l(null,P);Ji(t)||(n.markerLineColor=t)}else k.markerLineColor&&(n.markerLineColor=k.markerLineColor);if(c){const t=c(null,P);Ji(t)||(n.markerLineWidth=t)}else k.markerLineWidth>=0&&(n.markerLineWidth=k.markerLineWidth);if(f){const t=f(null,P);Ji(t)||(n.markerLineOpacity=t)}else k.markerLineOpacity>=0&&(n.markerLineOpacity=k.markerLineOpacity);if(d){const t=d(null,P);Ji(t)||(n.markerLineDasharray=t)}else k.markerLineDasharray&&(n.markerLineDasharray=k.markerLineDasharray);if(y){const t=y(null,P);Ji(t)||(n.markerLinePatternFile=t)}else k.markerLinePatternFile&&(n.markerLinePatternFile=k.markerLinePatternFile);t="vector://"+JSON.stringify(n)}else t=S?S.replace(nr,this.V):k.markerPath?function(t,n,i){if(!t.markerPath)return null;let e=1;const r=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);Xi(t.markerOpacity)&&(e=t.markerOpacity),Xi(t.opacity)&&(e*=t.opacity);const s={};if(r){for(const t in r.stroke)Qi(r.stroke,t)&&(Ji(r.stroke[t])||(s[t]=r.stroke[t]));for(const t in r.fill)Qi(r.fill,t)&&(Ji(r.fill[t])||(s[t]=r.fill[t]))}const o=Array.isArray(t.markerPath)?t.markerPath:[t.markerPath];let a;const h=[];for(let t=0;t<o.length;t++)a=Yi(o[t])?{path:o[t]}:o[t],a=Gi({},a,s),a.d=a.path,delete a.path,h.push(a);const u=[\'<svg version="1.1"\',\'xmlns="http://www.w3.org/2000/svg"\'];e<1&&u.push(\'opacity="\'+e+\'"\'),t.markerPathWidth&&t.markerPathHeight&&u.push(\'viewBox="0 0 \'+t.markerPathWidth+" "+t.markerPathHeight+\'"\'),u.push(\'preserveAspectRatio="none"\'),n&&u.push(\'width="\'+n+\'"\'),i&&u.push(\'height="\'+i+\'"\'),u.push("><defs></defs>");for(let t=0;t<h.length;t++){let n="<path ";for(const i in h[t])Qi(h[t],i)&&(n+=" "+i+\'="\'+h[t][i]+\'"\');n+="></path>",u.push(n)}return u.push("</svg>"),"data:image/svg+xml;base64,"+btoa(u.join(" "))}(k,T[0],T[1]):null;A.icon={url:t,size:T}}if(I){const t=w?w(null,P):k.textName;if(t||0===t){const n=function(t,n,i){return[n||"normal",i||"normal","24px",t||"monospace"].join(" ")}(M?M(null,P):k.textFaceName,b?b(null,P):k.textStyle,x?x(null,P):k.textWeight);let i=ve(t,P);i&&i.length&&(i=tr(i),A.glyph={font:n,text:i})}}return this.iconGlyph=A,A}}function er(t,n){n&&"middle"!==n||(n="center"),t&&"middle"!==t||(t="center");let i="center"!==n?n:"";return i+="center"!==t?(i.length?"-":"")+t:"",i\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */}function rr(t,n,i,e,r){const s=[];for(let o=0;o<t.length;o++){const a=t[o];let h;for(let t=0;t<a.length-1;t++){let o=a[t],u=a[t+1];o.x<n&&u.x<n||(o.x<n?o=new Ht(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y)).I():u.x<n&&(u=new Ht(n,o.y+(n-o.x)/(u.x-o.x)*(u.y-o.y)).I()),o.y<i&&u.y<i||(o.y<i?o=new Ht(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i).I():u.y<i&&(u=new Ht(o.x+(i-o.y)/(u.y-o.y)*(u.x-o.x),i).I()),o.x>=e&&u.x>=e||(o.x>=e?o=new Ht(e,o.y+(e-o.x)/(u.x-o.x)*(u.y-o.y)).I():u.x>=e&&(u=new Ht(e,o.y+(e-o.x)/(u.x-o.x)*(u.y-o.y)).I()),o.y>=r&&u.y>=r||(o.y>=r?o=new Ht(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r).I():u.y>=r&&(u=new Ht(o.x+(r-o.y)/(u.y-o.y)*(u.x-o.x),r).I()),h&&o.equals(h[h.length-1])||(h=[o],s.push(h)),h.push(u)))))}}return s}class sr extends Ht{constructor(t,n,i,e){super(t,n),this.angle=i,void 0!==e&&(this.segment=e)}clone(){return new sr(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 or(t,n,i,e,r){if(void 0===n.segment)return!0;let s=n,o=n.segment+1,a=0;for(;a>-i/2;){if(o--,o<0)return!1;a-=t[o].dist(s),s=t[o]}a+=t[o].dist(t[o+1]),o++;const h=[];let u=0;for(;a<i/2;){const n=t[o],i=t[o+1];if(!i)return!1;let s=t[o-1].angleTo(n)-n.angleTo(i);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),h.push({distance:a,angleDelta:s}),u+=s;a-h[0].distance>e;)u-=h.shift().angleDelta;if(u>r)return!1;o++,a+=n.dist(i)}return!0}function ar(t,n,i,e,r,s,o,a,h){const u=function(t,n,i){return t?.6*n*i:0}(e,s,o),l=function(t,n){return Math.max(t?t.right-t.left:0,n?n.right-n.left:0)}(e,r),c=0===t[0].x||t[0].x===h||0===t[0].y||t[0].y===h;return n-l*o<n/4&&(n=l*o+n/4),function t(n,i,e,r,s,o,a,h,u){const l=o/2,c=function(t){let n=0;for(let i=0;i<t.length-1;i++)n+=t[i].dist(t[i+1]);return n}(n);let f=0,d=i-e,y=[];for(let t=0;t<n.length-1;t++){const i=n[t],a=n[t+1],h=i.dist(a),v=a.angleTo(i);for(;d+e<f+h;){d+=e;const p=(d-f)/h,m=hr(i.x,a.x,p),g=hr(i.y,a.y,p);if(m>=0&&m<u&&g>=0&&g<u&&d-l>=0&&d+l<=c){const i=new sr(m,g,v,t);i.line=n,i.I(),r&&!or(n,i,o,r,s)||y.push(i)}}f+=h}return h||y.length||a||(y=t(n,f/2,e,r,s,o,a,!0,u)),y}(t,c?n/2*a%n:(l/2+2*s)*o*a%n,n,u,i,l*o,c,!1,h)}function hr(t,n,i){return t*(1-i)+n*i}function ur(t,n){const i=t.length;if(i<=1)return[t];const e=[];let r,s;for(let n=0;n<i;n++){const i=ne(t[n]);0!==i&&(t[n].area=Math.abs(i),void 0===s&&(s=i<0),s===i<0?(r&&e.push(r),r=[t[n]]):r.push(t[n]))}if(r&&e.push(r),n>1)for(let t=0;t<e.length;t++)e[t].length<=n||(Bt(e[t],n,1,e[t].length-1,lr),e[t]=e[t].slice(0,n));return e}function lr(t,n){return n.area-t.area}function cr(t,n,i){const e=n.distSqr(i);if(0===e)return t.distSqr(n);const r=((t.x-n.x)*(i.x-n.x)+(t.y-n.y)*(i.y-n.y))/e;return t.distSqr(r<0?n:r>1?i:i.sub(n).F(r).u(n))}function fr(t,n=1,i=!1){let e=1/0,r=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<e)&&(e=n.x),(!t||n.y<r)&&(r=n.y),(!t||n.x>s)&&(s=n.x),(!t||n.y>o)&&(o=n.y)}const h=Math.min(s-e,o-r);let u=h/2;const l=new Zt(null,dr);if(0===h)return new Ht(e,r);for(let n=e;n<s;n+=h)for(let i=r;i<o;i+=h)l.push(new yr(n+u,i+u,u,t));let c=function(t){let n=0,i=0,e=0;const r=t[0];for(let t=0,s=r.length,o=s-1;t<s;o=t++){const s=r[t],a=r[o],h=s.x*a.y-a.x*s.y;i+=(s.x+a.x)*h,e+=(s.y+a.y)*h,n+=3*h}return new yr(i/n,e/n,0,t)}(t),f=l.length;for(;l.length;){const e=l.pop();(e.d>c.d||!c.d)&&(c=e,i&&console.log("found best %d after %d probes",Math.round(1e4*e.d)/1e4,f)),e.max-c.d<=n||(u=e.h/2,l.push(new yr(e.p.x-u,e.p.y-u,u,t)),l.push(new yr(e.p.x+u,e.p.y-u,u,t)),l.push(new yr(e.p.x-u,e.p.y+u,u,t)),l.push(new yr(e.p.x+u,e.p.y+u,u,t)),f+=4)}return i&&(console.log("num probes: "+f),console.log("best distance: "+c.d)),c.p}function dr(t,n){return n.max-t.max}function yr(t,n,i,e){this.p=new Ht(t,n),this.h=i,this.d=function(t,n){let i=!1,e=1/0;for(let r=0;r<n.length;r++){const s=n[r];for(let n=0,r=s.length,o=r-1;n<r;o=n++){const r=s[n],a=s[o];r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(i=!i),e=Math.min(e,cr(t,r,a))}}return(i?1:-1)*Math.sqrt(e)}(this.p,e),this.max=this.d+this.h*Math.SQRT2}const vr=45*Math.PI/100;function pr(t,n){const i={},e={},r=[];let s=0;function o(n){r.push(t[n]),s++}function a(t,n,i){const s=e[t];return delete e[t],e[n]=s,r[s].geometry[0].pop(),r[s].geometry[0]=r[s].geometry[0].concat(i[0]),s}function h(t,n,e){const s=i[n];return delete i[n],i[t]=s,r[s].geometry[0].shift(),r[s].geometry[0]=e[0].concat(r[s].geometry[0]),s}function u(t,n,i){const e=i?n[0][n[0].length-1]:n[0][0];return`${t}:${e.x}:${e.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 y=u(d,f),v=u(d,f,!0);if(y in e&&v in i&&e[y]!==i[v]){const t=h(y,v,f),n=a(y,v,r[t].geometry);delete i[y],delete e[v],e[u(d,r[n].geometry,!0)]=n,r[t].geometry=null}else y in e?a(y,v,f):v in i?h(y,v,f):(o(l),i[y]=s-1,e[v]=s-1)}return r.filter(t=>t.geometry)}class mr extends le{static needMerge(t){return t.mergeOnProperty&&("line"===t.textPlacement||"line"===t.markerPlacement)}static mergeLineFeatures(t,n,i){const e="__index".trim(),r=function(t,n,i){const e="__index".trim(),r=le.genFnTypes(n),{mergeOnPropertyFn:s}=r;if(!n.mergeOnProperty||"line"!==n.textPlacement&&"line"!==n.markerPlacement)return[];if(!(oe(o=n.mergeOnProperty)||"string"!=typeof o&&(null===o.constructor||o.constructor!==String)||"line"!==n.textPlacement&&"line"!==n.markerPlacement))return[{features:t,property:n.mergeOnProperty}];var o;const a=[],h={},u=[];for(let r=0;r<t.length;r++){t[r][e]=r;const o=t[r].properties=t[r].properties||{};o.$layer=t[r].layer,o.$type=t[r].type;let l=n.markerPlacement;"line"!==l&&(l=n.textPlacement);const c=s?s(i,o):n.mergeOnProperty;"line"!==l||oe(c)?u.push(t[r]):(void 0===h[c]&&(h[c]=a.length,a.push({features:[],property:c})),a[h[c]].features.push(t[r]))}return u.length&&a.push({features:u}),a}(t,n,i);if(r.length){const n=[];for(let i=0;i<r.length;i++)n.push(r[i].property?pr(r[i].features,r[i].property):t);if(1===n.length)return n[0];{let t=[];for(let i=0;i<n.length;i++)t=t.concat(n[i]);return t.sort((t,n)=>t[e]-n[e]),t}}}static splitPointSymbol(t,n=0){const i=[];if(Array.isArray(t)){const n=t;for(let t=0;t<n.length;t++)n[t]&&i.push(...mr.splitPointSymbol(n[t],t));return i}let e=null,r=null;for(const n in t)0===n.indexOf("marker")?(e=e||{},e[n]=t[n]):0===n.indexOf("text")&&(r=r||{},r[n]=t[n]);return e&&(e.isIconText=!0,t.mergeOnProperty&&(e.mergeOnProperty=t.mergeOnProperty),i.push(e)),r&&(e&&(r.textPlacement=e.markerPlacement,r.textSpacing=e.markerSpacing,r.isIconText=!0),t.mergeOnProperty&&(r.mergeOnProperty=t.mergeOnProperty),i.push(r)),void 0!==t.visible&&(e&&(e.visible=t.visible),r&&(r.visible=t.visible)),e&&(e.markerTextFit&&r&&(e.text={},e.text.textName=r.textName,e.text.textSize=r.textSize),e.index={index:n,type:0}),r&&(r.index={index:n,type:1}),i}static isAtlasLoaded(t,n){const{icon:i,glyph:e}=t,{iconAtlas:r,glyphAtlas:s}=n;if(i&&(!r||!r.positions[i.url]))return!1;if(e){if(!s||!s.positions[e.font])return!1;const t=s.positions[e.font],{text:n}=e;for(let i=0;i<n.length;i++)if(!t[n.charCodeAt(i)])return!1}return!0}constructor(t,n,i){super(t,n,i)}createStyledVector(t,n,i,e,r,s){const o=new ir(t,this.symbolDef,n,i,e),a=o.getIconAndGlyph();if(a.icon&&!this.options.atlas){const{url:t,size:n}=a.icon;r[t]||(r[t]=a.icon.size),r[t][0]<n[0]&&(r[t][0]=n[0]),r[t][1]<n[1]&&(r[t][1]=n[1])}if(a.glyph&&!this.options.atlas){const{font:t,text:i}=a.glyph,e=s[t]=s[t]||{};for(let t=0;t<i.length;t++)e[i.charCodeAt(t)]=1;"line"===n.textPlacement&&(s.options={isCharsCompact:!1})}return this.options.allowEmptyPack||a.icon||a.glyph?o:null}getFormat(t){const n=void 0!==t.textName,i=n?function(t){return"line"!==t.textPlacement||t.isIconText?[{type:Int16Array,width:3,name:"aPosition"},{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"}]:[{type:Int16Array,width:3,name:"aPosition"},{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"}]}(t):[{type:Int16Array,width:3,name:"aPosition"},{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"}];n?i.push(...this.q()):i.push(...this.B());const{markerOpacityFn:e,textOpacityFn:r,markerPitchAlignmentFn:s,textPitchAlignmentFn:o,markerRotationAlignmentFn:a,textRotationAlignmentFn:h,markerRotationFn:u,textRotationFn:l,markerAllowOverlapFn:c,textAllowOverlapFn:f,markerIgnorePlacementFn:d,textIgnorePlacementFn:y}=this.C;return(e||r)&&i.push({type:Uint8Array,width:1,name:"aColorOpacity"}),(s||o)&&i.push({type:Uint8Array,width:1,name:"aPitchAlign"}),(a||h)&&i.push({type:Uint8Array,width:1,name:"aRotationAlign"}),(u||l)&&i.push({type:Uint16Array,width:1,name:"aRotation"}),(c||f||d||y)&&i.push({type:Uint8Array,width:1,name:"aOverlap"}),i}q(){const{textFillFn:t,textSizeFn:n,textHaloFillFn:i,textHaloRadiusFn:e,textHaloOpacityFn:r,textDxFn:s,textDyFn:o}=this.C,a=[];return t&&a.push({type:Uint8Array,width:4,name:"aTextFill"}),n&&a.push({type:Uint8Array,width:1,name:"aTextSize"}),i&&a.push({type:Uint8Array,width:4,name:"aTextHaloFill"}),e&&a.push({type:Uint8Array,width:1,name:"aTextHaloRadius"}),r&&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}B(){const{markerWidthFn:t,markerHeightFn:n,markerDxFn:i,markerDyFn:e}=this.C,r=[];return t&&r.push({type:Uint8Array,width:1,name:"aMarkerWidth"}),n&&r.push({type:Uint8Array,width:1,name:"aMarkerHeight"}),i&&r.push({type:Int8Array,width:1,name:"aMarkerDx"}),e&&r.push({type:Int8Array,width:1,name:"aMarkerDy"}),r}createDataPack(){if(!this.iconAtlas&&!this.glyphAtlas){if(!this.options.allowEmptyPack)return null;this.empty=!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 i=t.getShape(this.iconAtlas,this.glyphAtlas);if(!this.options.allowEmptyPack&&!i)return;const e=this.G(t,i,n);if(0===e.length)return;const r=this.data;let s=this.data.aPosition.length/3;const o=t.symbol,a=t.feature.properties,h="line"===o.textPlacement&&!o.isIconText,u=void 0!==o.textName,l=u&&h&&function(t){let n=0;for(let i=0;i<t.length;i++)if(He(t.charAt(i).charCodeAt(0)))n=0;else if(n++,n>=1)return!1;return!0}(t.getIconAndGlyph().glyph.text)?1:0,{textFillFn:c,textSizeFn:f,textHaloFillFn:d,textHaloRadiusFn:y,textHaloOpacityFn:v,textDxFn:p,textDyFn:g,textPitchAlignmentFn:w,textRotationAlignmentFn:M,textRotationFn:b,textAllowOverlapFn:x,textIgnorePlacementFn:F,textOpacityFn:A,markerWidthFn:k,markerHeightFn:P,markerDxFn:S,markerDyFn:_,markerPitchAlignmentFn:O,markerRotationAlignmentFn:I,markerRotationFn:T,markerAllowOverlapFn:L,markerIgnorePlacementFn:U,markerOpacityFn:z}=this.C;let D,E,C,j,N,H,V,R,$,W,q,B,G,J,X,Z,Y;if(u){const n=t.getIconAndGlyph().glyph.font;D=function(t,n,i){const e=t.positionedGlyphs,r=[];for(let s=0;s<e.length;s++){const o=e[s],a=i[o.glyph];if(!a)continue;const h=a.rect;if(!h)continue;const u=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],y=a.metrics.left-u-l+d[0],v=a.metrics.top-u+d[1],p=y+h.w,m=v+h.h,g=new Ht(y,v),w=new Ht(p,v),M=new Ht(y,m),b=new Ht(p,m);if(n&&o.vertical){const t=new Ht(-l,l),n=-Math.PI/2,i=new Ht(5,0);g.P(n,t).u(i),w.P(n,t).u(i),M.P(n,t).u(i),b.P(n,t).u(i)}r.push({tl:g,tr:w,bl:M,br:b,tex:h,writingMode:t.writingMode,glyphOffset:f})}return r}(i.horizontal,h,this.glyphAtlas.positions[n]),c&&(E=c(null,a),m(E)?E=[0,0,0,0]:(E=Array.isArray(E)?E.map(t=>255*t):Vn(E).array(),3===E.length&&E.push(255))),f&&(C=f(this.options.zoom,a),oe(C)&&(C=14)),d&&(j=d(null,a),j=Array.isArray(j)?j.map(t=>255*t):Vn(j).array(),3===j.length&&j.push(255)),y&&(N=y(null,a)),v&&(H=255*v(null,a)),p&&(V=p(null,a)||0),g&&(R=g(null,a)||0),w&&(G=+("map"===w(null,a))),M&&(J=+("map"===M(null,a))),b&&(X=ae(b(null,a),0,360)*Math.PI/180)}else D=i?function(t){const n=t.image,i=t.top-1/n.pixelRatio,e=t.left-1/n.pixelRatio,r=t.bottom+1/n.pixelRatio,s=t.right+1/n.pixelRatio;let o,a,h,u;return o=new Ht(e,i),a=new Ht(s,i),h=new Ht(s,r),u=new Ht(e,r),[{tl:o,tr:a,bl:u,br:h,tex:{x:n.tl[0],y:n.tl[1],w:n.displaySize[0],h:n.displaySize[1]},writingMode:void 0,glyphOffset:[0,0]}]}(i):function(){const t=new Ht(0,0),n=new Ht(0,0),i=new Ht(0,0);return[{tl:t,tr:n,bl:new Ht(0,0),br:i,tex:{x:0,y:0,w:0,h:0},writingMode:void 0,glyphOffset:[0,0]}]}(),k&&($=k(null,a)),P&&(W=P(null,a)),S&&(q=S(null,a)),_&&(B=_(null,a)),O&&(G=+("map"===O(null,a))),I&&(J=+("map"===I(null,a))),T&&(X=ae(T(null,a),0,360)*Math.PI/180);const K=L||x;K&&(Z=K(null,a)||0);const Q=U||F;let tt;Q&&(Y=Q(null,a)||0);const nt=A||z;nt&&(tt=255*nt(this.options.zoom,a));const it=this.options.EXTENT,et=D.length,rt=this.getAltitude(t.feature.properties);for(let t=0;t<e.length;t++){const n=e[t];if(it!==1/0&&se(n,it))continue;const i=n.x,o=n.y,a=D.length;for(let t=0;t<a;t++){const e=D[t],{tl:a,tr:c,bl:f,br:d,tex:y}=e;this.J(r,i,o,rt,10*a.x,10*a.y,y.x,y.y+y.h),u&&this.X(r,h,et,e.glyphOffset,n,l),this.Z(r,E,C,j,N,H,V,R,$,W,q,B,tt,G,J,X,Z,Y),this.J(r,i,o,rt,10*c.x,10*c.y,y.x+y.w,y.y+y.h),u&&this.X(r,h,et,e.glyphOffset,n,l),this.Z(r,E,C,j,N,H,V,R,$,W,q,B,tt,G,J,X,Z,Y),this.J(r,i,o,rt,10*f.x,10*f.y,y.x,y.y),u&&this.X(r,h,et,e.glyphOffset,n,l),this.Z(r,E,C,j,N,H,V,R,$,W,q,B,tt,G,J,X,Z,Y),this.J(r,i,o,rt,10*d.x,10*d.y,y.x+y.w,y.y),u&&this.X(r,h,et,e.glyphOffset,n,l),this.Z(r,E,C,j,N,H,V,R,$,W,q,B,tt,G,J,X,Z,Y),this.addElements(s,s+1,s+2),this.addElements(s+1,s+2,s+3),s+=4;const v=Math.max(Math.abs(i),Math.abs(o),Math.abs(rt));v>this.maxPos&&(this.maxPos=v)}}}J(t,n,i,e,r,s,o,a){t.aPosition.push(n,i,e),t.aShape.push(r,s),t.aTexCoord.push(o,a)}X(t,n,i,e,r,s){if(t.aCount.push(i),n){t.aGlyphOffset.push(e[0],e[1]);const n=r.startIndex;t.aSegment.push(r.segment+n,n,r.line.length),t.aVertical.push(s)}}Z(t,n,i,e,r,s,o,a,h,u,l,c,f,d,y,v,p,m){const{textFillFn:g,textSizeFn:w,textHaloFillFn:M,textHaloRadiusFn:b,textHaloOpacityFn:x,textDxFn:F,textDyFn:A,textPitchAlignmentFn:k,textRotationAlignmentFn:P,textRotationFn:S,textAllowOverlapFn:_,textIgnorePlacementFn:O,textOpacityFn:I,markerWidthFn:T,markerHeightFn:L,markerDxFn:U,markerDyFn:z,markerPitchAlignmentFn:D,markerRotationAlignmentFn:E,markerRotationFn:C,markerAllowOverlapFn:j,markerIgnorePlacementFn:N,markerOpacityFn:H}=this.C;g&&t.aTextFill.push(...n),w&&t.aTextSize.push(i),M&&t.aTextHaloFill.push(...e),b&&t.aTextHaloRadius.push(r),x&&t.aTextHaloOpacity.push(s),F&&t.aTextDx.push(o),A&&t.aTextDy.push(a),T&&t.aMarkerWidth.push(h),L&&t.aMarkerHeight.push(u),U&&t.aMarkerDx.push(l),z&&t.aMarkerDy.push(c),(H||I)&&t.aColorOpacity.push(f),(k||D)&&t.aPitchAlign.push(d),(E||P)&&t.aRotationAlign.push(y),(C||S)&&t.aRotation.push(9362*v);const V=j||_,R=N||O;(V||R)&&t.aOverlap.push((V?8:0)+4*p+((R?2:0)+m)),r>0&&(this.properties.hasHalo=1)}G(t,n,i){const{feature:e,symbol:r}=t,s=this.Y(t,r),o=e.properties,{markerSpacingFn:a,textSpacingFn:h}=this.C,u=((a?a(null,o):r.markerSpacing)||(h?h(null,o):r.textSpacing)||250)*i;return function(t,n,i,e,r,s,o){const{feature:a,size:h,symbol:u}=t,l=h?24:0,c=e*(h?h[0]/l:1),f=[];if("line"===s){let t=a.geometry;r&&(t=rr(a.geometry,0,0,r,r));for(let e=0;e<t.length;e++){const s=ar(t[e],o,vr,u.isIconText?null:i.vertical||i.horizontal||i,null,l,u.isIconText?1:c,1,r||1/0);if(u.textPlacement&&!u.isIconText)for(let t=0;t<s.length;t++)s[t].startIndex=n.length/3;if(f.push.apply(f,s),u.textPlacement&&!u.isIconText)for(let i=0;i<t[e].length;i++)n.push(t[e][i].x,t[e][i].y,0)}}else if(3===a.type){const t=ur(a.geometry,0);for(let n=0;n<t.length;n++){const i=t[n];if("vertex"===s)for(let t=0;t<i.length;t++){const n=i[t];for(let t=0;t<n.length;t++)se(n[t],r)||f.push(n[t])}else{const t=fr(i,16);se(t,r)||f.push(t)}}}else if(2===a.type)for(let t=0;t<a.geometry.length;t++){const n=a.geometry[t];if("vertex"===s)for(let t=0;t<n.length;t++)se(n[t],r)||f.push(n[t]);else se(n[0],r)||f.push(n[0])}else if(1===a.type)for(let t=0;t<a.geometry.length;t++){const n=a.geometry[t];for(let t=0;t<n.length;t++){const i=n[t];se(i,r)||f.push(i)}}return f}(t,this.lineVertex,n,i,this.options.EXTENT,s,u)}Y(t,n){return this.C.markerPlacementFn?this.C.markerPlacementFn(this.options.zoom,t.feature.properties):n.markerPlacement||n.textPlacement}}const gr=Math.cos(Math.PI/180*37.5),wr=Math.pow(2,16)/1;class Mr extends le{constructor(t,n,i){super(t,n,i);let e=!1;const{lineDasharrayFn:r,lineDashColorFn:s}=this.C;r&&(e=function(t,n,i){for(let e=0;e<t.length;e++)if(i(n,t[e].properties))return!0;return!1}(t,this.options.zoom,r),e&&(this.dasharrayFn=r)),(Fr(this.symbol.lineDasharray)||e)&&s&&(this.dashColorFn=s)}createStyledVector(t,n,i,e,r){const s=new he(t,n,i,e),o=s.getLineResource();return!this.options.atlas&&o&&(r[o]=[0,0]),s}getFormat(){const{lineWidthFn:t,lineStrokeWidthFn:n,lineStrokeColorFn:i,lineColorFn:e,lineOpacityFn:r,lineDxFn:s,lineDyFn:o,linePatternAnimSpeedFn:a,linePatternGapFn:h}=this.C,u=[{type:Int16Array,width:3,name:"aPosition"}];if(u.push(this.options.center||this.iconAtlas?{type:Int8Array,width:3,name:"aExtrude"}:{type:Int8Array,width:2,name:"aExtrude"}),u.push({type:Uint16Array,width:1,name:"aLinesofar"}),t&&u.push({type:Uint8Array,width:1,name:"aLineWidth"}),n&&u.push({type:Uint8Array,width:1,name:"aLineStrokeWidth"}),e&&u.push({type:Uint8Array,width:4,name:"aColor"}),i&&u.push({type:Uint8Array,width:4,name:"aStrokeColor"}),r&&u.push({type:Uint8Array,width:1,name:"aOpacity"}),this.symbol.lineOffset&&u.push({type:Int8Array,width:2,name:"aExtrudeOffset"}),this.dasharrayFn&&u.push({type:Uint8Array,width:4,name:"aDasharray"}),this.dashColorFn&&u.push({type:Uint8Array,width:4,name:"aDashColor"}),this.iconAtlas){const t=this.getIconAtlasMaxValue();u.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return s&&u.push({type:Int8Array,width:1,name:"aLineDx"}),o&&u.push({type:Int8Array,width:1,name:"aLineDy"}),a&&u.push({type:Int8Array,width:1,name:"aLinePatternAnimSpeed"}),h&&u.push({type:Uint8Array,width:1,name:"aLinePatternGap"}),u}placeVector(t){const{lineJoinFn:n,lineCapFn:i,lineWidthFn:e,lineStrokeWidthFn:r,lineStrokeColorFn:s,lineColorFn:o,lineOpacityFn:a,lineJoinPatternModeFn:h,lineDxFn:u,lineDyFn:l,linePatternAnimSpeedFn:c,linePatternGapFn:f}=this.C,d=this.symbol,y=t.feature,v=3===y.type,p=y.properties,g=this.elements;v&&(this.elements=[]);let w=d.lineJoin||"miter",M=d.lineCap||"butt";if(n&&(w=n(this.options.zoom,p)||"miter"),i&&(M=i(this.options.zoom,p)||"butt"),e){let t=e(this.options.zoom,p);Ji(t)&&(t=4),this.feaLineWidth=t}else this.feaLineWidth=d.lineWidth;if(r){let t=r(this.options.zoom,p);Ji(t)&&(t=0),this.feaLineStrokeWidth=t}else this.feaLineStrokeWidth=d.lineStrokeWidth||0;if(o&&(this.feaColor=o(this.options.zoom,p)||[0,0,0,255],m(this.feaColor)?this.feaColor=[0,0,0,0]:(this.feaColor=Array.isArray(this.feaColor)?this.feaColor.map(t=>255*t):Vn(this.feaColor).array(),3===this.feaColor.length&&this.feaColor.push(255))),s&&(this.feaStrokeColor=s(this.options.zoom,p)||[0,0,0,255],m(this.feaStrokeColor)?this.feaStrokeColor=[0,0,0,0]:(this.feaStrokeColor=Array.isArray(this.feaStrokeColor)?this.feaStrokeColor.map(t=>255*t):Vn(this.feaStrokeColor).array(),3===this.feaStrokeColor.length&&this.feaStrokeColor.push(255))),a){let t=a(this.options.zoom,p);Ji(t)&&(t=1),this.feaOpacity=255*t}if(this.dasharrayFn){let t=this.dasharrayFn(this.options.zoom,p)||[0,0,0,0];if(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,p):this.symbol.lineDashColor)||[0,0,0,0];t=Array.isArray(t)?t.map(t=>255*t):Vn(t).array(),3===t.length&&t.push(255),this.feaDashColor=t}if(this.iconAtlas){const n=t.getLineResource(),i=this.iconAtlas.glyphMap[n];if(this.feaTexInfo=this.feaTexInfo||[0,0,0,0],i){const{tl:t,displaySize:i}=this.iconAtlas.positions[n];this.feaTexInfo[0]=t[0]+1,this.feaTexInfo[1]=t[1]+1,this.feaTexInfo[2]=i[0]-3,this.feaTexInfo[3]=i[1]-3}else this.feaTexInfo[0]=this.feaTexInfo[1]=this.feaTexInfo[2]=this.feaTexInfo[3]=0;this.feaJoinPatternMode=h?h(this.options.zoom,p)||0:d.lineJoinPatternMode||0}if(u){let t=u(this.options.zoom,p);Ji(t)&&(t=0),this.feaLineDx=t}if(l){let t=l(this.options.zoom,p);Ji(t)&&(t=0),this.feaLineDy=t}if(c){let t=c(this.options.zoom,p);Ji(t)&&(t=0),0!==t&&(this.properties.hasPatternAnim=1),this.feaPatternAnimSpeed=t}if(f){let t=f(this.options.zoom,p);Ji(t)&&(t=0),this.feaLinePatternGap=t}const b=this.options.EXTENT;let x=y.geometry;b!==1/0&&3!==y.type&&(x=rr(y.geometry,-1,-1,b+1,b+1));for(let t=0;t<x.length;t++)this.offset=this.data.aPosition.length/3,this.K(x[t],y,w,M,2,1.05),v&&(this.tt(g),this.elements=[]);v&&(this.elements=g)}nt(){return this.iconAtlas&&this.feaTexInfo[2]&&this.feaTexInfo[3]}K(t,n,i,e,r,s){const o=this.nt()||Fr(this.feaDash)||Fr(this.symbol.lineDasharray);this.overscaling=1;const a=this.options.EXTENT;if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.symbol.lineGradientProperty&&n.properties&&Qi(n.properties,"mapbox_clip_start")&&Qi(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;let u=t.length;for(;u>=2&&t[u-1].equals(t[u-2]);)u--;let l=0;for(;l<u-1&&t[l].equals(t[l+1]);)l++;if(u<(h?3:2))return;"bevel"===i&&(r=1.05);const c=this.overscaling<=16?15*a/(512*this.overscaling):0,f={vertexLength:0,primitiveLength:0};let d,y,v,p,m;this.e1=this.e2=-1,h&&(d=t[u-2],m=t[l].sub(d)._().O());for(let n=l;n<u;n++){if(v=n===u-1?h?t[l+1]:void 0:t[n+1],v&&t[n].equals(v))continue;m&&(p=m),d&&(y=d),d=t[n],m=v?v.sub(d)._().O():p,p=p||m;let a=p.add(m);0===a.x&&0===a.y||a._();const g=p.x*m.x+p.y*m.y,w=a.x*m.x+a.y*m.y,M=0!==w?1/w:1/0,b=2*Math.sqrt(2-2*w),x=w<gr&&y&&v,F=p.x*m.y-p.y*m.x>0;if(!o&&x&&n>l){const t=d.dist(y);if(t>2*c){const n=d.sub(d.sub(y).F(c/t).I());this.updateDistance(y,n),this.addCurrentVertex(n,p,0,0,f),y=n}}const A=y&&v;let k=A?i:h?"butt":e;if(A&&"round"===k&&(M<s?k="miter":M<=2&&(k="fakeround")),"miter"===k&&M>r&&(k="bevel"),"bevel"===k&&(M>2&&(k="flipbevel"),M<r&&(k="miter")),y&&this.updateDistance(y,d),(n>l&&n<u-1||h&&n===u-1)&&o){const t=this.feaJoinPatternMode?0:-p.mag()*w;this.addCurrentVertex(d,p,t,t,f),this.it=1}if("miter"===k)a.F(M),this.addCurrentVertex(d,a,0,0,f);else if("flipbevel"===k){if(M>100)a=m.mult(-1);else{const t=M*p.add(m).mag()/p.sub(m).mag();a.O().F(t*(F?-1:1))}this.addCurrentVertex(d,a,0,0,f),this.addCurrentVertex(d,a.mult(-1),0,0,f)}else if("bevel"===k||"fakeround"===k){const t=-Math.sqrt(M*M-1),n=F?t:0,i=F?0:t;if(y&&this.addCurrentVertex(d,p,n,i,f),"fakeround"===k){const t=Math.round(180*b/Math.PI/20);for(let n=1;n<t;n++){let i=n/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+g*(g*(3.55645-1.43519*g)-3.2452))*t*t+(.848013+g*(.215638*g-1.06021)))}const e=m.sub(p).F(i).u(p)._().F(F?-1:1);this.addHalfVertex(d,e.x,e.y,!1,F,0,f)}}v&&this.addCurrentVertex(d,m,-n,-i,f)}else if("butt"===k)this.addCurrentVertex(d,a,0,0,f);else if("square"===k){const t=y?1:-1;this.addCurrentVertex(d,a,t,t,f)}else"round"===k&&(y&&(this.addCurrentVertex(d,p,0,0,f),this.addCurrentVertex(d,p,1,1,f,!0)),v&&(this.addCurrentVertex(d,m,-1,-1,f,!0),this.addCurrentVertex(d,m,0,0,f)));if(!o&&x&&n<u-1){const t=d.dist(v);if(t>2*c){const n=d.add(v.sub(d).F(c/t).I());this.updateDistance(d,n),this.addCurrentVertex(n,m,0,0,f),d=n}}if((n>l&&n<u-1||h&&n===l)&&o){delete this.it;const t=this.feaJoinPatternMode?0:m.mag()*w;this.addCurrentVertex(d,m,t,t,f)}}}addCurrentVertex(t,n,i,e,r,s=!1){const o=n.y*e-n.x,a=-n.y-n.x*e;this.addHalfVertex(t,n.x+n.y*i,n.y-n.x*i,s,!1,i,r),this.addHalfVertex(t,o,a,s,!0,-e,r),this.distance>wr/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,n,i,e,r,s))}addHalfVertex({x:t,y:n},i,e,r,s,o,a){this.fillData(this.data,t,n,i,e,r,s,1*this.scaledDistance);const h=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.addElements(this.e1,this.e2,h),a.primitiveLength++),s?this.e2=h:this.e1=h}fillData(t,n,i,e,r,s,o,a){const{lineWidthFn:h,lineStrokeWidthFn:u,lineStrokeColorFn:l,lineColorFn:c,lineOpacityFn:f,lineDxFn:d,lineDyFn:y,linePatternAnimSpeedFn:v,linePatternGapFn:p}=this.C;if(this.options.center?t.aPosition.push(n,i,0):t.aPosition.push(n=(n<<1)+(s?1:0),i=(i<<1)+(o?1:0),0),t.aExtrude.push(63*e,63*r),this.options.center||this.iconAtlas){let n=0;this.options.center&&(n+=2*s+o),this.iconAtlas&&(n+=4*(this.it&&this.feaJoinPatternMode?1:0)),t.aExtrude.push(n)}t.aLinesofar.push(a),h&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),u&&t.aLineStrokeWidth.push(Math.round(2*this.feaLineStrokeWidth)),c&&t.aColor.push(...this.feaColor),l&&t.aStrokeColor.push(...this.feaStrokeColor),f&&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),d&&t.aLineDx.push(this.feaLineDx),y&&t.aLineDy.push(this.feaLineDy),v&&t.aLinePatternAnimSpeed.push(127*this.feaPatternAnimSpeed),p&&t.aLinePatternGap.push(10*this.feaLinePatternGap),this.maxPos=Math.max(this.maxPos,Math.abs(n)+1,Math.abs(i)+1)}addElements(t,n,i){super.addElements(this.offset+t,this.offset+n,this.offset+i)}tt(t){const n=this.options.EXTENT,i=this.elements;for(let e=0;e<i.length;e+=3)n!==1/0&&(xr(this.data.aPosition,i[e],i[e+1],3,n)||xr(this.data.aPosition,i[e+1],i[e+2],3,n))||t.push(i[e],i[e+1],i[e+2])}et(t){if(t.length<=1)return t;const n=[],i=this.options.EXTENT;let e,r=!0;for(e=0;e<t.length-1;e++){const s=br(t[e],t[e+1],i);s&&r||(n.push(t[e]),r=s)}return r||n.push(t[e]),n}updateDistance(t,n){this.distance+=t.dist(n),this.updateScaledDistance()}updateScaledDistance(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(wr-1):this.distance}}function br(t,n,i){return i!==1/0&&(t.x<0&&n.x<0||t.x>i&&n.x>i||t.y<0&&n.y<0||t.y>i&&n.y>i)}function xr(t,n,i,e,r){if(r===1/0)return!1;const s=Math.floor(.5*t[n*e]),o=Math.floor(.5*t[n*e+1]),a=Math.floor(.5*t[i*e]),h=Math.floor(.5*t[i*e+1]);return s===a&&(s<0||s>r)&&o!==h||o===h&&(o<0||o>r)&&s!==a}function Fr(t){if(!Array.isArray(t))return!1;for(let n=0;n<t.length;n++)if(t[n])return!0;return!1}class Ar extends Mr{constructor(t,n,i){super(t,n,i),this.rt=i.altitudeProperty}getFormat(){const{lineColorFn:t,lineWidthFn:n}=this.C,i=[{type: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&&i.push({type:Uint8Array,width:4,name:"aColor"}),n&&i.push({type:Uint8Array,width:1,name:"aLineWidth"}),this.rt&&i.push({type:Array,width:1,name:"aLineHeight"}),i}placeVector(t){const n=t.feature;if(this.rt){const{altitudeScale:t,altitudeProperty:i,defaultAltitude:e,heightProperty:r,defaultHeight:s,minHeightProperty:o}=this.options,{altitude:a,height:h}=re(n,t,i,e,r,s,o);this.feaAltitude=a,this.feaMinHeight=(a-h)/a*32767,a>this.maxAltitude&&(this.maxAltitude=a)}return super.placeVector(t)}K(t,n,i,e,r,s){const o=this.data.aPosition.length/3;super.K(t,n,i,e,r,s);const a=this.data.aPosition.length/3,h=this.data.aPosition.length/3-this.offset;if(3!==n.type&&h>0&&!1!==this.options.side){const t=!1!==this.options.top?1:0,n=t+4;let i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],e=n.length/i;for(let t=0;t<e;t++)n.push(n[o*e+3*e+t])}i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],r=e.length/i;for(let t=0;t<r;t++)e.push(e[o*r+r*n+t])}i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],r=e.length/i;for(let t=0;t<r;t++)e.push(e[o*r+r*(n+3)+t])}super.addElements(t+1,h+1,h),super.addElements(h,h+1,h+2);const e=this.data.aPosition.length/3-this.offset;i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],e=n.length/i;for(let t=0;t<e;t++)n.push(n[a*e-e+t])}i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],r=e.length/i;for(let t=0;t<r;t++)e.push(e[a*r-n*r-r+t])}i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],r=e.length/i;for(let t=0;t<r;t++)e.push(e[a*r-n*r-3*r+t])}super.addElements(e,h-3,e+1),super.addElements(h-3,e+2,e+1)}}fillData(t,n,i,e,r,s,o,a){const h=!1!==this.options.top,u=!1!==this.options.side,l=this.feaLineWidth||this.symbol.lineWidth/2*(this.options.EXTENT/this.options.tileSize),c=63*e,f=63*r,d=l*e+n,y=l*r+i;this.st(t,n,i,e,r,s,o,a,d,y,c,f),u&&(h&&this.st(t,n,i,e,r,s,o,a,d,y,c,f),this.st(t,n,i,e,r,s,o,a,d,y,c,f),this.ot(t,n,i,e,r,s,o,a,d,y,c,f),this.ot(t,n,i,e,r,s,o,a,d,y,c,f)),this.maxPos=Math.max(this.maxPos,Math.abs(n),Math.abs(i))}st(t,n,i,e,r,s,o,a,h,u,l,c){const{lineColorFn:f,lineWidthFn:d}=this.C;t.aPosition.push(n,i,32767),t.aLinesofar.push(a),t.aUp.push(+o),t.aExtrudedPosition.push(h,u,1),t.aExtrude.push(l,c),f&&t.aColor.push(...this.feaColor),d&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.rt&&t.aLineHeight.push(this.feaAltitude)}ot(t,n,i,e,r,s,o,a,h,u,l,c){const{lineColorFn:f,lineWidthFn:d}=this.C;t.aPosition.push(n,i,this.feaMinHeight||0),t.aLinesofar.push(a),t.aUp.push(+o),t.aExtrudedPosition.push(h,u,1),t.aExtrude.push(l,c),f&&t.aColor.push(...this.feaColor),d&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.rt&&t.aLineHeight.push(this.feaAltitude)}addElements(t,n,i){const e=!1!==this.options.top,r=!1!==this.options.side,s=(e?1:0)+(r?4:0);if(t*=s,n*=s,this.data.aUp[this.offset+(i*=s)+4]){if(e&&super.addElements(n,t,i),r){const t=e?1:0;super.addElements(n+t,i+t,i+t+2),super.addElements(n+t+1,i+t+1+2,n+t+1+2)}}else if(e&&super.addElements(t,i,n),r){const n=e?1:0;super.addElements(t+n,t+n+2,i+n),super.addElements(t+n+1+2,i+n+1+2,i+n+1)}}createDataPack(t,n){this.maxAltitude=0;const i=super.createDataPack(t,n);if(!i)return i;const{data:e,indices:r}=i;this.getFormat().reduce((t,n)=>(t[n.name]={size:n.width},t),{}).aPickingId={size:1};const{aExtrudedPosition:s,aPosition:o,aLinesofar:a,aUp:h,aExtrude:u,aColor:l,aLineHeight:c,aLineWidth:f}=e,d={},y=Xn(s,r);let v,p=!0;for(let t=0;t<y.length;t++)y[t]=-y[t],y[t]%1!=0&&(p=!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)&&(v=function(t,n,i){const e=[];for(let r=0;r<t.length;r+=3){const t=n[r/3];e.push(t/256,i[r/3]?1:0)}return e}(s,a,h)),d.aPosition=o,v&&(d.aTexCoord0=new Float32Array(v)),d.aNormal=p?new Int8Array(y):new Float32Array(y),d.aPickingId=e.aPickingId,d.aExtrude=u,l&&(d.aColor=l),f&&(d.aLineWidth=f),c){const t=Wi(this.maxAltitude);d.aLineHeight=new t(c)}const m=[];for(const t in d)m.push(d[t].buffer);return i.data=d,i.buffers=m,i}}const kr=Math.pow(2,16)/1;class Pr extends le{getFormat(){return[{type:Int16Array,width:3,name:"aPosition"}]}placeVector(t){const n=t.feature,i=3===n.type,e=n.geometry,r=this.elements;i&&(this.elements=[]);for(let t=0;t<e.length;t++)this.offset=this.data.aPosition.length/3,this.K(e[t],n),i&&(this.tt(r),this.elements=[]);i&&(this.elements=r)}K(t,n){const i=3===n.type;let e=t.length;for(;e>=2&&t[e-1].equals(t[e-2]);)e--;let r,s,o,a=0;for(;a<e-1&&t[a].equals(t[a+1]);)a++;if(!(e<(i?3:2))){this.distance=0,this.vertexLength=0,this.primitiveLength=0,this.e1=this.e2=this.e3=-1,i&&(r=t[e-2]);for(let n=a;n<e;n++)o=i&&n===e-1?t[a+1]:t[n+1],o&&t[n].equals(o)||(r&&(s=r),r=t[n],s&&(this.distance+=r.dist(s)),this.addCurrentVertex(r,this.distance))}}addCurrentVertex(t,n){const i=this.vertexLength++;this.addLineVertex(this.data,t,n),i>=1&&this.addElements(i-1,i),n>kr&&(this.distance=0,this.addCurrentVertex(t,this.distance))}addLineVertex(t,n){t.aPosition.push(n.x,n.y,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)}tt(t){const n=this.options.EXTENT,i=this.elements;for(let e=0;e<i.length;e+=2)ie(this.data.aPosition,i[e],i[e+1],3,n)||t.push(i[e],i[e+1])}}const Sr=45*Math.PI/100;class _r extends le{getFormat(){return[{type:Int16Array,width:3,name:"aPosition"}]}placeVector(t){const n=this.G(t,this.symbol.markerSpacing||250,this.symbol.markerPlacement||"point"),i=this.getAltitude(t.feature.properties);for(let t=0;t<n.length;t++){const e=n[t];this.data.aPosition.push(e.x,e.y),this.data.aPosition.push(i);const r=Math.max(Math.abs(e.x),Math.abs(e.y));r>this.maxPos&&(this.maxPos=r)}}G(t,n,i){const e=t.feature,r=t.feature.type,s=this.options.EXTENT,o=[];if("line"===i){let t=e.geometry;s&&(t=rr(e.geometry,0,0,s,s));for(let i=0;i<t.length;i++){const e=ar(t[i],n,Sr,null,null,24,1,1,s||1/0);o.push.apply(o,e)}}else if(3===r){const t=ur(e.geometry,0);for(let n=0;n<t.length;n++){const i=fr(t[n],16);se(i,s)||o.push(i)}}else if(2===e.type)for(let t=0;t<e.geometry.length;t++){const n=e.geometry[t];se(n[0],s)||o.push(n[0])}else if(1===e.type)for(let t=0;t<e.geometry.length;t++){const n=e.geometry[t];for(let t=0;t<n.length;t++){const i=n[t];se(i,s)||o.push(i)}}return o}hasElements(){return!1}}\n/*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */const Or=[],Ir=[];function Tr(t,n){var i,e,r,s,o,a,h;for(e=1;e<=8;e*=2){for(i=[],s=!(Ur(r=t[t.length-1],n)&e),o=0;o<t.length;o++){if((h=!(Ur(a=t[o],n)&e))!==s){const t=Lr(r,a,e,n);i.push(void 0!==a.x?new Ht(t[0],t[1]):t)}h&&i.push(a),r=a,s=h}if(!(t=i).length)break}return i}function Lr(t,n,i,e){return Or[0]=void 0===t.x?t[0]:t.x,Or[1]=void 0===t.y?t[1]:t.y,t=Or,Ir[0]=void 0===n.x?n[0]:n.x,Ir[1]=void 0===n.y?n[1]:n.y,n=Ir,8&i?[t[0]+(n[0]-t[0])*(e[3]-t[1])/(n[1]-t[1]),e[3]]:4&i?[t[0]+(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1]),e[1]]:2&i?[e[2],t[1]+(n[1]-t[1])*(e[2]-t[0])/(n[0]-t[0])]:1&i?[e[0],t[1]+(n[1]-t[1])*(e[0]-t[0])/(n[0]-t[0])]:null}function Ur(t,n){Or[0]=void 0===t.x?t[0]:t.x,Or[1]=void 0===t.y?t[1]:t.y;var i=0;return(t=Or)[0]<n[0]?i|=1:t[0]>n[2]&&(i|=2),t[1]<n[1]?i|=4:t[1]>n[3]&&(i|=8),i}class zr extends le{constructor(...t){super(...t),this.lineElements=[]}createStyledVector(t,n,i,e,r){const s=new he(t,n,i,e),o=s.getPolygonResource();return!this.options.atlas&&o&&(r[o]=[0,0]),s}getFormat(){const t=[{type:Int16Array,width:3,name:"aPosition"}],{polygonFillFn:n,polygonOpacityFn:i,uvScaleFn:e,uvOffsetFn:r}=this.C;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"}),i&&t.push({type:Uint8Array,width:1,name:"aOpacity"}),e&&t.push({type:Uint16Array,width:2,name:"aUVScale"}),r&&t.push({type:Uint8Array,width:2,name:"aUVOffset"}),t}createDataPack(...t){this.maxLineIndex=0,this.lineElements=[];const n=super.createDataPack(...t);if(!n)return n;let i=this.lineElements;return i=new($i(this.maxLineIndex))(this.lineElements),n.lineIndices=i,n.buffers.push(i.buffer),n}placeVector(t,n){const i=t.feature;this.at(i.geometry,i,n)}at(t,n){let i,e,r,s;const{polygonFillFn:o,polygonOpacityFn:a,uvScaleFn:h,uvOffsetFn:u}=this.C,l=n.properties;o&&(i=o(this.options.zoom,l)||[255,255,255,255],m(i)?i=[0,0,0,0]:(i=Array.isArray(i)?i.map(t=>255*t):Vn(i).array(),3===i.length&&i.push(255))),a&&(e=a(this.options.zoom,l),Ji(e)&&(e=1),e*=255),h&&(r=h(this.options.zoom,l),Ji(r)&&(r=[1,1]),r=[255*r[0],255*r[1]]),u&&(s=u(this.options.zoom,l),Ji(s)&&(s=[0,0]),s=[255*s[0],255*s[1]]);const c=!!this.iconAtlas,f=ur(t,500),d=this.getAltitude(l),y=[0,0],v=[0,0];if(c){const{polygonPatternFileFn:t}=this.C,n=t?t(null,l):this.symbol.polygonPatternFile;if(this.iconAtlas.glyphMap[n]){const t=this.iconAtlas.positions[n];y[0]=t.tl[0]+1,y[1]=t.tl[1]+1,v[0]=t.displaySize[0]-3,v[1]=t.displaySize[1]-3}}const p=[-1,-1,n.extent+1,n.extent+1];for(let t=0;t<f.length;t++){const n=f[t],o=this.data.aPosition.length/3,a=[],h=[];for(let t=0;t<n.length;t++){let o=n[t];if(this.options.EXTENT!==1/0&&(o=Tr(o,p)),0===o.length)continue;0!==t&&h.push(a.length/2);const u=this.lineElements.length;this.data.aPosition.push(o[0].x,o[0].y,d),c&&this.data.aTexInfo.push(...y,...v),void 0!==i&&this.data.aColor.push(...i),void 0!==e&&this.data.aOpacity.push(e),void 0!==r&&this.data.aUVScale.push(...r),void 0!==s&&this.data.aUVOffset.push(...s),this.maxPos=Math.max(this.maxPos,Math.abs(o[0].x),Math.abs(o[0].y)),this.addLineElements(u+o.length-1,u),a.push(o[0].x),a.push(o[0].y);for(let t=1;t<o.length;t++)this.data.aPosition.push(o[t].x,o[t].y,d),c&&this.data.aTexInfo.push(...y,...v),void 0!==i&&this.data.aColor.push(...i),void 0!==e&&this.data.aOpacity.push(e),void 0!==r&&this.data.aUVScale.push(...r),void 0!==s&&this.data.aUVOffset.push(...s),this.maxPos=Math.max(this.maxPos,Math.abs(o[t].x),Math.abs(o[t].y)),this.addLineElements(u+t-1,u+t),a.push(o[t].x),a.push(o[t].y)}const u=ki(a,h);for(let t=0;t<u.length;t+=3)this.addElements(o+u[t],o+u[t+1],o+u[t+2])}}addLineElements(...t){this.maxLineIndex=Math.max(this.maxLineIndex,...t),this.lineElements.push(...t)}}var Dr=Object.freeze({__proto__:null,clipPolygon:Tr,calculateSignedArea:ne,getFeaAltitudeAndHeight:re,convertRTLText:tr});const Er={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},Er),Object.assign({lineDasharray:1},Er);function Cr(t,n,i,e,r,s,o,a,h,u,l,c,f,d,y){const v=n.length,p=r/3;for(let i=2,e=v;i<e;i+=3)t[r+i-2]=n[i-2],t[r+i-1]=n[i-1],t[r+i-0]=n[i]-s;r+=v;for(let i=2,e=v;i<e;i+=3)t[r+i-2]=n[i-2],t[r+i-1]=n[i-1],t[r+i-0]=n[i]-o;r+=v;for(let i=2,e=v;i<e;i+=3)t[r+i-2]=n[i-2],t[r+i-1]=n[i-1],t[r+i-0]=n[i]-s;r+=v;for(let i=2,e=v;i<e;i+=3)t[r+i-2]=n[i-2],t[r+i-1]=n[i-1],t[r+i-0]=n[i]-o;r+=v,(i=i||[]).push(v/3);for(let n=0;n<i.length;n++){jr(p+(i[n-1]||0),p+i[n],t,v/3,a,e,h,u,l,c,f,d,y)}return r}function jr(t,n,i,e,r,s,o,a,h,u,l,c,f){const d=s.length;let y,v;for(let o=t,a=n;o<a-1;o++)y=o,v=o+1,ct(i,y,v,r)||((o-t)%2==1&&(y+=2*e,v+=2*e),s.push(y+e,y,v),s.push(v,v+e,y+e));o&&function(t,n,i,e,r,s,o,a,h){let u,l=0,c=0,f=0,d=0;for(let y=e.length-1;y>=0;y--){const v=3*e[y],p=3*e[y]+1,m=3*e[y]+2,g=i[v],w=i[p],M=i[m];l||c||(l=Math.max(i[m],i[3*e[y-2]+2]),c=Math.min(i[m],i[3*e[y-2]+2]),u=l-c);let b=f;const x=y%6;0===t?(5===x&&(d=Nt(i,e,y,g,w)),b=2===x||3===x||4===x?f:f+d):1===t&&(2===x||3===x||4===x?b=0:5===x?(d=Nt(i,e,y,g,w),b=d):b=d);const F=b*o*a/r,A=M===l?0:u*h/s;n[v/3*2]=F,n[v/3*2+1]=-A,0===x&&(f+=d)}}(a,h,i,s.slice(d,s.length),u[0],u[1],l,c,f)}function Nr(t,n,i,e,r,s,o,a,h,u){void 0===n.top&&(n.top=!0),void 0===n.side&&(n.side=!0);const{altitudeScale:l,altitudeProperty:c,defaultAltitude:f,heightProperty:d,minHeightProperty:y,defaultHeight:v,tangent:p,uv:m,uvScale:M,topUVMode:b,sideUVMode:x,top:F,side:A,topThickness:k}=n,S=function(t,n,{altitudeScale:i,altitudeProperty:e,defaultAltitude:r,heightProperty:s,minHeightProperty:o,defaultHeight:a},{side:h,top:u,topThickness:l,uvOrigin:c,uv:f,uvSize:d,topUVMode:y,sideUVMode:v,glScale:p,localScale:m,vScale:g},w){const M=n/t[0].extent,b=[],x=[],F=[],A=[],k=[],S=[],_=!!f,O=!!u,T=!!h,z=_?[]:null;function D(t,i,e,r){if(O){const r=ki(A,e,3);if(0===r.length)return i;let s;I(k,A),i+=A.length;for(let n=2,i=r.length;n<i;n+=3)s=r[n-1],r[n-1]=r[n]+t/3,r[n]=s+t/3,r[n-2]+=t/3;I(S,r),_&&Et(y||0,t,i,z,k,0,p,m,d[0],d[1]),l>0&&!T&&(i=Cr(k,A,e,S,i,0,l,n,_,v||0,z,d,p,m,g))}return T&&(O&&(l=0),i=Cr(k,A,e,S,i,l,r,n,_,v||0,z,d,p,m,g)),i}let E=0,C=0;const j=[-1,-1,n+1,n+1];let N=0,H=t.length;void 0!==w&&(N=w,H=w+1);let V=0,R=!1;for(;N<H;N++){const h=t[N],u=h.id;P(u)&&(Math.abs(u)>V&&(V=Math.abs(u)),u<0&&(R=!0));const l=h.geometry,{altitude:c,height:f}=Dr.getFeaAltitudeAndHeight(h,i,e,r,s,a,o);E=Math.max(Math.abs(c),E);const d=k.length;let y=C,v=[];A.length=0;for(let t=0,i=l.length;t<i;t++){const e=Dr.calculateSignedArea(l[t])<0;!e&&t>0&&(C=D(y,C,v,f*M),A.length=0,v=[],y=C);let r=l[t];if(n!==1/0&&(r=Dr.clipPolygon(r,j)),!r.length){t===i-1&&(C=D(y,C,v,f*M));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]),e&&v.push(A.length/3),lt(A,A.length,r,M,c),t===i-1&&(C=D(y,C,v,f*M))}const p=k.length-d,m="__fea_idx".trim();for(let t=0;t<p/3;t++)x.push(void 0===h[m]?N:h[m]),b.push(N),P(u)&&F.push(u)}const $=L(x.length?x[x.length-1]:0),W={maxAltitude:E,vertices:new(U(Math.max(512,E)))(k),indices:S,pickingIds:new $(x),featureIndexes:b};if(F.length){const t=R?U(V):L(V);W.featureIds=new t(F)}else W.featureIds=[];return z&&(z.length=k.length/3*2,W.uvs=z),W}(t,i,{altitudeScale:l,altitudeProperty:c,defaultAltitude:f||0,heightProperty:d,minHeightProperty:y,defaultHeight:v||0},{top:F,side:A,topThickness:10*k||0,uv:m||p,uvSize:M?[.5*M[0],.5*M[1]]:[.5,.5],uvOrigin:e,topUVMode:b,sideUVMode:x,glScale:r,localScale:o,vScale:s},u),_=[],O=new(T(S.vertices.length/3))(S.indices);delete S.indices,_.push(O.buffer,S.vertices.buffer,S.pickingIds.buffer);const z=Xn(S.vertices,O);let E=!0;for(let t=0;t<z.length;t++)z[t]=-z[t],z[t]%1!=0&&(E=!1);if(S.normals=z,p){let t=function(t,n,i,e){const r=t.length/3,s=new Array(4*r),o=[],a=[];for(let t=0;t<r;t++)o[t]=[0,0,0],a[t]=[0,0,0];const h=[0,0,0],u=[0,0,0],l=[0,0,0],c=[0,0],f=[0,0],d=[0,0],y=[0,0,0],v=[0,0,0];function p(n,e,r){Zn(h,t,3*n),Zn(u,t,3*e),Zn(l,t,3*r),Yn(c,i,2*n),Yn(f,i,2*e),Yn(d,i,2*r);const s=u[0]-h[0],p=l[0]-h[0],m=u[1]-h[1],g=l[1]-h[1],w=u[2]-h[2],M=l[2]-h[2],b=f[0]-c[0],x=d[0]-c[0],F=f[1]-c[1],A=d[1]-c[1],k=1/(b*A-x*F);bt(y,(A*s-F*p)*k,(A*m-F*g)*k,(A*w-F*M)*k),bt(v,(b*p-x*s)*k,(b*g-x*m)*k,(b*M-x*w)*k),xt(o[n],o[n],y),xt(o[e],o[e],y),xt(o[r],o[r],y),xt(a[n],a[n],v),xt(a[e],a[e],v),xt(a[r],a[r],v)}for(let t=0,n=e.length;t<n;t+=3)p(e[t+0],e[t+1],e[t+2]);const m=[],g=[],w=[],M=[];let b,x,F;function A(t){Zn(w,n,3*t),Mt(M,w),x=o[t],Mt(m,x),St(m,m,function(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}(w,w,kt(w,x))),At(m,m),Pt(g,M,x),F=kt(g,a[t]),b=F<0?-1:1,s[4*t]=m[0],s[4*t+1]=m[1],s[4*t+2]=m[2],s[4*t+3]=b}for(let t=0,n=e.length;t<n;t+=3)A(e[t+0]),A(e[t+1]),A(e[t+2]);return s}(S.vertices,S.normals,S.uvs,O);t=function(t,n){const i=new Float32Array(n.length),e=[],r=[],s=[];for(let o=0;o<n.length;o+=4){const a=o/4*3;bt(r,t[a]||0,t[a+1]||0,t[a+2]||0),Ot(e,n[o]||0,n[o+1]||0,n[o+2]||0,n[o+3]||0),Jn(s,r,e),_t(i.subarray(o,o+4),s)}return i}(S.normals,t),S.tangents=t,_.push(t.buffer),delete S.normals}if(S.normals&&(S.normals=E?new Int8Array(S.normals):new Float32Array(S.normals),_.push(S.normals.buffer)),S.uvs){const t=S.uvs;S.uvs=new Float32Array(t),_.push(S.uvs.buffer)}const C=function(t,n,i,e){const r={};if(D(n.polygonFill)){const s={},o=w(n.polygonFill),a=new Uint8Array(4*e.length);for(let n=0;n<e.length;n++){const r=t[e[n]],h=r.properties||{};h.$layer=r.layer,h.$type=r.type;let u=o(i,h);if(delete h.$layer,delete h.$type,Array.isArray(u)||(u=s[u]=s[u]||Vn(u).array()),Array.isArray(u)){for(let t=0;t<u.length;t++)Hr[t]=255*u[t];3===u.length&&(Hr[3]=255)}a[4*n]=Hr[0],a[4*n+1]=Hr[1],a[4*n+2]=Hr[2],a[4*n+3]=Hr[3]}r.aColor=a}if(D(n.polygonOpacity)){const s=g(n.polygonOpacity),o=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const r=t[e[n]],a=r.properties||{};a.$layer=r.layer,a.$type=r.type;const h=s(i,a);delete a.$layer,delete a.$type,o[n]=255*h}r.aOpacity=o}return r}(t,a,h,S.featureIndexes),j={data:{data:{aPosition:S.vertices,aNormal:S.normals,aTexCoord0:S.uvs,aTangent:S.tangents,aPickingId:S.pickingIds},indices:O,properties:{maxAltitude:S.maxAltitude}},buffers:_};return S.featureIds.length?(j.data.featureIds=S.featureIds,_.push(j.data.featureIds.buffer)):j.data.featureIds=[],C.aColor&&(j.data.data.aColor=C.aColor,j.buffers.push(C.aColor.buffer)),C.aOpacity&&(j.data.data.aOpacity=C.aOpacity,j.buffers.push(C.aOpacity.buffer)),j}const Hr=[];function Vr(t,n,{altitudeScale:i,altitudeProperty:e,defaultAltitude:r,heightProperty:s,minHeightProperty:o,defaultHeight:a,bottom:h}){const u=h,l=n/t[0].extent,c=2*function(t,n){let i=0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(P(r.geometry[0][0])){const t=3*r.geometry.length;i+=n?2*t-6:t}else for(let t=0,e=r.geometry.length;t<e;t++){let e=3*r.geometry[t].length;3===r.type&&(e-=3),i+=n?2*e-6:e}}return i}(t)+3*t.length*2,f=[],d=new Int16Array(c),y=[];function v(t,i,e){const r=i-t,s=d.subarray(t,i),o=d.subarray(i,i+r);o.set(s);for(let t=2,n=o.length;t<n;t+=3)o[t]=s[t]-e;const a=t/3,h=r/3;let l,c;for(let t=a,i=h+a;t<i;t++)t<i-1?(l=t,c=t+1):(l=t,c=a),ct(d,l,c,n)||(y.push(l,c),u&&y.push(l+h,c+h),Rr(d,l,n)||y.push(l,l+h));return i+r}let p=0,m=0;const g="__fea_idx".trim();for(let n=0,h=t.length;n<h;n++){const h=t[n],u=h.geometry,{altitude:c,height:w}=Dr.getFeaAltitudeAndHeight(h,i,e,r,s,a,o);m=Math.max(Math.abs(c),m);let M=p;for(let t=0,n=u.length;t<n;t++){let n=u[t];const i=n.length;n[0][0]===n[i-1][0]&&n[0][1]===n[i-1][1]&&(n=n.slice(0,i-1)),p=lt(d,M,n,l,c),p=v(M,p,w*l),M=p}const b=y.length-f.length;for(let t=0;t<b;t++)f.push(h[g])}const w=new(T(y.reduce((t,n)=>Math.max(t,n),0)))(y),M=L(t.length);return{aPosition:new(U(Math.max(512,m)))(d),indices:w,aPickingId:new M(f)}}function Rr(t,n,i){const e=t[3*n],r=t[3*n+1];return e<0||e>i||r<0||r>i}function $r(t,n,i){const e=Vr(t,i,n),r=[e.aPosition.buffer,e.indices.buffer,e.aPickingId.buffer],s=e.indices;return delete e.indices,{data:{data:e,indices:s},buffers:r}}class Wr{constructor(t,n,i,e,r){this.id=t,this.options=n,this.upload=i,this.ht(n.style),this.requests={},this.ut=0,this.lt=e,this.loadings=r}updateStyle(t,n){this.options.style=t,this.ht(t),this.ut++,n()}updateOptions(t,n){this.options=A(this.options,t),n()}loadTile(t,n){const i=this.loadings,e=t.tileInfo.url,r=this.options.debugTile;if(r){const{x:i,y:e,z:s}=t.tileInfo;if(s!==r.z||i!==r.x||e!==r.y)return void n()}if(this.lt.has(e)){const{features:r,layers:s}=this.lt.get(e),o=i[e];if(delete i[e],!r||!r.length)return this.ct(o),void n();if(o)for(let n=0;n<o.length;n++)this.ft.call(o[n].ref,t,o[n].callback,e,s,r);this.ft(t,n,e,s,r)}else i[e]?i[e].push({callback:n,ref:this}):(i[e]=[{callback:n,ref:this}],this.requests[e]=this.getTileFeatures(t.tileInfo,(n,r,s,o)=>{const a=i[e];if(delete i[e],this.checkIfCanceled(e))return delete this.requests[e],void this.ct(a,null,{canceled:!0});if(delete this.requests[e],this.options.debug&&r)for(let n=0;n<r.length;n++)r[n]._debug_info={index:n,tileId:t.tileInfo.id};if(n)return n.loading||this.lt.add(e,{features:[],layers:[]}),void this.ct(a,n);if(!r||!r.length)return this.lt.add(e,{features:[],layers:[]}),void this.ct(a);if(this.lt.add(e,{features:r,layers:s}),a)for(let n=0;n<a.length;n++)this.ft.call(a[n].ref,t,a[n].callback,e,s,r,o)}))}ft(t,n,i,e,r,s){this.dt(e,r,t).then(t=>{t.canceled?n(null,{canceled:!0}):(t.data.style=this.ut,s&&A(t.data,s),n(null,t.data,t.buffers))}).catch(t=>{n(t)})}abortTile(t,n){delete this.requests[t],this.yt(t),n()}yt(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]}ct(t,n,i){if(t)for(let e=0;e<t.length;e++)t[e].callback(n,i)}checkIfCanceled(t){return!this.requests[t]}fetchIconGlyphs(t,n,i){this.upload("fetchIconGlyphs",{icons:t,glyphs:n},null,i)}dt(t,n,{glScale:i,zScale:e,tileInfo:r}){if(!n.length)return Promise.resolve({data:null,buffers:[]});const s=!this.options.style.style.length&&!this.options.style.featureStyle.length;let o=this.pluginConfig.slice(0);s&&(o=this.vt(t)),this.featurePlugins&&I(o,this.featurePlugins);const a=n[0].extent,h=r.z,u={x:r.extent2d.xmin*i,y:r.extent2d.ymax*i},l=[],c=[],f=[],d=this.options,y=[],v={},p=[Promise.resolve(this.ut)];let m=0,g=-1;for(let t=0;t<o.length;t++){g++;const r=o[t];r.type!==m&&(g=0,m=r.type);const d=0===r.type?l:c;if(r.symbol&&!1===r.symbol.visible){d[g]=null;continue}const{tileFeatures:w,tileFeaIndexes:M}=this.pt(r.type,r.filter,n,v,t);if(!w.length){d[g]=null;continue}const b=T(M[M.length-1]);d[g]={styledFeatures:new b(M)},f.push({idx:t,typeIdx:g}),y.push(d[g].styledFeatures.buffer);let x=this.gt(w,r,{extent:a,tilePoint:u,glScale:i,zScale:e,zoom:h});s&&(x=x.then(t=>{if(!t)return null;if(t.data)t.data.layer=w[0].layer;else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]&&t[n].data&&(t[n].data.layer=w[0].layer);return t})),p.push(x)}return Promise.all(p).then(([i,...e])=>{function r(t,n){if(void 0===t.data.ref&&(t.data.type=o[f[n].idx].renderPlugin.dataConfig.type,t.data.filter=o[f[n].idx].filter.def,t.buffers&&t.buffers.length))for(let n=0;n<t.buffers.length;n++)y.push(t.buffers[n])}if(i!==this.ut)return{canceled:!0};for(let t=0;t<e.length;t++){if(!e[t])continue;const n=e[t],i=0===o[f[t].idx].type?l:c;if(Array.isArray(n)){const e=[];for(let i=0;i<n.length;i++)n[i]&&(r(n[i],t),(void 0===n[i].data.ref||n[n[i].data.ref])&&e.push(n[i].data));e.length&&(i[f[t].typeIdx].data=e)}else r(n,t),i[f[t].typeIdx].data=n.data}const s={},h=t;if(d.features||d.schema){let t;for(let i=0,e=n.length;i<e;i++)if(t=n[i],h[t.layer].properties||(h[t.layer].properties=Gr(t.properties)),d.features&&t&&v[i])if("id"===d.features)s[i]=t.id;else{const n=A({},t);d.pickingGeometry||delete n.geometry,delete n.extent,delete n.properties.$layer,delete n.properties.$type,delete n.__index,s[i]=n}}return{data:{schema:h,data:l,featureData:c,extent:a,features:s},buffers:y}})}gt(t,n,i){const e=n.renderPlugin.dataConfig,r=n.symbol,s=this.options.tileSize[0],{extent:o,glScale:a,zScale:h,zoom:u,tilePoint:l}=i,c=o/s,f=e.type,d=this.options.debugTile&&this.options.debugTile.index;if("3d-extrusion"===f){const n=Jr(r);return n&&(e.uv=1,2===n&&(e.tangent=1)),Promise.all([Promise.resolve(Nr(t,e,o,l,a,h,this.options.tileSize[1]/o,r,u,d))])}if("3d-wireframe"===f)return Promise.all([Promise.resolve($r(t,e,o))]);if("point"===f){const n=A({},e,{EXTENT:o,requestor:this.fetchIconGlyphs.bind(this),zoom:u,debugIndex:d}),i=mr.splitPointSymbol(r);return mr.needMerge(i[0])&&(t=mr.mergeLineFeatures(t,i[0],u)),Promise.all(i.map(i=>new mr(t,i,n).load(c)))}if("native-point"===f){const n=A({},e,{EXTENT:o,zoom:u,debugIndex:d});return Xr(t,r,n,_r,o/s)}if("line"===f){const n=A({},e,{EXTENT:o,requestor:this.fetchIconGlyphs.bind(this),tileRatio:c,zoom:u,debugIndex:d});return Xr(t,r,n,Mr)}if("native-line"===f){const n=A({},e,{EXTENT:o,zoom:u,debugIndex:d});return Xr(t,r,n,Pr)}if("fill"===f){const n=A({},e,{EXTENT:o,requestor:this.fetchIconGlyphs.bind(this),zoom:u,debugIndex:d});return Xr(t,r,n,zr)}if("line-extrusion"===f){delete r.lineGradientProperty,r.lineJoin="miter",r.lineCap="butt";const n=Jr(r);n&&(e.uv=1,2===n&&(e.tangent=1));const i=A({},e,{EXTENT:o,tileSize:s,zScale:h,glScale:a,zoom:u,debugIndex:d});if(n){const n=[];if(!1!==e.top){const e=A({},i);e.side=!1,n.push(new Ar(t,r,e))}return!1!==e.side&&(i.side=!0,i.top=!1,n.push(new Ar(t,r,i))),Promise.all(n.map(t=>t.load()))}return Promise.all([new Ar(t,r,i).load()])}return Promise.resolve([])}pt(t,n,i,e){const r="__fea_idx".trim(),s=[],o=[],a=i.length;for(let h=0;h<a;h++)if((1===t||void 0===i[h].id||!this.styledFeatures[i[h].id])&&((!n.def||"default"===n.def)&&!e[h]||!0===n.def||Array.isArray(n.def)&&n(i[h]))){e[h]=1;const n=A({},i[h]);if(n[r]=h,o.push(n),s.push(h),1===t)break}return{tileFeatures:o,tileFeaIndexes:s}}ht(t){const{style:n,featureStyle:i}=t,e={};i.forEach(t=>{Array.isArray(t.id)?(t.id.forEach(t=>{e[t]=1}),t.filter=["in","$id",...t.id]):(e[t.id]=1,t.filter=["==","$id",t.id])});const r=z(n);for(let t=0;t<n.length;t++)r[t].filter&&(r[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0),r[t].type=0;const s=[],o=z(i);for(let t=0;t<i.length;t++)o[t].type=1,o[t].filter.def=i[t].filter?i[t].filter.value||i[t].filter:void 0,o[t].renderPlugin&&s.push(o[t]);this.pluginConfig=r,this.featurePlugins=s,this.styledFeatures=e}vt(t){let n=this.wt;this.wt||(n=this.wt={});const e=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],r=[];for(const s in t){const o=s;if(!n[s]){const r=[];for(let n=0;n<t[s].types.length;n++){const a=t[s].types[n],h=["all",["==","$layer",o],["==","$type",e[a]]],u={filter:i(h),renderPlugin:qr(a),symbol:Br(a)};u.filter.def=h,u.type=0,r.push(u)}n[o]=r}r.push(...n[o])}return r}}function qr(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 Br(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 Gr(t){if(Array.isArray(t)||!_(t))return{};const n={};for(const i in t){const e=t[i];k(e)?n[i]="string":P(e)?n[i]="number":!0===e||!1===e?n[i]="boolean":Array.isArray(e)?n[i]="array":n[i]="object"}return n}function Jr(t){if(!t)return 0;let n=0;for(const i in t){if(("normalTexture"===i||"bumpTexture"===i)&&t[i])return 2;if(i.indexOf("Texture")>0&&t[i])n=1;else if(_(t[i])){const e=Jr(t[i]);if(2===e)return e;1===e&&(n=1)}}return n}function Xr(t,n,i,e,r){const s={},o=Array.isArray(n)?n:[n];let a=-1;for(let t=0;t<o.length;t++)s[t]=Zr(o[t]),!s[t]&&o[t]&&-1===a&&(a=t);const h=[];for(let n=0;n<o.length;n++)o[n]&&(o[n].index={index:n},s[n]||n===a?h.push(new e(t,o[n],i).load(r)):h.push({data:{ref:a,symbolIndex:{index:n}}}));return Promise.all(h)}function Zr(t){if(!t)return 0;for(const n in t)if(D(t[n]))return 1;return 0}function Yr(t,n){Kr(t.geometry,n)}function Kr(t,n){if(t)switch(t.type){case"Point":Qr(t.coordinates,n);break;case"MultiPoint":case"LineString":ts(t.coordinates,n);break;case"MultiLineString":case"Polygon":ns(t.coordinates,n);break;case"MultiPolygon":!function(t,n){for(let i=0;i<t.length;i++)ns(t[i],n)}(t.coordinates,n);break;case"GeometryCollection":for(let i=0;i<t.geometries.length;i++)Kr(t.geometries[i],n)}}function Qr(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 ts(t,n){for(let i=0;i<t.length;i++)Qr(t[i],n)}function ns(t,n){for(let i=0;i<t.length;i++)ts(t[i],n)}class is extends Wr{constructor(t,n,i,e,r,s){super(t,n,i,e,r),(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,i=Math.round(n);return Math.abs(i-n)<1e-14?i:n}(n.tileSize[0]/256)),this.setData(n.data,s)}setData(t,n){if(delete this.index,!t)return void n();const i={maxZoom:24,tolerance:this.options.extent/this.options.tileSize[0]*1,extent:this.options.extent,buffer:this.options.tileBuffer||64,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5};if(k(t)&&"{"!=t.substring(0,1)||t.url)C.getJSON(t.url?t.url:t,t.url?t:{},(t,e)=>{if(t&&n(t),!e)return void n(null,{extent:null,idMap:{}});const r=e,{first1000:s,idMap:o}=this.Mt(r);this.bt(s,o,r,i,n)});else{"string"==typeof t&&(t=JSON.parse(t));const e=Array.isArray(t)?t:t.features;let r=e;e&&e.length>1e3&&(r=e.slice(0,1e3)),this.bt(r,null,t,i,n)}}bt(t,n,i,e,r){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":for(let i=0;i<t.features.length;i++)Yr(t.features[i],n);break;case"Feature":Yr(t,n);break;default:Kr(t,n)}return n}({type:"FeatureCollection",features:t}):null;this.index=function(t,n){return new ht(t,n)}(i,this.options.geojsonvt||e),r(null,{extent:s,idMap:n})}catch(t){console.warn(t),r({error:t.message})}}Mt(t){const n=[],i={};let e=0;function r(t){t&&("Feature"!==t.type||t.geometry)&&(void 0!==t.id&&null!==t.id||(t.id=e++),i[t.id]=A({},t),t.geometry?(i[t.id].geometry=A({},t.geometry),i[t.id].geometry.coordinates=null):t.coordinates&&(i[t.id].coordinates=null),n.length<1e3&&n.push(t))}return Array.isArray(t)?t.forEach(t=>{r(t)}):t.features&&t.features.forEach(t=>{r(t)}),{first1000:n,idMap:i}}getTileFeatures(t,n){const i=[];if(!this.index)return setTimeout((function(){n({loading:!0})}),1),1;const e=this.index.getTile(t.z+this.zoomOffset,t.x,t.y);if(!e||0===e.features.length)return setTimeout((function(){n(null,i,[])}),1),1;const r=[];for(let t=0,n=e.features.length;t<n;t++){const n=e.features[t];let s=n.layer;void 0===s&&(s="0"),r[s]={types:{}};r[s].types[n.type]=1,n.tags=n.tags||{},i.push({type:n.type,layer:s,id:n.id,geometry:n.geometry,properties:n.tags,extent:this.options.extent})}for(const t in r)r[t].types=Object.keys(r[t].types).map(t=>+t);return setTimeout((function(){n(null,i,r)}),1),1}onRemove(){delete this.index}}var es={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,n,i,e,r){var s,o,a=8*r-e-1,h=(1<<a)-1,u=h>>1,l=-7,c=i?r-1:0,f=i?-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+=e;l>0;o=256*o+t[n+c],c+=f,l-=8);if(0===s)s=1-u;else{if(s===h)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,e),s-=u}return(d?-1:1)*o*Math.pow(2,s-e)},write:function(t,n,i,e,r,s){var o,a,h,u=8*s-r-1,l=(1<<u)-1,c=l>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=e?0:s-1,y=e?1:-1,v=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*(h=Math.pow(2,-o))<1&&(o--,h*=2),(n+=o+c>=1?f/h:f*Math.pow(2,1-c))*h>=2&&(o++,h/=2),o+c>=l?(a=0,o=l):o+c>=1?(a=(n*h-1)*Math.pow(2,r),o+=c):(a=n*Math.pow(2,c-1)*Math.pow(2,r),o=0));r>=8;t[i+d]=255&a,d+=y,a/=256,r-=8);for(o=o<<r|a,u+=r;u>0;t[i+d]=255&o,d+=y,o/=256,u-=8);t[i+d-y]|=128*v}},rs=os,ss=es;function os(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}os.Varint=0,os.Fixed64=1,os.Bytes=2,os.Fixed32=5;var as="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function hs(t){return t.type===os.Bytes?t.readVarint()+t.pos:t.pos+1}function us(t,n,i){return i?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function ls(t,n,i){var e=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(e);for(var r=i.pos-1;r>=t;r--)i.buf[r+e]=i.buf[r]}function cs(t,n){for(var i=0;i<t.length;i++)n.writeVarint(t[i])}function fs(t,n){for(var i=0;i<t.length;i++)n.writeSVarint(t[i])}function ds(t,n){for(var i=0;i<t.length;i++)n.writeFloat(t[i])}function ys(t,n){for(var i=0;i<t.length;i++)n.writeDouble(t[i])}function vs(t,n){for(var i=0;i<t.length;i++)n.writeBoolean(t[i])}function ps(t,n){for(var i=0;i<t.length;i++)n.writeFixed32(t[i])}function ms(t,n){for(var i=0;i<t.length;i++)n.writeSFixed32(t[i])}function gs(t,n){for(var i=0;i<t.length;i++)n.writeFixed64(t[i])}function ws(t,n){for(var i=0;i<t.length;i++)n.writeSFixed64(t[i])}function Ms(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+16777216*t[n+3]}function bs(t,n,i){t[i]=n,t[i+1]=n>>>8,t[i+2]=n>>>16,t[i+3]=n>>>24}function xs(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}os.prototype={destroy:function(){this.buf=null},readFields:function(t,n,i){for(i=i||this.length;this.pos<i;){var e=this.readVarint(),r=e>>3,s=this.pos;this.type=7&e,t(r,n,this),this.pos===s&&this.skip(e)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=Ms(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=xs(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ms(this.buf,this.pos)+4294967296*Ms(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ms(this.buf,this.pos)+4294967296*xs(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ss.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ss.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,i,e=this.buf;return n=127&(i=e[this.pos++]),i<128?n:(n|=(127&(i=e[this.pos++]))<<7,i<128?n:(n|=(127&(i=e[this.pos++]))<<14,i<128?n:(n|=(127&(i=e[this.pos++]))<<21,i<128?n:function(t,n,i){var e,r,s=i.buf;if(r=s[i.pos++],e=(112&r)>>4,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(127&r)<<3,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(127&r)<<10,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(127&r)<<17,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(127&r)<<24,r<128)return us(t,e,n);if(r=s[i.pos++],e|=(1&r)<<31,r<128)return us(t,e,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(i=e[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&&as?function(t,n,i){return as.decode(t.subarray(n,i))}(this.buf,n,t):function(t,n,i){var e="",r=n;for(;r<i;){var s,o,a,h=t[r],u=null,l=h>239?4:h>223?3:h>191?2:1;if(r+l>i)break;1===l?h<128&&(u=h):2===l?128==(192&(s=t[r+1]))&&(u=(31&h)<<6|63&s)<=127&&(u=null):3===l?(s=t[r+1],o=t[r+2],128==(192&s)&&128==(192&o)&&((u=(15&h)<<12|(63&s)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===l&&(s=t[r+1],o=t[r+2],a=t[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((u=(15&h)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,l=1):u>65535&&(u-=65536,e+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),e+=String.fromCharCode(u),r+=l}return e}(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!==os.Bytes)return t.push(this.readVarint(n));var i=hs(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(n));return t},readPackedSVarint:function(t){if(this.type!==os.Bytes)return t.push(this.readSVarint());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==os.Bytes)return t.push(this.readBoolean());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==os.Bytes)return t.push(this.readFloat());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==os.Bytes)return t.push(this.readDouble());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==os.Bytes)return t.push(this.readFixed32());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==os.Bytes)return t.push(this.readSFixed32());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==os.Bytes)return t.push(this.readFixed64());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==os.Bytes)return t.push(this.readSFixed64());var n=hs(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed64());return t},skip:function(t){var n=7&t;if(n===os.Varint)for(;this.buf[this.pos++]>127;);else if(n===os.Bytes)this.pos=this.readVarint()+this.pos;else if(n===os.Fixed32)this.pos+=4;else{if(n!==os.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 i=new Uint8Array(n);i.set(this.buf),this.buf=i,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),bs(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),bs(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),bs(this.buf,-1&t,this.pos),bs(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),bs(this.buf,-1&t,this.pos),bs(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 i,e;t>=0?(i=t%4294967296|0,e=t/4294967296|0):(e=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,e=e+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn\'t fit into 10 bytes");n.realloc(10),function(t,n,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,n),function(t,n){var i=(7&t)<<4;if(n.buf[n.pos++]|=i|((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}(e,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,i){for(var e,r,s=0;s<n.length;s++){if((e=n.charCodeAt(s))>55295&&e<57344){if(!r){e>56319||s+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=e;continue}if(e<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);e<128?t[i++]=e:(e<2048?t[i++]=e>>6|192:(e<65536?t[i++]=e>>12|224:(t[i++]=e>>18|240,t[i++]=e>>12&63|128),t[i++]=e>>6&63|128),t[i++]=63&e|128)}return i}(this.buf,t,this.pos);var i=this.pos-n;i>=128&&ls(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),ss.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ss.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 i=0;i<n;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,n){this.pos++;var i=this.pos;t(n,this);var e=this.pos-i;e>=128&&ls(i,e,this),this.pos=i-1,this.writeVarint(e),this.pos+=e},writeMessage:function(t,n,i){this.writeTag(t,os.Bytes),this.writeRawMessage(n,i)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,cs,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,fs,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,vs,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,ds,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,ys,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,ps,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,ms,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,gs,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,ws,n)},writeBytesField:function(t,n){this.writeTag(t,os.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,os.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,os.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,os.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,os.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,os.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,os.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,os.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,os.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,os.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}};var Fs=Ht,As=ks;function ks(t,n,i,e,r){this.properties={},this.extent=i,this.type=0,this.xt=t,this.Ft=-1,this.At=e,this.kt=r,t.readFields(Ps,this,n)}function Ps(t,n,i){1==t?n.id=i.readVarint():2==t?function(t,n){var i=t.readVarint()+t.pos;for(;t.pos<i;){var e=n.At[t.readVarint()],r=n.kt[t.readVarint()];n.properties[e]=r}}(i,n):3==t?n.type=i.readVarint():4==t&&(n.Ft=i.pos)}function Ss(t){for(var n,i,e=0,r=0,s=t.length,o=s-1;r<s;o=r++)n=t[r],e+=((i=t[o]).x-n.x)*(n.y+i.y);return e}ks.types=["Unknown","Point","LineString","Polygon"],ks.prototype.loadGeometry=function(){var t=this.xt;t.pos=this.Ft;for(var n,i=t.readVarint()+t.pos,e=1,r=0,s=0,o=0,a=[];t.pos<i;){if(r<=0){var h=t.readVarint();e=7&h,r=h>>3}if(r--,1===e||2===e)s+=t.readSVarint(),o+=t.readSVarint(),1===e&&(n&&a.push(n),n=[]),n.push(new Fs(s,o));else{if(7!==e)throw new Error("unknown command "+e);n&&n.push(n[0].clone())}}return n&&a.push(n),a},ks.prototype.bbox=function(){var t=this.xt;t.pos=this.Ft;for(var n=t.readVarint()+t.pos,i=1,e=0,r=0,s=0,o=1/0,a=-1/0,h=1/0,u=-1/0;t.pos<n;){if(e<=0){var l=t.readVarint();i=7&l,e=l>>3}if(e--,1===i||2===i)(r+=t.readSVarint())<o&&(o=r),r>a&&(a=r),(s+=t.readSVarint())<h&&(h=s),s>u&&(u=s);else if(7!==i)throw new Error("unknown command "+i)}return[o,h,a,u]},ks.prototype.toGeoJSON=function(t,n,i){var e,r,s=this.extent*Math.pow(2,i),o=this.extent*t,a=this.extent*n,h=this.loadGeometry(),u=ks.types[this.type];function l(t){for(var n=0;n<t.length;n++){var i=t[n],e=180-360*(i.y+a)/s;t[n]=[360*(i.x+o)/s-180,360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(e=0;e<h.length;e++)c[e]=h[e][0];l(h=c);break;case 2:for(e=0;e<h.length;e++)l(h[e]);break;case 3:for(h=function(t){var n=t.length;if(n<=1)return[t];for(var i,e,r=[],s=0;s<n;s++){var o=Ss(t[s]);0!==o&&(void 0===e&&(e=o<0),e===o<0?(i&&r.push(i),i=[t[s]]):i.push(t[s]))}i&&r.push(i);return r}(h),e=0;e<h.length;e++)for(r=0;r<h[e].length;r++)l(h[e][r])}1===h.length?h=h[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:h},properties:this.properties};return"id"in this&&(f.id=this.id),f};var _s=As,Os=Is;function Is(t,n){this.version=1,this.name=null,this.extent=4096,this.length=0,this.xt=t,this.At=[],this.kt=[],this.Pt=[],t.readFields(Ts,this,n),this.length=this.Pt.length}function Ts(t,n,i){15===t?n.version=i.readVarint():1===t?n.name=i.readString():5===t?n.extent=i.readVarint():2===t?n.Pt.push(i.pos):3===t?n.At.push(i.readString()):4===t&&n.kt.push(function(t){var n=null,i=t.readVarint()+t.pos;for(;t.pos<i;){var e=t.readVarint()>>3;n=1===e?t.readString():2===e?t.readFloat():3===e?t.readDouble():4===e?t.readVarint64():5===e?t.readVarint():6===e?t.readSVarint():7===e?t.readBoolean():null}return n}(i))}Is.prototype.feature=function(t){if(t<0||t>=this.Pt.length)throw new Error("feature index out of bounds");this.xt.pos=this.Pt[t];var n=this.xt.readVarint()+this.xt.pos;return new _s(this.xt,n,this.extent,this.At,this.kt)};var Ls=Os;function Us(t,n,i){if(3===t){var e=new Ls(i,i.readVarint()+i.pos);e.length&&(n[e.name]=e)}}var zs=function(t,n){this.layers=t.readFields(Us,{},n)};class Ds extends Wr{constructor(t,n,i,e,r,s){super(t,n,i,e,r),n=n||{},s()}getTileFeatures(t,n){const i=t.url;return C.getArrayBuffer(i,(t,i)=>{if(t)return void n(t);const e=new zs(new rs(i.data)),r=[];if(!e.layers)return void n(null,r,[]);const s={};let o;for(const n in e.layers)if(a=e.layers,h=n,Object.prototype.hasOwnProperty.call(a,h)){s[n]={types:{}};const i=s[n].types;for(let s=0,a=e.layers[n].length;s<a;s++)try{o=e.layers[n].feature(s),i[o.type]=1,r.push({type:o.type,layer:n,geometry:o.loadGeometry(),properties:o.properties,extent:o.extent})}catch(t){console.warn("error when load vt geometry:",t)}}var a,h;for(const t in s)s[t].types=Object.keys(s[t].types).map(t=>+t);n(null,r,s,{byteLength:i.data.byteLength})})}abortTile(t,n){const i=this.requests[t];delete this.requests[t],i&&i.abort&&i.abort(),this.yt(t),n()}onRemove(){for(const t in this.requests)this.requests[t].abort();this.requests={}}}let Es=0;const Cs=new class{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}}(128),js={};class Ns{constructor(t){this.St={},this._t={},this.workerId=t}addLayer({actorId:t,mapId:n,layerId:i,params:e},r){if(this.Ot(n,i))return;const s=this.It(n,i),o=e.type,a=e.options,h=this.send.bind(this,t);this.St[s]="GeoJSONVectorTileLayer"===o?new is(i,a,h,Cs,js,r):new Ds(i,a,h,Cs,js,r)}removeLayer({mapId:t,layerId:n},i){const e=this.Ot(t,n),r=this.It(t,n);delete this.St[r],e&&(e.onRemove(i),this.Tt())}loadTile({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&r.loadTile(i,e)}abortTile({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&r.abortTile&&r.abortTile(i.url,e)}removeTile({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&r.removeTile(i,e)}updateStyle({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&(r.updateStyle(i,e),this.Tt())}updateOptions({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&(r.updateOptions(i,e),this.Tt())}setData({mapId:t,layerId:n,params:i},e){const r=this.Ot(t,n);r&&(r.setData(i.data,e),this.Tt())}receive(t){const n=t.callback,i=this._t[n];delete this._t[n],i&&t.error?i(new Error(t.error)):i&&i(null,t.data)}send(t,n,i,e,r){const s=r?`${t}-${Es++}`:null;r&&(this._t[s]=r),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:n,params:i,callback:String(s)},e||[])}It(t,n){return`${t}-${n}`}Ot(t,n){const i=this.It(t,n);return this.St[i]}Tt(){const t=Object.keys(js);for(let n=0;n<t.length;n++)delete js[t[n]];Cs.reset()}}t.initialize=function(){},t.onmessage=function(t,n){const i=t.data;if(this.dispatcher||(this.dispatcher=new Ns(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const e=i.command;this.dispatcher[e]({actorId:t.actorId,mapId:i.mapId,layerId:i.layerId,params:i.params},(t,i,r)=>{t&&console.error(e,t),n(t,i,r)})}},Object.defineProperty(t,"Lt",{value:!0})}';
29
29
 
30
- let D = 0;
30
+ let H = 0;
31
31
 
32
- const H = "function" == typeof Object.assign;
32
+ const D = "function" == typeof Object.assign;
33
33
 
34
34
  function L(t, ...e) {
35
- if (H) return Object.assign(t, ...e), t;
35
+ if (D) return Object.assign(t, ...e), t;
36
36
  for (let n = 0; n < e.length; n++) {
37
37
  const i = e[n];
38
38
  for (const e in i) t[e] = i[e];
@@ -40,11 +40,11 @@ function L(t, ...e) {
40
40
  return t;
41
41
  }
42
42
 
43
- function N(t) {
43
+ function R(t) {
44
44
  return !V(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);
45
45
  }
46
46
 
47
- function R(t) {
47
+ function N(t) {
48
48
  return "number" == typeof t && !isNaN(t);
49
49
  }
50
50
 
@@ -56,7 +56,7 @@ function V(t) {
56
56
  return null == t;
57
57
  }
58
58
 
59
- function U(t) {
59
+ function j(t) {
60
60
  for (let e = 1; e < arguments.length; e++) {
61
61
  const n = arguments[e];
62
62
  if (n) for (let e = 0, i = n.length; e < i; e++) t.push(n[e]);
@@ -64,7 +64,7 @@ function U(t) {
64
64
  return t.length;
65
65
  }
66
66
 
67
- function j(t) {
67
+ function U(t) {
68
68
  const e = {};
69
69
  for (const n in t) void 0 !== t[n] && null !== t[n] && (t[n].toJSON ? e[n] = t[n].toJSON() : e[n] = t[n]);
70
70
  return e;
@@ -156,7 +156,7 @@ class X extends t.worker.Actor {
156
156
  layerId: n,
157
157
  command: "loadTile",
158
158
  params: {
159
- tileInfo: j(t.tileInfo),
159
+ tileInfo: U(t.tileInfo),
160
160
  glScale: t.glScale,
161
161
  zScale: t.zScale
162
162
  }
@@ -195,9 +195,9 @@ class X extends t.worker.Actor {
195
195
  }
196
196
  }
197
197
 
198
- const q = {};
198
+ const Y = {};
199
199
 
200
- class Y {
200
+ class q {
201
201
  constructor(t, e, n) {
202
202
  this.m = t, this.g = e, this.v = n || [ 0, 1, 0 ];
203
203
  }
@@ -294,36 +294,36 @@ class Y {
294
294
 
295
295
  const J = new Uint8Array([ 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1 ]), Z = [];
296
296
 
297
- class $ {
297
+ class K {
298
298
  constructor(t, e, i) {
299
299
  this.m = t;
300
- (this.O = new n.Geometry({
300
+ (this.I = new n.Geometry({
301
301
  aPosition: J
302
302
  }, null, J.length / 2, {
303
303
  positionSize: 2
304
- })).generateBuffers(t), this.I = new n.Scene, this.C = [], this.F = 0, this.D = e,
304
+ })).generateBuffers(t), this.O = new n.Scene, this.C = [], this.F = 0, this.H = e,
305
305
  this.g = i, this._(t);
306
306
  }
307
307
  start() {
308
- this.F = 0, this.I.clear();
308
+ this.F = 0, this.O.clear();
309
309
  }
310
310
  add(t, e, n) {
311
- const s = this.H(n);
311
+ const s = this.D(n);
312
312
  s.setUniform("ref", t), i.set(Z, e, e, 1);
313
313
  const o = s.localTransform;
314
- r.fromScaling(o, Z), r.mul(o, n, o), s.setLocalTransform(o), this.I.addMesh(s);
314
+ r.fromScaling(o, Z), r.mul(o, n, o), s.setLocalTransform(o), this.O.addMesh(s);
315
315
  }
316
316
  render(t) {
317
- this.L.render(this.N, {
317
+ this.L.render(this.R, {
318
318
  projViewMatrix: this.g.projViewMatrix
319
- }, this.I, t);
319
+ }, this.O, t);
320
320
  }
321
- H() {
321
+ D() {
322
322
  const t = this.F++;
323
- return this.C[t] || (this.C[t] = new n.Mesh(this.O)), this.C[t];
323
+ return this.C[t] || (this.C[t] = new n.Mesh(this.I)), this.C[t];
324
324
  }
325
325
  _(t) {
326
- const e = this.D, i = {
326
+ const e = this.H, i = {
327
327
  viewport: {
328
328
  x: 0,
329
329
  y: 0,
@@ -351,7 +351,7 @@ class $ {
351
351
  },
352
352
  colorMask: [ !1, !1, !1, !1 ]
353
353
  };
354
- this.N = new n.MeshShader({
354
+ this.R = new n.MeshShader({
355
355
  vert: "\n#define SHADER_NAME TILE_STENCIL_VERT\nattribute vec2 aPosition;\nuniform mat4 projViewModelMatrix;\n\nvoid main()\n{\n gl_Position = projViewModelMatrix * vec4(aPosition, 0.0, 1.0);\n}\n",
356
356
  frag: "\n#define SHADER_NAME TILE_STENCIL_FRAG\nvoid main()\n{\n gl_FragColor = vec4(1.0, 0.0, 0.0, 0.1);\n}\n",
357
357
  uniforms: [ {
@@ -366,20 +366,20 @@ class $ {
366
366
  }), this.L = new n.Renderer(t);
367
367
  }
368
368
  remove() {
369
- this.O.dispose();
369
+ this.I.dispose();
370
370
  for (let t = 0; t < this.C.length; t++) this.C[t].dispose();
371
- this.C.length = 0, this.N.dispose();
371
+ this.C.length = 0, this.R.dispose();
372
372
  }
373
373
  }
374
374
 
375
- const K = [], Q = [ 0, 0, 0, 0 ], tt = new t.Point(0, 0);
375
+ const $ = [], Q = [ 0, 0, 0, 0 ], tt = new t.Point(0, 0);
376
376
 
377
377
  class et extends t.renderer.TileLayerCanvasRenderer {
378
378
  supportRenderMode() {
379
379
  return !0;
380
380
  }
381
381
  constructor(t) {
382
- super(t), this.ready = !1, this.R = 0, this.V = {}, this.U = {}, this.j = {}, this.G = [];
382
+ super(t), this.ready = !1, this.N = 0, this.V = {}, this.j = {}, this.U = {}, this.G = [];
383
383
  }
384
384
  getTileLevelValue(t, e) {
385
385
  if (this.isBackTile(t.id)) {
@@ -392,22 +392,22 @@ class et extends t.renderer.TileLayerCanvasRenderer {
392
392
  return this.W;
393
393
  }
394
394
  setStyle() {
395
- this.B && this.B.update(), this.W ? (this.R++, this.W.updateStyle(this.layer.X(), t => {
395
+ this.B && this.B.update(), this.W ? (this.N++, this.W.updateStyle(this.layer.X(), t => {
396
396
  if (t) throw new Error(t);
397
- this.q = !0, this.clear(), this.Y(), this.J(), this.setToRedraw(), this.layer.fire("refreshstyle");
397
+ this.Y = !0, this.clear(), this.q(), this.J(), this.setToRedraw(), this.layer.fire("refreshstyle");
398
398
  })) : this.J();
399
399
  }
400
400
  updateOptions(t) {
401
401
  this.W && this.W.updateOptions(this.layer.getWorkerOptions(), e => {
402
402
  if (e) throw new Error(e);
403
- (t.features || t.pickingGeometry || t.altitudeProperty) && (this.clear(), this.Y(),
403
+ (t.features || t.pickingGeometry || t.altitudeProperty) && (this.clear(), this.q(),
404
404
  this.J()), this.setToRedraw();
405
405
  });
406
406
  }
407
407
  updateSceneConfig(t, e, n) {
408
408
  const i = 0 === t ? this.plugins : this.featurePlugins;
409
409
  if (!i || !i[e]) return;
410
- this.q = !0;
410
+ this.Y = !0;
411
411
  const r = this.layer.X(), s = this.layer.Z(t, r);
412
412
  i[e].config = s[e].renderPlugin, i[e].updateSceneConfig({
413
413
  sceneConfig: n
@@ -415,7 +415,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
415
415
  }
416
416
  updateDataConfig(t, e, n, i) {
417
417
  const r = 0 === t ? this.plugins : this.featurePlugins;
418
- r && r[e] && (this.q = !0, r[e].updateDataConfig(n, i) ? this.setStyle() : this.setToRedraw());
418
+ r && r[e] && (this.Y = !0, r[e].updateDataConfig(n, i) ? this.setStyle() : this.setToRedraw());
419
419
  }
420
420
  updateSymbol(t, e, n) {
421
421
  const i = 0 === t ? this.plugins : this.featurePlugins;
@@ -429,25 +429,25 @@ class et extends t.renderer.TileLayerCanvasRenderer {
429
429
  if (this.G.length) return !0;
430
430
  const t = super.needToRedraw();
431
431
  if (!t) {
432
- const t = this.$();
432
+ const t = this.K();
433
433
  for (let e = 0; e < t.length; e++) if (t[e] && t[e].needToRedraw()) return !0;
434
434
  }
435
435
  return t;
436
436
  }
437
437
  needRetireFrames() {
438
- if (this.q) return !0;
439
- const t = this.$();
438
+ if (this.Y) return !0;
439
+ const t = this.K();
440
440
  for (let e = 0; e < t.length; e++) if (t[e] && t[e].needToRetireFrames()) return !0;
441
441
  return !1;
442
442
  }
443
443
  createContext() {
444
444
  const t = this.canvas.gl && this.canvas.gl.wrap;
445
- t ? (this.gl = this.canvas.gl.wrap(), this.regl = this.canvas.gl.regl) : this.K(),
445
+ t ? (this.gl = this.canvas.gl.wrap(), this.regl = this.canvas.gl.regl) : this.$(),
446
446
  t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
447
447
  this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
448
- this.tt = new Y(this.regl, this.getMap()), this.et(), this.B = new s(this.regl, this.layer);
448
+ this.tt = new q(this.regl, this.getMap()), this.et(), this.B = new s(this.regl, this.layer);
449
449
  }
450
- K() {
450
+ $() {
451
451
  const t = this.layer, e = t.options.glOptions || {
452
452
  alpha: !0,
453
453
  depth: !0,
@@ -482,10 +482,10 @@ class et extends t.renderer.TileLayerCanvasRenderer {
482
482
  return !0;
483
483
  }
484
484
  checkResources() {
485
- return K;
485
+ return $;
486
486
  }
487
487
  draw(t, e) {
488
- this.it !== t && (this.q = !1, this.rt());
488
+ this.it !== t && (this.Y = !1, this.rt());
489
489
  const n = this.layer;
490
490
  this.prepareCanvas(), this.ready && n.ready ? (this.plugins || this.J(), n.isDefaultRender() || this.plugins.length || this.featurePlugins.length ? (n.options.collision && (n.clearCollisionIndex(),
491
491
  n.clearBackgroundCollisionIndex()), this.st = t, this.ot = this.at(this.getMap().getGLRes()),
@@ -493,12 +493,12 @@ class et extends t.renderer.TileLayerCanvasRenderer {
493
493
  this.ut(t), this.completeRender(), this.it = t) : this.completeRender()) : this.completeRender();
494
494
  }
495
495
  rt() {
496
- this.$().forEach((t, e) => {
496
+ this.K().forEach((t, e) => {
497
497
  t.renderIndex = e;
498
498
  });
499
499
  }
500
500
  ft() {
501
- const t = this.$();
501
+ const t = this.K();
502
502
  this.dt = [];
503
503
  let e = +!!this.layer.getGroundConfig().enable;
504
504
  t.forEach((t, n) => {
@@ -518,7 +518,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
518
518
  }
519
519
  getShadowMeshes() {
520
520
  const t = [];
521
- return this.$().forEach((e, n) => {
521
+ return this.K().forEach((e, n) => {
522
522
  if (!e) return;
523
523
  if (!this.vt(n)) return;
524
524
  const i = e.getShadowMeshes();
@@ -557,7 +557,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
557
557
  if (delete this.V[t], e) {
558
558
  if (e.status && 404 === e.status) for (let t = 0; t < s.length; t++) {
559
559
  const e = s[t];
560
- this.onTileError(q, e);
560
+ this.onTileError(Y, e);
561
561
  }
562
562
  return;
563
563
  }
@@ -570,7 +570,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
570
570
  }
571
571
  return;
572
572
  }
573
- if (n.style !== this.R) return;
573
+ if (n.style !== this.N) return;
574
574
  let o = !1;
575
575
  const a = n.features, l = [];
576
576
  for (let t = 0; t < n.data.length; t++) {
@@ -659,17 +659,17 @@ class et extends t.renderer.TileLayerCanvasRenderer {
659
659
  isUpdated: s
660
660
  };
661
661
  }
662
- $(t) {
662
+ K(t) {
663
663
  let e = this.plugins || [];
664
664
  return this.layer.isDefaultRender() && this.Tt && (e = [], t ? t.layers.forEach(t => {
665
665
  const n = ("plugin_" + t.type).trim();
666
666
  e.push(this.Tt[t.layer][n].plugin);
667
667
  }) : Object.keys(this.Tt).forEach(t => {
668
668
  for (let n = 0; n < this.Tt[t].length; n++) e.push(this.Tt[t][n].plugin);
669
- })), this.featurePlugins && this.featurePlugins.length && (e = e.slice(), U(e, this.featurePlugins)),
669
+ })), this.featurePlugins && this.featurePlugins.length && (e = e.slice(), j(e, this.featurePlugins)),
670
670
  e;
671
671
  }
672
- Ot() {
672
+ It() {
673
673
  if (this.layer.isDefaultRender() && this.Tt) {
674
674
  const t = [];
675
675
  return Object.keys(this.Tt).forEach(e => {
@@ -680,7 +680,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
680
680
  }
681
681
  ht(t) {
682
682
  const e = this.layer.isDefaultRender() && this.Tt, n = this.lt;
683
- this.$().forEach((i, r) => {
683
+ this.K().forEach((i, r) => {
684
684
  if (!i) return;
685
685
  if (!this.vt(r)) return;
686
686
  const s = e ? i.defaultSymbol : i.style && i.style.symbol, o = {
@@ -697,22 +697,22 @@ class et extends t.renderer.TileLayerCanvasRenderer {
697
697
  });
698
698
  }
699
699
  ut(t) {
700
- const e = this.lt, n = e.renderMode, i = e && e.renderTarget && e.renderTarget.fbo, r = this.getMap().cameraPosition, s = this.$();
700
+ const e = this.lt, n = e.renderMode, i = e && e.renderTarget && e.renderTarget.fbo, r = this.getMap().cameraPosition, s = this.K();
701
701
  this.layer.options.collision ? s.forEach(e => {
702
702
  if (!rt(e)) return;
703
703
  if (n && "default" !== n && !e.supportRenderMode(n)) return;
704
- const i = this.It(e, 0, r, t);
704
+ const i = this.Ot(e, 0, r, t);
705
705
  e.prepareRender(i), e.updateCollision(i);
706
706
  }) : s.forEach(e => {
707
707
  if (!rt(e)) return;
708
708
  if (n && "default" !== n && !e.supportRenderMode(n)) return;
709
- const i = this.It(e, 0, r, t);
709
+ const i = this.Ot(e, 0, r, t);
710
710
  e.prepareRender(i);
711
711
  });
712
712
  const o = !e.timestamp || e.isFinalRender, a = this.it !== e.timestamp;
713
713
  let l = !1;
714
714
  if (a) {
715
- const e = -this.layer.getPolygonOffset(), n = this.It(null, e, r, t);
715
+ const e = -this.layer.getPolygonOffset(), n = this.Ot(null, e, r, t);
716
716
  n.offsetFactor = n.offsetUnits = e, this.B.paint(n);
717
717
  }
718
718
  s.forEach((e, s) => {
@@ -722,7 +722,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
722
722
  stencil: 255,
723
723
  fbo: i
724
724
  }), this.isEnableTileStencil() && e.painter && !e.painter.needClearStencil() && this.Ft(i);
725
- const o = this.dt[s] || 0, a = this.It(e, o, r, t), h = e.endFrame(a);
725
+ const o = this.dt[s] || 0, a = this.Ot(e, o, r, t), h = e.endFrame(a);
726
726
  h && h.redraw && this.setToRedraw(), l = !0;
727
727
  }), l && this.layer.fire("canvasisdirty"), o && this.Et();
728
728
  }
@@ -740,10 +740,10 @@ class et extends t.renderer.TileLayerCanvasRenderer {
740
740
  }
741
741
  Ct(t) {
742
742
  if (!t) return !0;
743
- const e = t.renderIndex, n = this.lt, i = this.vt(e), r = n && n.states && n.states.includesChanged, s = this.Dt(t.painter.scene.getMeshes());
743
+ const e = t.renderIndex, n = this.lt, i = this.vt(e), r = n && n.states && n.states.includesChanged, s = this.Ht(t.painter.scene.getMeshes());
744
744
  return !i || !r && !s ? 0 : s ? 2 : 1;
745
745
  }
746
- It(t, e, n, i) {
746
+ Ot(t, e, n, i) {
747
747
  const r = {
748
748
  regl: this.regl,
749
749
  layer: this.layer,
@@ -756,31 +756,31 @@ class et extends t.renderer.TileLayerCanvasRenderer {
756
756
  }, s = this.lt;
757
757
  return s && L(r, s), r;
758
758
  }
759
- Dt(t) {
759
+ Ht(t) {
760
760
  if (!t) return !1;
761
761
  const e = this.lt && this.lt.sceneFilter;
762
762
  return e ? t.filter(e).length > 0 : t.length > 0;
763
763
  }
764
764
  Ft(t) {
765
765
  const e = this.isEnableTileStencil(), n = this.getCurrentTileZoom();
766
- let i = this.Ht;
767
- i || (i = this.Ht = new $(this.regl, this.canvas, this.getMap())), i.start();
766
+ let i = this.Dt;
767
+ i || (i = this.Dt = new K(this.regl, this.canvas, this.getMap())), i.start();
768
768
  const {tiles: r} = this.Lt;
769
769
  let {parentTiles: s, childTiles: o} = this.Lt, a = 1;
770
770
  o = o.sort(it);
771
- for (let t = 0; t < o.length; t++) this.Nt(o[t].info, e ? a : this.getTileLevelValue(o[t].info.z, n)),
771
+ for (let t = 0; t < o.length; t++) this.Rt(o[t].info, e ? a : this.getTileLevelValue(o[t].info.z, n)),
772
772
  a++;
773
773
  s = s.sort(it);
774
- for (let t = 0; t < s.length; t++) this.Nt(s[t].info, e ? a : this.getTileLevelValue(s[t].info.z, n)),
774
+ for (let t = 0; t < s.length; t++) this.Rt(s[t].info, e ? a : this.getTileLevelValue(s[t].info.z, n)),
775
775
  a++;
776
776
  const l = r.sort(it);
777
- for (let t = l.length - 1; t >= 0; t--) this.Nt(l[t].info, e ? a : this.getTileLevelValue(l[t].info.z, n)),
777
+ for (let t = l.length - 1; t >= 0; t--) this.Rt(l[t].info, e ? a : this.getTileLevelValue(l[t].info.z, n)),
778
778
  a++;
779
779
  i.render(t);
780
780
  }
781
- Nt(t, e) {
782
- const n = this.Rt, i = tt.set(t.extent2d.xmin, t.extent2d.ymax), r = t.transform = t.transform || this.calculateTileMatrix(i, t.z);
783
- t.stencilRef = e, this.Ht.add(e, n, r);
781
+ Rt(t, e) {
782
+ const n = this.Nt, i = tt.set(t.extent2d.xmin, t.extent2d.ymax), r = t.transform = t.transform || this.calculateTileMatrix(i, t.z);
783
+ t.stencilRef = e, this.Dt.add(e, n, r);
784
784
  }
785
785
  onDrawTileStart(t) {
786
786
  super.onDrawTileStart(t);
@@ -797,8 +797,8 @@ class et extends t.renderer.TileLayerCanvasRenderer {
797
797
  drawTile(t, e) {
798
798
  if (!e.cache) return;
799
799
  const n = e.cache, i = tt.set(t.extent2d.xmin, t.extent2d.ymax), r = t.transform = t.transform || this.calculateTileMatrix(i, t.z), s = t.tileTranslationMatrix = t.tileTranslationMatrix || this.calculateTileTranslationMatrix(i, t.z), o = [];
800
- U(o, e.data), U(o, e.featureData);
801
- this.$(e).forEach((i, a) => {
800
+ j(o, e.data), j(o, e.featureData);
801
+ this.K(e).forEach((i, a) => {
802
802
  if (!i) return;
803
803
  const l = this.vt(a);
804
804
  if (!o[a] || !l) return;
@@ -819,17 +819,17 @@ class et extends t.renderer.TileLayerCanvasRenderer {
819
819
  tileZoom: this._tileZoom,
820
820
  bloom: this.lt && this.lt.bloom
821
821
  }, c = i.paintTile(h);
822
- !this.q && (c.retire || c.redraw) && i.supportRenderMode("taa") && (this.q = !0),
822
+ !this.Y && (c.retire || c.redraw) && i.supportRenderMode("taa") && (this.Y = !0),
823
823
  c.redraw && this.setToRedraw();
824
824
  }), this.setCanvasUpdated();
825
825
  }
826
826
  zt(t, e) {
827
827
  if (!e.loadTime || e.wt) return;
828
828
  let n = e.cache;
829
- n || (n = e.cache = {}), this.Rt || (this.Rt = e.extent);
829
+ n || (n = e.cache = {}), this.Nt || (this.Nt = e.extent);
830
830
  const i = tt.set(t.extent2d.xmin, t.extent2d.ymax), r = t.transform = t.transform || this.calculateTileMatrix(i, t.z), s = t.tileTranslationMatrix = t.tileTranslationMatrix || this.calculateTileTranslationMatrix(i, t.z), o = [];
831
- U(o, e.data), U(o, e.featureData);
832
- this.$(e).forEach((i, a) => {
831
+ j(o, e.data), j(o, e.featureData);
832
+ this.K(e).forEach((i, a) => {
833
833
  if (!i) return;
834
834
  const l = this.vt(a);
835
835
  if (!o[a] || !l) return;
@@ -849,7 +849,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
849
849
  tileInfo: t,
850
850
  tileZoom: this._tileZoom
851
851
  }, c = i.createTile(h);
852
- n[a].geometry && (o[a] = 1), !this.q && c.retire && i.supportRenderMode("taa") && (this.q = !0);
852
+ n[a].geometry && (o[a] = 1), !this.Y && c.retire && i.supportRenderMode("taa") && (this.Y = !0);
853
853
  });
854
854
  }
855
855
  ct() {
@@ -862,7 +862,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
862
862
  }
863
863
  pick(t, e, n) {
864
864
  const i = [];
865
- return this.$().forEach((r, s) => {
865
+ return this.K().forEach((r, s) => {
866
866
  if (!r) return;
867
867
  if (!this.vt(s)) return;
868
868
  const o = r.pick(t, e, n.tolerance);
@@ -872,7 +872,7 @@ class et extends t.renderer.TileLayerCanvasRenderer {
872
872
  deleteTile(t) {
873
873
  if (t) {
874
874
  if (t.image && !t.image.wt) {
875
- const e = this.Ot();
875
+ const e = this.It();
876
876
  e && e.forEach((e, n) => {
877
877
  e && e.deleteTile({
878
878
  pluginIndex: n,
@@ -895,19 +895,19 @@ class et extends t.renderer.TileLayerCanvasRenderer {
895
895
  super.resizeCanvas(t);
896
896
  const e = this.canvas;
897
897
  e && (!this.pickingFBO || this.pickingFBO.width === e.width && this.pickingFBO.height === e.height || this.pickingFBO.resize(e.width, e.height),
898
- this.$().forEach(t => {
898
+ this.K().forEach(t => {
899
899
  t && t.resize(e.width, e.height);
900
900
  }));
901
901
  }
902
902
  onRemove() {
903
- this.Ht && this.Ht.remove(), this.W && (this.W.removeLayer(t => {
903
+ this.Dt && this.Dt.remove(), this.W && (this.W.removeLayer(t => {
904
904
  if (t) throw t;
905
905
  }), this.W.remove(), delete this.W), this.pickingFBO && (this.canvas.pickingFBO || this.pickingFBO.destroy(),
906
906
  delete this.pickingFBO), this.tt && this.tt.delete(), super.onRemove && super.onRemove(),
907
- this.Y();
907
+ this.q();
908
908
  }
909
- Y() {
910
- this.$().forEach(t => {
909
+ q() {
910
+ this.K().forEach(t => {
911
911
  t.remove();
912
912
  }), this.plugins = [];
913
913
  }
@@ -1050,21 +1050,21 @@ class et extends t.renderer.TileLayerCanvasRenderer {
1050
1050
  }(this.gl));
1051
1051
  }
1052
1052
  isCachePlaced(t) {
1053
- return 1 === this.j[t];
1053
+ return 1 === this.U[t];
1054
1054
  }
1055
1055
  placeCache(t) {
1056
- this.j[t] = 1;
1056
+ this.U[t] = 1;
1057
1057
  }
1058
1058
  fetchCache(t) {
1059
- return this.U[t] && this.U[t].resource;
1059
+ return this.j[t] && this.j[t].resource;
1060
1060
  }
1061
1061
  removeCache(t) {
1062
- delete this.j[t];
1063
- const e = this.U[t];
1064
- e && (e.count--, e.count <= 0 && (e.onDelete && e.onDelete(e.resource), delete this.U[t]));
1062
+ delete this.U[t];
1063
+ const e = this.j[t];
1064
+ e && (e.count--, e.count <= 0 && (e.onDelete && e.onDelete(e.resource), delete this.j[t]));
1065
1065
  }
1066
1066
  addToCache(t, e, n) {
1067
- delete this.j[t], this.U[t] ? this.U[t].count++ : this.U[t] = {
1067
+ delete this.U[t], this.j[t] ? this.j[t].count++ : this.j[t] = {
1068
1068
  resource: e,
1069
1069
  onDelete: n,
1070
1070
  count: 1
@@ -1084,28 +1084,28 @@ class et extends t.renderer.TileLayerCanvasRenderer {
1084
1084
  this.gt = !0, this.setToRedraw();
1085
1085
  }
1086
1086
  paintOutlineAll(t) {
1087
- const e = this.$();
1087
+ const e = this.K();
1088
1088
  for (let n = 0; n < e.length; n++) e[n].outlineAll(t);
1089
1089
  }
1090
1090
  paintOutline(t, e, n) {
1091
- const i = e, r = this.$();
1091
+ const i = e, r = this.K();
1092
1092
  !r[i] || r[i].painter && !r[i].painter.isVisible() || r[i].outline(t, n);
1093
1093
  }
1094
1094
  paintBatchOutline(t, e) {
1095
- const n = this.$();
1095
+ const n = this.K();
1096
1096
  !n[e] || n[e].painter && !n[e].painter.isVisible() || n[e].outlineAll(t);
1097
1097
  }
1098
1098
  cancelOutline() {
1099
1099
  delete this.yt, delete this.gt, this.setToRedraw();
1100
1100
  }
1101
1101
  setZIndex() {
1102
- return this.setToRedraw(), this.q = !0, super.setZIndex.apply(this, arguments);
1102
+ return this.setToRedraw(), this.Y = !0, super.setZIndex.apply(this, arguments);
1103
1103
  }
1104
1104
  }
1105
1105
 
1106
1106
  function nt(t) {
1107
1107
  let e;
1108
- Array.isArray(t.data) ? (e = [], U(e, t.data)) : (e = {}, L(e, t.data));
1108
+ Array.isArray(t.data) ? (e = [], j(e, t.data)) : (e = {}, L(e, t.data));
1109
1109
  const n = L({}, t);
1110
1110
  return n.data = e, n;
1111
1111
  }
@@ -1124,7 +1124,7 @@ function st(t, e, n) {
1124
1124
  const r = t[i], s = L({}, r), {renderPlugin: o} = r, a = L({}, o);
1125
1125
  a.sceneConfig && !Object.keys(a.sceneConfig).length && delete a.sceneConfig;
1126
1126
  let l = -1;
1127
- for (let t = n.length - 1; t >= 0; t--) if (O(a, n[t])) {
1127
+ for (let t = n.length - 1; t >= 0; t--) if (I(a, n[t])) {
1128
1128
  l = t;
1129
1129
  break;
1130
1130
  }
@@ -1136,7 +1136,7 @@ et.include({
1136
1136
  calculateTileMatrix: function() {
1137
1137
  const t = new Array(3), e = new Array(3), n = new Array(3);
1138
1138
  return function(s, o) {
1139
- const a = this.Rt, l = this.getTileGLScale(o), h = s, c = this.layer.getTileSize(), f = r.identity([]);
1139
+ const a = this.Nt, l = this.getTileGLScale(o), h = s, c = this.layer.getTileSize(), f = r.identity([]);
1140
1140
  return r.scale(f, f, i.set(t, l, l, this.ot)), r.translate(f, f, i.set(e, h.x, h.y, 0)),
1141
1141
  r.scale(f, f, i.set(n, c.width / a, -c.height / a, 1)), f;
1142
1142
  };
@@ -1152,7 +1152,7 @@ et.include({
1152
1152
 
1153
1153
  const ot = "function" == typeof fetch && "function" == typeof AbortController, at = {
1154
1154
  jsonp: function(t, e) {
1155
- const n = "_maptalks_jsonp_" + D++;
1155
+ const n = "_maptalks_jsonp_" + H++;
1156
1156
  t.match(/\?/) ? t += "&callback=" + n : t += "?callback=" + n;
1157
1157
  let i = document.createElement("script");
1158
1158
  return i.type = "text/javascript", i.src = t, window[n] = function(t) {
@@ -1174,7 +1174,7 @@ const ot = "function" == typeof fetch && "function" == typeof AbortController, a
1174
1174
  };
1175
1175
  return i && (V(e.body) || (s.body = JSON.stringify(e.body))), V(e.headers) || (s.headers = e.headers),
1176
1176
  V(e.credentials) || (s.credentials = e.credentials), fetch(t, s).then(t => {
1177
- const i = this.Ut(t, e.returnJSON, e.responseType);
1177
+ const i = this.jt(t, e.returnJSON, e.responseType);
1178
1178
  i.message ? n(i) : i.then(i => {
1179
1179
  "arraybuffer" === e.responseType ? n(null, {
1180
1180
  data: i,
@@ -1190,7 +1190,7 @@ const ot = "function" == typeof fetch && "function" == typeof AbortController, a
1190
1190
  }), r;
1191
1191
  }
1192
1192
  {
1193
- const r = at.jt(n);
1193
+ const r = at.Ut(n);
1194
1194
  if (r.open(e.method || "GET", t, !0), e) {
1195
1195
  for (const t in e.headers) r.setRequestHeader(t, e.headers[t]);
1196
1196
  r.withCredentials = "include" === e.credentials, e.responseType && (r.responseType = e.responseType);
@@ -1198,7 +1198,7 @@ const ot = "function" == typeof fetch && "function" == typeof AbortController, a
1198
1198
  return r.send(i ? e.body : null), r;
1199
1199
  }
1200
1200
  },
1201
- Ut: (t, e, n) => 200 !== t.status ? {
1201
+ jt: (t, e, n) => 200 !== t.status ? {
1202
1202
  status: t.status,
1203
1203
  statusText: t.statusText,
1204
1204
  message: `incorrect http request with status code(${t.status}): ${t.statusText}`
@@ -1223,7 +1223,7 @@ const ot = "function" == typeof fetch && "function" == typeof AbortController, a
1223
1223
  });
1224
1224
  };
1225
1225
  },
1226
- jt: function(t) {
1226
+ Ut: function(t) {
1227
1227
  let e;
1228
1228
  try {
1229
1229
  e = new XMLHttpRequest;
@@ -1321,7 +1321,7 @@ class ht extends t.TileLayer {
1321
1321
  };
1322
1322
  }
1323
1323
  setStyle(t) {
1324
- if (t && (N(t) || t.url)) {
1324
+ if (t && (R(t) || t.url)) {
1325
1325
  const e = t, n = e.lastIndexOf("/"), i = n < 0 ? "." : e.substring(0, n);
1326
1326
  return this.ready = !1, at.getJSON(t.url ? t.url : t, t.url ? t : {}, (t, n) => {
1327
1327
  if (t) throw this.setStyle([]), t;
@@ -1363,11 +1363,11 @@ class ht extends t.TileLayer {
1363
1363
  const i = t[n].style;
1364
1364
  if (i && Array.isArray(i) && i.length) for (let r = 0; r < i.length; r++) {
1365
1365
  const s = L({}, t[n], i[r]);
1366
- i[r].qt = e.length, delete s.style, e.push(s);
1366
+ i[r].Yt = e.length, delete s.style, e.push(s);
1367
1367
  } else e.push(L({}, t[n]));
1368
1368
  }
1369
1369
  return e;
1370
- }(t.featureStyle), this.Yt = t.style || [];
1370
+ }(t.featureStyle), this.qt = t.style || [];
1371
1371
  const e = t.background || {};
1372
1372
  this.Jt = {
1373
1373
  enable: e.enable || !1,
@@ -1387,13 +1387,13 @@ class ht extends t.TileLayer {
1387
1387
  return t ? t.getPolygonOffsetCount() : 0;
1388
1388
  }
1389
1389
  getPolygonOffset() {
1390
- return this.$t || 0;
1390
+ return this.Kt || 0;
1391
1391
  }
1392
1392
  setPolygonOffset(t, e) {
1393
- return this.$t = t, this.Kt = e, this;
1393
+ return this.Kt = t, this.$t = e, this;
1394
1394
  }
1395
1395
  getTotalPolygonOffset() {
1396
- return this.Kt;
1396
+ return this.$t;
1397
1397
  }
1398
1398
  outlineAll() {
1399
1399
  const t = this.getRenderer();
@@ -1412,7 +1412,7 @@ class ht extends t.TileLayer {
1412
1412
  return t ? (t.cancelOutline(), this) : this;
1413
1413
  }
1414
1414
  Zt() {
1415
- t.Util.convertStylePath(this.Yt, this.Wt), t.Util.convertStylePath(this.Xt, this.Wt);
1415
+ t.Util.convertStylePath(this.qt, this.Wt), t.Util.convertStylePath(this.Xt, this.Wt);
1416
1416
  }
1417
1417
  updateSceneConfig(t, e) {
1418
1418
  return this.Qt(0, t, e);
@@ -1426,7 +1426,7 @@ class ht extends t.TileLayer {
1426
1426
  let s, o = e;
1427
1427
  if (r[e].renderPlugin.sceneConfig || (r[e].renderPlugin.sceneConfig = {}), L(r[e].renderPlugin.sceneConfig, n),
1428
1428
  void 0 !== i) {
1429
- dt(this.Bt, e, i), o = this.Bt[e].style[i].qt;
1429
+ dt(this.Bt, e, i), o = this.Bt[e].style[i].Yt;
1430
1430
  const t = r[o].renderPlugin;
1431
1431
  t.sceneConfig || (t.sceneConfig = {}), s = t.sceneConfig;
1432
1432
  } else pt(r, e), s = r[e].renderPlugin.sceneConfig;
@@ -1459,7 +1459,7 @@ class ht extends t.TileLayer {
1459
1459
  const r = this.Z(t);
1460
1460
  if (!r) return this;
1461
1461
  let s, o = e;
1462
- void 0 !== i ? (dt(this.Bt, e, i), o = this.Bt[e].style[i].qt, s = r[o].renderPlugin.dataConfig) : (pt(r, e),
1462
+ void 0 !== i ? (dt(this.Bt, e, i), o = this.Bt[e].style[i].Yt, s = r[o].renderPlugin.dataConfig) : (pt(r, e),
1463
1463
  s = r[e].renderPlugin.dataConfig);
1464
1464
  const a = L({}, s);
1465
1465
  if (L(s, n), Array.isArray(this.options.style)) L(this.options.style[e].renderPlugin.dataConfig, n); else {
@@ -1488,7 +1488,7 @@ class ht extends t.TileLayer {
1488
1488
  const s = this.Z(e);
1489
1489
  if (!s) return this;
1490
1490
  let o = n;
1491
- void 0 !== r && (dt(this.Bt, n, r), o = this.Bt[n].style[r].qt);
1491
+ void 0 !== r && (dt(this.Bt, n, r), o = this.Bt[n].style[r].Yt);
1492
1492
  const a = s[o];
1493
1493
  if (!a) throw new Error("No style defined at " + n);
1494
1494
  const l = this, h = this.Wt;
@@ -1534,15 +1534,15 @@ class ht extends t.TileLayer {
1534
1534
  if (e) {
1535
1535
  return 0 === t ? e.style : e.featureStyle;
1536
1536
  }
1537
- return 0 === t ? this.Yt : this.Xt;
1537
+ return 0 === t ? this.qt : this.Xt;
1538
1538
  }
1539
1539
  isDefaultRender() {
1540
1540
  return !!this.ne && this.options.defaultRendering;
1541
1541
  }
1542
1542
  validateStyle() {
1543
1543
  this.ie = !0, this.ne = !1;
1544
- let t = this.Yt;
1545
- this.options.style || (this.ne = !0, t = this.Yt = []), Array.isArray(t) || (t = this.Yt = [ t ]);
1544
+ let t = this.qt;
1545
+ this.options.style || (this.ne = !0, t = this.qt = []), Array.isArray(t) || (t = this.qt = [ t ]);
1546
1546
  for (let e = 0; e < t.length; e++) {
1547
1547
  let n = t[e].filter;
1548
1548
  if (n && n.value && (n = n.value), void 0 !== n && "default" !== n && !0 !== n && !Array.isArray(n)) throw new Error(`Invalid filter at ${e} : ${JSON.stringify(n)}`);
@@ -1575,7 +1575,7 @@ class ht extends t.TileLayer {
1575
1575
  X() {
1576
1576
  return {
1577
1577
  background: this.Jt,
1578
- style: this.Yt || [],
1578
+ style: this.qt || [],
1579
1579
  featureStyle: this.Xt || []
1580
1580
  };
1581
1581
  }
@@ -1616,7 +1616,7 @@ class ht extends t.TileLayer {
1616
1616
  return t && "VectorTileLayer" === t.type ? new ht(t.id, t.options) : null;
1617
1617
  }
1618
1618
  St() {
1619
- this.Yt && (this.se = G(this.Yt)), this.Xt && (this.oe = G(this.Xt));
1619
+ this.qt && (this.se = G(this.qt)), this.Xt && (this.oe = G(this.Xt));
1620
1620
  }
1621
1621
  static registerPlugin(t) {
1622
1622
  ht.plugins || (ht.plugins = {}), ht.plugins[t.type] = t;
@@ -1650,7 +1650,7 @@ function ct(t) {
1650
1650
  }
1651
1651
 
1652
1652
  function ft(t) {
1653
- return t ? (Array.isArray(t) || (t = I(t).unitArray()), 3 === t.length && t.push(1),
1653
+ return t ? (Array.isArray(t) || (t = O(t).unitArray()), 3 === t.length && t.push(1),
1654
1654
  t) : null;
1655
1655
  }
1656
1656
 
@@ -1694,11 +1694,11 @@ class gt extends ht {
1694
1694
  getWorkerOptions() {
1695
1695
  const t = super.getWorkerOptions();
1696
1696
  let e = this.options.data;
1697
- return e = N(e) || e && e.url ? xt(e) : this.features, t.data = e, t.tileBuffer = this.options.tileBuffer,
1697
+ return e = R(e) || e && e.url ? xt(e) : this.features, t.data = e, t.tileBuffer = this.options.tileBuffer,
1698
1698
  t.extent = this.options.extent, t;
1699
1699
  }
1700
1700
  setData(t) {
1701
- if (this.options.data = t, t && (N(t) || t.url)) {
1701
+ if (this.options.data = t, t && (R(t) || t.url)) {
1702
1702
  return !!this.getRenderer() && this.he(), this;
1703
1703
  }
1704
1704
  return this.ce(t), this.he(), this;
@@ -1715,7 +1715,7 @@ class gt extends ht {
1715
1715
  const e = t.getWorkerConnection();
1716
1716
  if (e) {
1717
1717
  let n = this.options.data;
1718
- n = N(n) || n.url ? xt(n) : this.features, e.setData(n, (e, n) => {
1718
+ n = R(n) || n.url ? xt(n) : this.features, e.setData(n, (e, n) => {
1719
1719
  t.clear(), this.onWorkerReady(null, n), t.setToRedraw();
1720
1720
  });
1721
1721
  }
@@ -1735,7 +1735,7 @@ class gt extends ht {
1735
1735
  this.ue = new t.Extent(...e);
1736
1736
  }
1737
1737
  ye(t, e) {
1738
- N(t) ? at.getJSON(t, e) : at.getJSON(t.url, t, e);
1738
+ R(t) ? at.getJSON(t, e) : at.getJSON(t.url, t, e);
1739
1739
  }
1740
1740
  getData() {
1741
1741
  return this.features || null;
@@ -1799,13 +1799,13 @@ class bt extends t.OverlayLayer {
1799
1799
  return 1;
1800
1800
  }
1801
1801
  getPolygonOffset() {
1802
- return this.$t || 0;
1802
+ return this.Kt || 0;
1803
1803
  }
1804
1804
  setPolygonOffset(t, e) {
1805
- return this.$t = t, this.Kt = e, this;
1805
+ return this.Kt = t, this.$t = e, this;
1806
1806
  }
1807
1807
  getTotalPolygonOffset() {
1808
- return this.Kt;
1808
+ return this.$t;
1809
1809
  }
1810
1810
  identify(e, n = {}) {
1811
1811
  const i = this.getMap(), r = this.getRenderer();
@@ -2264,9 +2264,9 @@ const St = {
2264
2264
 
2265
2265
  let Tt = 1;
2266
2266
 
2267
- const kt = "_symbol_", Ot = "__fea_idx".trim();
2267
+ const kt = "_symbol_", It = "__fea_idx".trim();
2268
2268
 
2269
- let It = new Float32Array(1);
2269
+ let Ot = new Float32Array(1);
2270
2270
 
2271
2271
  class Ct extends t.renderer.CanvasRenderer {
2272
2272
  constructor(...t) {
@@ -2286,26 +2286,26 @@ class Ct extends t.renderer.CanvasRenderer {
2286
2286
  draw(t, e) {
2287
2287
  const n = this.layer;
2288
2288
  if (this.prepareCanvas(), this.ot = this.at(this.getMap().getGLRes()), this.we) this.buildMesh(),
2289
- this.ke(), this.Oe(), this.Me = {}, this.Ie = !1, this.we = !1, this.Ce = !1; else if (this.Ie) {
2289
+ this.ke(), this.Ie(), this.Me = {}, this.Oe = !1, this.we = !1, this.Ce = !1; else if (this.Oe) {
2290
2290
  const t = this.atlas, e = this.Fe, n = this.Ee;
2291
2291
  delete this.atlas, delete this.Fe, delete this.Ee, this.buildMesh(t), this.ke(e),
2292
- this.Oe(n), this.Ie = !1, this.Ce = !1;
2292
+ this.Ie(n), this.Oe = !1, this.Ce = !1;
2293
2293
  } else if (this.Ce) {
2294
2294
  const t = this.Ee;
2295
- delete this.Ee, this.Oe(t), this.Ce = !1;
2295
+ delete this.Ee, this.Ie(t), this.Ce = !1;
2296
2296
  }
2297
- if (!this.meshes && !this.De && !this.He) return void this.completeRender();
2298
- this.Le && (this.Ne(), this.Le = !1), this.Re(), n.options.collision && n.clearCollisionIndex(),
2297
+ if (!this.meshes && !this.He && !this.De) return void this.completeRender();
2298
+ this.Le && (this.Re(), this.Le = !1), this.Ne(), n.options.collision && n.clearCollisionIndex(),
2299
2299
  this.st = t, this.lt = e || {};
2300
2300
  const i = this.ze();
2301
2301
  let r = 0;
2302
2302
  this.painter && this.meshes && (this.painter.startFrame(i), this.painter.addMesh(this.meshes, null, {
2303
2303
  bloom: 1
2304
2304
  }), this.painter.prepareRender(i), i.polygonOffsetIndex = r++, this.painter.render(i)),
2305
- this.He && (this.Te.startFrame(i), this.Te.addMesh(this.He, null, {
2305
+ this.De && (this.Te.startFrame(i), this.Te.addMesh(this.De, null, {
2306
2306
  bloom: 1
2307
- }), this.Te.prepareRender(i), i.polygonOffsetIndex = r++, this.Te.render(i)), this.De && (this.Pe.startFrame(i),
2308
- this.Pe.addMesh(this.De, null, {
2307
+ }), this.Te.prepareRender(i), i.polygonOffsetIndex = r++, this.Te.render(i)), this.He && (this.Pe.startFrame(i),
2308
+ this.Pe.addMesh(this.He, null, {
2309
2309
  bloom: 1
2310
2310
  }), this.Pe.prepareRender(i), n.options.collision && this.Pe.updateCollision(i),
2311
2311
  this.Pe.render(i)), this.completeRender(), this.layer.fire("canvasisdirty");
@@ -2335,7 +2335,7 @@ class Ct extends t.renderer.CanvasRenderer {
2335
2335
  getFrameTimestamp() {
2336
2336
  return this.st;
2337
2337
  }
2338
- Ue() {
2338
+ je() {
2339
2339
  const t = [], e = [ 0, 0, 0, 0 ];
2340
2340
  this.layer._sortGeometries();
2341
2341
  const n = this.layer.getGeometries();
@@ -2345,12 +2345,12 @@ class Ct extends t.renderer.CanvasRenderer {
2345
2345
  const s = this.features[r];
2346
2346
  if (Array.isArray(s)) for (let n = 0; n < s.length; n++) {
2347
2347
  const i = s[n];
2348
- i.visible || (this.Le = !0), this.je(i.geometry, e), t.push(i);
2349
- } else s.visible || (this.Le = !0), this.je(s.geometry, e), t.push(s);
2348
+ i.visible || (this.Le = !0), this.Ue(i.geometry, e), t.push(i);
2349
+ } else s.visible || (this.Le = !0), this.Ue(s.geometry, e), t.push(s);
2350
2350
  }
2351
2351
  return t.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
2352
- delete this.meshes), this.De && (this.Pe.deleteMesh(this.De), delete this.De), this.He && (this.Te.deleteMesh(this.He),
2353
- delete this.He)), e[3] && (e[0] /= e[3], e[1] /= e[3]), {
2352
+ delete this.meshes), this.He && (this.Pe.deleteMesh(this.He), delete this.He), this.De && (this.Te.deleteMesh(this.De),
2353
+ delete this.De)), e[3] && (e[0] /= e[3], e[1] /= e[3]), {
2354
2354
  features: t,
2355
2355
  center: e
2356
2356
  };
@@ -2394,9 +2394,9 @@ class Ct extends t.renderer.CanvasRenderer {
2394
2394
  };
2395
2395
  });
2396
2396
  }
2397
- je(t, e) {
2398
- for (let n = 0; n < t.length; n++) if (R(t[n][0])) e[0] += t[n][0], e[1] += t[n][1],
2399
- e[3] += 1; else for (let i = 0; i < t[n].length; i++) if (R(t[n][i][0])) e[0] += t[n][i][0],
2397
+ Ue(t, e) {
2398
+ for (let n = 0; n < t.length; n++) if (N(t[n][0])) e[0] += t[n][0], e[1] += t[n][1],
2399
+ e[3] += 1; else for (let i = 0; i < t[n].length; i++) if (N(t[n][i][0])) e[0] += t[n][i][0],
2400
2400
  e[1] += t[n][i][1], e[3] += 1; else for (let r = 0; r < t[n][i].length; r++) e[0] += t[n][i][r][0],
2401
2401
  e[1] += t[n][i][r][1], e[3] += 1;
2402
2402
  }
@@ -2421,7 +2421,7 @@ class Ct extends t.renderer.CanvasRenderer {
2421
2421
  const e = !this.We("win-intel-gpu-crash");
2422
2422
  this.u = new b(e => {
2423
2423
  t.getMap().getRenderer().callInNextFrame(e);
2424
- }, t.options.glyphSdfLimitPerFrame, e), this.requestor = this.Be.bind(this), this.Xe = this.qe.bind(this);
2424
+ }, t.options.glyphSdfLimitPerFrame, e), this.requestor = this.Be.bind(this), this.Xe = this.Ye.bind(this);
2425
2425
  }
2426
2426
  Be(t, e, n) {
2427
2427
  const i = [];
@@ -2432,7 +2432,7 @@ class Ct extends t.renderer.CanvasRenderer {
2432
2432
  }, i);
2433
2433
  });
2434
2434
  }
2435
- qe(t, e, n) {
2435
+ Ye(t, e, n) {
2436
2436
  this.u.getGlyphs(e, (e, i) => {
2437
2437
  if (e) throw e;
2438
2438
  const r = i.buffers || [];
@@ -2447,22 +2447,22 @@ class Ct extends t.renderer.CanvasRenderer {
2447
2447
  }
2448
2448
  ke(t) {
2449
2449
  const e = Object.keys(this.xe), n = Object.keys(this.be);
2450
- if (!e.length && !n.length) return void (this.De && (this.Pe.deleteMesh(this.De),
2451
- delete this.De));
2452
- const {features: s, center: o} = this.Ue(), a = [], l = [];
2450
+ if (!e.length && !n.length) return void (this.He && (this.Pe.deleteMesh(this.He),
2451
+ delete this.He));
2452
+ const {features: s, center: o} = this.je(), a = [], l = [];
2453
2453
  for (let t = 0; t < s.length; t++) {
2454
- const e = s[t][Ot];
2454
+ const e = s[t][It];
2455
2455
  this.xe[e] && a.push(s[t]), this.be[e] && l.push(s[t]);
2456
2456
  }
2457
- if (!a.length && !l.length) return void (this.De && (this.Pe.deleteMesh(this.De),
2458
- delete this.De));
2457
+ if (!a.length && !l.length) return void (this.He && (this.Pe.deleteMesh(this.He),
2458
+ delete this.He));
2459
2459
  const h = this.Le;
2460
- this.Ye = o;
2460
+ this.qe = o;
2461
2461
  const c = this.Je(a, l, t, o);
2462
2462
  this.Fe = {};
2463
2463
  const f = [], u = [];
2464
2464
  this.Ze = !0, Promise.all(c).then(t => {
2465
- if (this.De && (this.Pe.deleteMesh(this.De), delete this.De), !t || !t.length) return void this.setToRedraw();
2465
+ if (this.He && (this.Pe.deleteMesh(this.He), delete this.He), !t || !t.length) return void this.setToRedraw();
2466
2466
  const e = this.Pe.createGeometries(t.map(t => t && t.data), this.ge);
2467
2467
  for (let n = 0; n < e.length; n++) this.Ge(e[n].geometry, t[n] && t[n].data);
2468
2468
  const n = t[0] && t[0].data.iconAtlas, s = t[0] && t[0].data.glyphAtlas || t[1] && t[1].data.glyphAtlas;
@@ -2472,14 +2472,14 @@ class Ct extends t.renderer.CanvasRenderer {
2472
2472
  const l = this.Pe.createMeshes(e, a);
2473
2473
  for (let t = 0; t < l.length; t++) l[t].geometry.properties.originElements = l[t].geometry.properties.elements.slice(),
2474
2474
  l[t].setUniform("level", 0), l[t].material.set("flipY", 1), l[t].properties.meshKey = Tt++;
2475
- this.De = l, h && (this.Le = !0), this.Ze = !1, this.setToRedraw();
2475
+ this.He = l, h && (this.Le = !0), this.Ze = !1, this.setToRedraw();
2476
2476
  });
2477
2477
  }
2478
- Ne() {
2479
- if (this.De && (this.$e(this.De[0], this.xe), this.$e(this.De[1], this.be)), this.He) for (let t = 0; t < this.He.length; t++) this.$e(this.He[t], this.Ae);
2480
- if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.$e(this.meshes[t], this.ge);
2478
+ Re() {
2479
+ if (this.He && (this.Ke(this.He[0], this.xe), this.Ke(this.He[1], this.be)), this.De) for (let t = 0; t < this.De.length; t++) this.Ke(this.De[t], this.Ae);
2480
+ if (this.meshes) for (let t = 0; t < this.meshes.length; t++) this.Ke(this.meshes[t], this.ge);
2481
2481
  }
2482
- $e(t, e) {
2482
+ Ke(t, e) {
2483
2483
  if (!t) return;
2484
2484
  const {aPickingId: n, originElements: i} = t.geometry.properties, r = [];
2485
2485
  for (let t = 0; t < i.length; t++) {
@@ -2504,11 +2504,11 @@ class Ct extends t.renderer.CanvasRenderer {
2504
2504
  return A.splitPointSymbol(this.Se).map((n, i) => new A(0 === i ? t : e, n, 0 === i ? r : s).load());
2505
2505
  }
2506
2506
  updateMesh() {}
2507
- Ke(t) {
2507
+ $e(t) {
2508
2508
  const e = t._getInternalSymbol(), n = {
2509
2509
  zoom: this.getMap().getZoom()
2510
2510
  }, i = this.Qe(t);
2511
- if (!this.De) return !1;
2511
+ if (!this.He) return !1;
2512
2512
  let r = this.features[i];
2513
2513
  Array.isArray(r) || (r = [ r ]);
2514
2514
  const s = [], o = [], a = this.getMap().getZoom();
@@ -2521,10 +2521,10 @@ class Ct extends t.renderer.CanvasRenderer {
2521
2521
  !1;
2522
2522
  }
2523
2523
  for (let t = 0; t < r.length; t++) {
2524
- const e = r[t][Ot];
2524
+ const e = r[t][It];
2525
2525
  this.xe[e] && s.push(r[t]), this.be[e] && o.push(r[t]);
2526
2526
  }
2527
- const c = r[0].id, f = this.Je(s, o, this.Fe, this.Ye), u = this.De;
2527
+ const c = r[0].id, f = this.Je(s, o, this.Fe, this.qe), u = this.He;
2528
2528
  return Promise.all(f).then(t => {
2529
2529
  for (let e = 0; e < t.length; e++) {
2530
2530
  if (!t[e]) continue;
@@ -2541,7 +2541,7 @@ class Ct extends t.renderer.CanvasRenderer {
2541
2541
  }), !0;
2542
2542
  }
2543
2543
  en(t) {
2544
- return this.nn(t, this.He, this.Ee, this.in, this.Te, S, Pt, this.rn);
2544
+ return this.nn(t, this.De, this.Ee, this.in, this.Te, S, Pt, this.rn);
2545
2545
  }
2546
2546
  nn(t, e, n, i, r, s, o, a) {
2547
2547
  if (!e) return !1;
@@ -2589,23 +2589,23 @@ class Ct extends t.renderer.CanvasRenderer {
2589
2589
  let t = s + 1;
2590
2590
  for (;r[t] === d; ) t++;
2591
2591
  const e = t - s;
2592
- It.length !== 3 * e && (It = new Float32Array(3 * e), It.fill(-1 / 0, 0)), i.geometry.updateSubData(i.geometry.desc.positionAttribute, It, 3 * s);
2592
+ Ot.length !== 3 * e && (Ot = new Float32Array(3 * e), Ot.fill(-1 / 0, 0)), i.geometry.updateSubData(i.geometry.desc.positionAttribute, Ot, 3 * s);
2593
2593
  }
2594
2594
  this.setToRedraw();
2595
2595
  }
2596
2596
  }
2597
2597
  }), !0;
2598
2598
  }
2599
- Oe(t) {
2600
- if (!Object.keys(this.Ae).length) return void (this.He && (this.Te.deleteMesh(this.He),
2601
- delete this.He));
2602
- const {features: e, center: n} = this.Ue();
2599
+ Ie(t) {
2600
+ if (!Object.keys(this.Ae).length) return void (this.De && (this.Te.deleteMesh(this.De),
2601
+ delete this.De));
2602
+ const {features: e, center: n} = this.je();
2603
2603
  if (!e.length) return;
2604
2604
  const i = this.Le;
2605
2605
  this.in = n;
2606
2606
  const r = this.rn(e), s = L({}, Pt), o = r.map((e, i) => this.createMesh(this.Te, S, s, e, t && t[i], n));
2607
2607
  this.sn = !0, Promise.all(o).then(t => {
2608
- this.He && this.Te.deleteMesh(this.He);
2608
+ this.De && this.Te.deleteMesh(this.De);
2609
2609
  const e = [], n = [];
2610
2610
  for (let i = 0; i < t.length; i++) {
2611
2611
  const r = t[i] && t[i].meshes;
@@ -2617,19 +2617,19 @@ class Ct extends t.renderer.CanvasRenderer {
2617
2617
  n[i] = t[i].atlas;
2618
2618
  }
2619
2619
  }
2620
- this.He = e, this.Ee = n, i && (this.Le = i), this.sn = !1, this.setToRedraw();
2620
+ this.De = e, this.Ee = n, i && (this.Le = i), this.sn = !1, this.setToRedraw();
2621
2621
  });
2622
2622
  }
2623
2623
  rn(t) {
2624
2624
  const e = (kt + "lineDasharray").trim(), n = (kt + "linePatternFile").trim(), i = [], r = [], s = [];
2625
2625
  for (let o = 0; o < t.length; o++) {
2626
2626
  const a = t[o], l = a.properties && a.properties[e];
2627
- l && Nt(l) ? s.push(a) : a.properties && a.properties[n] ? r.push(a) : i.push(a);
2627
+ l && Rt(l) ? s.push(a) : a.properties && a.properties[n] ? r.push(a) : i.push(a);
2628
2628
  }
2629
2629
  return [ r, s, i ];
2630
2630
  }
2631
2631
  an() {
2632
- this.Ie = !0, this.setToRedraw();
2632
+ this.Oe = !0, this.setToRedraw();
2633
2633
  }
2634
2634
  tn() {
2635
2635
  this.we = !0, this.setToRedraw();
@@ -2658,29 +2658,29 @@ class Ct extends t.renderer.CanvasRenderer {
2658
2658
  if (!t) return;
2659
2659
  const e = Array.isArray(t) ? t[0].id : t.id;
2660
2660
  if (this.ve[e] = t, Array.isArray(t)) for (let e = 0; e < t.length; e++) {
2661
- const n = t[e][Ot];
2661
+ const n = t[e][It];
2662
2662
  this.ge[n] = {
2663
2663
  feature: t[e]
2664
2664
  };
2665
2665
  const i = {
2666
2666
  feature: t[e]
2667
2667
  };
2668
- Dt(t[e]) && (this.xe[n] = i), Ht(t[e]) && (this.be[n] = i), Lt(t[e]) && (this.Ae[n] = i);
2668
+ Ht(t[e]) && (this.xe[n] = i), Dt(t[e]) && (this.be[n] = i), Lt(t[e]) && (this.Ae[n] = i);
2669
2669
  } else {
2670
2670
  const e = {
2671
2671
  feature: t
2672
- }, n = t[Ot];
2673
- Dt(t) && (this.xe[n] = e), Ht(t) && (this.be[n] = e), Lt(t) && (this.Ae[n] = e),
2672
+ }, n = t[It];
2673
+ Ht(t) && (this.xe[n] = e), Dt(t) && (this.be[n] = e), Lt(t) && (this.Ae[n] = e),
2674
2674
  this.ge[n] = e;
2675
2675
  }
2676
2676
  }
2677
2677
  hn(t) {
2678
2678
  const e = this.features[t];
2679
2679
  if (Array.isArray(e)) for (let t = 0; t < e.length; t++) {
2680
- const n = e[t][Ot], i = e[t].id;
2680
+ const n = e[t][It], i = e[t].id;
2681
2681
  delete this.ve[i], delete this.ge[n], delete this.xe[n], delete this.be[n], delete this.Ae[n];
2682
2682
  } else {
2683
- const t = e[Ot], n = e.id;
2683
+ const t = e[It], n = e.id;
2684
2684
  delete this.ve[n], delete this.ge[t], delete this.xe[t], delete this.be[t], delete this.Ae[t];
2685
2685
  }
2686
2686
  }
@@ -2697,14 +2697,14 @@ class Ct extends t.renderer.CanvasRenderer {
2697
2697
  }
2698
2698
  un(t) {
2699
2699
  const e = t[wt], n = this.features[e];
2700
- return Array.isArray(n) ? n[0][Ot] : n[Ot];
2700
+ return Array.isArray(n) ? n[0][It] : n[It];
2701
2701
  }
2702
- Re() {
2702
+ Ne() {
2703
2703
  let t = !1;
2704
2704
  for (const e in this.Me) {
2705
2705
  const n = this.Me[e], i = this.un(n);
2706
2706
  if (!this.Ze && (this.xe[i] || this.be[i])) {
2707
- const e = this.Ke(n);
2707
+ const e = this.$e(n);
2708
2708
  t = t || e;
2709
2709
  }
2710
2710
  if (!this.sn && this.Ae[i]) {
@@ -2741,8 +2741,8 @@ class Ct extends t.renderer.CanvasRenderer {
2741
2741
  return Array.isArray(t) ? !!Array.isArray(e) && t.length === e.length : !Array.isArray(e);
2742
2742
  }(r, s)) {
2743
2743
  if (Array.isArray(r)) for (let t = 0; t < r.length; t++) {
2744
- if (!Rt(r[t], s[t])) return void this.pn(e);
2745
- } else if (!Rt(r, s)) return void this.pn(e);
2744
+ if (!Nt(r[t], s[t])) return void this.pn(e);
2745
+ } else if (!Nt(r, s)) return void this.pn(e);
2746
2746
  this.onGeometryPositionChange(t);
2747
2747
  } else this.pn(e); else this.pn(e);
2748
2748
  }
@@ -2756,7 +2756,7 @@ class Ct extends t.renderer.CanvasRenderer {
2756
2756
  for (let i = 0; i < e.length; i++) if (!t(e[0], n[0])) return !1;
2757
2757
  } else if (Array.isArray(e[0]) || Array.isArray(n[0])) return !1;
2758
2758
  return !0;
2759
- }(n, (Array.isArray(r) ? r[0] : r).geometry)) return this.He && (this.Ce = !0),
2759
+ }(n, (Array.isArray(r) ? r[0] : r).geometry)) return this.De && (this.Ce = !0),
2760
2760
  void this.onGeometryPositionChange(t);
2761
2761
  this.ln([ e ]), this.an(), Ft(this);
2762
2762
  }
@@ -2800,7 +2800,7 @@ class Ct extends t.renderer.CanvasRenderer {
2800
2800
  }
2801
2801
  createContext() {
2802
2802
  const t = this.canvas.gl && this.canvas.gl.wrap;
2803
- t ? (this.gl = this.canvas.gl.wrap(), this.regl = this.canvas.gl.regl) : this.K(),
2803
+ t ? (this.gl = this.canvas.gl.wrap(), this.regl = this.canvas.gl.regl) : this.$(),
2804
2804
  t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
2805
2805
  this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
2806
2806
  this.painter = this.createPainter();
@@ -2812,7 +2812,7 @@ class Ct extends t.renderer.CanvasRenderer {
2812
2812
  this.Te = new i(this.regl, this.layer, r, this.layer.options.sceneConfig, 0), this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
2813
2813
  }
2814
2814
  createPainter() {}
2815
- K() {
2815
+ $() {
2816
2816
  const t = this.layer.options.glOptions || {
2817
2817
  alpha: !0,
2818
2818
  depth: !0,
@@ -2898,12 +2898,12 @@ function Et(t) {
2898
2898
  return !1;
2899
2899
  }
2900
2900
 
2901
- function Dt({properties: t}) {
2901
+ function Ht({properties: t}) {
2902
2902
  const e = (kt + "markerFile").trim(), n = (kt + "markerType").trim();
2903
2903
  return t[e] || t[n];
2904
2904
  }
2905
2905
 
2906
- function Ht({properties: t}) {
2906
+ function Dt({properties: t}) {
2907
2907
  return t[(kt + "textName").trim()];
2908
2908
  }
2909
2909
 
@@ -2912,14 +2912,14 @@ function Lt(t) {
2912
2912
  return 2 === t.type || 3 === t.type && !!t.properties[e];
2913
2913
  }
2914
2914
 
2915
- function Nt(t) {
2915
+ function Rt(t) {
2916
2916
  if (!Array.isArray(t)) return 0;
2917
2917
  let e = 0;
2918
2918
  for (let n = 0; n < t.length; n++) e += t[n];
2919
2919
  return e;
2920
2920
  }
2921
2921
 
2922
- function Rt(t, e) {
2922
+ function Nt(t, e) {
2923
2923
  if (Object.keys(t).sort().join() !== Object.keys(e.properties || {}).filter(t => 0 === t.indexOf(kt)).map(t => t.substring(kt.length)).sort().join()) return !1;
2924
2924
  for (const n in t) if (W(t, n)) {
2925
2925
  const i = (kt + n).trim();
@@ -2974,27 +2974,27 @@ Vt.registerRenderer("gl", class extends Ct {
2974
2974
  }
2975
2975
  });
2976
2976
 
2977
- class Ut extends bt {
2977
+ class jt extends bt {
2978
2978
  static fromJSON(t) {
2979
- return zt(t, "LineStringLayer", Ut);
2979
+ return zt(t, "LineStringLayer", jt);
2980
2980
  }
2981
2981
  }
2982
2982
 
2983
- Ut.registerJSONType("LineStringLayer");
2983
+ jt.registerJSONType("LineStringLayer");
2984
2984
 
2985
- Ut.registerRenderer("gl", class extends Ct {
2985
+ jt.registerRenderer("gl", class extends Ct {
2986
2986
  constructor(...e) {
2987
2987
  super(...e), this.GeometryTypes = [ t.LineString, t.MultiLineString ];
2988
2988
  }
2989
- }), Ut.registerRenderer("canvas", null);
2989
+ }), jt.registerRenderer("canvas", null);
2990
2990
 
2991
- class jt extends bt {
2991
+ class Ut extends bt {
2992
2992
  static fromJSON(t) {
2993
- return zt(t, "PolygonLayer", jt);
2993
+ return zt(t, "PolygonLayer", Ut);
2994
2994
  }
2995
2995
  }
2996
2996
 
2997
- jt.registerJSONType("PolygonLayer");
2997
+ Ut.registerJSONType("PolygonLayer");
2998
2998
 
2999
2999
  const Gt = {
3000
3000
  polygonFill: {
@@ -3024,12 +3024,12 @@ const Gt = {
3024
3024
  }
3025
3025
  };
3026
3026
 
3027
- jt.registerRenderer("gl", class extends Ct {
3027
+ Ut.registerRenderer("gl", class extends Ct {
3028
3028
  constructor(...e) {
3029
3029
  super(...e), this.PackClass = T, this.GeometryTypes = [ t.Polygon, t.MultiPolygon ];
3030
3030
  }
3031
3031
  buildMesh(t) {
3032
- const {features: e, center: n} = this.Ue();
3032
+ const {features: e, center: n} = this.je();
3033
3033
  if (!e.length) return;
3034
3034
  const i = this.Le;
3035
3035
  this.vn = n;
@@ -3065,7 +3065,7 @@ jt.registerRenderer("gl", class extends Ct {
3065
3065
  updateMesh(t) {
3066
3066
  return this.nn(t, this.meshes, this.atlas, this.vn, this.painter, T, Gt, this.xn);
3067
3067
  }
3068
- }), jt.registerRenderer("canvas", null);
3068
+ }), Ut.registerRenderer("canvas", null);
3069
3069
 
3070
3070
  const Wt = {
3071
3071
  redraw: !1,
@@ -3074,7 +3074,7 @@ const Wt = {
3074
3074
 
3075
3075
  let Xt = 1;
3076
3076
 
3077
- function qt(t, e) {
3077
+ function Yt(t, e) {
3078
3078
  return F.extend(t, {
3079
3079
  init: function() {
3080
3080
  this.bn = {};
@@ -3136,7 +3136,7 @@ function qt(t, e) {
3136
3136
  for (let e = 0; e < o.length; e++) o[e] && o[e].geometry && (i = !0, o[e].geometry.properties.features = s,
3137
3137
  this.Ge(o[e].geometry, t));
3138
3138
  }
3139
- let a = this.H(s);
3139
+ let a = this.D(s);
3140
3140
  if (!a) {
3141
3141
  const {meshes: e, retire: n} = this.Pn(o, t);
3142
3142
  i || (i = n), a = e;
@@ -3173,7 +3173,7 @@ function qt(t, e) {
3173
3173
  if (!a) return Wt;
3174
3174
  let l = !1;
3175
3175
  const h = this.Sn(t);
3176
- let c = this.H(h);
3176
+ let c = this.D(h);
3177
3177
  if (!c) {
3178
3178
  const {meshes: e, retire: n} = this.Pn(a, t);
3179
3179
  l || (l = n), c = e;
@@ -3271,7 +3271,7 @@ function qt(t, e) {
3271
3271
  const i = e[n];
3272
3272
  if (o = t[i].symbol, a = h[i], !a) if (l) {
3273
3273
  let e;
3274
- e = "function" == typeof l ? l(t[i].feature && t[i].feature.properties) : l, e = I(e),
3274
+ e = "function" == typeof l ? l(t[i].feature && t[i].feature.properties) : l, e = O(e),
3275
3275
  a = h[i] = e.array();
3276
3276
  } else a = h[i] = [ 255, 255, 255 ];
3277
3277
  c = 4 * n, s[c] = a[0], s[c + 1] = a[1], s[c + 2] = a[2], s[c + 3] = 255 * (o[this.painter.opacitySymbol] || 1);
@@ -3282,19 +3282,19 @@ function qt(t, e) {
3282
3282
  const e = t.tileInfo;
3283
3283
  return e.meshKey || (e.meshKey = Xt++), e.meshKey;
3284
3284
  },
3285
- H: function(t) {
3285
+ D: function(t) {
3286
3286
  return this.bn[t];
3287
3287
  },
3288
- On(t, e) {
3288
+ In(t, e) {
3289
3289
  if (Array.isArray(t)) t.forEach((t, n) => {
3290
3290
  const {features: i} = t.properties;
3291
- this.In(t, e[n], i);
3291
+ this.On(t, e[n], i);
3292
3292
  }); else {
3293
3293
  const {features: n} = t.properties;
3294
- this.In(t, Array.isArray(e) ? e[0] : e, n);
3294
+ this.On(t, Array.isArray(e) ? e[0] : e, n);
3295
3295
  }
3296
3296
  },
3297
- In(t, e, n) {
3297
+ On(t, e, n) {
3298
3298
  const i = e.featureIndexes || e.data.featureIndexes;
3299
3299
  if (i) if (this.wn) {
3300
3300
  const r = e.indices;
@@ -3322,7 +3322,7 @@ function qt(t, e) {
3322
3322
  });
3323
3323
  }
3324
3324
 
3325
- class Yt {
3325
+ class qt {
3326
3326
  constructor() {
3327
3327
  this.Cn = 1;
3328
3328
  }
@@ -3351,13 +3351,13 @@ function Zt(t, e, n) {
3351
3351
  return Math.min(n, Math.max(e, t));
3352
3352
  }
3353
3353
 
3354
- function $t(t, e, n) {
3354
+ function Kt(t, e, n) {
3355
3355
  if (t === n || t === e) return t;
3356
3356
  const i = n - e;
3357
3357
  return ((t - e) % i + i) % i + e;
3358
3358
  }
3359
3359
 
3360
- function Kt(t) {
3360
+ function $t(t) {
3361
3361
  return null == t;
3362
3362
  }
3363
3363
 
@@ -3369,7 +3369,7 @@ function te(t, e, n, i, r, s) {
3369
3369
  Object.defineProperty(t, e, {
3370
3370
  enumerable: !0,
3371
3371
  get: function() {
3372
- const t = Kt(n[i]) || m(n[i]) ? r : n[i];
3372
+ const t = $t(n[i]) || m(n[i]) ? r : n[i];
3373
3373
  return s ? s(t) : t;
3374
3374
  }
3375
3375
  });
@@ -3389,7 +3389,7 @@ function ie(t, e = 4) {
3389
3389
  function re(t, e, n) {
3390
3390
  if (Array.isArray(n)) return 3 === n.length && 4 === e && n.push(1), n;
3391
3391
  if (t && t[n]) return t[n];
3392
- const i = I(n).unitArray();
3392
+ const i = O(n).unitArray();
3393
3393
  return 3 === i.length && 4 === e && i.push(1), t && (t[n] = i), i;
3394
3394
  }
3395
3395
 
@@ -3588,14 +3588,14 @@ function we(t) {
3588
3588
  return t && m(t) && t.property;
3589
3589
  }
3590
3590
 
3591
- const {loginIBLResOnCanvas: _e, logoutIBLResOnCanvas: Se, getIBLResOnCanvas: Me} = n.pbr.PBRUtils, Pe = [], Te = [], ke = t => 0 === t.getUniform("level"), Oe = t => t.getUniform("level") > 0;
3591
+ const {loginIBLResOnCanvas: _e, logoutIBLResOnCanvas: Se, getIBLResOnCanvas: Me} = n.pbr.PBRUtils, Pe = [], Te = [], ke = t => 0 === t.getUniform("level"), Ie = t => t.getUniform("level") > 0;
3592
3592
 
3593
- class Ie {
3593
+ class Oe {
3594
3594
  constructor(t, e, i, r, s, o) {
3595
3595
  this.regl = t, this.layer = e, this.canvas = e.getRenderer().canvas, this.sceneConfig = r || {},
3596
3596
  this.dataConfig = o || {}, this.pluginIndex = s, this.scene = new n.Scene, this.pickingFBO = e.getRenderer().pickingFBO,
3597
- this.Dn = new Yt, this.level0Filter = ke, this.levelNFilter = Oe, this.loginTextureCache(),
3598
- this.symbolDef = Array.isArray(i) ? i.map(t => Qt(t)) : [ Qt(i) ], this.Hn(), this.pickingViewport = {
3597
+ this.Hn = new qt, this.level0Filter = ke, this.levelNFilter = Ie, this.loginTextureCache(),
3598
+ this.symbolDef = Array.isArray(i) ? i.map(t => Qt(t)) : [ Qt(i) ], this.Dn(), this.pickingViewport = {
3599
3599
  x: 0,
3600
3600
  y: 0,
3601
3601
  width: () => this.canvas ? this.canvas.width : 1,
@@ -3631,10 +3631,10 @@ class Ie {
3631
3631
  return !1 !== r && 0 !== r;
3632
3632
  }
3633
3633
  needToRedraw() {
3634
- return this.Nn;
3634
+ return this.Rn;
3635
3635
  }
3636
3636
  needToRetireFrames() {
3637
- return this.q;
3637
+ return this.Y;
3638
3638
  }
3639
3639
  fillIncludes(t, e, n) {
3640
3640
  const i = n && n.includes;
@@ -3655,7 +3655,7 @@ class Ie {
3655
3655
  }) : n.push(null); else {
3656
3656
  const r = this.createGeometry(t[i], e, i);
3657
3657
  if (r && r.geometry) {
3658
- const {pickingIdMap: n, idPickingMap: s, hasFeaIds: o} = this.Rn(t[i]), a = r.geometry.properties;
3658
+ const {pickingIdMap: n, idPickingMap: s, hasFeaIds: o} = this.Nn(t[i]), a = r.geometry.properties;
3659
3659
  a.symbolIndex = r.symbolIndex, a.features = e, o && (a.feaIdPickingMap = n, a.feaPickingIdMap = s);
3660
3660
  }
3661
3661
  this.postCreateGeometry(r, n), n.push(r);
@@ -3663,7 +3663,7 @@ class Ie {
3663
3663
  return n;
3664
3664
  }
3665
3665
  postCreateGeometry() {}
3666
- Rn(t) {
3666
+ Nn(t) {
3667
3667
  if (!t) return {};
3668
3668
  if (Array.isArray(t) && !(t = t[0])) return {};
3669
3669
  const e = t.featureIds, n = {}, i = {}, r = e && e.length;
@@ -3728,11 +3728,11 @@ class Ie {
3728
3728
  this.zn = t;
3729
3729
  const n = this.getUniformValues(e, t);
3730
3730
  return this.callShader(n, t), {
3731
- redraw: this.Nn
3731
+ redraw: this.Rn
3732
3732
  };
3733
3733
  }
3734
3734
  setToRedraw(t) {
3735
- t && (this.q = t), this.Nn = !0;
3735
+ t && (this.Y = t), this.Rn = !0;
3736
3736
  }
3737
3737
  callShader(t, e) {
3738
3738
  this.callCurrentTileShader(t, e), this.callBackgroundTileShader(t, e);
@@ -3812,8 +3812,8 @@ class Ie {
3812
3812
  }
3813
3813
  }
3814
3814
  startFrame(t) {
3815
- this.Vn || (this.init(t), this.Vn = !0), this.it !== t.timestamp && (this.Nn = !1,
3816
- this.q = !1), this.scene.clear();
3815
+ this.Vn || (this.init(t), this.Vn = !0), this.it !== t.timestamp && (this.Rn = !1,
3816
+ this.Y = !1), this.scene.clear();
3817
3817
  }
3818
3818
  resize() {}
3819
3819
  delete() {
@@ -3821,9 +3821,9 @@ class Ie {
3821
3821
  for (let t = 0; t < this.picking.length; t++) this.picking[t].dispose();
3822
3822
  delete this.picking;
3823
3823
  }
3824
- if (this.Un) {
3825
- for (let t = 0; t < this.Un.length; t++) this.Un[t].dispose();
3826
- delete this.Un;
3824
+ if (this.jn) {
3825
+ for (let t = 0; t < this.jn.length; t++) this.jn[t].dispose();
3826
+ delete this.jn;
3827
3827
  }
3828
3828
  this.logoutTextureCache();
3829
3829
  }
@@ -3832,16 +3832,16 @@ class Ie {
3832
3832
  Array.isArray(t) || (t = [ t ], e = [ e ]);
3833
3833
  let i = !1;
3834
3834
  for (let n = 0; n < t.length; n++) if (t[n]) {
3835
- const r = this.jn(n, t[n], e[n]);
3835
+ const r = this.Un(n, t[n], e[n]);
3836
3836
  r && (i = r);
3837
3837
  }
3838
3838
  return delete this.Gn, this.setToRedraw(n), i;
3839
3839
  }
3840
3840
  Wn(t, e) {
3841
- for (const n in e) if (le(e, n) && k[n] && !O(e[n], t[n])) return !0;
3841
+ for (const n in e) if (le(e, n) && k[n] && !I(e[n], t[n])) return !0;
3842
3842
  return !1;
3843
3843
  }
3844
- jn(t, e, n) {
3844
+ Un(t, e, n) {
3845
3845
  if (!this.Bn) return !1;
3846
3846
  const i = this.Wn(this.symbolDef[t] || {}, n);
3847
3847
  this.symbolDef[t] = Qt(n);
@@ -3869,7 +3869,7 @@ class Ie {
3869
3869
  const e = t.index;
3870
3870
  return this.Bn[e];
3871
3871
  }
3872
- Hn() {
3872
+ Dn() {
3873
3873
  const t = this.getMap(), e = () => [ t.getZoom() ];
3874
3874
  this.Bn = [], this.Ln = [];
3875
3875
  for (let t = 0; t < this.symbolDef.length; t++) this.Bn[t] = y(Jt({}, this.symbolDef[t]), e),
@@ -3894,7 +3894,7 @@ class Ie {
3894
3894
  }), e[t].count++;
3895
3895
  }
3896
3896
  logoutTextureCache() {
3897
- const t = "__gl_textures".trim(), e = this.getMap(), n = this.qn;
3897
+ const t = "__gl_textures".trim(), e = this.getMap(), n = this.Yn;
3898
3898
  if (n) for (const i in n) le(n, i) && e[t][i] && (e[t][i].count--, e[t][i].count <= 0 && delete e[t][i]);
3899
3899
  e[t].count--, e[t].count <= 0 && (e[t] = {});
3900
3900
  }
@@ -3908,13 +3908,13 @@ class Ie {
3908
3908
  r ? r.data = e : r = i[n][t] = {
3909
3909
  data: e,
3910
3910
  count: 0
3911
- }, this.qn || (this.qn = {}), r.data.then || this.qn[t] || (r.count++, this.qn[t] = 1);
3911
+ }, this.Yn || (this.Yn = {}), r.data.then || this.Yn[t] || (r.count++, this.Yn[t] = 1);
3912
3912
  }
3913
3913
  disposeCachedTexture(t) {
3914
3914
  let e;
3915
- if (e = "string" == typeof t ? t : t.url, !this.qn || !this.qn[e]) return;
3915
+ if (e = "string" == typeof t ? t : t.url, !this.Yn || !this.Yn[e]) return;
3916
3916
  const n = "__gl_textures".trim();
3917
- delete this.qn[e];
3917
+ delete this.Yn[e];
3918
3918
  const i = this.getMap();
3919
3919
  i[n][e] && (i[n][e].count--, i[n][e].count <= 0 && delete i[n][e]);
3920
3920
  }
@@ -3927,7 +3927,7 @@ class Ie {
3927
3927
  supportRenderMode(t) {
3928
3928
  return "taa" === t || "fxaa" === t;
3929
3929
  }
3930
- Yn(t) {
3930
+ qn(t) {
3931
3931
  const e = this.scene.getMeshes();
3932
3932
  if (!e.length) return;
3933
3933
  const n = e.map(t => ({
@@ -3935,26 +3935,26 @@ class Ie {
3935
3935
  level: t.getUniform("level"),
3936
3936
  mesh: t
3937
3937
  })).sort(this.Jn), i = this.getMap().projViewMatrix;
3938
- this.Dn.start(t);
3938
+ this.Hn.start(t);
3939
3939
  const s = {};
3940
3940
  for (let e = 0; e < n.length; e++) {
3941
3941
  const o = n[e].mesh;
3942
3942
  let a = s[o.properties.tile.id];
3943
- void 0 === a && (r.multiply(Pe, i, n[e].transform), a = this.Dn.write(t, Pe), s[o.properties.tile.id] = a),
3943
+ void 0 === a && (r.multiply(Pe, i, n[e].transform), a = this.Hn.write(t, Pe), s[o.properties.tile.id] = a),
3944
3944
  o.setUniform("ref", a);
3945
3945
  }
3946
- this.Dn.end(t), this.regl.Zn();
3946
+ this.Hn.end(t), this.regl.Zn();
3947
3947
  }
3948
3948
  Jn(t, e) {
3949
3949
  return e.level - t.level;
3950
3950
  }
3951
3951
  outline(t, e) {
3952
3952
  const n = {};
3953
- for (let i = 0; i < e.length; i++) Kt(e[i]) || n[e[i]] || (this.$n(t, e[i]), n[e[i]] = 1);
3953
+ for (let i = 0; i < e.length; i++) $t(e[i]) || n[e[i]] || (this.Kn(t, e[i]), n[e[i]] = 1);
3954
3954
  }
3955
- $n(t, e) {
3955
+ Kn(t, e) {
3956
3956
  if (!this.picking) return;
3957
- if (this.Kn || (this.Kn = new n.Scene), !this.Un && (this.Qn(), !this.Un)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
3957
+ if (this.$n || (this.$n = new n.Scene), !this.jn && (this.Qn(), !this.jn)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
3958
3958
  const i = this.getUniformValues(this.getMap(), this.zn), r = this.ti(e);
3959
3959
  if (r.length) for (let n = 0; n < r.length; n++) {
3960
3960
  const s = r[n].geometry.properties.feaIdPickingMap;
@@ -3962,12 +3962,12 @@ class Ie {
3962
3962
  const o = s[e];
3963
3963
  if (o) {
3964
3964
  const e = {};
3965
- this.Kn.setMeshes(r[n]);
3965
+ this.$n.setMeshes(r[n]);
3966
3966
  for (let n = 0; n < o.length; n++) {
3967
3967
  const r = o[n];
3968
3968
  if (!e[r]) {
3969
3969
  e[r] = 1, i.highlightPickingId = r;
3970
- for (let e = 0; e < this.Un.length; e++) this.renderer.render(this.Un[e], i, this.Kn, t);
3970
+ for (let e = 0; e < this.jn.length; e++) this.renderer.render(this.jn[e], i, this.$n, t);
3971
3971
  }
3972
3972
  }
3973
3973
  }
@@ -3984,21 +3984,21 @@ class Ie {
3984
3984
  }
3985
3985
  outlineAll(t) {
3986
3986
  if (!this.picking) return;
3987
- if (!this.Un && (this.Qn(), !this.Un)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
3987
+ if (!this.jn && (this.Qn(), !this.jn)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
3988
3988
  const e = this.getUniformValues(this.getMap(), this.zn);
3989
3989
  e.highlightPickingId = -1;
3990
- for (let n = 0; n < this.Un.length; n++) this.renderer.render(this.Un[n], e, this.scene, t);
3990
+ for (let n = 0; n < this.jn.length; n++) this.renderer.render(this.jn[n], e, this.scene, t);
3991
3991
  }
3992
3992
  Qn() {
3993
3993
  if (!this.picking) return;
3994
3994
  const t = this.layer.getRenderer().canvas;
3995
- this.Un = [];
3995
+ this.jn = [];
3996
3996
  for (let e = 0; e < this.picking.length; e++) {
3997
3997
  const i = this.picking[e].getPickingVert(), r = {
3998
3998
  ENABLE_PICKING: 1,
3999
3999
  HAS_PICKING_ID: 1
4000
4000
  }, s = this.picking[e].getUniformDeclares().slice(0);
4001
- void 0 !== s.uPickingId && (r.HAS_PICKING_ID = 2), this.Un[e] = new n.MeshShader({
4001
+ void 0 !== s.uPickingId && (r.HAS_PICKING_ID = 2), this.jn[e] = new n.MeshShader({
4002
4002
  vert: i,
4003
4003
  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}",
4004
4004
  uniforms: s,
@@ -4024,7 +4024,7 @@ class Ie {
4024
4024
  equation: "add"
4025
4025
  }
4026
4026
  }
4027
- }), this.Un[e].filter = this.picking[e].filter;
4027
+ }), this.jn[e].filter = this.picking[e].filter;
4028
4028
  }
4029
4029
  }
4030
4030
  hasIBL() {
@@ -4074,7 +4074,7 @@ function Fe(t, e) {
4074
4074
  return t.properties.level - e.properties.level;
4075
4075
  }
4076
4076
 
4077
- class Ee extends Ie {
4077
+ class Ee extends Oe {
4078
4078
  constructor(t, e, n, i, r, s) {
4079
4079
  super(t, e, n, i, r, s);
4080
4080
  }
@@ -4139,9 +4139,9 @@ class Ee extends Ie {
4139
4139
  }
4140
4140
  }
4141
4141
 
4142
- var De = "attribute vec3 aPosition;\nuniform mat4 projViewModelMatrix;\n#include <fbo_picking_vert>\nvoid main() {\n gl_Position = projViewModelMatrix * vec4(aPosition, 1.);\n fbo_picking_setData(gl_Position.w, true);\n}";
4142
+ var He = "attribute vec3 aPosition;\nuniform mat4 projViewModelMatrix;\n#include <fbo_picking_vert>\nvoid main() {\n gl_Position = projViewModelMatrix * vec4(aPosition, 1.);\n fbo_picking_setData(gl_Position.w, true);\n}";
4143
4143
 
4144
- function He(t, e, n) {
4144
+ function De(t, e, n) {
4145
4145
  const i = e, r = {
4146
4146
  width: i.width,
4147
4147
  height: i.height,
@@ -4165,7 +4165,7 @@ const Le = {
4165
4165
  uvOffset: [ 0, 0 ]
4166
4166
  };
4167
4167
 
4168
- class Ne extends Ee {
4168
+ class Re extends Ee {
4169
4169
  prepareSymbol(t) {
4170
4170
  const e = t.polygonFill;
4171
4171
  Array.isArray(e) && (3 === e.length && e.push(1), t.polygonFill = e.map(t => 255 * t));
@@ -4198,7 +4198,7 @@ class Ne extends Ee {
4198
4198
  get: function() {
4199
4199
  return s.properties.tileResolution / t.getResolution();
4200
4200
  }
4201
- }), h.polygonPatternFile = He(this.regl, f, !1), h.atlasSize = [ f.width, f.height ],
4201
+ }), h.polygonPatternFile = De(this.regl, f, !1), h.atlasSize = [ f.width, f.height ],
4202
4202
  this.drawDebugAtlas(f);
4203
4203
  }
4204
4204
  const u = new n.Material(h, Le), d = new n.Mesh(s, u, {
@@ -4221,7 +4221,7 @@ class Ne extends Ee {
4221
4221
  define: "HAS_COLOR",
4222
4222
  evaluate: (e, i, r) => {
4223
4223
  let s = n(t.getZoom(), e);
4224
- return m(s) && (s = this.evaluateInFnTypeConfig(s, r, t, e, !0)), Array.isArray(s) || (s = this.colorCache[s] = this.colorCache[s] || I(s).unitArray()),
4224
+ return m(s) && (s = this.evaluateInFnTypeConfig(s, r, t, e, !0)), Array.isArray(s) || (s = this.colorCache[s] = this.colorCache[s] || O(s).unitArray()),
4225
4225
  s = ne(s), s;
4226
4226
  }
4227
4227
  }, {
@@ -4263,7 +4263,7 @@ class Ne extends Ee {
4263
4263
  init(t) {
4264
4264
  const e = this.regl;
4265
4265
  this.renderer = new n.Renderer(e), this.ni(t), this.pickingFBO && (this.picking = [ new n.FBORayPicking(this.renderer, {
4266
- vert: De,
4266
+ vert: He,
4267
4267
  uniforms: [ {
4268
4268
  name: "projViewModelMatrix",
4269
4269
  type: "function",
@@ -4318,7 +4318,7 @@ class Ne extends Ee {
4318
4318
  enable: !0,
4319
4319
  range: h || [ 0, 1 ],
4320
4320
  mask: (t, e) => {
4321
- if (!Kt(this.sceneConfig.depthMask)) return !!this.sceneConfig.depthMask;
4321
+ if (!$t(this.sceneConfig.depthMask)) return !!this.sceneConfig.depthMask;
4322
4322
  if (e.meshConfig.transparent) return !1;
4323
4323
  const n = e.polygonOpacity;
4324
4324
  return !(oe(n) && n < 1);
@@ -4347,7 +4347,7 @@ class Ne extends Ee {
4347
4347
  }
4348
4348
  }
4349
4349
 
4350
- var Re = "#define SHADER_NAME LINE\n#define AA_CLIP_LIMIT 2.0\n#define AA_LINE_WIDTH 16.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n#define EXTRUDE_SCALE 63.0;\n#define MAX_LINE_DISTANCE 65535.0\nattribute vec3 aPosition;\n#if defined(HAS_UP) || defined(HAS_PATTERN)\nattribute vec3 aExtrude;\n#else\nattribute vec2 aExtrude;\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nattribute float aLinesofar;\nvarying highp float vLinesofar;\n#endif\nuniform float cameraToCenterDistance;\n#if defined(HAS_STROKE_WIDTH)\nattribute float aLineStrokeWidth;\n#else\nuniform float lineStrokeWidth;\n#endif\nuniform mat4 projViewModelMatrix;\nuniform mat4 modelMatrix;\nuniform float tileResolution;\nuniform float resolution;\nuniform float tileRatio;\n#ifdef HAS_LINE_DX\nattribute float aLineDx;\n#else\nuniform float lineDx;\n#endif\n#ifdef HAS_LINE_DY\nattribute float aLineDy;\n#else\nuniform float lineDy;\n#endif\nuniform vec2 canvasSize;\nuniform float layerScale;\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\n#ifdef USE_LINE_OFFSET\nattribute vec2 aExtrudeOffset;\n#endif\n#ifdef HAS_LINE_WIDTH\nattribute float aLineWidth;\n#else\nuniform float lineWidth;\n#endif\n#ifndef PICKING_MODE\n#ifndef HAS_GRADIENT\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_PATTERN\n#ifdef HAS_PATTERN_ANIM\nattribute float aLinePatternAnimSpeed;\nvarying float vLinePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nattribute float aLinePatternGap;\nvarying float vLinePatternGap;\n#endif\nattribute vec4 aTexInfo;\nvarying vec4 vTexInfo;\nvarying float vJoin;\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nattribute vec4 aDasharray;\nvarying vec4 vDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nattribute vec4 aDashColor;\nvarying vec4 vDashColor;\n#endif\n#endif\n#endif\n#ifdef HAS_STROKE_COLOR\nattribute vec4 aStrokeColor;\nvarying vec4 vStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\nvarying float vOpacity;\n#endif\n#ifdef HAS_GRADIENT\nattribute float aGradIndex;\nvarying float vGradIndex;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#else\n#include <fbo_picking_vert>\n#endif\nvarying vec3 vVertex;\nvoid main() {\n vec3 c = aPosition;\n#ifdef HAS_UP\nfloat d = mod(aExtrude.z, 4.);\n float e = floor(d * .5);\n float f = d - e * 2.;\n vNormal = vec2(e, f * 2. - 1.);\n#else\nc.xy = floor(c.xy * .5);\n vNormal = aPosition.xy - 2. * c.xy;\n vNormal.y = vNormal.y * 2. - 1.;\n#endif\nvec4 h = vec4(c, 1.);\n vec4 i = projViewModelMatrix * h;\n vVertex = (modelMatrix * h).xyz;\n#ifdef HAS_STROKE_WIDTH\nfloat j = aLineStrokeWidth / 2. * layerScale;\n#else\nfloat j = lineStrokeWidth;\n#endif\n#ifdef HAS_LINE_WIDTH\nfloat k = aLineWidth / 2. * layerScale;\n#else\nfloat k = lineWidth * layerScale;\n#endif\nfloat l = k / 2. + j;\n float m = sign(j) * k / 2.;\n float n = m + sign(m) * ANTIALIASING;\n float o = l + sign(l) * ANTIALIASING;\n#ifdef USE_LINE_OFFSET\nvec2 u = lineOffset * (vNormal.y * (aExtrude.xy - aExtrudeOffset) + aExtrudeOffset);\n vec2 v = (o * aExtrude.xy + u) / EXTRUDE_SCALE;\n#else\nvec2 A = aExtrude.xy / EXTRUDE_SCALE;\n vec2 v = o * A;\n#endif\nfloat B = tileResolution / resolution;\n vec4 C = vec4(c + vec3(v, .0) * tileRatio / B, 1.);\n gl_Position = projViewModelMatrix * C;\n float D = min(AA_CLIP_LIMIT / canvasSize.x, AA_CLIP_LIMIT / canvasSize.y);\n float E = distance(gl_Position.xy / gl_Position.w, i.xy / i.w) - D;\n if(E * k < .0) {\n float F = -E / D;\n float G = F * F * F * F * AA_LINE_WIDTH;\n v += G * A;\n o += G / 6.;\n C = vec4(c + vec3(v, .0) * tileRatio / B, 1.);\n gl_Position = projViewModelMatrix * C;\n }\n#ifdef HAS_LINE_DX\nfloat H = aLineDx;\n#else\nfloat H = lineDx;\n#endif\n#ifdef HAS_LINE_DY\nfloat I = aLineDy;\n#else\nfloat I = lineDy;\n#endif\nfloat J = gl_Position.w;\n gl_Position.xy += vec2(H, I) * 2. / canvasSize * J;\n#ifndef PICKING_MODE\nvWidth = vec2(o, n);\n vGammaScale = J / cameraToCenterDistance;\n#ifndef ENABLE_TILE_STENCIL\nvPosition = c.xy;\n#ifdef USE_LINE_OFFSET\nvPosition += tileRatio * u / EXTRUDE_SCALE;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT)\n#ifdef HAS_GRADIENT\nvLinesofar = aLinesofar / MAX_LINE_DISTANCE;\n vGradIndex = aGradIndex;\n#else\nvLinesofar = aLinesofar / tileRatio * B;\n#endif\n#endif\n#ifndef HAS_GRADIENT\n#ifdef HAS_COLOR\nvColor = aColor;\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvDasharray = aDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvDashColor = aDashColor / 255.;\n#endif\n#endif\n#ifdef HAS_PATTERN\nvTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\n vJoin = floor(aExtrude.z / 4.);\n#ifdef HAS_PATTERN_ANIM\nvLinePatternAnimSpeed = aLinePatternAnimSpeed / 127.;\n#endif\n#ifdef HAS_PATTERN_GAP\nvLinePatternGap = aLinePatternGap / 10.0;\n#endif\n#endif\n#endif\n#ifdef HAS_STROKE_COLOR\nvStrokeColor = aStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvOpacity = aOpacity / 255.;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(C);\n#endif\n#else\nfbo_picking_setData(J, true);\n#endif\n}";
4350
+ var Ne = "#define SHADER_NAME LINE\n#define AA_CLIP_LIMIT 2.0\n#define AA_LINE_WIDTH 16.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n#define EXTRUDE_SCALE 63.0;\n#define MAX_LINE_DISTANCE 65535.0\nattribute vec3 aPosition;\n#if defined(HAS_UP) || defined(HAS_PATTERN)\nattribute vec3 aExtrude;\n#else\nattribute vec2 aExtrude;\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nattribute float aLinesofar;\nvarying highp float vLinesofar;\n#endif\nuniform float cameraToCenterDistance;\n#if defined(HAS_STROKE_WIDTH)\nattribute float aLineStrokeWidth;\n#else\nuniform float lineStrokeWidth;\n#endif\nuniform mat4 projViewModelMatrix;\nuniform mat4 modelMatrix;\nuniform float tileResolution;\nuniform float resolution;\nuniform float tileRatio;\n#ifdef HAS_LINE_DX\nattribute float aLineDx;\n#else\nuniform float lineDx;\n#endif\n#ifdef HAS_LINE_DY\nattribute float aLineDy;\n#else\nuniform float lineDy;\n#endif\nuniform vec2 canvasSize;\nuniform float layerScale;\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\n#ifdef USE_LINE_OFFSET\nattribute vec2 aExtrudeOffset;\n#endif\n#ifdef HAS_LINE_WIDTH\nattribute float aLineWidth;\n#else\nuniform float lineWidth;\n#endif\n#ifndef PICKING_MODE\n#ifndef HAS_GRADIENT\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_PATTERN\n#ifdef HAS_PATTERN_ANIM\nattribute float aLinePatternAnimSpeed;\nvarying float vLinePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nattribute float aLinePatternGap;\nvarying float vLinePatternGap;\n#endif\nattribute vec4 aTexInfo;\nvarying vec4 vTexInfo;\nvarying float vJoin;\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nattribute vec4 aDasharray;\nvarying vec4 vDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nattribute vec4 aDashColor;\nvarying vec4 vDashColor;\n#endif\n#endif\n#endif\n#ifdef HAS_STROKE_COLOR\nattribute vec4 aStrokeColor;\nvarying vec4 vStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\nvarying float vOpacity;\n#endif\n#ifdef HAS_GRADIENT\nattribute float aGradIndex;\nvarying float vGradIndex;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#else\n#include <fbo_picking_vert>\n#endif\nvarying vec3 vVertex;\nvoid main() {\n vec3 c = aPosition;\n#ifdef HAS_UP\nfloat d = mod(aExtrude.z, 4.);\n float e = floor(d * .5);\n float f = d - e * 2.;\n vNormal = vec2(e, f * 2. - 1.);\n#else\nc.xy = floor(c.xy * .5);\n vNormal = aPosition.xy - 2. * c.xy;\n vNormal.y = vNormal.y * 2. - 1.;\n#endif\nvec4 h = vec4(c, 1.);\n vec4 i = projViewModelMatrix * h;\n vVertex = (modelMatrix * h).xyz;\n#ifdef HAS_STROKE_WIDTH\nfloat j = aLineStrokeWidth / 2. * layerScale;\n#else\nfloat j = lineStrokeWidth;\n#endif\n#ifdef HAS_LINE_WIDTH\nfloat k = aLineWidth / 2. * layerScale;\n#else\nfloat k = lineWidth * layerScale;\n#endif\nfloat l = k / 2. + j;\n float m = sign(j) * k / 2.;\n float n = m + sign(m) * ANTIALIASING;\n float o = l + sign(l) * ANTIALIASING;\n#ifdef USE_LINE_OFFSET\nvec2 u = lineOffset * (vNormal.y * (aExtrude.xy - aExtrudeOffset) + aExtrudeOffset);\n vec2 v = (o * aExtrude.xy + u) / EXTRUDE_SCALE;\n#else\nvec2 A = aExtrude.xy / EXTRUDE_SCALE;\n vec2 v = o * A;\n#endif\nfloat B = tileResolution / resolution;\n vec4 C = vec4(c + vec3(v, .0) * tileRatio / B, 1.);\n gl_Position = projViewModelMatrix * C;\n float D = min(AA_CLIP_LIMIT / canvasSize.x, AA_CLIP_LIMIT / canvasSize.y);\n float E = distance(gl_Position.xy / gl_Position.w, i.xy / i.w) - D;\n if(E * k < .0) {\n float F = -E / D;\n float G = F * F * F * F * AA_LINE_WIDTH;\n v += G * A;\n o += G / 6.;\n C = vec4(c + vec3(v, .0) * tileRatio / B, 1.);\n gl_Position = projViewModelMatrix * C;\n }\n#ifdef HAS_LINE_DX\nfloat H = aLineDx;\n#else\nfloat H = lineDx;\n#endif\n#ifdef HAS_LINE_DY\nfloat I = aLineDy;\n#else\nfloat I = lineDy;\n#endif\nfloat J = gl_Position.w;\n gl_Position.xy += vec2(H, I) * 2. / canvasSize * J;\n#ifndef PICKING_MODE\nvWidth = vec2(o, n);\n vGammaScale = J / cameraToCenterDistance;\n#ifndef ENABLE_TILE_STENCIL\nvPosition = c.xy;\n#ifdef USE_LINE_OFFSET\nvPosition += tileRatio * u / EXTRUDE_SCALE;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT)\n#ifdef HAS_GRADIENT\nvLinesofar = aLinesofar / MAX_LINE_DISTANCE;\n vGradIndex = aGradIndex;\n#else\nvLinesofar = aLinesofar / tileRatio * B;\n#endif\n#endif\n#ifndef HAS_GRADIENT\n#ifdef HAS_COLOR\nvColor = aColor;\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvDasharray = aDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvDashColor = aDashColor / 255.;\n#endif\n#endif\n#ifdef HAS_PATTERN\nvTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\n vJoin = floor(aExtrude.z / 4.);\n#ifdef HAS_PATTERN_ANIM\nvLinePatternAnimSpeed = aLinePatternAnimSpeed / 127.;\n#endif\n#ifdef HAS_PATTERN_GAP\nvLinePatternGap = aLinePatternGap / 10.0;\n#endif\n#endif\n#endif\n#ifdef HAS_STROKE_COLOR\nvStrokeColor = aStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvOpacity = aOpacity / 255.;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(C);\n#endif\n#else\nfbo_picking_setData(J, true);\n#endif\n}";
4351
4351
 
4352
4352
  class ze extends Ee {
4353
4353
  prepareSymbol(t) {
@@ -4393,7 +4393,7 @@ class ze extends Ee {
4393
4393
  return e || [ 0, 0, 0, 0 ];
4394
4394
  }), te(a, "lineDashColor", o, "lineDashColor", [ 0, 0, 0, 0 ], ie(this.colorCache));
4395
4395
  const l = i.properties.iconAtlas, h = i.data.aPosition instanceof Int16Array;
4396
- l && (a.linePatternFile = He(this.regl, l, !1), a.atlasSize = l ? [ l.width, l.height ] : [ 0, 0 ],
4396
+ l && (a.linePatternFile = De(this.regl, l, !1), a.atlasSize = l ? [ l.width, l.height ] : [ 0, 0 ],
4397
4397
  a.flipY = h ? -1 : 1, this.drawDebugAtlas(l)), void 0 === s && (i.properties.hasUp = !h,
4398
4398
  i.generateBuffers(this.regl));
4399
4399
  const c = new n.Material(a), f = new n.Mesh(i, c, {
@@ -4449,7 +4449,7 @@ class ze extends Ee {
4449
4449
  define: "HAS_COLOR",
4450
4450
  evaluate: (e, i, r) => {
4451
4451
  let s = n(t.getZoom(), e);
4452
- return m(s) && (s = this.evaluateInFnTypeConfig(s, r, t, e, !0)), Array.isArray(s) || (s = this.colorCache[s] = this.colorCache[s] || I(s).unitArray()),
4452
+ return m(s) && (s = this.evaluateInFnTypeConfig(s, r, t, e, !0)), Array.isArray(s) || (s = this.colorCache[s] = this.colorCache[s] || O(s).unitArray()),
4453
4453
  s = ne(s), s;
4454
4454
  }
4455
4455
  }, {
@@ -4460,7 +4460,7 @@ class ze extends Ee {
4460
4460
  define: "HAS_PATTERN_ANIM",
4461
4461
  evaluate: (e, n, r) => {
4462
4462
  let s = i(t.getZoom(), e);
4463
- return Kt(s) && (s = 0), 0 !== s && (r.properties.hasPatternAnim = 1), o[0] = s / 127,
4463
+ return $t(s) && (s = 0), 0 !== s && (r.properties.hasPatternAnim = 1), o[0] = s / 127,
4464
4464
  o[0];
4465
4465
  }
4466
4466
  }, {
@@ -4471,7 +4471,7 @@ class ze extends Ee {
4471
4471
  define: "HAS_PATTERN_GAP",
4472
4472
  evaluate: e => {
4473
4473
  let n = r(t.getZoom(), e);
4474
- return Kt(n) && (n = 0), o[0] = 10 * n, o[0];
4474
+ return $t(n) && (n = 0), o[0] = 10 * n, o[0];
4475
4475
  }
4476
4476
  } ].concat(s);
4477
4477
  }
@@ -4539,7 +4539,7 @@ class ze extends Ee {
4539
4539
  init(t) {
4540
4540
  const e = this.regl;
4541
4541
  this.renderer = new n.Renderer(e), this.createShader(t), this.pickingFBO && (this.picking = [ new n.FBORayPicking(this.renderer, {
4542
- vert: "#define PICKING_MODE 1\n" + Re,
4542
+ vert: "#define PICKING_MODE 1\n" + Ne,
4543
4543
  uniforms: [ {
4544
4544
  name: "projViewModelMatrix",
4545
4545
  type: "function",
@@ -4565,7 +4565,7 @@ class ze extends Ee {
4565
4565
  return r.multiply(n, e.projViewMatrix, e.modelMatrix), n;
4566
4566
  }
4567
4567
  }), this.shader = new n.MeshShader({
4568
- vert: Re,
4568
+ vert: Ne,
4569
4569
  frag: "#define SHADER_NAME LINE\n#define DEVICE_PIXEL_RATIO 1.0\nprecision highp float;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_frag>\n#endif\nuniform lowp float blendSrcIsOne;\nuniform lowp float lineBlur;\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform lowp vec4 lineColor;\n#endif\n#ifdef HAS_STROKE_COLOR\nvarying vec4 vStrokeColor;\n#else\nuniform lowp vec4 lineStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvarying float vOpacity;\n#else\nuniform lowp float lineOpacity;\n#endif\n#ifdef HAS_PATTERN\nuniform sampler2D linePatternFile;\nuniform vec2 atlasSize;\nuniform float flipY;\n#ifdef HAS_PATTERN_ANIM\nvarying float vLinePatternAnimSpeed;\n#else\nuniform float linePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nvarying float vLinePatternGap;\n#else\nuniform float linePatternGap;\n#endif\nvarying vec4 vTexInfo;\nvarying float vJoin;\nvec2 c(vec2 d) {\n vec2 e = mod(d, 1.);\n vec2 f = vTexInfo.xy;\n vec2 h = vTexInfo.zw;\n return (f + e * h) / atlasSize;\n}\n#endif\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\nuniform float tileExtent;\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvarying vec4 vDasharray;\n#else\nuniform vec4 lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvarying vec4 vDashColor;\n#else\nuniform vec4 lineDashColor;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nvarying highp float vLinesofar;\n#endif\n#ifdef HAS_TRAIL\nuniform float trailSpeed;\nuniform float trailLength;\nuniform float trailCircle;\n#endif\n#if defined(HAS_TRAIL) || defined(HAS_PATTERN)\nuniform float currentTime;\n#endif\nfloat i(float j, float k) {\n float l = k / 2.;\n float m = abs(j - l);\n float n = (.1 + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n return clamp(min(m + n, l - m) / n, .0, 1.);\n}\nvarying vec3 vVertex;\nuniform vec3 cameraPosition;\nuniform float cameraToCenterDistance;\nvoid main() {\n \n#ifndef ENABLE_TILE_STENCIL\nfloat o = sign(tileExtent - min(tileExtent, abs(vPosition.x))) * sign(1. + sign(vPosition.x)) * sign(tileExtent - min(tileExtent, abs(vPosition.y))) * sign(1. + sign(vPosition.y));\n if(o == .0) {\n discard;\n }\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nfloat u = vLinesofar;\n#endif\nfloat v = length(vNormal) * vWidth.s;\n#ifdef HAS_PATTERN\nvec2 h = vTexInfo.zw;\n float A = sign(h.x * h.y);\n float B = mix(lineBlur, .0, A);\n#else\nfloat B = lineBlur;\n#endif\nfloat n = (B + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n float C = clamp(min(v - (vWidth.t - n), vWidth.s - v) / n, .0, 1.);\n#ifdef HAS_COLOR\nvec4 D = vColor / 255.;\n#else\nvec4 D = lineColor;\n#endif\n#ifdef HAS_PATTERN\nif(A == 1.) {\n \n#ifdef HAS_PATTERN_GAP\nfloat E = vLinePatternGap;\n#else\nfloat E = linePatternGap;\n#endif\n#ifdef HAS_PATTERN_ANIM\nfloat F = vLinePatternAnimSpeed;\n#else\nfloat F = linePatternAnimSpeed;\n#endif\nfloat G = ceil(h.x * vWidth.s * 2. / h.y);\n float H = G * (1. + E);\n u += mod(currentTime * -F * .2, H);\n float I = mod(u / H, 1.);\n float J = mod((flipY * vNormal.y + 1.) / 2., 1.);\n vec2 f = vTexInfo.xy;\n D = mix(texture2D(linePatternFile, c(vec2(I * (1. + E), J))), vec4(.0), sign(vJoin));\n float K = clamp(sign(1. / (1. + E) - I) + .000001, .0, 1.);\n D *= K;\n }\n#endif\n#ifdef HAS_STROKE_COLOR\nvec4 L = vStrokeColor / 255.;\n#else\nvec4 L = lineStrokeColor;\n#endif\nL = mix(D, L, sign(vWidth.t));\n D = L * C + max(sign(vWidth.t - v), .0) * D * (1. - C);\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvec4 M = vDasharray;\n#else\nvec4 M = lineDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvec4 N = vDashColor;\n#else\nvec4 N = lineDashColor;\n#endif\nfloat k = M[0] + M[1] + M[2] + M[3];\n float j = mod(u, k);\n float O = max(sign(M[0] - j), .0);\n float P = j - M[0] - M[1];\n float Q = max(sign(P), .0) * max(sign(M[2] - P), .0);\n float R = O + Q;\n float S = i(j, M[0]);\n float T = i(P, M[2]);\n float U = S * O + T * Q;\n D = D * (1. - U) + C * N * U;\n#endif\n#ifdef HAS_TRAIL\nfloat V = mod(u - currentTime * trailSpeed * .1, trailCircle);\n float W = V < trailLength ? mix(.0, 1., V / trailLength) : .0;\n D *= W;\n#endif\n#ifdef HAS_OPACITY\nfloat X = vOpacity;\n#else\nfloat X = lineOpacity;\n#endif\ngl_FragColor = D * X;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nfloat Y = shadow_computeShadow();\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, Y);\n#endif\nfloat Z = clamp(cameraToCenterDistance * 1.5 / distance(vVertex, cameraPosition), .0, 1.);\n if(blendSrcIsOne == 1.) {\n gl_FragColor *= gl_FragColor.a;\n }\n gl_FragColor *= Z;\n}",
4570
4570
  uniforms: e,
4571
4571
  defines: i,
@@ -4651,11 +4651,11 @@ class Ve extends ze {
4651
4651
  this.setLineUniforms(a, o);
4652
4652
  const l = i.properties.gradients;
4653
4653
  let h = 2 * l.length;
4654
- je(h) || (h = Ge(h));
4654
+ Ue(h) || (h = Ge(h));
4655
4655
  const c = this.regl.texture({
4656
4656
  width: 256,
4657
4657
  height: h,
4658
- data: Ue(l),
4658
+ data: je(l),
4659
4659
  format: "rgba",
4660
4660
  mag: "linear",
4661
4661
  min: "linear",
@@ -4688,7 +4688,7 @@ class Ve extends ze {
4688
4688
  return r.multiply(n, e.projViewMatrix, e.modelMatrix), n;
4689
4689
  }
4690
4690
  }), this.shader = new n.MeshShader({
4691
- vert: Re,
4691
+ vert: Ne,
4692
4692
  frag: "#define SHADER_NAME LINE_GRADIENT\n#define DEVICE_PIXEL_RATIO 1.0\n#define MAX_LINE_COUNT 128.0\nprecision mediump float;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_frag>\n#endif\n#ifdef HAS_OPACITY\nvarying float vOpacity;\n#else\nuniform lowp float lineOpacity;\n#endif\nuniform lowp float lineBlur;\nuniform float lineGradientTextureHeight;\nuniform float tileExtent;\nuniform sampler2D lineGradientTexture;\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\nvarying highp float vLinesofar;\nvarying float vGradIndex;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\n#ifdef HAS_TRAIL\nuniform float trailSpeed;\nuniform float trailLength;\nuniform float trailCircle;\nuniform float currentTime;\n#endif\nvoid main() {\n \n#ifndef ENABLE_TILE_STENCIL\nfloat c = sign(tileExtent - min(tileExtent, abs(vPosition.x))) * sign(1. + sign(vPosition.x)) * sign(tileExtent - min(tileExtent, abs(vPosition.y))) * sign(1. + sign(vPosition.y));\n if(c == .0) {\n discard;\n }\n#endif\nfloat d = length(vNormal) * vWidth.s;\n float e = (lineBlur + 1. / DEVICE_PIXEL_RATIO) * vGammaScale;\n float f = clamp(min(d - (vWidth.t - e), vWidth.s - d) / e, .0, 1.);\n float h = vLinesofar;\n vec4 i = texture2D(lineGradientTexture, vec2(h, (vGradIndex * 2. + .5) / lineGradientTextureHeight)) * f;\n i *= max(sign(MAX_LINE_COUNT - vGradIndex), .0);\n#ifdef HAS_TRAIL\nfloat j = mod(h - currentTime * trailSpeed * .1, trailCircle);\n float k = j < trailLength ? mix(.0, 1., j / trailLength) : .0;\n i *= k;\n#endif\n#ifdef HAS_OPACITY\nfloat l = vOpacity;\n#else\nfloat l = lineOpacity;\n#endif\ngl_FragColor = i * l;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nfloat m = shadow_computeShadow();\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, m);\n#endif\n}",
4693
4693
  uniforms: e,
4694
4694
  defines: i,
@@ -4697,11 +4697,11 @@ class Ve extends ze {
4697
4697
  }
4698
4698
  }
4699
4699
 
4700
- function Ue(t) {
4700
+ function je(t) {
4701
4701
  t.length > 128 && (console.warn("Line count in a tile exceeds maximum limit (128) for line-gradient render plugin."),
4702
4702
  t = t.slice(0, 128));
4703
4703
  const e = document.createElement("canvas"), n = e.getContext("2d");
4704
- e.width = 256, e.height = 2 * t.length, je(e.height) || (e.height = Ge(2 * t.length));
4704
+ e.width = 256, e.height = 2 * t.length, Ue(e.height) || (e.height = Ge(2 * t.length));
4705
4705
  for (let e = 0; e < t.length; e++) {
4706
4706
  const i = t[e], r = n.createLinearGradient(0, 0, 256, 0);
4707
4707
  for (let t = 0; t < i.length; t += 2) r.addColorStop(+i[t], i[t + 1]);
@@ -4712,7 +4712,7 @@ function Ue(t) {
4712
4712
  return n.canvas;
4713
4713
  }
4714
4714
 
4715
- function je(t) {
4715
+ function Ue(t) {
4716
4716
  return 0 == (t & t - 1) && 0 !== t;
4717
4717
  }
4718
4718
 
@@ -4732,12 +4732,12 @@ class We {
4732
4732
  }
4733
4733
  }
4734
4734
 
4735
- const Be = 224, Xe = 600, qe = 100, Ye = new Uint8Array(1), Je = [], Ze = {
4735
+ const Be = 224, Xe = 600, Ye = 100, qe = new Uint8Array(1), Je = [], Ze = {
4736
4736
  collides: 0,
4737
4737
  boxes: []
4738
4738
  };
4739
4739
 
4740
- class $e extends Ee {
4740
+ class Ke extends Ee {
4741
4741
  supportRenderMode(t) {
4742
4742
  return "point" === t;
4743
4743
  }
@@ -4846,13 +4846,13 @@ class $e extends Ee {
4846
4846
  let m = t && d && 0 === d.collides, g = 1, v = !1;
4847
4847
  if (this.sceneConfig.fading) {
4848
4848
  const t = this.Pi(e);
4849
- if (this.Ti) t[r] = m ? 1 : -1; else if (f && delete e.ki, g = this.Oi(f, m, t, r),
4850
- f ? (g > 0 && (m = !0), v = this.isBoxFading(e, r), v && this.setToRedraw()) : m || (this.Ii(t, r),
4849
+ if (this.Ti) t[r] = m ? 1 : -1; else if (f && delete e.ki, g = this.Ii(f, m, t, r),
4850
+ f ? (g > 0 && (m = !0), v = this.isBoxFading(e, r), v && this.setToRedraw()) : m || (this.Oi(t, r),
4851
4851
  g = 0), m) {
4852
4852
  const n = e.ki;
4853
4853
  if (n && 1 === g && t[r] > 0) {
4854
4854
  let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
4855
- Kt(e) && (e = Be), Kt(t) && (t = qe);
4855
+ $t(e) && (e = Be), $t(t) && (t = Ye);
4856
4856
  const i = Zt(1 - (o.getFrameTimestamp() - n - t) / e, 0, 1);
4857
4857
  g *= i, i > 0 && this.setToRedraw();
4858
4858
  }
@@ -4864,7 +4864,7 @@ class $e extends Ee {
4864
4864
  !this.Ci(i, t, e) && d && d.boxes && this.Fi(d.boxes, t);
4865
4865
  }
4866
4866
  if (m) {
4867
- const t = Ye[0] = 255 * g;
4867
+ const t = qe[0] = 255 * g;
4868
4868
  for (let e = 0; e < u; e++) {
4869
4869
  const {mesh: i, allElements: r, start: s, end: o, boxIndex: a} = n[e];
4870
4870
  this.setCollisionOpacity(i, r, t, s, o, a);
@@ -4892,11 +4892,11 @@ class $e extends Ee {
4892
4892
  isBoxFading(t, e) {
4893
4893
  const {frameTimestamp: n} = this.ai;
4894
4894
  let i = this.sceneConfig.fadingDuration;
4895
- Kt(i) && (i = Be);
4895
+ $t(i) && (i = Be);
4896
4896
  return n - Math.abs(this.Pi(t)[e]) < i;
4897
4897
  }
4898
4898
  Mi(t, e, n, i, r, s, o) {
4899
- const a = this.getSymbol(t.properties.symbolIndex), l = this.Ci(a, t, e[i]), h = this.Di(a, t, e[i]);
4899
+ const a = this.getSymbol(t.properties.symbolIndex), l = this.Ci(a, t, e[i]), h = this.Hi(a, t, e[i]);
4900
4900
  if (!1 === this.sceneConfig.collision || l && h) return Ze;
4901
4901
  const c = this.isBoxCollides(t, e, n, i, r, s, o);
4902
4902
  return h && (c.collides = 0, c.isAllowOverlap = 1), c;
@@ -4908,7 +4908,7 @@ class $e extends Ee {
4908
4908
  const r = i[n], s = r % 8;
4909
4909
  return r < 2 ? 1 == +t[this.propIgnorePlacement] : s % 2;
4910
4910
  }
4911
- Di(t, e, n) {
4911
+ Hi(t, e, n) {
4912
4912
  if (!1 === this.sceneConfig.collision) return !0;
4913
4913
  const i = e.geometry.properties.aOverlap;
4914
4914
  if (!i) return 1 == +t[this.propAllowOverlap];
@@ -4918,9 +4918,9 @@ class $e extends Ee {
4918
4918
  Fi(t) {
4919
4919
  if (Array.isArray(t[0])) for (let e = 0; e < t.length; e++) this.insertCollisionBox(t[e]); else this.insertCollisionBox(t);
4920
4920
  }
4921
- Oi(t, e, n, i) {
4921
+ Ii(t, e, n, i) {
4922
4922
  let {fadingDuration: r, fadeInDelay: s, fadeOutDelay: o} = this.sceneConfig;
4923
- Kt(r) && (r = Be), Kt(s) && (s = Xe), Kt(o) && (o = qe);
4923
+ $t(r) && (r = Be), $t(s) && (s = Xe), $t(o) && (o = Ye);
4924
4924
  const {frameTimestamp: a} = this.ai;
4925
4925
  let l = n[i], h = e ? 1 : 0;
4926
4926
  if (!l) return e && t && (n[i] = a + s), 0;
@@ -4933,47 +4933,47 @@ class $e extends Ee {
4933
4933
  h;
4934
4934
  }
4935
4935
  Pi(t) {
4936
- this.Hi || (this.Hi = {});
4936
+ this.Di || (this.Di = {});
4937
4937
  const {meshKey: e} = t.properties;
4938
- if (!this.Hi[e]) {
4938
+ if (!this.Di[e]) {
4939
4939
  const {frameTimestamp: t} = this.ai;
4940
- this.Hi[e] = {
4940
+ this.Di[e] = {
4941
4941
  timestamp: t
4942
4942
  };
4943
4943
  }
4944
- return this.Hi[e];
4944
+ return this.Di[e];
4945
4945
  }
4946
4946
  Li(t) {
4947
- if (!this.Ni) return void (this.Ni = t);
4947
+ if (!this.Ri) return void (this.Ri = t);
4948
4948
  const e = this.scene.getMeshes();
4949
4949
  if (e && e.length) {
4950
4950
  for (let n = 0; n < e.length; n++) {
4951
4951
  const i = this.Pi(e[n]);
4952
- i.timestamp < this.Ni ? delete e[n]._fading_timestamps : i.timestamp = t;
4952
+ i.timestamp < this.Ri ? delete e[n]._fading_timestamps : i.timestamp = t;
4953
4953
  }
4954
- this.Ni = t;
4954
+ this.Ri = t;
4955
4955
  }
4956
4956
  }
4957
- Ii(t, e) {
4957
+ Oi(t, e) {
4958
4958
  if (!t) return;
4959
4959
  const {frameTimestamp: n} = this.ai;
4960
4960
  let {fadingDuration: i} = this.sceneConfig;
4961
- Kt(i) && (i = Be), t[e] = -(n - i - 1);
4961
+ $t(i) && (i = Be), t[e] = -(n - i - 1);
4962
4962
  }
4963
4963
  deleteMesh(t, e) {
4964
4964
  if (t) {
4965
4965
  if (Array.isArray(t)) for (let e = 0; e < t.length; e++) {
4966
4966
  const n = t[e].properties.meshKey;
4967
- this.di && delete this.di.tags[n], this.Hi && delete this.Hi[n];
4967
+ this.di && delete this.di.tags[n], this.Di && delete this.Di[n];
4968
4968
  } else {
4969
4969
  const e = t.properties.meshKey;
4970
- this.di && delete this.di.tags[e], this.Hi && delete this.Hi[e];
4970
+ this.di && delete this.di.tags[e], this.Di && delete this.Di[e];
4971
4971
  }
4972
4972
  super.deleteMesh(t, e);
4973
4973
  }
4974
4974
  }
4975
4975
  delete(t) {
4976
- this.Ri && (this.Ri.geometry.dispose(), this.zi.dispose(), this.Ri.dispose(), delete this.Ri,
4976
+ this.Ni && (this.Ni.geometry.dispose(), this.zi.dispose(), this.Ni.dispose(), delete this.Ni,
4977
4977
  delete this.zi, delete this.Vi), delete this.di, super.delete(t);
4978
4978
  }
4979
4979
  isCollides(t) {
@@ -4987,12 +4987,12 @@ class $e extends Ee {
4987
4987
  addCollisionDebugBox(t, e) {
4988
4988
  if (t && t.length) if (Array.isArray(t[0])) for (let n = 0; n < t.length; n++) {
4989
4989
  const i = t[n];
4990
- this.Ui(i, e);
4991
- } else this.Ui(t, e);
4990
+ this.ji(i, e);
4991
+ } else this.ji(t, e);
4992
4992
  }
4993
- Ui(t, e) {
4993
+ ji(t, e) {
4994
4994
  if (!t) return;
4995
- const n = this.ji = this.ji || {
4995
+ const n = this.Ui = this.Ui || {
4996
4996
  aPosition: [],
4997
4997
  aVisible: [],
4998
4998
  indices: []
@@ -5008,7 +5008,7 @@ class $e extends Ee {
5008
5008
  updateCollision(t) {
5009
5009
  super.updateCollision(t), this.gi(), this.Wi(), this.Bi && this.Bi.length && (this.Xi(),
5010
5010
  this.Bi && (this.setToRedraw(), this.scene.addMesh(this.Bi)));
5011
- (this.getMap().isZooming() || this.Bi && this.Bi.length) && (this.qi(), this.Yi(this.scene.getMeshes()));
5011
+ (this.getMap().isZooming() || this.Bi && this.Bi.length) && (this.Yi(), this.qi(this.scene.getMeshes()));
5012
5012
  }
5013
5013
  paint(t) {
5014
5014
  const e = super.paint(t);
@@ -5026,19 +5026,19 @@ class $e extends Ee {
5026
5026
  const t = this.layer.getRenderer();
5027
5027
  this.Bi = this.scene.getMeshes().filter(e => !t.isForeground(e) && !e.properties.isLinePlacement);
5028
5028
  } else e && !this.Si && (this.Zi = t.getResolution());
5029
- if (e) this.$i && (clearTimeout(this.$i), delete this.Ti, delete this.$i), this.Ti = this.Zi && t.getResolution() > this.Zi; else if (this.Si && !this.$i) {
5029
+ if (e) this.Ki && (clearTimeout(this.Ki), delete this.Ti, delete this.Ki), this.Ti = this.Zi && t.getResolution() > this.Zi; else if (this.Si && !this.Ki) {
5030
5030
  let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
5031
- Kt(t) && (t = qe), Kt(e) && (e = Be), this.$i = setTimeout(() => {
5032
- delete this.Ti, delete this.$i;
5031
+ $t(t) && (t = Ye), $t(e) && (e = Be), this.Ki = setTimeout(() => {
5032
+ delete this.Ti, delete this.Ki;
5033
5033
  }, t + e + 1);
5034
5034
  }
5035
5035
  this.Si = e;
5036
5036
  }
5037
5037
  Ji(t) {
5038
- if (!this.ji || !this.layer.options.debugCollision) return;
5039
- this.Vi || this.Ki();
5040
- const {aPosition: e, aVisible: i, indices: r} = this.ji;
5041
- if (!this.Ri) {
5038
+ if (!this.Ui || !this.layer.options.debugCollision) return;
5039
+ this.Vi || this.$i();
5040
+ const {aPosition: e, aVisible: i, indices: r} = this.Ui;
5041
+ if (!this.Ni) {
5042
5042
  const t = new n.Geometry({
5043
5043
  aPosition: [],
5044
5044
  aVisible: []
@@ -5046,15 +5046,15 @@ class $e extends Ee {
5046
5046
  positionSize: 2,
5047
5047
  primitive: "lines"
5048
5048
  });
5049
- this.Ri = new n.Mesh(t), this.Qi = new n.Scene, this.Qi.addMesh(this.Ri);
5049
+ this.Ni = new n.Mesh(t), this.Qi = new n.Scene, this.Qi.addMesh(this.Ni);
5050
5050
  }
5051
- const s = this.Ri.geometry;
5051
+ const s = this.Ni.geometry;
5052
5052
  s.updateData("aPosition", new Float32Array(e)), s.updateData("aVisible", new Uint8Array(i)),
5053
5053
  s.setElements(r), this.Vi.render(this.zi, {
5054
5054
  size: [ this.canvas.width, this.canvas.height ]
5055
- }, this.Qi, this.getRenderFBO(t)), delete this.ji;
5055
+ }, this.Qi, this.getRenderFBO(t)), delete this.Ui;
5056
5056
  }
5057
- Ki() {
5057
+ $i() {
5058
5058
  const t = this.regl;
5059
5059
  this.Vi = new n.Renderer(t);
5060
5060
  const e = this.canvas, i = {
@@ -5085,7 +5085,7 @@ class $e extends Ee {
5085
5085
  }
5086
5086
  Xi() {
5087
5087
  let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
5088
- Kt(t) && (t = qe), Kt(e) && (e = Be);
5088
+ $t(t) && (t = Ye), $t(e) && (e = Be);
5089
5089
  const n = this.layer.getRenderer(), i = n.getCurrentTileZoom(), r = n.getFrameTimestamp(), s = [];
5090
5090
  for (let o = 0; o < this.Bi.length; o++) {
5091
5091
  const a = this.Bi[o], l = a.properties.tile;
@@ -5104,7 +5104,7 @@ class $e extends Ee {
5104
5104
  isMeshUniquePlaced(t) {
5105
5105
  return this.isMeshIterable(t);
5106
5106
  }
5107
- qi() {
5107
+ Yi() {
5108
5108
  if (!this.isEnableUniquePlacement()) return;
5109
5109
  const t = this.scene.getMeshes(), e = (t, e, n, i) => {
5110
5110
  const {start: r, end: s} = e[0], o = t.geometry.properties, a = o.elements;
@@ -5124,7 +5124,7 @@ class $e extends Ee {
5124
5124
  this.isMeshUniquePlaced(i) && this.forEachBox(i, e);
5125
5125
  }
5126
5126
  }
5127
- Yi(t) {
5127
+ qi(t) {
5128
5128
  if (!this.isEnableUniquePlacement()) return;
5129
5129
  const e = this.getMap().getZoom();
5130
5130
  let n = !this.tr || this.er !== e;
@@ -5143,7 +5143,7 @@ class $e extends Ee {
5143
5143
  const {uniquePlacements: o} = n.geometry.properties;
5144
5144
  if (o) for (let t = 0; t < o.length; t++) {
5145
5145
  if (!o[t]) continue;
5146
- const {key: e, index: s} = o[t], a = this.Pi(n), l = Ke(e, i), h = r[l];
5146
+ const {key: e, index: s} = o[t], a = this.Pi(n), l = $e(e, i), h = r[l];
5147
5147
  if (h) {
5148
5148
  const t = h.length, e = h[t - 3].properties.meshKey, i = h[t - 2], r = h[t - 1];
5149
5149
  this.nr[e] = this.nr[e] || {}, this.nr[e][r] = 1, this.ir(a, s, i, r), h.push(n, a, s);
@@ -5202,7 +5202,7 @@ class $e extends Ee {
5202
5202
  }
5203
5203
  }
5204
5204
 
5205
- function Ke(t, e) {
5205
+ function $e(t, e) {
5206
5206
  return Math.round(t[0] / e / 10) * Math.round(t[1] / e / 10) * (t[2] ? Math.round(t[2] / 10) : 1) + "-" + t[3];
5207
5207
  }
5208
5208
 
@@ -5255,29 +5255,29 @@ function _n(t, e, n, r, s) {
5255
5255
  if (o.markerPerspectiveRatio) {
5256
5256
  m = Zt(.5 + .5 * (1 - (1 - a / y) * o.markerPerspectiveRatio), 0, 4);
5257
5257
  }
5258
- const {aShape: g, aMarkerDx: v, aMarkerDy: x, aMarkerWidth: b, aMarkerHeight: A, aPitchAlign: w, aRotationAlign: _, aRotation: S} = l, M = v ? v[n] : c.markerDx, P = x ? x[n] : c.markerDy, T = w ? w[n] : o.pitchWithMap, k = _ ? _[n] : o.rotateWithMap, O = h.set(bn, M || 0, -(P || 0));
5259
- let I = h.set(mn, g[2 * n] / 10, g[2 * n + 1] / 10), C = h.set(gn, g[2 * n + 2] / 10, g[2 * n + 3] / 10), F = h.set(vn, g[2 * n + 4] / 10, g[2 * n + 5] / 10), E = h.set(xn, g[2 * n + 6] / 10, g[2 * n + 7] / 10);
5260
- 0 === o.flipY && 1 === T && (h.multiply(I, I, An), h.multiply(C, C, An), h.multiply(F, F, An),
5258
+ const {aShape: g, aMarkerDx: v, aMarkerDy: x, aMarkerWidth: b, aMarkerHeight: A, aPitchAlign: w, aRotationAlign: _, aRotation: S} = l, M = v ? v[n] : c.markerDx, P = x ? x[n] : c.markerDy, T = w ? w[n] : o.pitchWithMap, k = _ ? _[n] : o.rotateWithMap, I = h.set(bn, M || 0, -(P || 0));
5259
+ let O = h.set(mn, g[2 * n] / 10, g[2 * n + 1] / 10), C = h.set(gn, g[2 * n + 2] / 10, g[2 * n + 3] / 10), F = h.set(vn, g[2 * n + 4] / 10, g[2 * n + 5] / 10), E = h.set(xn, g[2 * n + 6] / 10, g[2 * n + 7] / 10);
5260
+ 0 === o.flipY && 1 === T && (h.multiply(O, O, An), h.multiply(C, C, An), h.multiply(F, F, An),
5261
5261
  h.multiply(E, E, An));
5262
- let D = b ? b[n] : c.markerWidth;
5263
- Kt(D) && (D = 15);
5264
- let H = A ? A[n] : c.markerHeight;
5265
- Kt(H) && (H = 15);
5266
- const L = h.set(wn, D / 24, H / 24);
5267
- h.mul(I, I, L), h.mul(C, C, L), h.mul(F, F, L), h.mul(E, E, L);
5268
- let N = S ? S[n] / 9362 : -(c.markerRotation || 0) * Math.PI / 180;
5269
- const R = s.getBearing() * Math.PI / 180;
5270
- if (R * k || N) {
5271
- const t = un(yn, N, R, k, T);
5272
- I = h.transformMat2(I, I, t), C = h.transformMat2(C, C, t), F = h.transformMat2(F, F, t),
5262
+ let H = b ? b[n] : c.markerWidth;
5263
+ $t(H) && (H = 15);
5264
+ let D = A ? A[n] : c.markerHeight;
5265
+ $t(D) && (D = 15);
5266
+ const L = h.set(wn, H / 24, D / 24);
5267
+ h.mul(O, O, L), h.mul(C, C, L), h.mul(F, F, L), h.mul(E, E, L);
5268
+ let R = S ? S[n] / 9362 : -(c.markerRotation || 0) * Math.PI / 180;
5269
+ const N = s.getBearing() * Math.PI / 180;
5270
+ if (N * k || R) {
5271
+ const t = un(yn, R, N, k, T);
5272
+ O = h.transformMat2(O, O, t), C = h.transformMat2(C, C, t), F = h.transformMat2(F, F, t),
5273
5273
  E = h.transformMat2(E, E, t);
5274
5274
  }
5275
- return 1 === T ? cn(t, d, I, C, F, E, r, O, o, s, y, m) : (h.multiply(I, I, An),
5276
- h.multiply(C, C, An), h.multiply(F, F, An), h.multiply(E, E, An), fn(t, p, I, C, F, E, O, m)),
5275
+ return 1 === T ? cn(t, d, O, C, F, E, r, I, o, s, y, m) : (h.multiply(O, O, An),
5276
+ h.multiply(C, C, An), h.multiply(F, F, An), h.multiply(E, E, An), fn(t, p, O, C, F, E, I, m)),
5277
5277
  t;
5278
5278
  }
5279
5279
 
5280
- const Sn = [], Mn = [], Pn = [], Tn = [], kn = [], On = [], In = [ 1, -1 ];
5280
+ const Sn = [], Mn = [], Pn = [], Tn = [], kn = [], In = [], On = [ 1, -1 ];
5281
5281
 
5282
5282
  function Cn(t, e, n, i, r, s, o, a, l) {
5283
5283
  const c = i.material.uniforms, f = l.cameraToCenterDistance, u = i.geometry.properties, d = this.getSymbol(u.symbolIndex), p = "line" === d.textPlacement && !ae(d), y = n[2];
@@ -5285,17 +5285,17 @@ function Cn(t, e, n, i, r, s, o, a, l) {
5285
5285
  if (c.textPerspectiveRatio) {
5286
5286
  m = Zt(.5 + .5 * (1 - (1 - f / y) * c.textPerspectiveRatio), 0, 4);
5287
5287
  }
5288
- const {aTextDx: g, aTextDy: v, aPitchAlign: x, aRotationAlign: b, aRotation: A} = i.geometry.properties, w = g ? g[o] : d.textDx, _ = v ? v[o] : d.textDy, S = x ? x[o] : c.pitchWithMap, M = b ? b[o] : c.rotateWithMap, P = h.set(On, w || 0, -(_ || 0));
5288
+ const {aTextDx: g, aTextDy: v, aPitchAlign: x, aRotationAlign: b, aRotation: A} = i.geometry.properties, w = g ? g[o] : d.textDx, _ = v ? v[o] : d.textDy, S = x ? x[o] : c.pitchWithMap, M = b ? b[o] : c.rotateWithMap, P = h.set(In, w || 0, -(_ || 0));
5289
5289
  if (p) {
5290
5290
  const {aOffset: i} = u;
5291
5291
  let r = h.set(Mn, i[2 * o] / 10, i[2 * o + 1] / 10), s = h.set(Pn, i[2 * o + 2] / 10, i[2 * o + 3] / 10), f = h.set(Tn, i[2 * o + 4] / 10, i[2 * o + 5] / 10), d = h.set(kn, i[2 * o + 6] / 10, i[2 * o + 7] / 10);
5292
- 1 === S ? cn(t, e, r, s, f, d, a, P, c, l, y, m) : (h.multiply(r, r, In), h.multiply(s, s, In),
5293
- h.multiply(f, f, In), h.multiply(d, d, In), fn(t, n, r, s, f, d, P, m));
5292
+ 1 === S ? cn(t, e, r, s, f, d, a, P, c, l, y, m) : (h.multiply(r, r, On), h.multiply(s, s, On),
5293
+ h.multiply(f, f, On), h.multiply(d, d, On), fn(t, n, r, s, f, d, P, m));
5294
5294
  } else {
5295
5295
  const {aShape: i} = u;
5296
5296
  let s = h.set(Mn, i[2 * o] / 10, i[2 * o + 1] / 10), f = h.set(Pn, i[2 * o + 2] / 10, i[2 * o + 3] / 10), g = h.set(Tn, i[2 * o + 4] / 10, i[2 * o + 5] / 10), v = h.set(kn, i[2 * o + 6] / 10, i[2 * o + 7] / 10);
5297
- 0 === c.flipY && 1 === S && (h.multiply(s, s, In), h.multiply(f, f, In), h.multiply(g, g, In),
5298
- h.multiply(v, v, In));
5297
+ 0 === c.flipY && 1 === S && (h.multiply(s, s, On), h.multiply(f, f, On), h.multiply(g, g, On),
5298
+ h.multiply(v, v, On));
5299
5299
  let x = A ? -A[o] / 9362 : -(d.textRotation || 0) * Math.PI / 180;
5300
5300
  const b = p ? 0 : l.getBearing() * Math.PI / 180;
5301
5301
  if (x || b) {
@@ -5330,14 +5330,14 @@ const En = {
5330
5330
  textRotation: 0
5331
5331
  };
5332
5332
 
5333
- function Dn(t, e, i, r, s, o, a, l, h) {
5333
+ function Hn(t, e, i, r, s, o, a, l, h) {
5334
5334
  const c = [];
5335
5335
  if (e.isDisposed() || 0 === e.data.aPosition.length) return c;
5336
5336
  const f = e.properties.glyphAtlas;
5337
5337
  if (!f) return c;
5338
5338
  if (0 === r.textSize || 0 === r.textOpacity) return c;
5339
5339
  if (ue(e, r, o), !e.properties.aAnchor) {
5340
- Hn.call(this, e, a || h, l);
5340
+ Dn.call(this, e, a || h, l);
5341
5341
  const {aTextSize: t, aTextDx: n, aTextDy: i, aPitchAlign: r, aRotationAlign: s, aRotation: o, aOverlap: c} = e.data;
5342
5342
  if (t) {
5343
5343
  const n = (ce + "aTextSize").trim();
@@ -5368,7 +5368,7 @@ function Dn(t, e, i, r, s, o, a, l, h) {
5368
5368
  e.properties.aOverlap = e.properties[t] || new c.constructor(c);
5369
5369
  }
5370
5370
  }
5371
- const u = He(t, f, !1), d = {
5371
+ const u = De(t, f, !1), d = {
5372
5372
  flipY: 0,
5373
5373
  tileResolution: e.properties.tileResolution,
5374
5374
  tileRatio: e.properties.tileRatio,
@@ -5425,7 +5425,7 @@ function Dn(t, e, i, r, s, o, a, l, h) {
5425
5425
  }), c;
5426
5426
  }
5427
5427
 
5428
- function Hn(t, e, n) {
5428
+ function Dn(t, e, n) {
5429
5429
  const i = this.getSymbol(t.properties.symbolIndex), r = "line" === i.textPlacement && !ae(i), {aPosition: s, aShape: o} = t.data, a = s.length / t.desc.positionSize;
5430
5430
  if (t.properties.aPickingId = t.data.aPickingId, t.properties.aCount = t.data.aCount,
5431
5431
  delete t.data.aCount, (e || r) && (t.properties.aAnchor = s, t.properties.aShape = o),
@@ -5463,7 +5463,7 @@ function Ln(t, e, n) {
5463
5463
  te(e, "textDy", n, "textDy", En.textDy), te(e, "textRotation", n, "textRotation", En.textRotation, t => t * Math.PI / 180);
5464
5464
  }
5465
5465
 
5466
- function Nn(t, e) {
5466
+ function Rn(t, e) {
5467
5467
  const n = t.getRenderer().canvas;
5468
5468
  return {
5469
5469
  uniforms: [ {
@@ -5522,7 +5522,7 @@ function Nn(t, e) {
5522
5522
  };
5523
5523
  }
5524
5524
 
5525
- function Rn(t, e) {
5525
+ function Nn(t, e) {
5526
5526
  const n = g(e.textFill), i = g(e.textSize), r = g(e.textHaloFill), s = g(e.textHaloRadius), o = g(e.textHaloOpacity), a = g(e.textDx), l = g(e.textDy), h = g(e.textOpacity), c = v(e.textPitchAlignment), f = v(e.textRotationAlignment), u = g(e.textRotation), d = v(e.textAllowOverlapFn), p = v(e.textIgnorePlacement), y = {}, x = new Int16Array(1), b = new Uint16Array(1);
5527
5527
  return [ {
5528
5528
  attrName: "aTextFill",
@@ -5532,7 +5532,7 @@ function Rn(t, e) {
5532
5532
  width: 4,
5533
5533
  evaluate: (e, i, r) => {
5534
5534
  let s = n(t.getZoom(), e);
5535
- return m(s) && (s = this.evaluateInFnTypeConfig(s, r, t, e, !0)), Array.isArray(s) || (s = y[s] = y[s] || I(s).unitArray()),
5535
+ return m(s) && (s = this.evaluateInFnTypeConfig(s, r, t, e, !0)), Array.isArray(s) || (s = y[s] = y[s] || O(s).unitArray()),
5536
5536
  s = ne(s), s;
5537
5537
  }
5538
5538
  }, {
@@ -5553,7 +5553,7 @@ function Rn(t, e) {
5553
5553
  width: 4,
5554
5554
  evaluate: e => {
5555
5555
  let n = r(t.getZoom(), e);
5556
- return Array.isArray(n) || (n = y[n] = y[n] || I(n).array()), n = ne(n), n;
5556
+ return Array.isArray(n) || (n = y[n] = y[n] || O(n).array()), n = ne(n), n;
5557
5557
  }
5558
5558
  }, {
5559
5559
  attrName: "aTextHaloRadius",
@@ -5626,7 +5626,7 @@ function Rn(t, e) {
5626
5626
  width: 1,
5627
5627
  define: "HAS_ROTATION",
5628
5628
  evaluate: e => {
5629
- const n = $t(u(t.getZoom(), e), 0, 360) * Math.PI / 180;
5629
+ const n = Kt(u(t.getZoom(), e), 0, 360) * Math.PI / 180;
5630
5630
  return b[0] = 9362 * n, b[0];
5631
5631
  }
5632
5632
  }, {
@@ -5650,14 +5650,14 @@ function Rn(t, e) {
5650
5650
  } ];
5651
5651
  }
5652
5652
 
5653
- const zn = [], Vn = [], Un = [], jn = [];
5653
+ const zn = [], Vn = [], jn = [], Un = [];
5654
5654
 
5655
5655
  function Gn(t, e, n, i, r, s, o) {
5656
5656
  t = 1 === t ? 1 : 0;
5657
5657
  const a = this.getMap(), l = e.geometry.properties, h = this.getSymbol(l.symbolIndex), c = "line" === h.textPlacement && !ae(h), {aTextSize: f, aTextHaloRadius: u, aShape: d} = l;
5658
5658
  let p = f ? f[n[r]] : e.properties.textSize;
5659
5659
  null == p && (p = En.textSize);
5660
- const y = u ? u[n[r]] : e.properties.textHaloRadius, m = Fn(Un, e, n[r]), g = nn(jn, m, o, a.width, a.height), v = i, {boxes: x, collision: b} = this.rr(e, r);
5660
+ const y = u ? u[n[r]] : e.properties.textHaloRadius, m = Fn(jn, e, n[r]), g = nn(Un, m, o, a.width, a.height), v = i, {boxes: x, collision: b} = this.rr(e, r);
5661
5661
  let A = 0;
5662
5662
  if (c || 1 === e.material.uniforms.rotateWithMap || h.textRotation) {
5663
5663
  let i = 0;
@@ -5703,11 +5703,11 @@ function Wn(t, e) {
5703
5703
 
5704
5704
  const Bn = [], Xn = [];
5705
5705
 
5706
- var qn = "#define SHADER_NAME TEXT\n#define RAD 0.0174532925\nattribute vec3 aPosition;\nattribute vec2 aShape;\nattribute vec2 aTexCoord;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nattribute float aRotationAlign;\n#else\nuniform float rotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_ROTATION)\nattribute float aRotation;\n#else\nuniform float textRotation;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform vec2 texSize;\nuniform vec2 canvasSize;\nuniform float glyphSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nattribute float aTextHaloRadius;\nvarying float vTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nattribute float aTextHaloOpacity;\nvarying float vTextHaloOpacity;\n#endif\n#else\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n vec3 c = aPosition;\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aTextDx;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aTextDy;\n#else\nfloat f = textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nfloat h = aPitchAlign;\n#else\nfloat h = pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nfloat i = aRotationAlign;\n#else\nfloat i = rotateWithMap;\n#endif\nvec2 j = aShape / 10.0;\n if(h == 1. && flipY == .0) {\n j = j * vec2(1., -1.);\n }\n vec2 k = aTexCoord;\n gl_Position = projViewModelMatrix * vec4(c, 1.);\n float l = gl_Position.w;\n float m = (1. - cameraToCenterDistance / l) * textPerspectiveRatio;\n float n = clamp(.5 + .5 * (1. - m), .0, 4.);\n#ifdef HAS_ROTATION\nfloat o = aRotation / 9362. - mapRotation * i;\n#else\nfloat o = textRotation - mapRotation * i;\n#endif\nif(h == 1.) {\n \n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\no += mapRotation;\n#else\no -= mapRotation;\n#endif\n }\n float u = sin(o);\n float v = cos(o);\n mat2 A = mat2(v, -1. * u, u, v);\n j = A * (j / glyphSize * d);\n float B = l / cameraToCenterDistance;\n if(h == .0) {\n vec2 C = j * 2. / canvasSize;\n gl_Position.xy += C * n * l;\n } else {\n vec2 C = j;\n gl_Position = projViewModelMatrix * vec4(c + vec3(C, .0) * tileRatio / zoomScale * B * n, 1.);\n }\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * l;\n#ifndef PICKING_MODE\nif(h == .0) {\n vGammaScale = mix(1., B, textPerspectiveRatio);\n } else {\n vGammaScale = B + mapPitch / 4.;\n }\n vTexCoord = k / texSize;\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vSize = d;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nvTextHaloRadius = aTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nvTextHaloOpacity = aTextHaloOpacity;\n#endif\n#else\n#ifdef ENABLE_COLLISION\nbool D = aOpacity == 255.;\n#else\nbool D = true;\n#endif\nfbo_picking_setData(gl_Position.w, D);\n#endif\n}", Yn = "#define SHADER_NAME TEXT\n#define SDF_PX 8.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define EDGE_GAMMA 0.105 / DEVICE_PIXEL_RATIO\nprecision mediump float;\nuniform sampler2D texture;\nuniform float textOpacity;\nuniform highp float gammaScale;\nuniform int isHalo;\nuniform highp float textHaloBlur;\n#ifdef HAS_TEXT_HALO_OPACITY\nvarying float vTextHaloOpacity;\n#else\nuniform float textHaloOpacity;\n#endif\nvarying vec2 vTexCoord;\nvarying float vSize;\nvarying float vGammaScale;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nvarying vec4 vTextFill;\n#else\nuniform vec4 textFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvarying vec4 vTextHaloFill;\n#else\nuniform vec4 textHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nvarying float vTextHaloRadius;\n#else\nuniform highp float textHaloRadius;\n#endif\nvoid main() {\n \n#ifdef HAS_TEXT_FILL\nvec4 c = vTextFill;\n#else\nvec4 c = textFill;\n#endif\nfloat d = vSize / 24.;\n lowp vec4 e = c;\n highp float f = EDGE_GAMMA / (d * gammaScale);\n lowp float h = 185. / 256.;\n if(isHalo == 1) {\n \n#ifdef HAS_TEXT_HALO_FILL\nvec4 i = vTextHaloFill;\n#else\nvec4 i = textHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nfloat j = vTextHaloRadius;\n#else\nfloat j = textHaloRadius;\n#endif\ne = i;\n f = (textHaloBlur * 1.19 / SDF_PX + EDGE_GAMMA) / (d * gammaScale);\n h = (6. - j / d) / SDF_PX;\n#ifdef HAS_TEXT_HALO_OPACITY\nfloat k = vTextHaloOpacity / 255.;\n#else\nfloat k = textHaloOpacity;\n#endif\ne *= k * 1.25;\n }\n float l = texture2D(texture, vTexCoord).a;\n highp float m = f * vGammaScale * .7;\n float n = clamp(smoothstep(h - m, h + m, l), .0, 1.);\n gl_FragColor = e * (n * textOpacity * vOpacity);\n}";
5706
+ var Yn = "#define SHADER_NAME TEXT\n#define RAD 0.0174532925\nattribute vec3 aPosition;\nattribute vec2 aShape;\nattribute vec2 aTexCoord;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nattribute float aRotationAlign;\n#else\nuniform float rotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_ROTATION)\nattribute float aRotation;\n#else\nuniform float textRotation;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform vec2 texSize;\nuniform vec2 canvasSize;\nuniform float glyphSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nattribute float aTextHaloRadius;\nvarying float vTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nattribute float aTextHaloOpacity;\nvarying float vTextHaloOpacity;\n#endif\n#else\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n vec3 c = aPosition;\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aTextDx;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aTextDy;\n#else\nfloat f = textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nfloat h = aPitchAlign;\n#else\nfloat h = pitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nfloat i = aRotationAlign;\n#else\nfloat i = rotateWithMap;\n#endif\nvec2 j = aShape / 10.0;\n if(h == 1. && flipY == .0) {\n j = j * vec2(1., -1.);\n }\n vec2 k = aTexCoord;\n gl_Position = projViewModelMatrix * vec4(c, 1.);\n float l = gl_Position.w;\n float m = (1. - cameraToCenterDistance / l) * textPerspectiveRatio;\n float n = clamp(.5 + .5 * (1. - m), .0, 4.);\n#ifdef HAS_ROTATION\nfloat o = aRotation / 9362. - mapRotation * i;\n#else\nfloat o = textRotation - mapRotation * i;\n#endif\nif(h == 1.) {\n \n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\no += mapRotation;\n#else\no -= mapRotation;\n#endif\n }\n float u = sin(o);\n float v = cos(o);\n mat2 A = mat2(v, -1. * u, u, v);\n j = A * (j / glyphSize * d);\n float B = l / cameraToCenterDistance;\n if(h == .0) {\n vec2 C = j * 2. / canvasSize;\n gl_Position.xy += C * n * l;\n } else {\n vec2 C = j;\n gl_Position = projViewModelMatrix * vec4(c + vec3(C, .0) * tileRatio / zoomScale * B * n, 1.);\n }\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * l;\n#ifndef PICKING_MODE\nif(h == .0) {\n vGammaScale = mix(1., B, textPerspectiveRatio);\n } else {\n vGammaScale = B + mapPitch / 4.;\n }\n vTexCoord = k / texSize;\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vSize = d;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nvTextHaloRadius = aTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nvTextHaloOpacity = aTextHaloOpacity;\n#endif\n#else\n#ifdef ENABLE_COLLISION\nbool D = aOpacity == 255.;\n#else\nbool D = true;\n#endif\nfbo_picking_setData(gl_Position.w, D);\n#endif\n}", qn = "#define SHADER_NAME TEXT\n#define SDF_PX 8.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define EDGE_GAMMA 0.105 / DEVICE_PIXEL_RATIO\nprecision mediump float;\nuniform sampler2D texture;\nuniform float textOpacity;\nuniform highp float gammaScale;\nuniform int isHalo;\nuniform highp float textHaloBlur;\n#ifdef HAS_TEXT_HALO_OPACITY\nvarying float vTextHaloOpacity;\n#else\nuniform float textHaloOpacity;\n#endif\nvarying vec2 vTexCoord;\nvarying float vSize;\nvarying float vGammaScale;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nvarying vec4 vTextFill;\n#else\nuniform vec4 textFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvarying vec4 vTextHaloFill;\n#else\nuniform vec4 textHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nvarying float vTextHaloRadius;\n#else\nuniform highp float textHaloRadius;\n#endif\nvoid main() {\n \n#ifdef HAS_TEXT_FILL\nvec4 c = vTextFill;\n#else\nvec4 c = textFill;\n#endif\nfloat d = vSize / 24.;\n lowp vec4 e = c;\n highp float f = EDGE_GAMMA / (d * gammaScale);\n lowp float h = 185. / 256.;\n if(isHalo == 1) {\n \n#ifdef HAS_TEXT_HALO_FILL\nvec4 i = vTextHaloFill;\n#else\nvec4 i = textHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nfloat j = vTextHaloRadius;\n#else\nfloat j = textHaloRadius;\n#endif\ne = i;\n f = (textHaloBlur * 1.19 / SDF_PX + EDGE_GAMMA) / (d * gammaScale);\n h = (6. - j / d) / SDF_PX;\n#ifdef HAS_TEXT_HALO_OPACITY\nfloat k = vTextHaloOpacity / 255.;\n#else\nfloat k = textHaloOpacity;\n#endif\ne *= k * 1.25;\n }\n float l = texture2D(texture, vTexCoord).a;\n highp float m = f * vGammaScale * .7;\n float n = clamp(smoothstep(h - m, h + m, l), .0, 1.);\n gl_FragColor = e * (n * textOpacity * vOpacity);\n}";
5707
5707
 
5708
5708
  const Jn = new Uint16Array(1), Zn = new Int8Array(1);
5709
5709
 
5710
- function $n(t, e, n) {
5710
+ function Kn(t, e, n) {
5711
5711
  ue(t, e, n), function(t) {
5712
5712
  const {aMarkerWidth: e, aMarkerHeight: n, aMarkerDx: i, aMarkerDy: r, aPitchAlign: s, aRotationAlign: o, aRotation: a, aOverlap: l} = t.data;
5713
5713
  if (e) {
@@ -5745,7 +5745,7 @@ function $n(t, e, n) {
5745
5745
  }(t);
5746
5746
  }
5747
5747
 
5748
- function Kn(t, e) {
5748
+ function $n(t, e) {
5749
5749
  const n = g(e.markerWidth), i = g(e.markerHeight), r = g(e.markerDx), s = g(e.markerDy), o = g(e.markerOpacity), a = g(e.markerTextFit), l = v(e.markerPitchAlignment), h = v(e.markerRotationAlignment), c = g(e.markerRotation), f = v(e.markerAllowOverlapFn), u = v(e.markerIgnorePlacement), d = new Int16Array(1), p = new Uint16Array(1);
5750
5750
  return [ {
5751
5751
  attrName: "aMarkerWidth",
@@ -5822,7 +5822,7 @@ function Kn(t, e) {
5822
5822
  width: 1,
5823
5823
  define: "HAS_ROTATION",
5824
5824
  evaluate: e => {
5825
- const n = $t(c(t.getZoom(), e), 0, 360) * Math.PI / 180;
5825
+ const n = Kt(c(t.getZoom(), e), 0, 360) * Math.PI / 180;
5826
5826
  return p[0] = 9362 * n, p[0];
5827
5827
  }
5828
5828
  }, {
@@ -6049,7 +6049,7 @@ const ni = function(t) {
6049
6049
  colliides: -1
6050
6050
  };
6051
6051
 
6052
- class li extends $e {
6052
+ class li extends Ke {
6053
6053
  constructor(t, e, n, i, r) {
6054
6054
  super(t, e, n, i, r), this.propAllowOverlap = "markerAllowOverlap", this.propIgnorePlacement = "markerIgnorePlacement",
6055
6055
  this.Gn = {}, this.isLabelCollides = Gn.bind(this), this.cr = ni.bind(this), this.ur = ii.bind(this),
@@ -6060,8 +6060,8 @@ class li extends $e {
6060
6060
  }
6061
6061
  createFnTypeConfig(t, e) {
6062
6062
  return {
6063
- icon: Kn.call(this, t, e),
6064
- text: Rn.call(this, t, e)
6063
+ icon: $n.call(this, t, e),
6064
+ text: Nn.call(this, t, e)
6065
6065
  };
6066
6066
  }
6067
6067
  startFrame(...t) {
@@ -6076,7 +6076,7 @@ class li extends $e {
6076
6076
  postCreateGeometry(t, e) {
6077
6077
  const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), s = this.getFnTypeConfig(i);
6078
6078
  if (this.gr(n)) n.properties.iconAtlas ? this.drawDebugAtlas(n.properties.iconAtlas) : n.properties.isEmpty = !0,
6079
- $n(n, r, s.icon); else if (this.vr(n) && ae(r)) {
6079
+ Kn(n, r, s.icon); else if (this.vr(n) && ae(r)) {
6080
6080
  const t = e[e.length - 1];
6081
6081
  if (t) {
6082
6082
  const {geometry: e, symbolIndex: s} = t;
@@ -6125,7 +6125,7 @@ class li extends $e {
6125
6125
  te(f, "markerWidth", s, "markerWidth", 15), te(f, "markerHeight", s, "markerHeight", 15),
6126
6126
  te(f, "markerDx", s, "markerDx", 0), te(f, "markerDy", s, "markerDy", 0), te(f, "markerRotation", s, "markerRotation", 0, t => t * Math.PI / 180),
6127
6127
  te(f, "pitchWithMap", s, "markerPitchAlignment", 0, t => "map" === t ? 1 : 0), te(f, "rotateWithMap", s, "markerRotationAlignment", 0, t => "map" === t ? 1 : 0),
6128
- f.texture = c ? He(t, c, !1) : null, f.texSize = c ? [ c.width, c.height ] : [ 0, 0 ],
6128
+ f.texture = c ? De(t, c, !1) : null, f.texSize = c ? [ c.width, c.height ] : [ 0, 0 ],
6129
6129
  e.generateBuffers(t, {
6130
6130
  excludeElementsInVAO: !0
6131
6131
  });
@@ -6145,7 +6145,7 @@ class li extends $e {
6145
6145
  }(this.regl, a, e, 0, c, f.icon, o.options.collision, !s, this.isEnableUniquePlacement());
6146
6146
  t && (delete t.geometry.properties.glyphAtlas, u.push(t));
6147
6147
  } else if (this.vr(a)) {
6148
- const t = Dn.call(this, this.regl, a, e, h, c, f.text, o.options.collision, !s, this.isEnableUniquePlacement());
6148
+ const t = Hn.call(this, this.regl, a, e, h, c, f.text, o.options.collision, !s, this.isEnableUniquePlacement());
6149
6149
  t.length && (t.forEach(t => {
6150
6150
  delete t.geometry.properties.iconAtlas;
6151
6151
  }), u.push(...t));
@@ -6297,7 +6297,7 @@ class li extends $e {
6297
6297
  u++;
6298
6298
  }
6299
6299
  if (!h) return !1;
6300
- return n.call(this, t, l, a, i.boxIndex++) && this.Or(t, e), !0;
6300
+ return n.call(this, t, l, a, i.boxIndex++) && this.Ir(t, e), !0;
6301
6301
  }
6302
6302
  Mr(t) {
6303
6303
  const e = t.meshes;
@@ -6306,7 +6306,7 @@ class li extends $e {
6306
6306
  i && (i.properties.visElemts.count = 0);
6307
6307
  }
6308
6308
  }
6309
- Or(t, e) {
6309
+ Ir(t, e) {
6310
6310
  const n = t.meshes;
6311
6311
  for (let t = 0; t < n.length; t++) {
6312
6312
  const i = n[t];
@@ -6352,7 +6352,7 @@ class li extends $e {
6352
6352
  }) : t.material && delete t.material.uniforms.texture), super.deleteMesh(t, e));
6353
6353
  }
6354
6354
  isBloom(t) {
6355
- const e = t && t.material && !Kt(t.material.get("markerOpacity")), n = this.getSymbol(t.properties.symbolIndex);
6355
+ const e = t && t.material && !$t(t.material.get("markerOpacity")), n = this.getSymbol(t.properties.symbolIndex);
6356
6356
  return !!(e ? n.markerBloom : n.textBloom);
6357
6357
  }
6358
6358
  init() {
@@ -6399,10 +6399,10 @@ class li extends $e {
6399
6399
  }
6400
6400
  }
6401
6401
  });
6402
- const {uniforms: s, extraCommandProps: o} = Nn.call(this, this.layer, this.sceneConfig), a = this.mr || {};
6402
+ const {uniforms: s, extraCommandProps: o} = Rn.call(this, this.layer, this.sceneConfig), a = this.mr || {};
6403
6403
  if (this.wr = new n.MeshShader({
6404
- vert: qn,
6405
- frag: Yn,
6404
+ vert: Yn,
6405
+ frag: qn,
6406
6406
  uniforms: s,
6407
6407
  extraCommandProps: o,
6408
6408
  defines: a
@@ -6428,7 +6428,7 @@ class li extends $e {
6428
6428
  }, this.pickingFBO);
6429
6429
  t.filter = t => !!t.geometry.properties.iconAtlas;
6430
6430
  const e = new n.FBORayPicking(this.renderer, {
6431
- vert: "#define PICKING_MODE 1\n" + qn,
6431
+ vert: "#define PICKING_MODE 1\n" + Yn,
6432
6432
  uniforms: s,
6433
6433
  extraCommandProps: {
6434
6434
  viewport: this.pickingViewport
@@ -6483,7 +6483,7 @@ fi.prototype = {
6483
6483
  return new fi(this.x, this.y);
6484
6484
  },
6485
6485
  add: function(t) {
6486
- return this.clone().Ir(t);
6486
+ return this.clone().Or(t);
6487
6487
  },
6488
6488
  sub: function(t) {
6489
6489
  return this.clone().Cr(t);
@@ -6495,19 +6495,19 @@ fi.prototype = {
6495
6495
  return this.clone().Er(t);
6496
6496
  },
6497
6497
  mult: function(t) {
6498
- return this.clone().Dr(t);
6498
+ return this.clone().Hr(t);
6499
6499
  },
6500
6500
  div: function(t) {
6501
- return this.clone().Hr(t);
6501
+ return this.clone().Dr(t);
6502
6502
  },
6503
6503
  rotate: function(t) {
6504
6504
  return this.clone().Lr(t);
6505
6505
  },
6506
6506
  rotateAround: function(t, e) {
6507
- return this.clone().Nr(t, e);
6507
+ return this.clone().Rr(t, e);
6508
6508
  },
6509
6509
  matMult: function(t) {
6510
- return this.clone().Rr(t);
6510
+ return this.clone().Nr(t);
6511
6511
  },
6512
6512
  unit: function() {
6513
6513
  return this.clone().zr();
@@ -6516,7 +6516,7 @@ fi.prototype = {
6516
6516
  return this.clone().Vr();
6517
6517
  },
6518
6518
  round: function() {
6519
- return this.clone().Ur();
6519
+ return this.clone().jr();
6520
6520
  },
6521
6521
  mag: function() {
6522
6522
  return Math.sqrt(this.x * this.x + this.y * this.y);
@@ -6543,20 +6543,20 @@ fi.prototype = {
6543
6543
  angleWithSep: function(t, e) {
6544
6544
  return Math.atan2(this.x * e - this.y * t, this.x * t + this.y * e);
6545
6545
  },
6546
- Rr: function(t) {
6546
+ Nr: function(t) {
6547
6547
  var e = t[0] * this.x + t[1] * this.y, n = t[2] * this.x + t[3] * this.y;
6548
6548
  return this.x = e, this.y = n, this;
6549
6549
  },
6550
- Ir: function(t) {
6550
+ Or: function(t) {
6551
6551
  return this.x += t.x, this.y += t.y, this;
6552
6552
  },
6553
6553
  Cr: function(t) {
6554
6554
  return this.x -= t.x, this.y -= t.y, this;
6555
6555
  },
6556
- Dr: function(t) {
6556
+ Hr: function(t) {
6557
6557
  return this.x *= t, this.y *= t, this;
6558
6558
  },
6559
- Hr: function(t) {
6559
+ Dr: function(t) {
6560
6560
  return this.x /= t, this.y /= t, this;
6561
6561
  },
6562
6562
  Fr: function(t) {
@@ -6566,7 +6566,7 @@ fi.prototype = {
6566
6566
  return this.x /= t.x, this.y /= t.y, this;
6567
6567
  },
6568
6568
  zr: function() {
6569
- return this.Hr(this.mag()), this;
6569
+ return this.Dr(this.mag()), this;
6570
6570
  },
6571
6571
  Vr: function() {
6572
6572
  var t = this.y;
@@ -6576,11 +6576,11 @@ fi.prototype = {
6576
6576
  var e = Math.cos(t), n = Math.sin(t), i = e * this.x - n * this.y, r = n * this.x + e * this.y;
6577
6577
  return this.x = i, this.y = r, this;
6578
6578
  },
6579
- Nr: function(t, e) {
6579
+ Rr: function(t, e) {
6580
6580
  var n = Math.cos(t), i = Math.sin(t), r = e.x + n * (this.x - e.x) - i * (this.y - e.y), s = e.y + i * (this.x - e.x) + n * (this.y - e.y);
6581
6581
  return this.x = r, this.y = s, this;
6582
6582
  },
6583
- Ur: function() {
6583
+ jr: function() {
6584
6584
  return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
6585
6585
  }
6586
6586
  }, fi.convert = function(t) {
@@ -6601,8 +6601,8 @@ function yi(t, e, n, r, s, o, a, l) {
6601
6601
  if (v += p, v < a || v >= m) return null;
6602
6602
  b.x = x.x, b.y = x.y, x.x = e[3 * v], x.y = e[3 * v + 1], A += w, w = b.dist(x) / f;
6603
6603
  }
6604
- const _ = (g - A) / w, S = x.sub(b), M = S.mult(_).Ir(b);
6605
- M.Ir(S.zr().Vr().Dr(s * p));
6604
+ const _ = (g - A) / w, S = x.sub(b), M = S.mult(_).Or(b);
6605
+ M.Or(S.zr().Vr().Hr(s * p));
6606
6606
  const P = y + Math.atan2(x.y - b.y, x.x - b.x);
6607
6607
  return t[0] = (M.x - n[0]) / f, t[1] = (M.y - n[1]) / f, t[2] = P, t;
6608
6608
  }(t, r, o, x, v[0], v[1], b[0], b[1], b[2], n / 24, l, a);
@@ -6637,19 +6637,19 @@ const bi = function(t) {
6637
6637
  }, _i = function(t) {
6638
6638
  const e = this.layer.getRenderer(), n = this.getSymbol(t.properties.symbolIndex);
6639
6639
  return !this.ar(t) && !e.isForeground(t) && "line" === n.textPlacement;
6640
- }, Si = [], Mi = [], Pi = [], Ti = [], ki = [], Oi = [], Ii = [], Ci = [], Fi = [], Ei = [ 1, -1 ], Di = new Int16Array(2), Hi = [], Li = [];
6640
+ }, Si = [], Mi = [], Pi = [], Ti = [], ki = [], Ii = [], Oi = [], Ci = [], Fi = [], Ei = [ 1, -1 ], Hi = new Int16Array(2), Di = [], Li = [];
6641
6641
 
6642
- class Ni extends $e {
6642
+ class Ri extends Ke {
6643
6643
  constructor(t, e, n, i, r) {
6644
6644
  super(t, e, n, i, r), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
6645
- this.colorCache = {}, this.jr = bi.bind(this), this.Gr = Ai.bind(this), this.Wr = wi.bind(this),
6645
+ this.colorCache = {}, this.Ur = bi.bind(this), this.Gr = Ai.bind(this), this.Wr = wi.bind(this),
6646
6646
  this.Br = _i.bind(this), this.isLabelCollides = Gn.bind(this), this.Xr();
6647
6647
  }
6648
6648
  Xr() {
6649
- this.qr = [];
6649
+ this.Yr = [];
6650
6650
  for (let t = 0; t < this.symbolDef.length; t++) {
6651
6651
  const e = this.symbolDef[t];
6652
- m(e.textName) && (this.qr[t] = g(e.textName));
6652
+ m(e.textName) && (this.Yr[t] = g(e.textName));
6653
6653
  }
6654
6654
  }
6655
6655
  updateSymbol(...t) {
@@ -6662,7 +6662,7 @@ class Ni extends $e {
6662
6662
  return !1;
6663
6663
  }
6664
6664
  createFnTypeConfig(t, e) {
6665
- return Rn(t, e);
6665
+ return Nn(t, e);
6666
6666
  }
6667
6667
  isBloom(t) {
6668
6668
  return !!this.getSymbol(t.properties.symbolIndex).textBloom;
@@ -6680,26 +6680,26 @@ class Ni extends $e {
6680
6680
  createMesh(t, e) {
6681
6681
  const n = this.isEnableCollision(), i = this.isEnableUniquePlacement(), {geometry: r, symbolIndex: s} = t;
6682
6682
  r.properties.symbolIndex = s;
6683
- const o = this.getSymbol(s), a = this.getSymbolDef(s), l = this.getFnTypeConfig(s), h = Dn.call(this, this.regl, r, e, a, o, l, this.layer.options.collision, !n, i);
6683
+ const o = this.getSymbol(s), a = this.getSymbolDef(s), l = this.getFnTypeConfig(s), h = Hn.call(this, this.regl, r, e, a, o, l, this.layer.options.collision, !n, i);
6684
6684
  if (h.length) {
6685
- "line" === o.textPlacement ? this.Yr = !0 : this.Jr = !0;
6685
+ "line" === o.textPlacement ? this.qr = !0 : this.Jr = !0;
6686
6686
  }
6687
6687
  return h;
6688
6688
  }
6689
6689
  updateCollision(t) {
6690
6690
  super.updateCollision(t);
6691
6691
  const e = this.scene.getMeshes();
6692
- e && e.length ? (this.Zr = {}, this.$r(t.timestamp), this.xi()) : this.xi();
6692
+ e && e.length ? (this.Zr = {}, this.Kr(t.timestamp), this.xi()) : this.xi();
6693
6693
  }
6694
6694
  callCurrentTileShader(t, e) {
6695
- this.shader.filter = e.sceneFilter ? [ this.jr, e.sceneFilter ] : this.jr, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
6696
- this.Kr.filter = e.sceneFilter ? [ this.Wr, e.sceneFilter ] : this.Wr, this.renderer.render(this.Kr, t, this.scene, this.getRenderFBO(e));
6695
+ this.shader.filter = e.sceneFilter ? [ this.Ur, e.sceneFilter ] : this.Ur, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
6696
+ this.$r.filter = e.sceneFilter ? [ this.Wr, e.sceneFilter ] : this.Wr, this.renderer.render(this.$r, t, this.scene, this.getRenderFBO(e));
6697
6697
  }
6698
6698
  callBackgroundTileShader(t, e) {
6699
6699
  this.shader.filter = e.sceneFilter ? [ this.Gr, e.sceneFilter ] : this.Gr, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
6700
- this.Kr.filter = e.sceneFilter ? [ this.Br, e.sceneFilter ] : this.Br, this.renderer.render(this.Kr, t, this.scene, this.getRenderFBO(e));
6700
+ this.$r.filter = e.sceneFilter ? [ this.Br, e.sceneFilter ] : this.Br, this.renderer.render(this.$r, t, this.scene, this.getRenderFBO(e));
6701
6701
  }
6702
- $r() {
6702
+ Kr() {
6703
6703
  let t = this.scene.getMeshes();
6704
6704
  if (!t || !t.length) return;
6705
6705
  const e = -this.getMap().getBearing() * Math.PI / 180, n = l.fromRotation(Pi, e), i = (t, e, n, i) => {
@@ -6710,14 +6710,14 @@ class Ni extends $e {
6710
6710
  t.count = e;
6711
6711
  }
6712
6712
  }, r = this.Gi(), s = this.layer.getRenderer();
6713
- t = t.sort(Ui);
6713
+ t = t.sort(ji);
6714
6714
  for (let e = 0; e < t.length; e++) {
6715
6715
  const o = t[e];
6716
6716
  if (!this.isMeshIterable(o)) continue;
6717
6717
  const a = s.isForeground(o);
6718
6718
  if (this.shouldIgnoreBackground() && !a) continue;
6719
6719
  const l = o.geometry, h = this.getSymbol(o.properties.symbolIndex);
6720
- o.properties.textHaloRadius = Kt(h.textHaloRadius) ? En.textHaloRadius : h.textHaloRadius;
6720
+ o.properties.textHaloRadius = $t(h.textHaloRadius) ? En.textHaloRadius : h.textHaloRadius;
6721
6721
  const c = o.properties.meshKey;
6722
6722
  if ("line" === h.textPlacement) {
6723
6723
  if (!l.properties.line) continue;
@@ -6787,7 +6787,7 @@ class Ni extends $e {
6787
6787
  if (c && this.isMeshUniquePlaced(t) && r && !r.label) {
6788
6788
  const e = r.properties || {};
6789
6789
  e.$layer = r.layer, e.$type = r.type;
6790
- const i = zi(this.qr[n] ? this.qr[n](null, e) : this.getSymbol(t.properties.symbolIndex).textName, e);
6790
+ const i = zi(this.Yr[n] ? this.Yr[n](null, e) : this.getSymbol(t.properties.symbolIndex).textName, e);
6791
6791
  delete e.$layer, delete e.$type, r.label = i;
6792
6792
  }
6793
6793
  const s = n, m = o[l[p]];
@@ -6800,36 +6800,36 @@ class Ni extends $e {
6800
6800
  const c = this.Gi(), f = this.getMap(), u = t.geometry, d = u.desc.positionSize, {aShape: p, aOffset: y, aAnchor: m} = u.properties, g = u.properties.aTextSize, v = !l, x = e[n] * d;
6801
6801
  let b = i.set(Ti, m[x], m[x + 1], 2 === d ? 0 : m[x + 2]);
6802
6802
  const A = nn(ki, b, o, f.width, f.height);
6803
- if (a.set(Oi, A[0], A[1], A[0], A[1]), f.isOffscreen(Oi)) return c || Vi(y, e, n, r),
6803
+ if (a.set(Ii, A[0], A[1], A[0], A[1]), f.isOffscreen(Ii)) return c || Vi(y, e, n, r),
6804
6804
  !1;
6805
6805
  v && (b = A);
6806
6806
  const w = v ? 1 : u.properties.tileExtent / this.layer.options.tileSize[0];
6807
6807
  let _ = !0;
6808
6808
  const S = e[n], M = e[r - 1], P = g ? g[S] : t.properties.textSize, T = this.ns(t, P, s, S, M, b, w, l);
6809
6809
  if (null === T) return Vi(y, e, n, r), !1;
6810
- const k = M - S <= 3, O = t.material.uniforms, I = 1 === O.pitchWithMap, C = Math.floor(T / 2), F = T % 2;
6810
+ const k = M - S <= 3, I = t.material.uniforms, O = 1 === I.pitchWithMap, C = Math.floor(T / 2), F = T % 2;
6811
6811
  for (let i = n; i < r; i += 6) {
6812
6812
  const o = e[i];
6813
6813
  let a;
6814
- if (a = C || i !== n || k ? C || i !== r - 6 || k ? yi.call(this, Mi, t, P, s, o, b, w, C) : Li : Hi,
6814
+ if (a = C || i !== n || k ? C || i !== r - 6 || k ? yi.call(this, Mi, t, P, s, o, b, w, C) : Li : Di,
6815
6815
  !a) {
6816
6816
  _ = !1, c || Vi(y, e, n, r);
6817
6817
  break;
6818
6818
  }
6819
6819
  let l = a[2];
6820
6820
  F && (l -= Math.PI / 2);
6821
- const f = un(Ii, l, 0, O.rotateWithMap, O.pitchWithMap);
6821
+ const f = un(Oi, l, 0, I.rotateWithMap, I.pitchWithMap);
6822
6822
  for (let t = 0; t < 4; t++) h.set(Ci, p[2 * (o + t)] / 10, p[2 * (o + t) + 1] / 10),
6823
- h.scale(Ci, Ci, P / 24), h.transformMat2(Ci, Ci, f), I ? (h.multiply(Ci, Ci, Ei),
6824
- h.add(Fi, Ci, a)) : (h.multiply(Fi, a, Ei), h.add(Fi, Ci, Fi)), Di[0] = 10 * Fi[0],
6825
- Di[1] = 10 * Fi[1], y[2 * (o + t)] === Di[0] && y[2 * (o + t) + 1] === Di[1] || (y.dirty = !0,
6826
- y[2 * (o + t)] = Di[0], y[2 * (o + t) + 1] = Di[1]);
6823
+ h.scale(Ci, Ci, P / 24), h.transformMat2(Ci, Ci, f), O ? (h.multiply(Ci, Ci, Ei),
6824
+ h.add(Fi, Ci, a)) : (h.multiply(Fi, a, Ei), h.add(Fi, Ci, Fi)), Hi[0] = 10 * Fi[0],
6825
+ Hi[1] = 10 * Fi[1], y[2 * (o + t)] === Hi[0] && y[2 * (o + t) + 1] === Hi[1] || (y.dirty = !0,
6826
+ y[2 * (o + t)] = Hi[0], y[2 * (o + t) + 1] = Hi[1]);
6827
6827
  }
6828
6828
  return _;
6829
6829
  }
6830
6830
  ns(t, e, n, i, r, s, o, a) {
6831
6831
  const l = r - i <= 3, h = this.getMap();
6832
- return l ? 0 : vi.call(this, Hi, Li, t, e, n, i, r, s, o, h.width / h.height, a);
6832
+ return l ? 0 : vi.call(this, Di, Li, t, e, n, i, r, s, o, h.width / h.height, a);
6833
6833
  }
6834
6834
  isBoxCollides(t, e, n, i, r, s) {
6835
6835
  return this.isLabelCollides(0, t, e, n, i, r, s);
@@ -6840,7 +6840,7 @@ class Ni extends $e {
6840
6840
  }) : t.material && delete t.material.uniforms.texture), super.deleteMesh(t, e));
6841
6841
  }
6842
6842
  delete() {
6843
- super.delete(), this.Kr.dispose(), delete this.Zr, this.rs && this.rs.dispose();
6843
+ super.delete(), this.$r.dispose(), delete this.Zr, this.rs && this.rs.dispose();
6844
6844
  }
6845
6845
  needClearStencil() {
6846
6846
  return !0;
@@ -6848,23 +6848,23 @@ class Ni extends $e {
6848
6848
  init() {
6849
6849
  const t = this.regl;
6850
6850
  this.renderer = new n.Renderer(t);
6851
- const {uniforms: e, extraCommandProps: i} = Nn.call(this, this.layer, this.sceneConfig);
6851
+ const {uniforms: e, extraCommandProps: i} = Rn.call(this, this.layer, this.sceneConfig);
6852
6852
  this.shader = new n.MeshShader({
6853
- vert: qn,
6854
- frag: Yn,
6853
+ vert: Yn,
6854
+ frag: qn,
6855
6855
  uniforms: e,
6856
6856
  extraCommandProps: i
6857
6857
  });
6858
6858
  let r = i;
6859
6859
  if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (r = Jt({}, i),
6860
- r.stencil = Jt({}, i.stencil), r.stencil.enable = !0), this.Kr = new n.MeshShader({
6860
+ r.stencil = Jt({}, i.stencil), r.stencil.enable = !0), this.$r = new n.MeshShader({
6861
6861
  vert: xi,
6862
- frag: Yn,
6862
+ frag: qn,
6863
6863
  uniforms: e,
6864
6864
  extraCommandProps: r
6865
6865
  }), this.pickingFBO) {
6866
6866
  const t = new n.FBORayPicking(this.renderer, {
6867
- vert: "#define PICKING_MODE 1\n" + qn,
6867
+ vert: "#define PICKING_MODE 1\n" + Yn,
6868
6868
  uniforms: e,
6869
6869
  extraCommandProps: {
6870
6870
  viewport: this.pickingViewport
@@ -6904,10 +6904,10 @@ class Ni extends $e {
6904
6904
  }
6905
6905
  }
6906
6906
 
6907
- const Ri = /\{([\w_]+)\}/g;
6907
+ const Ni = /\{([\w_]+)\}/g;
6908
6908
 
6909
6909
  function zi(t, e) {
6910
- return t.replace(Ri, (function(t, n) {
6910
+ return t.replace(Ni, (function(t, n) {
6911
6911
  if (!e) return "";
6912
6912
  const i = e[n];
6913
6913
  return null == i ? "" : Array.isArray(i) ? i.join() : i;
@@ -6922,12 +6922,12 @@ function Vi(t, e, n, i) {
6922
6922
  }
6923
6923
  }
6924
6924
 
6925
- function Ui(t, e) {
6925
+ function ji(t, e) {
6926
6926
  const n = t.uniforms.level - e.uniforms.level;
6927
6927
  return 0 === n ? t.properties.meshKey - e.properties.meshKey : n;
6928
6928
  }
6929
6929
 
6930
- var ji = "#define SHADER_NAME NATIVE_POINT\n#include <gl2_vert>\nattribute vec3 aPosition;\nuniform mat4 projViewModelMatrix;\nuniform float markerSize;\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n gl_Position = projViewModelMatrix * vec4(aPosition, 1.);\n gl_PointSize = markerSize;\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#endif\n}";
6930
+ var Ui = "#define SHADER_NAME NATIVE_POINT\n#include <gl2_vert>\nattribute vec3 aPosition;\nuniform mat4 projViewModelMatrix;\nuniform float markerSize;\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n gl_Position = projViewModelMatrix * vec4(aPosition, 1.);\n gl_PointSize = markerSize;\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#endif\n}";
6931
6931
 
6932
6932
  const Gi = {
6933
6933
  markerFill: [ 0, 0, 0 ],
@@ -6965,7 +6965,7 @@ class Wi extends Ee {
6965
6965
  width: () => this.canvas ? this.canvas.width : 1,
6966
6966
  height: () => this.canvas ? this.canvas.height : 1
6967
6967
  }, i = this.layer.getRenderer().isEnableTileStencil && this.layer.getRenderer().isEnableTileStencil(), s = {
6968
- vert: ji,
6968
+ vert: Ui,
6969
6969
  frag: "#define SHADER_NAME NATIVE_POINT\nprecision mediump float;\n#include <gl2_frag>\n#ifdef USE_CIRCLE\n#if __VERSION__ == 100\n#ifdef GL_OES_standard_derivatives\n#define STANDARD_DERIVATIVES_ENABLED 1\n#extension GL_OES_standard_derivatives : enable\n#endif\n#else\n#define STANDARD_DERIVATIVES_ENABLED 1\n#endif\n#endif\nuniform vec3 markerFill;\nuniform float markerOpacity;\nvoid main() {\n float c = 1.;\n#ifdef USE_CIRCLE\nfloat r = .0, d = .0;\n vec2 e = 2. * gl_PointCoord - 1.;\n r = dot(e, e);\n if(r > 1.) {\n discard;\n }\n#ifdef STANDARD_DERIVATIVES_ENABLED\nd = fwidth(r);\n c = 1. - smoothstep(1. - d, 1. + d, r);\n#endif\n#endif\nglFragColor = vec4(markerFill, 1.) * markerOpacity * c;\n#if __VERSION__ == 100\ngl_FragColor = glFragColor;\n#endif\n}",
6970
6970
  uniforms: [ {
6971
6971
  name: "projViewModelMatrix",
@@ -7005,7 +7005,7 @@ class Wi extends Ee {
7005
7005
  }
7006
7006
  };
7007
7007
  this.shader = new n.MeshShader(s), this.shader.version = 300, this.pickingFBO && (this.picking = [ new n.FBORayPicking(this.renderer, {
7008
- vert: "#define PICKING_MODE 1\n" + ji,
7008
+ vert: "#define PICKING_MODE 1\n" + Ui,
7009
7009
  uniforms: [ {
7010
7010
  name: "projViewModelMatrix",
7011
7011
  type: "function",
@@ -7122,9 +7122,9 @@ class Xi extends Ee {
7122
7122
  }
7123
7123
  }
7124
7124
 
7125
- const qi = [ 1, 1, 1 ], Yi = [ 1, 1, 1, 1 ], Ji = [ 0, 0 ];
7125
+ const Yi = [ 1, 1, 1 ], qi = [ 1, 1, 1, 1 ], Ji = [ 0, 0 ];
7126
7126
 
7127
- class Zi extends Ie {
7127
+ class Zi extends Oe {
7128
7128
  supportRenderMode(t) {
7129
7129
  return this.isAnimating() ? "fxaa" === t || "fxaaAfterTaa" === t : "taa" === t || "fxaa" === t;
7130
7130
  }
@@ -7135,9 +7135,9 @@ class Zi extends Ie {
7135
7135
  if (!this.material) return this.setToRedraw(), null;
7136
7136
  const {geometry: o, symbolIndex: a} = t, l = new n.Mesh(o, this.material);
7137
7137
  if (this.sceneConfig.animation) {
7138
- qi[2] = .01;
7138
+ Yi[2] = .01;
7139
7139
  const t = [];
7140
- r.fromScaling(t, qi), r.multiply(t, e, t), e = t;
7140
+ r.fromScaling(t, Yi), r.multiply(t, e, t), e = t;
7141
7141
  }
7142
7142
  const h = this.getSymbolDef(a), c = this.getFnTypeConfig(a);
7143
7143
  ue(o, h, c);
@@ -7158,7 +7158,7 @@ class Zi extends Ie {
7158
7158
  return oe(t) ? t : 0;
7159
7159
  }
7160
7160
  });
7161
- } else te(l.uniforms, "polygonFill", d, "polygonFill", Yi, ie(this.colorCache)),
7161
+ } else te(l.uniforms, "polygonFill", d, "polygonFill", qi, ie(this.colorCache)),
7162
7162
  te(l.uniforms, "polygonOpacity", d, "polygonOpacity", 1);
7163
7163
  if (o.data.aColor && (u.HAS_COLOR = 1), o.data.aLineWidth && (u.HAS_LINE_WIDTH = 1),
7164
7164
  o.data.aLineHeight && (u.HAS_LINE_HEIGHT = 1), o.data.aOpacity) {
@@ -7214,7 +7214,7 @@ class Zi extends Ie {
7214
7214
  si(t, e) {
7215
7215
  if (null !== e) {
7216
7216
  const n = t.localTransform;
7217
- 0 === e && (e = .01), qi[2] = e, r.fromScaling(n, qi), r.multiply(n, t.properties.tileTransform, n),
7217
+ 0 === e && (e = .01), Yi[2] = e, r.fromScaling(n, Yi), r.multiply(n, t.properties.tileTransform, n),
7218
7218
  t.setLocalTransform(n);
7219
7219
  } else t.setLocalTransform(t.properties.tileTransform);
7220
7220
  t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.ss = !0),
@@ -7237,7 +7237,7 @@ class Zi extends Ie {
7237
7237
  define: "HAS_COLOR",
7238
7238
  evaluate: e => {
7239
7239
  let i = n(t.getZoom(), e);
7240
- return Array.isArray(i) || (i = this.colorCache[i] = this.colorCache[i] || I(i).unitArray()),
7240
+ return Array.isArray(i) || (i = this.colorCache[i] = this.colorCache[i] || O(i).unitArray()),
7241
7241
  i = ne(i), i;
7242
7242
  }
7243
7243
  }, {
@@ -7272,17 +7272,17 @@ class Zi extends Ie {
7272
7272
  return t.material && this.os(t.material), n;
7273
7273
  }
7274
7274
  Wn(t, e) {
7275
- return $i(t) !== $i(e);
7275
+ return Ki(t) !== Ki(e);
7276
7276
  }
7277
7277
  }
7278
7278
 
7279
- function $i(t) {
7279
+ function Ki(t) {
7280
7280
  if (!t || !t.material) return !1;
7281
7281
  for (const e in t.material) if (e.indexOf("Texture") > 0 && t.material[e]) return !0;
7282
7282
  return !1;
7283
7283
  }
7284
7284
 
7285
- class Ki extends Zi {
7285
+ class $i extends Zi {
7286
7286
  createGeometry(t) {
7287
7287
  const e = t.data, i = this.getSymbols()[0];
7288
7288
  if (i.material && i.material.extrusionOpacity) {
@@ -7416,7 +7416,7 @@ class Ki extends Zi {
7416
7416
 
7417
7417
  const Qi = [ 1, 1, 1 ];
7418
7418
 
7419
- class tr extends Ie {
7419
+ class tr extends Oe {
7420
7420
  constructor(t, e, n, i, r) {
7421
7421
  if (super(t, e, n, i, r), m(this.symbolDef[0].lineColor)) {
7422
7422
  const t = e.getMap(), n = v(this.symbolDef.lineColor);
@@ -7817,7 +7817,7 @@ const rr = [], sr = [], or = [ 0, 0, 0 ], ar = [ 0, 0, 0 ], lr = [ 1, 1, 1 ], hr
7817
7817
  n || (n = !0);
7818
7818
  let e = r.speed;
7819
7819
  const s = !!r.loop;
7820
- Kt(e) && (e = 1), this._s[i].updateAnimation(t.timestamp, s, e);
7820
+ $t(e) && (e = 1), this._s[i].updateAnimation(t.timestamp, s, e);
7821
7821
  }
7822
7822
  }
7823
7823
  n && this.setToRedraw(!0), super.prepareRender(t);
@@ -7853,20 +7853,20 @@ const rr = [], sr = [], or = [ 0, 0, 0 ], ar = [ 0, 0, 0 ], lr = [ 1, 1, 1 ], hr
7853
7853
  if (this._s) return;
7854
7854
  this._s = [];
7855
7855
  const t = this.layer.getRenderer(), e = this.getSymbols();
7856
- this.Os = 0;
7856
+ this.Is = 0;
7857
7857
  for (let i = 0; i < e.length; i++) {
7858
7858
  const r = e[i].url;
7859
7859
  if (t.isCachePlaced(r)) continue;
7860
7860
  const s = t.fetchCache(r);
7861
- s ? (this._s[i] = [ s ], this.ws[i] = s.getMeshesInfo(), this.Os++, t.addToCache(r)) : (t.placeCache(r),
7861
+ s ? (this._s[i] = [ s ], this.ws[i] = s.getMeshesInfo(), this.Is++, t.addToCache(r)) : (t.placeCache(r),
7862
7862
  n.GLTFHelper.load(r).then(s => {
7863
7863
  const o = n.GLTFHelper.exportGLTFPack(s, this.regl);
7864
7864
  this._s[i] = [ o ], this.ws[i] = o.getMeshesInfo(), t.addToCache(r, o, t => {
7865
7865
  t.dispose();
7866
- }), this.Os++, this.Os >= e.length && (this.As = !0), this.setToRedraw(!0);
7866
+ }), this.Is++, this.Is >= e.length && (this.As = !0), this.setToRedraw(!0);
7867
7867
  }));
7868
7868
  }
7869
- this.Os >= e.length && (this.As = !0);
7869
+ this.Is >= e.length && (this.As = !0);
7870
7870
  }
7871
7871
  getPickingVert() {
7872
7872
  return "\n attribute vec3 aPosition;\n uniform mat4 projViewModelMatrix;\n uniform mat4 modelMatrix;\n uniform mat4 positionMatrix;\n //引入fbo picking的vert相关函数\n #include <fbo_picking_vert>\n #include <get_output>\n void main()\n {\n mat4 localPositionMatrix = getPositionMatrix();\n vec4 localPosition = getPosition(aPosition);\n\n gl_Position = projViewModelMatrix * localPositionMatrix * localPosition;\n //传入gl_Position的depth值\n fbo_picking_setData(gl_Position.w, true);\n }";
@@ -7894,7 +7894,7 @@ const rr = [], sr = [], or = [ 0, 0, 0 ], ar = [ 0, 0, 0 ], lr = [ 1, 1, 1 ], hr
7894
7894
  }
7895
7895
  };
7896
7896
 
7897
- class dr extends(ur(Ki)){
7897
+ class dr extends(ur($i)){
7898
7898
  getMaterialClazz(t) {
7899
7899
  return t.diffuseFactor ? n.PhongSpecularGlossinessMaterial : n.PhongMaterial;
7900
7900
  }
@@ -7934,7 +7934,7 @@ class vr extends Ee {
7934
7934
  }
7935
7935
  callShader(t, e) {
7936
7936
  super.callShader(t, e), this.transformWater();
7937
- const n = this.Is(this.getMap(), e);
7937
+ const n = this.Os(this.getMap(), e);
7938
7938
  this.renderer.render(this.Cs, n, this.Fs, this.getRenderFBO(e));
7939
7939
  }
7940
7940
  addMesh(t, e) {
@@ -7958,7 +7958,7 @@ class vr extends Ee {
7958
7958
  this.createIBLTextures();
7959
7959
  const e = this.regl;
7960
7960
  this.renderer = new n.Renderer(e), this.createGround(), this.ni(t), this.pickingFBO && (this.picking = [ new n.FBORayPicking(this.renderer, {
7961
- vert: De,
7961
+ vert: He,
7962
7962
  uniforms: [ {
7963
7963
  name: "projViewModelMatrix",
7964
7964
  type: "function",
@@ -7970,36 +7970,36 @@ class vr extends Ee {
7970
7970
  extraCommandProps: {
7971
7971
  viewport: this.pickingViewport
7972
7972
  }
7973
- }, this.pickingFBO) ]), this.Ds();
7973
+ }, this.pickingFBO) ]), this.Hs();
7974
7974
  }
7975
- Ds() {
7975
+ Hs() {
7976
7976
  const t = this.regl;
7977
- this.Hs = t.texture(2), this.Ls = [ 2, 2 ];
7977
+ this.Ds = t.texture(2), this.Ls = [ 2, 2 ];
7978
7978
  const e = this.getSymbol({
7979
7979
  index: 0
7980
7980
  }), n = e.texWaveNormal, i = this.getCachedTexture(n), r = this;
7981
- if (i) i.loading || (this.Ns = this.Rs(t, i)); else {
7981
+ if (i) i.loading || (this.Rs = this.Ns(t, i)); else {
7982
7982
  const e = new Image;
7983
7983
  e.loading = !0, e.onload = function() {
7984
- delete this.loading, r.Ns = r.Rs(t, this), this.Ls = [ this.width, this.height ],
7984
+ delete this.loading, r.Rs = r.Ns(t, this), this.Ls = [ this.width, this.height ],
7985
7985
  r.setToRedraw();
7986
7986
  }, e.onerror = () => {
7987
7987
  console.error("invalid water wave normal texture:" + n);
7988
7988
  }, this.addCachedTexture(n, e), e.src = n;
7989
7989
  }
7990
7990
  const s = e.texWavePerturbation, o = this.getCachedTexture(s);
7991
- if (o) o.loading || (this.zs = this.Rs(t, o)); else {
7991
+ if (o) o.loading || (this.zs = this.Ns(t, o)); else {
7992
7992
  const e = new Image;
7993
7993
  e.loading = !0, e.onload = function() {
7994
- delete this.loading, r.zs = r.Rs(t, this), this.Ls = [ this.width, this.height ],
7994
+ delete this.loading, r.zs = r.Ns(t, this), this.Ls = [ this.width, this.height ],
7995
7995
  r.setToRedraw();
7996
7996
  }, e.onerror = () => {
7997
7997
  console.error("invalid water wave perturbation texture:" + s);
7998
7998
  }, this.addCachedTexture(s, e), e.src = s;
7999
7999
  }
8000
8000
  }
8001
- Rs(t, e) {
8002
- return this.Hs ? t.texture({
8001
+ Ns(t, e) {
8002
+ return this.Ds ? t.texture({
8003
8003
  width: this.Ls[0],
8004
8004
  height: this.Ls[1],
8005
8005
  mag: "linear",
@@ -8119,7 +8119,7 @@ class vr extends Ee {
8119
8119
  };
8120
8120
  return this.setIncludeUniformValues(i, e), i;
8121
8121
  }
8122
- Is(t, e) {
8122
+ Os(t, e) {
8123
8123
  const {iblTexes: n} = this.getIBLRes(), i = t.projViewMatrix, r = t.getLightManager();
8124
8124
  let s = r && r.getDirectionalLight() || {};
8125
8125
  const o = r && r.getAmbientLight() || {}, a = this.getSymbol(mr), l = this.Vs = this.Vs || [], h = {
@@ -8136,8 +8136,8 @@ class vr extends Ee {
8136
8136
  lightColor: s.color || yr.color,
8137
8137
  camPos: t.cameraPosition,
8138
8138
  timeElapsed: a.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (a.waterSpeed || 1) * 1e4) : 0,
8139
- normalTexture: this.Ns || this.Hs,
8140
- heightTexture: this.zs || this.Hs,
8139
+ normalTexture: this.Rs || this.Ds,
8140
+ heightTexture: this.zs || this.Ds,
8141
8141
  waveParams: [ .09, a.uvScale || 3, .03, -.5 ],
8142
8142
  waterDir: xr(l, a.waterDirection || 0),
8143
8143
  waterBaseColor: a.waterBaseColor || [ .1451, .2588, .4863, 1 ],
@@ -8148,7 +8148,7 @@ class vr extends Ee {
8148
8148
  h;
8149
8149
  }
8150
8150
  delete() {
8151
- super.delete(), this.Hs && (this.Hs.destroy(), delete this.Hs), this.Ns && this.Ns.destroy(),
8151
+ super.delete(), this.Ds && (this.Ds.destroy(), delete this.Ds), this.Rs && this.Rs.destroy(),
8152
8152
  this.zs && this.zs.destroy(), this.shader && this.shader.dispose(), this.Cs && this.Cs.dispose(),
8153
8153
  this.Es && (this.Es.geometry.dispose(), this.Es.material && this.Es.material.dispose(),
8154
8154
  this.Es.dispose(), delete this.Es), this.disposeIBLTextures();
@@ -8174,53 +8174,53 @@ function xr(t, e) {
8174
8174
  return n = e, e = Math.PI * n / 180, t[0] = Math.sin(e), t[1] = Math.cos(e), t;
8175
8175
  }
8176
8176
 
8177
- const br = qt("fill", Ne);
8177
+ const br = Yt("fill", Re);
8178
8178
 
8179
8179
  br.registerAt(ht);
8180
8180
 
8181
- const Ar = qt("line", ze);
8181
+ const Ar = Yt("line", ze);
8182
8182
 
8183
8183
  Ar.registerAt(ht);
8184
8184
 
8185
- const wr = qt("line-gradient", Ve);
8185
+ const wr = Yt("line-gradient", Ve);
8186
8186
 
8187
8187
  wr.registerAt(ht);
8188
8188
 
8189
- const _r = qt("icon", li);
8189
+ const _r = Yt("icon", li);
8190
8190
 
8191
8191
  _r.registerAt(ht);
8192
8192
 
8193
- const Sr = qt("text", Ni);
8193
+ const Sr = Yt("text", Ri);
8194
8194
 
8195
8195
  Sr.registerAt(ht);
8196
8196
 
8197
- const Mr = qt("native-line", Xi);
8197
+ const Mr = Yt("native-line", Xi);
8198
8198
 
8199
8199
  Mr.registerAt(ht);
8200
8200
 
8201
- qt("native-point", Wi).registerAt(ht);
8201
+ Yt("native-point", Wi).registerAt(ht);
8202
8202
 
8203
- const Pr = qt("phong", Ki);
8203
+ const Pr = Yt("phong", $i);
8204
8204
 
8205
8205
  Pr.registerAt(ht);
8206
8206
 
8207
- const Tr = qt("wireframe", tr);
8207
+ const Tr = Yt("wireframe", tr);
8208
8208
 
8209
8209
  Tr.registerAt(ht);
8210
8210
 
8211
- const kr = qt("lit", ir);
8211
+ const kr = Yt("lit", ir);
8212
8212
 
8213
8213
  kr.registerAt(ht);
8214
8214
 
8215
- const Or = qt("gltf-phong", dr);
8215
+ const Ir = Yt("gltf-phong", dr);
8216
8216
 
8217
- Or.registerAt(ht);
8217
+ Ir.registerAt(ht);
8218
8218
 
8219
- const Ir = qt("gltf-lit", pr);
8219
+ const Or = Yt("gltf-lit", pr);
8220
8220
 
8221
- Ir.registerAt(ht);
8221
+ Or.registerAt(ht);
8222
8222
 
8223
- const Cr = qt("heatmap", class extends Ee {
8223
+ const Cr = Yt("heatmap", class extends Ee {
8224
8224
  createFnTypeConfig(t, e) {
8225
8225
  const n = g(e.heatWeight), i = new Int16Array(1);
8226
8226
  return [ {
@@ -8261,7 +8261,7 @@ const Cr = qt("heatmap", class extends Ee {
8261
8261
  o;
8262
8262
  }
8263
8263
  callRenderer(t, e) {
8264
- this.Us.render(this.scene, t, this.getRenderFBO(e));
8264
+ this.js.render(this.scene, t, this.getRenderFBO(e));
8265
8265
  }
8266
8266
  getUniformValues(t) {
8267
8267
  const {projViewMatrix: e} = t;
@@ -8275,7 +8275,7 @@ const Cr = qt("heatmap", class extends Ee {
8275
8275
  return this.scene.getMeshes();
8276
8276
  }
8277
8277
  delete() {
8278
- super.delete(...arguments), this.Us.dispose(), delete this.Us;
8278
+ super.delete(...arguments), this.js.dispose(), delete this.js;
8279
8279
  }
8280
8280
  init() {
8281
8281
  const t = this.regl;
@@ -8294,17 +8294,17 @@ const Cr = qt("heatmap", class extends Ee {
8294
8294
  zpass: "replace"
8295
8295
  }
8296
8296
  }, r = this.getPolygonOffset(), s = this.getSymbols()[0];
8297
- this.Us = new f(this.regl, this.sceneConfig, this.layer, s.heatmapColor, i, r);
8297
+ this.js = new f(this.regl, this.sceneConfig, this.layer, s.heatmapColor, i, r);
8298
8298
  }
8299
8299
  });
8300
8300
 
8301
8301
  Cr.registerAt(ht);
8302
8302
 
8303
- const Fr = qt("water", vr);
8303
+ const Fr = Yt("water", vr);
8304
8304
 
8305
8305
  Fr.registerAt(ht), bt.registerPainter("lit", ir), bt.registerPainter("icon", li),
8306
- bt.registerPainter("fill", Ne), bt.registerPainter("line", ze), bt.registerPainter("line-gradient", Ve),
8307
- bt.registerPainter("water", vr), ht.VERSION = "0.63.10", bt.VERSION = "0.63.10";
8306
+ bt.registerPainter("fill", Re), bt.registerPainter("line", ze), bt.registerPainter("line-gradient", Ve),
8307
+ bt.registerPainter("water", vr), ht.VERSION = "0.63.11", bt.VERSION = "0.63.11";
8308
8308
 
8309
8309
  if (e.mat4.create(), e.transcoders) {
8310
8310
  const n = t.Map.VERSION;
@@ -8316,6 +8316,6 @@ if (e.mat4.create(), e.transcoders) {
8316
8316
  }));
8317
8317
  } else t.registerWorkerAdapter("@maptalks/vt", E);
8318
8318
 
8319
- export { Ne as FillPainter, br as FillPlugin, Or as GLTFPhongPlugin, Ir as GLTFStandardPlugin, gt as GeoJSONVectorTileLayer, Cr as HeatmapPlugin, li as IconPainter, _r as IconPlugin, wr as LineGradientPlugin, ze as LinePainter, Ar as LinePlugin, Ut as LineStringLayer, kr as LitPlugin, yt as MapboxVectorTileLayer, Xi as NativeLinePainter, Mr as NativeLinePlugin, Wi as NativePointPainter, Ki as PhongPainter, Pr as PhongPlugin, Vt as PointLayer, jt as PolygonLayer, Ni as TextPainter, Sr as TextPlugin, bt as Vector3DLayer, ht as VectorTileLayer, et as VectorTileLayerRenderer, Fr as WaterPlugin, tr as WireframePainter, Tr as WireframePlugin };
8319
+ export { Re as FillPainter, br as FillPlugin, Ir as GLTFPhongPlugin, Or as GLTFStandardPlugin, gt as GeoJSONVectorTileLayer, Cr as HeatmapPlugin, li as IconPainter, _r as IconPlugin, wr as LineGradientPlugin, ze as LinePainter, Ar as LinePlugin, jt as LineStringLayer, kr as LitPlugin, yt as MapboxVectorTileLayer, Xi as NativeLinePainter, Mr as NativeLinePlugin, Wi as NativePointPainter, $i as PhongPainter, Pr as PhongPlugin, Vt as PointLayer, Ut as PolygonLayer, Ri as TextPainter, Sr as TextPlugin, bt as Vector3DLayer, ht as VectorTileLayer, et as VectorTileLayerRenderer, Fr as WaterPlugin, tr as WireframePainter, Tr as WireframePlugin };
8320
8320
 
8321
- "undefined" != typeof console && console.log("@maptalks/vt v0.63.10");
8321
+ "undefined" != typeof console && console.log("@maptalks/vt v0.63.11");