@maptalks/vt 0.108.5 → 0.109.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @maptalks/vt v0.108.5
2
+ * @maptalks/vt v0.109.0
3
3
  * LICENSE : undefined
4
4
  * (c) 2016-2025 maptalks.org
5
5
  */
@@ -21,7 +21,7 @@
21
21
  })), t.default = e, Object.freeze(t);
22
22
  }
23
23
  var r = i(t), o = i(n);
24
- const s = "${", a = `function(t){let e;const n={width:100,height:10};let r=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),r=!0}catch(t){r=!1}function i(){if(!e){const{width:t,height:i}=n;r?e=new OffscreenCanvas(t,i):(e=document.createElement("canvas"),e.width=t,e.height=i)}return e}class o{constructor(t,e={}){if(!Array.isArray(t))return void console.error("colors is not array");if(t.length<2)return void console.error("colors.length should >1");this.colors=t;let r=1/0,i=-1/0;for(let e=0,n=t.length;e<n;e++){const n=t[e][0];r=Math.min(n,r),i=Math.max(n,i)}this.min=r,this.max=i,this.valueOffset=this.max-this.min,this.options=Object.assign({},n,e),this._initImgData()}getImageData(){return this.imgData}_initImgData(){const t=i(),{width:e,height:n}=this.options;t.width=e,t.height=n;const r=t.getContext("2d");r.clearRect(0,0,t.width,t.height);const o=r.createLinearGradient(0,0,t.width,0),{colors:s,valueOffset:a}=this;for(let t=0,e=s.length;t<e;t++){const[e,n]=s[t],r=(e-this.min)/a;o.addColorStop(r,n)}r.fillStyle=o,r.fillRect(0,0,t.width,t.height),this.imgData=r.getImageData(0,0,t.width,t.height)}getColor(t){t=Math.max(this.min,t);const e=((t=Math.min(t,this.max))-this.min)/this.valueOffset;let n=Math.round(e*this.imgData.width);n=Math.min(n,this.imgData.width-1);const r=4*n;return[this.imgData.data[r],this.imgData.data[r+1],this.imgData.data[r+2],this.imgData.data[r+3]]}}var s;function a(t){return null==t}function l(t){return!a(t)}function u(t){return""===t}function h(t,e){var n,r,i;if(w(t)){var o,s=t.stops&&"object"==typeof t.stops[0][0],a=s||l(t.property),u=s||!a,d=t.type||e||"exponential";if("exponential"===d)o=p;else if("interval"===d)o=f;else if("categorical"===d)o=c;else if("identity"===d)o=y;else if("color-interpolate"===d)o=g;else{if("calculate-expression"!==d)throw new Error('Unknown function type "'+d+'"');o=x}if(s){var m={},v=[];for(let e=0;e<t.stops.length;e++){var b=t.stops[e];void 0===m[b[0].zoom]&&(m[b[0].zoom]={zoom:b[0].zoom,type:t.type,property:t.property,default:t.default,stops:[]}),m[b[0].zoom].stops.push([b[0].value,b[1]])}for(let t in m)v.push([m[t].zoom,h(m[t])]);n=function(e,n){const r=p({stops:v,base:t.base},e)(e,n);return"function"==typeof r?r(e,n):r},r=!1,i=!1}else u?(n=function(e){const n=o(t,e);return"function"==typeof n?n(e):n},r=!0,i=!1):(n=function(e,n){const r=o(t,n?n[t.property]:null);return"function"==typeof r?r(e,n):r},r=!1,i=!0)}else n=function(){return t},r=!0,i=!0;return n.isZoomConstant=i,n.isFeatureConstant=r,n}function c(t,e){for(let n=0;n<t.stops.length;n++)if(e===t.stops[n][0])return t.stops[n][1];return t.default}function f(t,e){for(var n=0;n<t.stops.length&&!(e<t.stops[n][0]);n++);return t.stops[Math.max(n-1,0)][1]}function p(t,e){for(var n=l(t.base)&&!u(t.base)?t.base:1,r=0;!(r>=t.stops.length||e<=t.stops[r][0]);)r++;return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:m(e,n,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}"function"==typeof Map&&(s=new Map);const d={width:100,height:1};function g(t,e){const n=t.stops;if(n&&n.length>1){let t;if(s){const e=JSON.stringify(n);if(!s.has(e)){const t=new o(n,d);s.set(e,t)}t=s.get(e)}else t=new o(n,d);const[r,i,a,l]=t.getColor(e);return[r/255,i/255,a/255,l/255]}return n&&1===n.length?n[0][1]:null}function y(t,e){return n=e,r=t.default,l(n)?n:l(r)?r:l(i)?i:null;var n,r,i}function x(t,e){const n=String(t.property),r=t.expression,i=e;function o(e){return a(e)||u(e)||isNaN(e)?t.default:e}if(!l(e)||u(e)||isNaN(e)||e<0)return o(t.default);{const e=function t(e,n,r){const i=Number(r),o=String(n);return Array.isArray(e)?e.map((e=>t(e,o,i))):e===o?i:e}(r,n,i);return o(function e(n){if(!Array.isArray(n)){if("number"==typeof n)return n;throw new Error("Invalid expression format")}{const r=n[0];if(!["+","-","*","/"].includes(r))throw new Error(\`Unknown operator: ${s}r}\`);const i=n.slice(1).map((t=>e(t)));switch(r){case"+":return i.reduce(((t,e)=>t+e),0);case"-":return i.reduce(((t,e)=>t-e));case"*":return i.reduce(((t,e)=>t*e),1);case"/":return i.some((t=>0===t))?t.default:i.reduce(((t,e)=>t/e));default:throw new Error(\`Unsupported operator: ${s}r}\`)}}}(e))}}function m(t,e,n,r,i,o){return"function"==typeof i?function(){var s=i.apply(void 0,arguments),a=o.apply(void 0,arguments);return m(t,e,n,r,s,a)}:i.length?function(t,e,n,r,i,o){var s=[];for(let a=0;a<i.length;a++)s[a]=v(t,e,n,r,i[a],o[a]);return s}(t,e,n,r,i,o):v(t,e,n,r,i,o)}function v(t,e,n,r,i,o){var s,a=r-n,l=t-n;return i*(1-(s=1===e?l/a:(Math.pow(e,l)-1)/(Math.pow(e,a)-1)))+o*s}function w(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type||t.expression&&"calculate-expression"===t.type)}function b(t){return M(t,"interval")}function M(t,e){if(!w(t))return function(){return t};let n=!0,r=!0;const i=(t=JSON.parse(JSON.stringify(t))).stops;if(i)for(let t=0;t<i.length;t++)if(w(i[t][1])){const o=M(i[t][1],e);n=n&&o.isZoomConstant,r=r&&o.isFeatureConstant,i[t]=[i[t][0],o]}const o=h(t,e);return o.isZoomConstant=n&&o.isZoomConstant,o.isFeatureConstant=r&&o.isFeatureConstant,o}let P=0;const _="function"==typeof Object.assign;function I(t,...e){if(_)return Object.assign(t,...e),t;for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)t[e]=r[e]}return t}function A(t){return!k(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function S(t){return"number"==typeof t&&!isNaN(t)}function T(t){return!k(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function F(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function k(t){return null==t}function B(t){return w(t)&&t.property}const L="function"==typeof fetch&&"function"==typeof AbortController,C={jsonp:function(t,e){const n="_maptalks_jsonp_"+P++;t.match(/\\?/)?t+="&callback="+n:t+="?callback="+n;let r=document.createElement("script");return r.type="text/javascript",r.src=t,window[n]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(r),r=null,delete window[n]},document.getElementsByTagName("head")[0].appendChild(r),this},get:function(t,e,n){if(T(e)){const t=n;n=e,e=t}(e=e||{}).method&&(e.method=e.method.toUpperCase());const r="POST"===e.method;if(L){const r=new AbortController,i=e;i.signal=r.signal,i.referrerPolicy=i.referrerPolicy||"origin",i.method=i.method||"GET";const o=new Request(t,i);return e.returnJSON&&o.headers.set("Accept","application/json"),fetch(o).then((r=>{const i=this._parseResponse(r,e.returnJSON,e.responseType);i.message?(i.url=t,n(i)):i.then((t=>{"arraybuffer"===e.responseType?n(null,{data:t,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),contentType:r.headers.get("Content-Type")}):n(null,t)})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(console.error("Fetch error:",t,e),n(e))}))})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(console.error("Fetch error:",t,e),n(e))})),r}{const i=C._getClient(n);if(i.open(e.method||"GET",t,!0),e){for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);i.withCredentials="include"===e.credentials,e.responseType&&(i.responseType=e.responseType)}return i.send(r?e.body:null),i}},_parseResponse:(t,e,n)=>200!==t.status?{status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${s}t.status}): ${s}t.statusText}\`}:"arraybuffer"===n?t.arrayBuffer():e?t.json():t.text(),_wrapCallback:function(t,e){return function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?e({status:200,statusText:t.statusText,message:"http status 200 returned without content."}):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else e(null,t.responseText);else e({status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${s}t.status}): ${s}t.statusText}\`})}},_getClient:function(t){let e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return e.onreadystatechange=C._wrapCallback(e,t),e},getArrayBuffer(t,e,n){if(T(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",C.get(t,e,n)}};function Y(t,e,n,r,i=3){let o=r;const s=n-e>>1;let a,l=n-e;const u=t[e],h=t[e+1],c=t[n],f=t[n+1];for(let r=e+i;r<n;r+=i){const e=V(t[r],t[r+1],u,h,c,f);if(e>o)a=r,o=e;else if(e===o){const t=Math.abs(r-s);t<l&&(a=r,l=t)}}o>r&&(a-e>i&&Y(t,e,a,r,i),t[a+2]=o,n-a>i&&Y(t,a,n,r,i))}function V(t,e,n,r,i,o){let s=i-n,a=o-r;if(0!==s||0!==a){const l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return s=t-n,a=e-r,s*s+a*a}function O(t,e,n,r,i,o){const s={id:null==t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};i&&(s.layer=i);return function(t,e){const n=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)X(t,n,e);else if("Polygon"===r)X(t,n[0],e);else if("MultiLineString"===r)for(const r of n)X(t,r,e);else if("MultiPolygon"===r)for(const r of n)X(t,r[0],e)}(s,o?4:3),s}function X(t,e,n){for(let r=0;r<e.length;r+=n)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function N(t,e,n,r){if(r.layer=e,"FeatureCollection"===n.type)for(let e=0;e<n.features.length;e++)E(t,n.features[e],r,e);else"Feature"===n.type?E(t,n,r):E(t,{geometry:n},r)}function E(t,e,n,r){if(!e.geometry)return;const i=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2);let a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=r||0),"Point"===o)z(i,a,n);else if("MultiPoint"===o)for(const t of i)z(t,a,n);else if("LineString"===o)D(i,a,s,!1,n);else if("MultiLineString"===o){if(n.lineMetrics){for(const r of i)a=[],D(r,a,s,!1,n),t.push(O(l,"LineString",a,e.properties,n.layer,n.hasAltitude));return}$(i,a,s,!1,n)}else if("Polygon"===o)$(i,a,s,!0,n);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const i of e.geometry.geometries)E(t,{id:l,geometry:i,properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of i){const e=[];$(t,e,s,!0,n),a.push(e)}}t.push(O(l,o,a,e.properties,n.layer,n.hasAltitude))}function z(t,e,n){e.push(q(t[0]),j(t[1],n.projection),0),n.hasAltitude&&(t.length>2?e.push(t[2]):e.push(0))}function D(t,e,n,r,i){let o,s,a=0;for(let n=0;n<t.length;n++){const l=q(t[n][0]),u=j(t[n][1],i.projection);e.push(l,u,0),i.hasAltitude&&(t[n].length>2?e.push(t[n][2]):e.push(0)),n>0&&(a+=r?(o*u-l*s)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-s,2))),o=l,s=u}const l=i.hasAltitude?4:3,u=e.length-l;e[2]=1,Y(e,0,u,n,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function $(t,e,n,r,i){for(let o=0;o<t.length;o++){const s=[];D(t[o],s,n,r,i),e.push(s)}}function q(t){return t/360+.5}function j(t,e){if("EPSG:4326"===e)return(90-t)/360;const n=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return r<0?0:r>1?1:r}function G(t,e,n,r,i,o,s,a){if(r/=e,o>=(n/=e)&&s<r)return t;if(s<n||o>=r)return null;const l=[];for(const e of t){const t=e.geometry;let o=e.type;const s=0===i?e.minX:e.minY,u=0===i?e.maxX:e.maxY;if(s>=n&&u<r){l.push(e);continue}if(u<n||s>=r)continue;let h=[];if("Point"===o||"MultiPoint"===o)Z(t,h,n,r,i,a.hasAltitude);else if("LineString"===o)U(t,h,n,r,i,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)J(t,h,n,r,i,!1,a.hasAltitude);else if("Polygon"===o)J(t,h,n,r,i,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];J(e,t,n,r,i,!0,a.hasAltitude),t.length&&h.push(t)}if(h.length){if(a.lineMetrics&&"LineString"===o){for(const t of h)l.push(O(e.id,o,t,e.tags,e.layer,a.hasAltitude));continue}"LineString"!==o&&"MultiLineString"!==o||(1===h.length?(o="LineString",h=h[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===h.length?"Point":"MultiPoint"),l.push(O(e.id,o,h,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function Z(t,e,n,r,i,o){const s=o?4:3;for(let a=0;a<t.length;a+=s){const s=t[a+i];s>=n&&s<=r&&(H(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function U(t,e,n,r,i,o,s,a){let l=R(t);const u=0===i?W:K;let h,c,f=t.start;const p=a?4:3,d=o?t.length:t.length-p;for(let g=0;g<d;g+=p){const y=t[g],x=t[g+1],m=t[g+2];let v,w,b,M;o&&g===d-p?(v=t[0],w=t[1]):(v=t[g+p],w=t[g+p+1]),a&&(b=t[g+3],M=o&&g===d-p?t[3]:t[g+p+3]);const P=0===i?y:x,_=0===i?v:w;let I=!1;s&&(h=Math.sqrt(Math.pow(y-v,2)+Math.pow(x-w,2))),P<n?_>n&&(c=u(l,y,x,v,w,n),a&&l.push(Q(b,M,c)),s&&(l.start=f+h*c)):P>r?_<r&&(c=u(l,y,x,v,w,r),a&&l.push(Q(b,M,c)),s&&(l.start=f+h*c)):(H(l,y,x,m),a&&l.push(b)),_<n&&P>=n&&(c=u(l,y,x,v,w,n),a&&l.push(Q(b,M,c)),I=!0),_>r&&P<=r&&(c=u(l,y,x,v,w,r),a&&l.push(Q(b,M,c)),I=!0),!o&&I&&(s&&(l.end=f+h*c),e.push(l),l=R(t)),s&&(f+=h)}let g=t.length-p;if(!o){const e=t[g],o=t[g+1],s=t[g+2],u=0===i?e:o;if(u>=n&&u<=r&&H(l,e,o,s),u>=n&&u<=r&&a){const e=t[g+3];l.push(e)}}g=l.length-p,o&&g>=p&&(l[g]!==l[0]||l[g+1]!==l[1])&&(H(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function R(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,n,r,i,o,s){for(const a of t)U(a,e,n,r,i,o,!1,s)}function H(t,e,n,r){t.push(e,n,r)}function W(t,e,n,r,i,o){const s=(o-e)/(r-e);return H(t,o,n+(i-n)*s,1),s}function K(t,e,n,r,i,o){const s=(o-n)/(i-n);return H(t,e+(r-e)*s,o,1),s}function Q(t,e,n){return t+(e-t)*n}function tt(t,e,n){const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=o.type;let a;if("Point"===s||"MultiPoint"===s||"LineString"===s)a=et(o.geometry,e,n);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(et(t,e,n))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const r=[];for(const i of t)r.push(et(i,e,n));a.push(r)}}r.push(O(o.id,s,a,o.tags,o.layer,n))}return r}function et(t,e,n){const r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);const i=n?4:3;for(let o=0;o<t.length;o+=i)r.push(t[o]+e,t[o+1],t[o+2]),n&&r.push(t[o+3]);return r}function nt(t,e,n){if(t.transformed)return t;const r=1<<t.z,i=t.x,o=t.y,s=n?3:2;for(const a of t.features){const t=a.geometry,l=a.type;if(a.geometry=[],1===l)for(let l=0;l<t.length;l+=s)a.geometry.push(rt(t[l],t[l+1],e,r,i,o)),n&&a.geometry[a.geometry.length-1].push(t[l+2]);else for(let l=0;l<t.length;l++){const u=[];for(let a=0;a<t[l].length;a+=s)u.push(rt(t[l][a],t[l][a+1],e,r,i,o)),n&&u[u.length-1].push(t[l][a+2]);a.geometry.push(u)}}return t.transformed=!0,t}function rt(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function it(t,e,n,r,i){const o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)ot(s,e,o,i);return s}function ot(t,e,n,r){const i=e.geometry,o=e.type,s=[],a=r.hasAltitude?4:3;if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===o||"MultiPoint"===o)for(let e=0;e<i.length;e+=a)s.push(i[e],i[e+1]),r.hasAltitude&&s.push(i[e+3]),t.numPoints++,t.numSimplified++;else if("LineString"===o)at(s,i,t,n,!1,!1,r);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<i.length;e++)at(s,i[e],t,n,"Polygon"===o,0===e,r);else if("MultiPolygon"===o)for(let e=0;e<i.length;e++){const o=i[e];for(let e=0;e<o.length;e++)at(s,o[e],t,n,!0,0===e,r)}if(s.length){let n=e.tags||null;if("LineString"===o&&r.lineMetrics){n={};for(const t in e.tags)n[t]=e.tags[t];n.mapbox_clip_start=i.start/i.size,n.mapbox_clip_end=i.end/i.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:n};e.layer&&(a.layer=e.layer),null!==e.id&&(a.id=e.id),t.features.push(a)}}function st(t,e,n){return 0===t[e+2]&&t[e+3]>0&&n}function at(t,e,n,r,i,o,s){const a=r*r,{hasAltitude:l,disableFilter:u}=s,h=l?4:3;if(!u&&r>0&&e.size<(i?a:r))return void(n.numPoints+=e.length/h);const c=[];for(let t=0;t<e.length;t+=h)(0===r||e[t+2]>a||st(e,t,l))&&(n.numSimplified++,c.push(e[t],e[t+1]),l&&c.push(e[t+3])),n.numPoints++;i&&function(t,e,n){const r=n?3:2;let i=0;for(let e=0,n=t.length,o=n-r;e<n;o=e,e+=r)i+=(t[e]-t[o])*(t[e+1]+t[o+1]);if(i>0===e){const e=r,i=r-1,o=r-2;for(let s=0,a=t.length;s<a/2;s+=r){const r=t[s],l=t[s+1];let u;n&&(u=t[s+2]),t[s]=t[a-e-s],t[s+1]=t[a-i-s],n&&(t[s+2]=t[a-o-s]),t[a-e-s]=r,t[a-i-s]=l,n&&(t[a-o-s]=u)}}}(c,o,l),t.push(c)}C.getJSON=function(t,e,n){if(T(e)){const t=n;n=e,e=t}const r=function(t,e){const r="string"==typeof e?JSON.parse(e):e||null;n(t,r)};return e&&e.jsonp?C.jsonp(t,r):((e=e||{}).returnJSON=!0,C.get(t,e,r))};const lt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,hasAltitude:!1,disableFilter:!1,debug:0};class ut{constructor(t,e){const n=(e=this.options=function(t,e){for(const n in e)t[n]=e[n];return t}(Object.create(lt),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,e){const n=[];if(Array.isArray(t)){for(let r=0;r<t.length;r++)N(n,t[r].layer,t[r].data,e);return n}if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)E(n,t.features[r],e,r);else"Feature"===t.type?E(n,t,e):E(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){const n=e.buffer/e.extent;let r=t;const i=G(t,1,-1-n,n,0,-1,2,e),o=G(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=G(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=tt(i,1,e.hasAltitude).concat(r)),o&&(r=r.concat(tt(o,-1,e.hasAltitude)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,n,r,i,o,s){const a=[t,e,n,r],l=this.options,u=l.debug;for(;a.length;){r=a.pop(),n=a.pop(),e=a.pop(),t=a.pop();const h=1<<e,c=ht(e,n,r);let f=this.tiles[c];if(!f&&(u>1&&console.time("creation"),f=this.tiles[c]=it(t,e,n,r,l),this.tileCoords.push({z:e,x:n,y:r}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));const t=\`z${s}e}\`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){const t=i-e;if(n!==o>>t||r!==s>>t)continue}}if(f.source=null,0===t.length)continue;u>1&&console.time("clipping");const p=.5*l.buffer/l.extent,d=.5-p,g=.5+p,y=1+p;let x=null,m=null,v=null,w=null,b=G(t,h,n-p,n+g,0,f.minX,f.maxX,l),M=G(t,h,n+d,n+y,0,f.minX,f.maxX,l);t=null,b&&(x=G(b,h,r-p,r+g,1,f.minY,f.maxY,l),m=G(b,h,r+d,r+y,1,f.minY,f.maxY,l),b=null),M&&(v=G(M,h,r-p,r+g,1,f.minY,f.maxY,l),w=G(M,h,r+d,r+y,1,f.minY,f.maxY,l),M=null),u>1&&console.timeEnd("clipping"),a.push(x||[],e+1,2*n,2*r),a.push(m||[],e+1,2*n,2*r+1),a.push(v||[],e+1,2*n+1,2*r),a.push(w||[],e+1,2*n+1,2*r+1)}}getTile(t,e,n){t=+t,e=+e,n=+n;const r=this.options,{extent:i,debug:o}=r,{hasAltitude:s,wrapX:a}=r;if(t<0||t>24)return null;if(a){const n=1<<t;e=e+n&n-1}const l=ht(t,e,n);if(this.tiles[l])return nt(this.tiles[l],i,s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);let u,h=t,c=e,f=n;for(;!u&&h>0;)h--,c>>=1,f>>=1,u=this.tiles[ht(h,c,f)];return u&&u.source?(o>1&&(console.log("found parent tile z%d-%d-%d",h,c,f),console.time("drilling down")),this.splitTile(u.source,h,c,f,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[l]?nt(this.tiles[l],i,s):null):null}}function ht(t,e,n){return 32*((1<<t)*n+e)+t}function ct(t,e,n,r,i,o,s){const a=n&&Array.isArray(n[0]);for(let l=0,u=n.length;l<u;l++){t[e]=(a?n[l][0]:n[l].x)*r,t[e+1]=(a?n[l][1]:n[l].y)*r,s!==Float32Array&&(t[e]=Math.round(t[e]),t[e+1]=Math.round(t[e+1]));let h=i||0;Array.isArray(i)&&(h=i[l]),h=h?Math.round(r*h):0,t[e+2]=h,e+=3,o&&0!==l&&l!==u-1&&(t[e]=t[e-3],t[e+1]=t[e-2],t[e+2]=t[e-1],e+=3)}return t.trySetLength&&t.trySetLength(e),e}function ft(t,e,n,r){const i=t[3*e],o=t[3*e+1],s=t[3*n],a=t[3*n+1];return i===s&&(i<0||i>r)||o===a&&(o<0||o>r)}var pt="undefined"!=typeof Float32Array?Float32Array:Array;function dt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function gt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function yt(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function xt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function mt(t,e,n){return t[0]=e,t[1]=n,t}function vt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),function(){var t,e=(t=new pt(3),pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t)}(),function(){var t,e=(t=new pt(4),pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}(),function(){var t,e=(t=new pt(2),pt!=Float32Array&&(t[0]=0,t[1]=0),t)}();const wt=Math.PI/180,bt=6378137*Math.PI/180,Mt=85.0511287798;function Pt(t,e,n){if("EPSG:3857"===n)return function(t,e){const n=Mt,r=e[0],i=Math.max(Math.min(n,e[1]),-n);let o;o=0===i?0:Math.log(Math.tan((90+i)*wt/2))/wt;return t[0]=r*bt,t[1]=o*bt,t}(t,e);if("EPSG:4326"===n||"EPSG:4490"===n||"identity"===n)return _t(t,e);if("baidu"===n)return _t(t,e);throw new Error("unsupported projection:"+n)}function _t(t,e){return t[0]=e[0],t[1]=e[1],t}function It(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){0===t?function(t,e,n,r,i,o,s,a,l,u){const h=1/(100*o[0]),c=1/(100*o[1]),f=u&&u[0]||0,p=u&&u[1]||0,d=[0,0];for(let i=t;i<e;i+=3){const t=i/3*2,e=r[i]-f,o=r[i+1]-p;n[t]=d[0]+e/s*h/a,n[t+1]=d[1]-o/s*c/l}}(e,n,r,i,0,s,a,l,u,d):1===t&&function(t,e,n,r,i,o,s,a,l,u,h){if(!t)return;let c,f,p,d;0===t[4]?(c=t[0],f=t[1],p=t[2],d=t[3]):(c=t[1],f=t[2],p=t[3],d=t[0]);const g=vt(c,f),y=vt(f,p),x=[],m=[],v=[];for(let t=e;t<n;t+=3){const e=t/3*2;mt(x,(o.x/l+i[t]/s)*a,o.y/l*a+(h?i[t+1]:-i[t+1])/s*a),"EPSG:4326"!==u&&"EPSG:4490"!==u||Pt(x,x,"EPSG:3857"),At(m,x,c,f),At(v,x,d,c),r[e]=vt(c,m)/g,r[e+1]=vt(c,v)/y}}(h,e,n,r,i,o,a,c,f,p,!!d)}function At(t,e,n,r){const i=n[0]-r[0],o=n[1]-r[1];let s=(e[0]-n[0])*(n[0]-r[0])+(e[1]-n[1])*(n[1]-r[1]);return s/=i*i+o*o,t[0]=n[0]+s*i,t[1]=n[1]+s*o,t}function St(t,e,n,r,i){const o=3*e[n-1],s=3*e[n-1]+1,a=t[o],l=t[s];return u=r,h=i,c=a,f=l,Math.sqrt((c-u)*(c-u)+(f-h)*(f-h));var u,h,c,f}function Tt(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let o=Ft(t,0,i,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u;if(r&&(o=function(t,e,n,r){const i=[];for(let n=0,o=e.length;n<o;n++){const s=Ft(t,e[n]*r,n<o-1?e[n+1]*r:t.length,r,!1);s===s.next&&(s.steiner=!0),i.push(zt(s))}i.sort(Ot);for(let t=0;t<i.length;t++)n=Xt(i[t],n);return n}(t,e,o,n)),t.length>80*n){a=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=n;o<i;o+=n){const n=t[o],i=t[o+1];n<a&&(a=n),i<l&&(l=i),n>e&&(e=n),i>r&&(r=i)}u=Math.max(e-a,r-l),u=0!==u?32767/u:0}return Bt(o,s,n,a,l,u,0),s}function Ft(t,e,n,r,i){let o;if(i===function(t,e,n,r){let i=0;for(let o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}(t,e,n,r)>0)for(let i=e;i<n;i+=r)o=Wt(i/r|0,t[i],t[i+1],o);else for(let i=n-r;i>=e;i-=r)o=Wt(i/r|0,t[i],t[i+1],o);return o&&Gt(o,o.next)&&(Kt(o),o=o.next),o}function kt(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!Gt(r,r.next)&&0!==jt(r.prev,r,r.next))r=r.next;else{if(Kt(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function Bt(t,e,n,r,i,o,s){if(!t)return;!s&&o&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=Et(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n=1;do{let r,i=t;t=null;let o=null;for(e=0;i;){e++;let s=i,a=0;for(let t=0;t<n&&(a++,s=s.nextZ,s);t++);let l=n;for(;a>0||l>0&&s;)0!==a&&(0===l||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(e>1)}(i)}(t,r,i,o);let a=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ct(t,r,i,o):Lt(t))e.push(l.i,t.i,u.i),Kt(t),t=u.next,a=u.next;else if((t=u)===a){s?1===s?Bt(t=Yt(kt(t),e),e,n,r,i,o,2):2===s&&Vt(t,e,n,r,i,o):Bt(kt(t),e,n,r,i,o,1);break}}}function Lt(t){const e=t.prev,n=t,r=t.next;if(jt(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,h=Math.min(i,o,s),c=Math.min(a,l,u),f=Math.max(i,o,s),p=Math.max(a,l,u);let d=r.next;for(;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&$t(i,a,o,l,s,u,d.x,d.y)&&jt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ct(t,e,n,r){const i=t.prev,o=t,s=t.next;if(jt(i,o,s)>=0)return!1;const a=i.x,l=o.x,u=s.x,h=i.y,c=o.y,f=s.y,p=Math.min(a,l,u),d=Math.min(h,c,f),g=Math.max(a,l,u),y=Math.max(h,c,f),x=Et(p,d,e,n,r),m=Et(g,y,e,n,r);let v=t.prevZ,w=t.nextZ;for(;v&&v.z>=x&&w&&w.z<=m;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&$t(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&$t(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;v&&v.z>=x;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&$t(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;w&&w.z<=m;){if(w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&$t(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function Yt(t,e){let n=t;do{const r=n.prev,i=n.next.next;!Gt(r,i)&&Zt(r,n,n.next,i)&&Jt(r,i)&&Jt(i,r)&&(e.push(r.i,n.i,i.i),Kt(n),Kt(n.next),n=t=i),n=n.next}while(n!==t);return kt(n)}function Vt(t,e,n,r,i,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&qt(s,t)){let a=Ht(s,t);return s=kt(s,s.next),a=kt(a,a.next),Bt(s,e,n,r,i,o,0),void Bt(a,e,n,r,i,o,0)}t=t.next}s=s.next}while(s!==t)}function Ot(t,e){let n=t.x-e.x;if(0===n&&(n=t.y-e.y,0===n)){n=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return n}function Xt(t,e){const n=function(t,e){let n=e;const r=t.x,i=t.y;let o,s=-1/0;if(Gt(t,n))return n;do{if(Gt(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>s&&(s=t,o=n.x<n.next.x?n:n.next,t===r))return o}n=n.next}while(n!==e);if(!o)return null;const a=o,l=o.x,u=o.y;let h=1/0;n=o;do{if(r>=n.x&&n.x>=l&&r!==n.x&&Dt(i<u?r:s,i,l,u,i<u?s:r,i,n.x,n.y)){const e=Math.abs(i-n.y)/(r-n.x);Jt(n,t)&&(e<h||e===h&&(n.x>o.x||n.x===o.x&&Nt(o,n)))&&(o=n,h=e)}n=n.next}while(n!==a);return o}(t,e);if(!n)return e;const r=Ht(n,t);return kt(r,r.next),kt(n,n.next)}function Nt(t,e){return jt(t.prev,t,e.prev)<0&&jt(e.next,t,t.next)<0}function Et(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zt(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Dt(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function $t(t,e,n,r,i,o,s,a){return!(t===s&&e===a)&&Dt(t,e,n,r,i,o,s,a)}function qt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Zt(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Jt(t,e)&&Jt(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(jt(t.prev,t,e.prev)||jt(t,e.prev,e))||Gt(t,e)&&jt(t.prev,t,t.next)>0&&jt(e.prev,e,e.next)>0)}function jt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Gt(t,e){return t.x===e.x&&t.y===e.y}function Zt(t,e,n,r){const i=Rt(jt(t,e,n)),o=Rt(jt(t,e,r)),s=Rt(jt(n,r,t)),a=Rt(jt(n,r,e));return i!==o&&s!==a||(!(0!==i||!Ut(t,n,e))||(!(0!==o||!Ut(t,r,e))||(!(0!==s||!Ut(n,t,r))||!(0!==a||!Ut(n,e,r)))))}function Ut(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Rt(t){return t>0?1:t<0?-1:0}function Jt(t,e){return jt(t.prev,t,t.next)<0?jt(t,e,t.next)>=0&&jt(t,t.prev,e)>=0:jt(t,e,t.prev)<0||jt(t,t.next,e)<0}function Ht(t,e){const n=Qt(t.i,t.x,t.y),r=Qt(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Wt(t,e,n,r){const i=Qt(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Kt(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 Qt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const te="__fea_idx";new Float32Array([-1e12])[0];const ee="maptalks_ombb";function ne(){return function(){if("undefined"!=typeof undefinedThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof undefined)return global;throw new Error("unable to locate global object")}().maptalks_vt_packers}const{PackUtil:re,ArrayPool:ie}=ne();function oe(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g,y){const x=e.getLength(),m=i/3;for(let n=2,r=x;n<r;n+=3)t[i+n-2]=e[n-2],t[i+n-1]=e[n-1],t[i+n-0]=e[n]-s;i+=x;for(let n=2,r=x;n<r;n+=3)t[i+n-2]=e[n-2],t[i+n-1]=e[n-1],t[i+n-0]=e[n]-a;i+=x,t.trySetLength(i+x),t.copyWithin(i,i-2*x,i-x),i+=x,t.trySetLength(i+x),t.copyWithin(i,i-2*x,i-x),i+=x,(n=n||[]).push(x/3);const v=n.getLength();for(let e=0;e<v;e++){se(m+(n[e-1]||0),m+n[e],t,x/3,l,r,u,h,c,f,o,p,d,g,y)}return i}function se(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){const g=o.getLength();let y,x;for(let s=t,a=e;s<a-1;s++)if(y=s,x=s+1,i===1/0||!ft(n,y,x,i))if((s-t)%2==1&&(y+=2*r,x+=2*r),d){let t=o.currentIndex;o[t++]=y+r,o[t++]=x,o[t++]=y,o[t++]=x+r,o[t++]=x,o[t++]=y+r,o.currentIndex=t}else{let t=o.currentIndex;o[t++]=y+r,o[t++]=y,o[t++]=x,o[t++]=x,o[t++]=x+r,o[t++]=y+r,o.currentIndex=t}s&&function(t,e,n,r,i,o,s,a,l,u,h,c){let f,p=0,d=0,g=0,y=0;const x=c?[1,3,4]:[2,3,4];for(let c=o.getLength()-1;c>=s;c--){const s=o[c],m=3*s+1,v=3*s+2,w=i[3*s],b=i[m],M=i[v];p||d||(p=Math.max(i[v],i[3*o[c-3]+2]),d=Math.min(i[v],i[3*o[c-3]+2]),f=p-d);let P=g;const _=c%6;0===t?(5===_&&(y=St(i,o,c,w,b)),P=_===x[0]||_===x[1]||_===x[2]?g:g+y):1===t&&(_===x[0]||_===x[1]||_===x[2]?P=0:5===_?(y=St(i,o,c,w,b),P=y):P=y);const I=P/u*(1/(100*h))/a;let A;A=1===e?M===p?1:0:"bottom"===n?M===p?f/100/l:0:M===p?0:-f/100/l,r[2*s]=I,r[2*s+1]=A,0===_&&(g+=y)}}(a,l,u,h,n,o,g,c[0],c[1],f,p,d)}function ae(t){const e=[t[0]];let n=t[0];for(let r=1;r<t.length;r++)Array.isArray(t[r])?t[r][0]===n[0]&&t[r][1]===n[1]&&t[r][2]===n[2]||e.push(t[r]):t[r].x===n.x&&t[r].y===n.y&&t[r].z===n.z||e.push(t[r]),n=t[r];return e}var le="undefined"!=typeof Float32Array?Float32Array:Array;function ue(){var t=new le(3);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function he(t,e,n){var r=new le(3);return r[0]=t,r[1]=e,r[2]=n,r}function ce(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function fe(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function pe(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function de(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function ge(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=i*l-o*a,t[1]=o*s-r*l,t[2]=r*a-i*s,t}var xe=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t};function me(){var t=new le(4);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ve(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+s]-e[3*s+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}!function(){var t=ue()}(),function(){var t,e=(t=new le(4),le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var we,be=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},Me=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=o*s),t};ue(),he(1,0,0),he(0,1,0),me(),me(),we=new le(9),le!=Float32Array&&(we[1]=0,we[2]=0,we[3]=0,we[5]=0,we[6]=0,we[7]=0),we[0]=1,we[4]=1,we[8]=1;\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */\nconst Pe=8,_e=[],Ie=[],Ae=[],Se=[];function Te(t,e,n){const r=ye(Ie,e,n),i=function(t,e,n,r,i,o,s,a,l,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(_e,n[0],n[1],n[2],...r,...e);t=ve(t,i),t=function(t){return t[3]<0?be(t,t,-1):t}(t=Me(t,t));const o=1/((1<<2*Pe-1)-1);if(t[3]<o){t[3]=o;const e=Math.sqrt(1-o*o);t[0]*=e,t[1]*=e,t[2]*=e}const s=n[3]>0?ye(Ae,n,e):ye(Ae,e,n);return ge(ye(Se,n,e),s)<0&&be(t,t,-1),t}const Fe=[];const ke=[],Be=[],Le=[],Ce=[],Ye=[],Ve=[],Oe=[];function Xe(t,e,n,r,i,o){fe(Ce,t[3*e],t[3*e+1],t[3*e+2]),fe(Ye,t[3*n],t[3*n+1],t[3*n+2]),fe(Ve,t[3*r],t[3*r+1],t[3*r+2]);const s=xe(ke,Ve,Ye),a=xe(Be,Ce,Ye),l=ye(Le,s,a);de(Oe,l),i[3*e]=i[3*e]||0,i[3*n]=i[3*n]||0,i[3*r]=i[3*r]||0,i[3*e+1]=i[3*e+1]||0,i[3*n+1]=i[3*n+1]||0,i[3*r+1]=i[3*r+1]||0,i[3*e+2]=i[3*e+2]||0,i[3*n+2]=i[3*n+2]||0,i[3*r+2]=i[3*r+2]||0,i[3*e]+=Oe[0],i[3*n]+=Oe[0],i[3*r]+=Oe[0],i[3*e+1]+=Oe[1],i[3*n+1]+=Oe[1],i[3*r+1]+=Oe[1],i[3*e+2]+=Oe[2],i[3*n+2]+=Oe[2],i[3*r+2]+=Oe[2],o[e]+=1,o[n]+=1,o[r]+=1}\n/*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */function Ne(t,e,n){return t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t}function Ee(t,e,n){return t[0]=e[n],t[1]=e[n+1],t}const{StyleUtil:ze,PackUtil:De,ArrayPool:$e}=ne(),qe=$e.getInstance();function je(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0),qe.reset();const{altitudeScale:y,altitudeProperty:x,defaultAltitude:m,heightProperty:v,minHeightProperty:P,defaultHeight:_,tangent:I,uv:A,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,top:L,side:C,textureYOrigin:Y,topThickness:V}=e,O=function(t,e,{altitudeScale:n,altitudeProperty:r,defaultAltitude:i,heightProperty:o,minHeightProperty:s,defaultHeight:a},{center:l,side:u,top:h,topThickness:c,uvOrigin:f,uv:p,uvSize:d,topUVMode:g,sideUVMode:y,sideVerticalUVMode:x,textureYOrigin:m,tileRatio:v,centimeterToPoint:w,verticalCentimeterToPoint:b,positionType:M,res:P,glScale:_,projectionCode:I},A,T){let F=e/t[0].extent;e===1/0&&(F=1);const k=e===1/0,B=T.get(),L=T.get(),C=T.get(),Y=T.getProxy(),V=T.get(),O=T.get(),X=T.get(),N=!!p,E=!!h,z=!!u,D=N?T.get():null;function $(t,n,r,i,o,s){let a=n;if(E){const u=Tt(Y,r,3);if(0===u.length)return n;let h=Y.getLength(),p=V.currentIndex;for(let t=0;t<h;t++)V[p++]=Y[t];if(V.currentIndex=p,n+=Y.getLength(),s)for(let e=2,n=u.length;e<n;e+=3)u[e]+=t/3,u[e-1]+=t/3,u[e-2]+=t/3;else{let e;for(let n=2,r=u.length;n<r;n+=3)e=u[n-1],u[n-1]=u[n]+t/3,u[n]=e+t/3,u[n-2]+=t/3}h=u.length,p=O.currentIndex;for(let t=0;t<h;t++)O[p++]=u[t];O.currentIndex=p,N&&It(g||0,t,n,D,V,f,w,v,d[0],d[1],o,P,_,I,l),c>0&&!z&&(n=oe(V,Y,r,O,n,D,0,c,e,N,y||0,x||0,m,d,v,b,i<0?!s:s)),X.setLength(n/3),X.fill(1,a/3,n/3)}if(z){E&&(c=0),a=n,n=oe(V,Y,r,O,n,D,c,i,e,N,y||0,x||0,m,d,v,b,i<0?!s:s),X.setLength(n/3);const t=Y.getLength()/3;X.fill(1,a/3,a/3+t),X.fill(0,a/3+t,a/3+2*t),X.fill(1,a/3+2*t,a/3+3*t),X.fill(0,a/3+3*t,n/3)}return n}let q=-1/0,j=1/0,G=0;const Z=[-1,-1,e+1,e+1];let U=0,R=t.length;S(A)&&(U=A,R=A+1);let J=0,H=!1;const W=T.getProxy();let K=!1;for(;U<R;U++){const l=t[U],u=l.id;S(u)&&(Math.abs(u)>J&&(J=Math.abs(u)),u<0&&(H=!0));const h=l.geometry,c=l.properties[ee];let f=Array.isArray(c&&c[0]&&c[0][0])?c[0]:c;const{altitude:p,height:d}=re.getFeaAltitudeAndHeight(l,n,r,i,o,a,s);d<0?(K=!0,j=Math.min(p,j),q=Math.max(p-d,q)):(q=Math.max(p,q),j=Math.min(p-d,j));const g=V.getLength();let y=0,x=G;W.setLength(0),Y.setLength(0);const m=re.calculateSignedArea(h[0])<0;for(let t=0,n=h.length;t<n;t++){let r=h[t];m&&(r=r.reverse()),r=ae(r);const i=re.calculateSignedArea(r)<0;if(!i&&t>0&&(y++,f=c&&c[y],G=$(x,G,W,d*F,f,k),Y.setLength(0),W.setLength(0),x=G),e!==1/0&&(r=re.clipPolygon(r,Z)),!r.length){t===n-1&&(G=$(x,G,W,d*F,f,k));continue}const o=r.length;if(Array.isArray(r[0])?r[0][0]===r[o-1][0]&&r[0][1]===r[o-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[o-1].x&&r[0].y===r[o-1].y||r.push(r[0]),i){let t=W.currentIndex;W[t++]=Y.getLength()/3,W.currentIndex=t}ct(Y,Y.getLength(),r,F,p,!1,M),t===n-1&&(G=$(x,G,W,d*F,f,k))}const v=V.getLength()-g,w=(te+"").trim();for(let t=0;t<v/3;t++){let t=L.currentIndex;L[t++]=void 0===l[w]?U:l[w],L.currentIndex=t,t=B.currentIndex,B[t++]=U,B.currentIndex=t,S(u)&&(t=C.currentIndex,C[t++]=u,C.currentIndex=t)}}const Q=re.getUnsignedArrayType(L.getLength()?L[L.getLength()-1]:0),tt={hasNegativeHeight:K,maxAltitude:q===-1/0?0:q,minAltitude:j===1/0?0:j,vertices:V,verticeTypes:X,indices:O,pickingIds:ie.createTypedArray(L,Q),featureIndexes:B};if(C.getLength()){const t=H?re.getPosArrayType(J):re.getUnsignedArrayType(J);tt.featureIds=ie.createTypedArray(C,t)}else tt.featureIds=[];return D&&(D.setLength(V.getLength()/3*2),tt.uvs=D),tt}(t,n,{altitudeScale:y,altitudeProperty:x,defaultAltitude:m||0,heightProperty:v,minHeightProperty:P,defaultHeight:_||0},{center:g,top:L,side:C,topThickness:10*V||0,uv:A||I,uvSize:[i,i],uvOrigin:r,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,textureYOrigin:Y,tileRatio:a,centimeterToPoint:l,verticalCentimeterToPoint:u,positionType:d,res:o,glScale:s,projectionCode:f},p,qe),X=[],N=O.vertices.getLength()/3,E=De.getIndexArrayType(N),z=$e.createTypedArray(O.indices,E);delete O.indices,X.push(z.buffer,O.pickingIds.buffer);const D=Math.max(Math.abs(O.maxAltitude),Math.abs(O.minAltitude)),$=De.getPosArrayType(Math.max(512,D));O.vertices=$e.createTypedArray(O.vertices,$);const q=I?qe.getProxy():new Float32Array(3*N);q.setLength&&q.setLength(3*N);const j=function(t,e,n){const r=n||[];r.setLength&&r.setLength(t.length);const i=Fe;i.length<t.length/3&&(i.length=t.length/3),i.fill(0,0,t.length/3);const o=void 0===e.length?e:e.length;for(let n=0;n<o/3;n++)void 0===e.length?Xe(t,3*n,3*n+1,3*n+2,r,i):Xe(t,e[3*n],e[3*n+1],e[3*n+2],r,i);for(let t=0;t<r.length;t+=3){const e=i[t/3];0!==e?(r[t]/=e,r[t+1]/=e,r[t+2]/=e):(r[t]=0,r[t+1]=0,r[t+2]=0)}return r}(O.vertices,z,q);let G=!0;const Z=j.getLength?j.getLength():j.length;for(let t=0;t<Z;t++){j[t]=-j[t];const e=j[t]%1;1-Math.abs(e)>1e-6?G=!1:0!==e&&(j[t]=Math.round(j[t]))}if(O.normals=j,I){let t=qe.get();t.setLength(4*N),t=function(t,e,n,r,i){const o=t.length/3,s=i||new Array(4*o),a=[],l=[];for(let t=0;t<o;t++)a[t]=[0,0,0],l[t]=[0,0,0];const u=[0,0,0],h=[0,0,0],c=[0,0,0],f=[0,0],p=[0,0],d=[0,0],g=[0,0,0],y=[0,0,0];function x(e,r,i){Ne(u,t,3*e),Ne(h,t,3*r),Ne(c,t,3*i),Ee(f,n,2*e),Ee(p,n,2*r),Ee(d,n,2*i);const o=h[0]-u[0],s=c[0]-u[0],x=h[1]-u[1],m=c[1]-u[1],v=h[2]-u[2],w=c[2]-u[2],b=p[0]-f[0],M=d[0]-f[0],P=p[1]-f[1],_=d[1]-f[1],I=1/(b*_-M*P);fe(g,(_*o-P*s)*I,(_*x-P*m)*I,(_*v-P*w)*I),fe(y,(b*s-M*o)*I,(b*m-M*x)*I,(b*w-M*v)*I),pe(a[e],a[e],g),pe(a[r],a[r],g),pe(a[i],a[i],g),pe(l[e],l[e],y),pe(l[r],l[r],y),pe(l[i],l[i],y)}for(let t=0,e=r.length;t<e;t+=3)x(r[t+0],r[t+1],r[t+2]);const m=[],v=[],w=[],b=[];let M,P,_;function I(t){Ne(w,e,3*t),ce(b,w),P=a[t],ce(m,P),xe(m,m,function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}(w,w,ge(w,P))),de(m,m),ye(v,b,P),_=ge(v,l[t]),M=_<0?-1:1,s[4*t]=m[0],s[4*t+1]=m[1],s[4*t+2]=m[2],s[4*t+3]=M}for(let t=0,e=r.length;t<e;t+=3)I(r[t+0]),I(r[t+1]),I(r[t+2]);return s}(O.vertices,O.normals,O.uvs,z,t),t=function(t,e){const n=e.getLength(),r=new Float32Array(n),i=[],o=[],s=[];for(let a=0;a<n;a+=4){const n=a/4*3;dt(o,t[n]||0,t[n+1]||0,t[n+2]||0),yt(i,e[a]||0,e[a+1]||0,e[a+2]||0,e[a+3]||0),Te(s,o,i),gt(r.subarray(a,a+4),s)}return r}(O.normals,t),O.tangents=t,X.push(t.buffer),delete O.normals}if(O.normals&&(G&&(O.normals=$e.createTypedArray(O.normals,Int8Array)),X.push(O.normals.buffer)),O.uvs){const t=O.uvs;O.uvs=$e.createTypedArray(t,Float32Array),X.push(O.uvs.buffer)}const U=function(t,e,n,r){const i={},o={},s=r.getLength();if(B(e.polygonFill)){let a=b(e.polygonFill);const l=new Uint8Array(4*s);l.fill(255);for(let e=0;e<s;e++){const o=t[r[e]],s=o.properties||{};s.$layer=o.layer,s.$type=o.type;let u=a(n,s);w(u)&&(i.aColor=1,a=b(u),u=a(n,s)),delete s.$layer,delete s.$type,ze.normalizeColor(Ge,u),l[4*e]=Ge[0],l[4*e+1]=Ge[1],l[4*e+2]=Ge[2],l[4*e+3]=Ge[3]}o.aColor=l}if(B(e.polygonOpacity)){let a=M(e.polygonOpacity,"exponential");const l=new Uint8Array(s);l.fill(255);for(let e=0;e<s;e++){const o=t[r[e]],s=o.properties||{};s.$layer=o.layer,s.$type=o.type;let u=a(n,s);w(u)&&(i.aOpacity=1,a=b(u),u=a(n,s)),delete s.$layer,delete s.$type,l[e]=255*u}o.aOpacity=l}return o.dynamicAttributes=i,o}(t,h,c,O.featureIndexes),R=function(t,e,n,r,i){const o=[[],[]],s=B(r.topPolygonFill),a=B(r.bottomPolygonFill),l=[255,255,255,255],u=e.getLength();if(s||a){let h=s&&b(r.topPolygonFill),c=a&&b(r.bottomPolygonFill),f=null,p=null,d=null,g=null;for(let r=0;r<u;r++){if(1===t[r]&&!s||0===t[r]&&!a)continue;const u=1===t[r];if(u&&e[r]===f){t[r]=d;continue}if(!u&&e[r]===p){t[r]=g;continue}const y=n[e[r]],x=y.properties||{};x.$layer=y.layer,x.$type=y.type;let m=u?h:c,v=m(i,x);w(v)&&(m=b(v),v=m(i,x)),delete x.$layer,delete x.$type,ze.normalizeColor(Ge,v),xt(Ge,Ge,l);let M=Ze(o,Ge);M<0&&(M=o.length,o.push(gt([],Ge))),t[r]=M,u?(f=e[r],d=M):(p=e[r],g=M)}}return o.slice(2)}(O.verticeTypes,O.featureIndexes,t,h,c),J={data:{data:{aVertexColorType:R.length<=252?$e.createTypedArray(O.verticeTypes,Uint8Array):$e.createTypedArray(O.verticeTypes,Uint16Array),aPosition:O.vertices,aNormal:O.normals,aTexCoord0:O.uvs,aTangent:O.tangents,aPickingId:O.pickingIds},indices:z,properties:{maxAltitude:O.maxAltitude/100,minAltitude:O.minAltitude/100,hasNegativeHeight:O.hasNegativeHeight},dynamicAttributes:U.dynamicAttributes,vertexColors:R},buffers:X};return O.featureIds.length?(J.data.featureIds=O.featureIds,X.push(J.data.featureIds.buffer)):J.data.featureIds=[],U.aColor&&(J.data.data.aColor=U.aColor,J.buffers.push(U.aColor.buffer)),U.aOpacity&&(J.data.data.aOpacity=U.aOpacity,J.buffers.push(U.aOpacity.buffer)),J.buffers.push(J.data.data.aPosition.buffer),J.data.pickingIdIndiceMap=De.generatePickingIndiceIndex(J.data.data.aPickingId,J.data.indices),J}const Ge=[];function Ze(t,e){for(let i=0;i<t.length;i++)if(n=e,r=t[i],n[0]===r[0]&&n[1]===r[1]&&n[2]===r[2]&&n[3]===r[3])return i;var n,r;return-1}const{PackUtil:Ue,StyleUtil:Re,FilterUtil:Je}=ne();function He(t,e,n,r,{altitudeScale:i,altitudeProperty:o,defaultAltitude:s,heightProperty:a,minHeightProperty:l,defaultHeight:u,bottom:h}){const c=h,f=e/t[0].extent,p=2*function(t,e){let n=0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(S(r.geometry[0][0]))n+=3*r.geometry.length;else for(let t=0,e=r.geometry.length;t<e;t++){let e=3*r.geometry[t].length;3===r.type&&(e-=3),n+=e}}return n}(t)+3*t.length*2,d=[],g=new Int16Array(p),y=new Uint8Array(g.length/3*4);w(n)&&(n=Je.compileFilter(n));const x=[];function m(t,n,r){const i=n-t,o=g.subarray(t,n),s=g.subarray(n,n+i);s.set(o);for(let t=2,e=s.length;t<e;t+=3)s[t]=o[t]-r;const a=t/3,l=i/3;let u,h;for(let t=a,n=l+a;t<n;t++)t<n-1?(u=t,h=t+1):(u=t,h=a),ft(g,u,h,e)||(x.push(u,h),c&&x.push(u+l,h+l),We(g,u,e)||x.push(u,u+l));return n+i}let v=0,b=-1/0,M=1/0;const P=(te+"").trim(),_=[];for(let e=0,h=t.length;e<h;e++){const h=t[e],c=h.geometry;if(n){let t;t="function"==typeof n?n(h&&h.properties):n,Re.normalizeColor(_,t)}else dt(_,255,255,255);const p=v/3*4,{altitude:w,height:I}=Ue.getFeaAltitudeAndHeight(h,i,o,s,a,u,l);I<0?(M=Math.min(w,M),b=Math.max(w-I,b)):(M=Math.min(w-I,M),b=Math.max(w,b));let A=v;for(let t=0,e=c.length;t<e;t++){let e=c[t];const n=e.length;e[0][0]===e[n-1][0]&&e[0][1]===e[n-1][1]&&(e=e.slice(0,n-1)),v=ct(g,A,e,f,w),v=m(A,v,I*f),A=v}const S=A/3*4;for(let t=p;t<S;t+=4)y[t]=_[0],y[t+1]=_[1],y[t+2]=_[2],y[t+3]=255*(r||1);const T=x.length-d.length;for(let t=0;t<T;t++)d.push(h[P])}const I=x.reduce(((t,e)=>Math.max(t,e)),0),A=new(Ue.getIndexArrayType(I))(x),T=Ue.getUnsignedArrayType(t.length),F=Math.max(Math.abs(b,Math.abs(M)));return{aPosition:new(Ue.getPosArrayType(Math.max(512,F)))(g),indices:A,aPickingId:new T(d),aColor:y,maxAltitude:b===-1/0?0:b/100,minAltitude:M===1/0?0:M/100}}function We(t,e,n){const r=t[3*e],i=t[3*e+1];return r<0||r>n||i<0||i>n}function Ke(t,e,n,r){const i=He(t,e,n.lineColor,n.lineOpacity,r),{minAltitude:o,maxAltitude:s}=i;delete i.minAltitude,delete i.maxAltitude;const a=[i.aPosition.buffer,i.indices.buffer,i.aPickingId.buffer],l=i.indices;return delete i.indices,{data:{data:i,properties:{minAltitude:o,maxAltitude:s},indices:l},buffers:a}}\n/*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */const Qe=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function tn(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return\`(${s}"=="===e?nn(t[1],t[2],"===",!1):"!="===e?nn(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?nn(t[1],t[2],e,!0):"any"===e?on(t.slice(1),"||"):"all"===e?on(t.slice(1),"&&"):"none"===e?ln(on(t.slice(1),"||")):"in"===e?sn(t[1],t.slice(2)):"!in"===e?ln(sn(t[1],t.slice(2))):"has"===e?an(t[1]):"!has"===e?ln(an(t[1])):"contains"===e?function(t,e,n){const r=en(t);return void 0!==n?\`(${s}r} + '').indexOf("${s}e}") === ${s}n}\`:\`(${s}r} + '').indexOf("${s}e}") >= 0\`}(t[1],t[2],t[3]):"true"})\`}function en(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function nn(t,e,n,r){if("object"==typeof(i=t)&&i&&t.op)return function(t,e,n,r){const i=t.property,o=t.op;let s=en(i);return"length"!==o?(console.error(\`not support ${s}o} op\`),"false"):(s=\`((${s}s}+='').length)\`,rn(s,i,e,n,r))}(t,e,n,r);var i;return rn(en(t),t,e,n,r)}function rn(t,e,n,r,i){const o="$type"===e?Qe.indexOf(n):JSON.stringify(n);return(i?\`typeof ${s}t}=== typeof ${s}o}&&\`:"")+t+r+o}function on(t,e){return t.map(tn).join(e)}function sn(t,e){"$type"===t&&(e=e.map((t=>Qe.indexOf(t))));const n=JSON.stringify(e.sort(un)),r=en(t);return e.length<=200?\`${s}n}.indexOf(${s}r}) !== -1\`:\`function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${s}r}, ${s}n},0,${s}e.length-1})\`}function an(t){return"$id"===t?'"id" in f':\`${s}JSON.stringify(t)} in p\`}function ln(t){return\`!(${s}t})\`}function un(t,e){return t<e?-1:t>e?1:0}let hn=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),hn=!0}catch(t){hn=!1}var cn=hn;const{VectorPack:fn,PolygonPack:pn,NativeLinePack:dn,LinePack:gn,PointPack:yn,NativePointPack:xn,LineExtrusionPack:mn,CirclePack:vn,RoundTubePack:wn,SquareTubePack:bn,FilterUtil:Mn,PackUtil:Pn,StyleUtil:_n,TextUtil:In,DEFAULT_TEX_WIDTH:An,GlyphRequestor:Sn}=ne(),Tn="__original_properties",Fn="__fn-type_properties";class kn{constructor(t,e,n,r,i){this.id=t,this.options=e,this.upload=n,this._compileStyle(e.style),this.requests={},this._cache=r,this._styleCounter=1,this.loadings=i}updateStyle(t,e){this.options.style=t,this._styleCounter=t.styleCounter,this._compileStyle(t),e()}updateOptions(t,e){this.options=I(this.options,t),e()}loadTile(t,e){const n=this.loadings,r=t.tileInfo.url,i=this.options.debugTile;if(i){const{x:n,y:r,z:o}=t.tileInfo;let s=!1;for(let t=0;t<i.length;t++)if(n===i[t].x&&r===i[t].y&&o===i[t].z){s=!0;break}if(!s)return void e()}if(n[r])return void n[r].push({context:t,callback:e,ref:this});n[r]=[{context:t,callback:e,ref:this}];const o=this.options.featureIdProperty;this.requests[r]=this.getTileFeatures(t,((e,i,s,a)=>{const l=n[r];if(delete n[r],this.checkIfCanceled(r))return delete this.requests[r],void this._callWaitings(l,null,{canceled:!0});if(delete this.requests[r],(this.options.debug||o)&&i)for(let e=0;e<i.length;e++)if(this.options.debug&&(i[e]._debug_info={index:e,id:i[e].id,tileId:t.tileInfo.id}),o){const t=F(o)?o[i[e].layer]:o,n=i[e].properties;i[e].id=n&&n[t]||null}if(e)this._callWaitings(l,e);else if(i&&i.length){if(l)for(let t=0;t<l.length;t++)this._onTileLoad.call(l[t].ref,l[t].context,l[t].callback,r,s,i,a)}else this._callWaitings(l)}))}_onTileLoad(t,e,n,r,i,o){this._createTileData(r,i,t).then((n=>{n.canceled?e(null,{canceled:!0}):(n.data.styleCounter=t.styleCounter,o&&I(n.data,o),e(null,n.data,n.buffers))})).catch((t=>{e(t)}))}abortTile(t,e){delete this.requests[t],this._cancelLoadings(t),e()}_cancelLoadings(t){const e=this.loadings[t];if(e)for(let t=0;t<e.length;t++)e[t].callback(null,{canceled:!0});delete this.loadings[t]}_callWaitings(t,e,n){if(t)for(let r=0;r<t.length;r++)t[r].callback(e,n)}checkIfCanceled(t){return!this.requests[t]}onRemove(){this.loadings={},delete this._cache,this.requests={}}fetchIconGlyphs(t,e,n){if(this.options.workerGlyph&&cn){const r=[];if(t&&Object.keys(t).length){const e=new Promise((e=>{this.upload("fetchIconGlyphs",{icons:t},null,((t,n)=>{e({err:t,iconData:n})}))}));r.push(e)}if(e&&Object.keys(e).length){const t=new Promise((t=>{this._glyphRequestor||(this._glyphRequestor=new Sn),this._glyphRequestor.getGlyphs(e,((e,n)=>{t({err:e,glyphData:n})}))}));r.push(t)}Promise.all(r).then((t=>{const e={icons:null,glyphs:null};for(let r=0;r<t.length;r++){if(t[r].err)return void n(t[r].err);t[r].iconData?e.icons=t[r].iconData.icons:t[r].glyphData&&(e.glyphs=t[r].glyphData.glyphs)}return e})).then((t=>{n(null,t)}))}else this.upload("fetchIconGlyphs",{icons:t,glyphs:e},null,n)}_createTileData(t,e,n){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:r,tileInfo:i}=n,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this._updateLayerPluginConfig(t)),this.featurePlugins&&function(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];if(n)for(let e=0,r=n.length;e<r;e++)t.push(n[e])}t.length}(s,this.featurePlugins);const a={};for(let t=0;t<s.length;t++)Xn(e,n.tileInfo.z,s[t],a);const l=[],u=[];for(let t=0;t<e.length;t++){const n=e[t],r=a[t];if(r){u.fill(null);let t=0;for(const e in r){let i=0;const o=r[e].values();for(const t of o){let r=u[i];r||(r=Dn(n),u[i]=r),r.properties[e]=t,i++}i>t&&(t=i)}for(let e=0;e<t;e++)l.push(u[e])}else l.push(n)}const h=(e=l)[0].extent,c=i.z,f={x:i.extent2d.xmin*r,y:i.extent2d.ymax*r},p=[],d=[],g=[],y=this.options,x=[],m={},v=[Promise.resolve(n.styleCounter)];let w=0,b=-1;const M=[];let P=!1;for(let t=0;t<s.length;t++){b++;const r=s[t];r.type!==w&&(b=0,w=r.type);const a=0===r.type?p:d;if(r.symbol&&!1===r.symbol.visible){a[b]=null;continue}jn(r.symbol,M,t),P=P||M[t]&&M[t].size>0;const{tileFeatures:l,tileFeaIndexes:u}=this._filterFeatures(c,r.type,r.filter,e,m,t);if(!l.length){a[b]=null;continue}const y=u[u.length-1],_=Pn.getIndexArrayType(y);a[b]={styledFeatures:new _(u)},g.push({idx:t,typeIdx:b}),x.push(a[b].styledFeatures.buffer);const A=I({},n,{extent:h,zoom:c,tilePoint:f});if(this.options.debugTile){const t=this.options.debugTile;for(let e=0;e<t.length;e++){const{x:n,y:r,z:o}=t[e];if(i.x===n&&i.y===r&&i.z===o){A.debugIndex=t[e].index;break}}}let S=this._createTileGeometry(l,r,A);o&&(S=S.then((t=>{if(!t)return null;if(t.data)t.data.layer=l[0].layer;else if(Array.isArray(t))for(let e=0;e<t.length;e++)t[e]&&t[e].data&&(t[e].data.layer=l[0].layer);return t}))),v.push(S)}return Promise.all(v).then((([n,...r])=>{if(n!==this._styleCounter)return{canceled:!0};function i(t,e){if(void 0!==t.data.ref)return;const n=s[g[e].idx],r=n.renderPlugin.dataConfig;if(t.data.type=r.type,t.data.filter=n.filter.def,r.altitudeOffset&&(t.data.properties.minAltitude+=r.altitudeOffset,t.data.properties.maxAltitude+=r.altitudeOffset),t.buffers&&t.buffers.length)for(let e=0;e<t.buffers.length;e++)x.push(t.buffers[e])}for(let t=0;t<r.length;t++){if(!r[t])continue;const e=r[t],n=0===s[g[t].idx].type?p:d;if(Array.isArray(e)){const r=[];for(let n=0;n<e.length;n++)e[n]&&(i(e[n],t),(void 0===e[n].data.ref||e[e[n].data.ref])&&r.push(e[n].data));r.length&&(n[g[t].typeIdx].data=r)}else i(e,t),n[g[t].typeIdx].data=e.data}const o={},a=t;if(y.features||y.schema||P){let t,n=!1;for(let r=0,i=e.length;r<i;r++)if(t=e[r],a[t.layer].properties||(a[t.layer].properties=Cn(t.properties)),t&&(y.features||P&&m[r]))if("id"===y.features)o[r]=t.id;else{y.pickingGeometry||delete t.geometry,delete t.extent,delete t.properties.$layer,delete t.properties.$type,delete t.__index;const e=t.originalFeature;if(e){const e=t.properties,n=I({},t.originalFeature);delete e[Tn],n.customProps=I({},e),t=n}const i=I({},t);if(P&&m[r]&&(!y.features||"transient"===y.features)){const i=m[r];for(let r=0;r<i.length;r++){const i=M[r];i&&i.forEach((r=>{const i=e?e.properties:t.properties;i[Fn]||(i[Fn]=new Set),i[Fn].add(r),n=!0}))}}o[r]=i}if(n)for(const t in o){const e=o[t],n=e.properties[Fn];if(n){delete e.properties[Fn],"transient"===y.features&&(e.fnTypeProps=I({},e.properties));for(const t in e.properties)n.has(t)||("transient"===y.features?delete e.fnTypeProps[t]:delete e.properties[t])}}}return{data:{styleCounter:n,schema:a,data:p,featureData:d,extent:h,features:o},buffers:x}})).catch((t=>{console.error(t)}))}_createTileGeometry(t,e,n){let r=t;const i=e.renderPlugin.dataConfig,o=e.symbol,s=this.options.tileSize,{extent:a,glScale:l,zScale:u,zoom:h,tilePoint:c,centimeterToPoint:f,verticalCentimeterToPoint:p}=n,d=a/s,g=i.type,y=n.debugIndex;let x=I({},i,{EXTENT:a,zoom:h,debugIndex:y,features:this.options.features,isWebGPU:this.options.isWebGPU});if("3d-extrusion"===g){Yn(o)&&(i.uv=1);const t=this.options.projectionCode,e=o.material&&o.material.textureWidth||An;return Promise.all([Promise.resolve(je(r,i,a,c,e,n.tileInfo.res,l,a/this.options.tileSize,f,p,o,h,t,y))])}if("3d-wireframe"===g)return Promise.all([Promise.resolve(Ke(r,a,o,i))]);if("point"===g){x=I(x,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:u*a/this.options.tileSize/l,pluginType:e.renderPlugin.type});let t=o;return Array.isArray(o)||(t=[o]),t=t.map(((t,e)=>(t&&(t.index={index:e},t.isIconText=function(t){return t.markerType||t.markerFile}(t)),t))).filter((t=>!!t)),Promise.all(t.map((t=>{const e=fn.genFnTypes(t);let n=r;return yn.needMerge(t,e,h)&&(n=yn.mergeLineFeatures(r,t,e,h)),new yn(n,t,x).load(d)})))}if("native-point"===g){const t=u*a/this.options.tileSize/l;return x.altitudeToTileScale=t,Vn(r,o,x,xn,d)}if("line"===g)return x=I(x,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:d}),Vn(r,o,x,gn,1,!0);if("native-line"===g)return Vn(r,o,x,dn,1,!0);if("fill"===g)return x=I(x,{requestor:this.fetchIconGlyphs.bind(this)}),Vn(r,o,x,pn);if("line-extrusion"===g){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=Yn(o);if(t&&(i.uv=1),x=I(x,{tileSize:s,zScale:u,glScale:l}),o.mergeOnProperty){const t=fn.genFnTypes(o);r=gn.mergeLineFeatures(r,o,t,x.zoom)}if(t){const t=[];if(!1!==i.top){const e=I({},x);e.side=!1,t.push(new mn(r,o,e))}return!1!==i.side&&(x.side=!0,x.top=!1,t.push(new mn(r,o,x))),Promise.all(t.map((t=>t.load())))}return Promise.all([new mn(r,o,x).load()])}if("circle"===g)return Vn(r,o,x,vn);if("round-tube"===g||"square-tube"===g){const t="round-tube"===g?wn:bn;return x=I(x,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:"round-tube"===g?i.radialSegments||8:4,centimeterToPoint:f,verticalCentimeterToPoint:p,tileRatio:d,isTube:!0}),Vn(r,o,x,t)}return Promise.resolve([])}_filterFeatures(t,e,n,r,i,o){const s=(te+"").trim(),a=[],l=[],u=r.length;for(let h=0;h<u;h++)if((1===e||void 0===r[h].id||!this.styledFeatures[r[h].id])&&((!n.def||"default"===n.def)&&!i[h]||!0===n.def||n.def&&(void 0!==n.def.condition||Array.isArray(n.def))&&n(r[h],t))){const t=r[h];if(void 0===t[s]&&(t[s]=h),i[h]||(i[h]=[]),i[h].push(o),l.push(t),a.push(h),1===e)break}return{tileFeatures:l,tileFeaIndexes:a}}_compileStyle(t){const{style:e,featureStyle:n}=t,r={};n.forEach((t=>{Array.isArray(t.id)?(t.id.forEach((t=>{r[t]=1})),t.filter=["in","$id",...t.id]):(r[t.id]=1,t.filter=["==","$id",t.id])}));const i=Mn.compileStyle(e);for(let t=0;t<e.length;t++)i[t].filter&&(i[t].filter.def=e[t].filter?e[t].filter.value||e[t].filter:void 0),i[t].type=0;const o=[],s=Mn.compileStyle(n);for(let t=0;t<n.length;t++)s[t].type=1,s[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0,s[t].renderPlugin&&o.push(s[t]);this.pluginConfig=i,this.featurePlugins=o,this.styledFeatures=r}_updateLayerPluginConfig(t){let e=this._layerPlugins;this._layerPlugins||(e=this._layerPlugins={});const n=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],r=[];for(const o in t){const s=o;if(!e[o]){const r=[];for(let e=0;e<t[o].types.length;e++){const a=t[o].types[e],l=["all",["==","$layer",s],["==","$type",n[a]]],u={filter:(i=l,new Function("f",\`var p = (f && f.properties || {}); return ${s}tn(i)}\`)),renderPlugin:Bn(a),symbol:Ln(a)};u.filter.def=l,u.type=0,r.push(u)}e[s]=r}r.push(...e[s])}var i;return r}}function Bn(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 Ln(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 Cn(t){if(Array.isArray(t)||!F(t))return{};const e={};for(const n in t){const r=t[n];A(r)?e[n]="string":S(r)?e[n]="number":!0===r||!1===r?e[n]="boolean":Array.isArray(r)?e[n]="array":e[n]="object"}return e}function Yn(t){if(!t)return 0;let e=0;for(const n in t){if(("normalTexture"===n||"bumpTexture"===n)&&t[n])return 2;if(n.indexOf("Texture")>0&&t[n])e=1;else if(F(t[n])){const r=Yn(t[n]);if(2===r)return r;1===r&&(e=1)}}return e}function Vn(t,e,n,r,i,o){const s={},a=Array.isArray(e)?e:[e];let l=-1;for(let t=0;t<a.length;t++)s[t]=On(a[t]),!s[t]&&a[t]&&-1===l&&(l=t);const u=[];for(let e=0;e<a.length;e++){if(!a[e])continue;a[e].index={index:e};let h=t;if(o&&a[e].mergeOnProperty){const r=fn.genFnTypes(a[e]);h=gn.mergeLineFeatures(t,a[0],r,n.zoom)}s[e]||e===l?u.push(new r(h,a[e],n).load(i)):u.push({data:{ref:l,symbolIndex:{index:e}}})}return Promise.all(u)}function On(t){if(!t)return 0;for(const e in t)if(B(t[e]))return 1;return 0}function Xn(t,e,n,r){const i=n.customProperties;if(!i)return t;if(i)for(let t=0;t<i.length;t++)i[t].fn=Mn.compileFilter(i[t].filter);for(let n=0;n<i.length;n++)for(let o=0,s=t.length;o<s;o++)if(i[n].fn(t[o],e))for(const t in i[n].properties){const e=i[n].properties[t];k(e)||(r[o]||(r[o]={}),r[o][t]||(r[o][t]=new Set),r[o][t].add(e))}}const Nn={get:(t,e)=>e in t?t[e]:t.originalFeature[e],has:(t,e)=>e in t||e in t.originalFeature},En={get:function(t,e){return e in t?t[e]:t[Tn][e]},has:(t,e)=>e in t||e in t[Tn]},zn={};function Dn(t){const e={};e.originalFeature=t;const n=new Proxy(e,Nn);return n.properties=new Proxy({},En),n.properties[Tn]=t.properties||zn,n}function $n(t,e,n){t[e]||(t[e]=new Set),t[e].add(n)}const qn=[];function jn(t,e,n){if(!t)return qn;for(const r in t){if(!t[r]||!_n.checkIfZoomFnTypeSymbol(r))continue;if(B(t[r]))$n(e,n,t[r].property);else{if("lineGradientProperty"===r){$n(e,n,t[r]);continue}if("textName"===r)if(A(t[r])){const i=In.resolveVarNames(t[r]);if(i)for(let t=0;t<i.length;t++)$n(e,n,i[t])}else if(Mn.isExpression(t[r])){const i=[];In.resolveExpVarNames(i,t[r]);for(let t=0;t<i.length;t++)$n(e,n,i[t])}}const i=t[r].stops;if(i&&i.length)for(let t=0;t<i.length;t++)B(i[t][1])&&$n(e,t,i[t][1].property)}return e[n]}function Gn(t,e){Zn(t.geometry,e)}function Zn(t,e){if(t)switch(t.type){case"Point":Un(t.coordinates,e);break;case"MultiPoint":case"LineString":Rn(t.coordinates,e);break;case"MultiLineString":!function(t,e){for(let n=0,r=t.length;n<r;n++)Rn(t[n],e)}(t.coordinates,e);break;case"Polygon":Jn(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let n=0,r=t.length;n<r;n++)Jn(t[n],e)}(t.coordinates,e);break;case"GeometryCollection":const n=t.geometries.length;for(let r=0;r<n;r++)Zn(t.geometries[r],e)}}function Un(t,e){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Rn(t,e){for(let n=0,r=t.length;n<r;n++)Un(t[n],e)}function Jn(t,e){t.length&&Rn(t[0],e)}function Hn(t,e,n,r,i){Wn(t,e,n||0,r||t.length-1,i||Qn)}function Wn(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Wn(t,e,Math.max(n,Math.floor(e-s*l/o+u)),Math.min(r,Math.floor(e+(o-s)*l/o+u)),i)}var h=t[e],c=n,f=r;for(Kn(t,n,e),i(t[r],h)>0&&Kn(t,n,r);c<f;){for(Kn(t,c,f),c++,f--;i(t[c],h)<0;)c++;for(;i(t[f],h)>0;)f--}0===i(t[n],h)?Kn(t,n,f):Kn(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function Kn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Qn(t,e){return t<e?-1:t>e?1:0}class tr{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!cr(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?r(s):s;cr(t,a)&&(e.leaf?n.push(s):hr(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n}collides(t){let e=this.data;if(!cr(t,e))return!1;const n=[];for(;e;){for(let r=0;r<e.children.length;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(cr(t,o)){if(e.leaf||hr(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=fr([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let s,a,l;for(;n||i.length;){if(n||(n=i.pop(),a=i[i.length-1],s=o.pop(),l=!0),n.leaf){const r=er(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}l||n.leaf||!hr(n,r)?a?(s++,n=a.children[s],l=!1):n=null:(i.push(n),o.push(s),s=0,a=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,s=this._maxEntries;if(i<=s)return o=fr(t.slice(e,n+1)),nr(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,r-1))),o=fr([]),o.leaf=!1,o.height=r;const a=Math.ceil(i/s),l=a*Math.ceil(Math.sqrt(s));pr(t,e,n,l,this.compareMinX);for(let i=e;i<=n;i+=l){const e=Math.min(i+l-1,n);pr(t,i,e,a,this.compareMinY);for(let n=i;n<=e;n+=a){const i=Math.min(n+a-1,e);o.children.push(this._build(t,n,i,r-1))}}return nr(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=ar(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<s?(s=h,r=u<r?u:r,n=l):h===s&&u<r&&(r=u,n=l)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),ir(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),s=fr(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,nr(n,this.toBBox),nr(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}_splitRoot(t,e){this.data=fr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,nr(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let s=e;s<=n-e;s++){const e=rr(t,0,s,this.toBBox),a=rr(t,s,n,this.toBBox),l=ur(e,a),u=ar(e)+ar(a);l<i?(i=l,r=s,o=u<o?u:o):l===i&&u<o&&(o=u,r=s)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:or,i=t.leaf?this.compareMinY:sr;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=rr(t,0,e,i),s=rr(t,n-e,n,i);let a=lr(o)+lr(s);for(let r=e;r<n-e;r++){const e=t.children[r];ir(o,t.leaf?i(e):e),a+=lr(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];ir(s,t.leaf?i(e):e),a+=lr(s)}return a}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)ir(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():nr(t[n],this.toBBox)}}function er(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function nr(t,e){rr(t,0,t.children.length,e,t)}function rr(t,e,n,r,i){i||(i=fr(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<n;o++){const e=t.children[o];ir(i,t.leaf?r(e):e)}return i}function ir(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function or(t,e){return t.minX-e.minX}function sr(t,e){return t.minY-e.minY}function ar(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function lr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ur(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function hr(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function cr(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function fr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function pr(t,e,n,r,i){const o=[e,n];for(;o.length;){if((n=o.pop())-(e=o.pop())<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Hn(t,s,e,n,i),o.push(e,s,s,n)}}class dr{constructor(t=[],e=gr){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,r=e[t];for(;t>0;){const i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}_down(t){const{data:e,compare:n}=this,r=this.length>>1,i=e[t];for(;t<r;){let r=1+(t<<1),o=e[r];const s=r+1;if(s<this.length&&n(e[s],o)<0&&(r=s,o=e[s]),n(o,i)>=0)break;e[t]=o,t=r}e[t]=i}}function gr(t,e){return t<e?-1:t>e?1:0}function yr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xr={exports:{}},mr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,l=0,u=a-1;l<a;u=l++){var h=e[n+2*l+0],c=e[n+2*l+1],f=e[n+2*u+0],p=e[n+2*u+1];c>o!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s},vr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,l=0,u=a-1;l<a;u=l++){var h=e[l+n][0],c=e[l+n][1],f=e[u+n][0],p=e[u+n][1];c>o!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s};xr.exports=function(t,e,n,r){return e.length>0&&Array.isArray(e[0])?vr(t,e,n,r):mr(t,e,n,r)};var wr=xr.exports.nested=vr;xr.exports.flat=mr;const br=11102230246251565e-32,Mr=134217729,Pr=(3+8*br)*br;function _r(t,e,n,r,i){let o,s,a,l,u=e[0],h=r[0],c=0,f=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=r[++f]);let p=0;if(c<t&&f<n)for(h>u==h>-u?(s=u+o,a=o-(s-u),u=e[++c]):(s=h+o,a=o-(s-h),h=r[++f]),o=s,0!==a&&(i[p++]=a);c<t&&f<n;)h>u==h>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c]):(s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f]),o=s,0!==a&&(i[p++]=a);for(;c<t;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c],o=s,0!==a&&(i[p++]=a);for(;f<n;)s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f],o=s,0!==a&&(i[p++]=a);return 0===o&&0!==p||(i[p++]=o),p}function Ir(t){return new Float64Array(t)}const Ar=33306690738754716e-32,Sr=22204460492503146e-32,Tr=11093356479670487e-47,Fr=Ir(4),kr=Ir(8),Br=Ir(12),Lr=Ir(16),Cr=Ir(4);function Yr(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=Ar*u?l:-function(t,e,n,r,i,o,s){let a,l,u,h,c,f,p,d,g,y,x,m,v,w,b,M,P,_;const I=t-i,A=n-i,S=e-o,T=r-o;w=I*T,f=Mr*I,p=f-(f-I),d=I-p,f=Mr*T,g=f-(f-T),y=T-g,b=d*y-(w-p*g-d*g-p*y),M=S*A,f=Mr*S,p=f-(f-S),d=S-p,f=Mr*A,g=f-(f-A),y=A-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Fr[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Fr[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Fr[2]=m-(_-c)+(x-c),Fr[3]=_;let F=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,Fr),k=Sr*s;if(F>=k||-F>=k)return F;if(c=t-I,a=t-(I+c)+(c-i),c=n-A,u=n-(A+c)+(c-i),c=e-S,l=e-(S+c)+(c-o),c=r-T,h=r-(T+c)+(c-o),0===a&&0===l&&0===u&&0===h)return F;if(k=Tr*s+Pr*Math.abs(F),F+=I*h+T*a-(S*u+A*l),F>=k||-F>=k)return F;w=a*T,f=Mr*a,p=f-(f-a),d=a-p,f=Mr*T,g=f-(f-T),y=T-g,b=d*y-(w-p*g-d*g-p*y),M=l*A,f=Mr*l,p=f-(f-l),d=l-p,f=Mr*A,g=f-(f-A),y=A-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Cr[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Cr[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const B=_r(4,Fr,4,Cr,kr);w=I*h,f=Mr*I,p=f-(f-I),d=I-p,f=Mr*h,g=f-(f-h),y=h-g,b=d*y-(w-p*g-d*g-p*y),M=S*u,f=Mr*S,p=f-(f-S),d=S-p,f=Mr*u,g=f-(f-u),y=u-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Cr[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Cr[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const L=_r(B,kr,4,Cr,Br);w=a*h,f=Mr*a,p=f-(f-a),d=a-p,f=Mr*h,g=f-(f-h),y=h-g,b=d*y-(w-p*g-d*g-p*y),M=l*u,f=Mr*l,p=f-(f-l),d=l-p,f=Mr*u,g=f-(f-u),y=u-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Cr[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Cr[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const C=_r(L,Br,4,Cr,Lr);return Lr[C-1]}(t,e,n,r,i,o,u)}function Vr(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var r=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;o<t.length;o++){var s=t[o];s[0]<e[0]&&(e=s),s[0]>r[0]&&(r=s),s[1]<n[1]&&(n=s),s[1]>i[1]&&(i=s)}var a=[e,n,r,i],l=a.slice();for(o=0;o<t.length;o++)wr(t[o],a)||l.push(t[o]);return function(t){t.sort(Ur);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&Dr(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&Dr(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(l)}(t),i=new tr(16);i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,e){return t[0]-e[0]},i.compareMinY=function(t,e){return t[1]-e[1]},i.load(t);for(var o,s=[],a=0;a<r.length;a++){var l=r[a];i.remove(l),o=qr(l,o),s.push(o)}var u=new tr(16);for(a=0;a<s.length;a++)u.insert($r(s[a]));for(var h=e*e,c=n*n;s.length;){var f=s.shift(),p=f.p,d=f.next.p,g=jr(p,d);if(!(g<c)){var y=g/h;(l=Or(i,f.prev.p,p,d,f.next.next.p,y,u))&&Math.min(jr(l,p),jr(l,d))<=y&&(s.push(f),s.push(qr(l,f)),i.remove(l),u.remove(f),u.insert($r(f)),u.insert($r(f.next)))}}f=o;var x=[];do{x.push(f.p),f=f.next}while(f!==o);return x.push(f.p),x}function Or(t,e,n,r,i,o,s){for(var a=new dr([],Xr),l=t.data;l;){for(var u=0;u<l.children.length;u++){var h=l.children[u],c=l.leaf?Gr(h,n,r):Nr(n,r,h);c>o||a.push({node:h,dist:c})}for(;a.length&&!a.peek().node.children;){var f=a.pop(),p=f.node,d=Gr(p,e,n),g=Gr(p,r,i);if(f.dist<d&&f.dist<g&&zr(n,p,s)&&zr(r,p,s))return p}(l=a.pop())&&(l=l.node)}return null}function Xr(t,e){return t.dist-e.dist}function Nr(t,e,n){if(Er(t,n)||Er(e,n))return 0;var r=Zr(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=Zr(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=Zr(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=Zr(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function Er(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function zr(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),l=Math.min(t[1],e[1]),u=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),c=n.search({minX:a,minY:l,maxX:u,maxY:h}),f=0;f<c.length;f++)if(r=c[f].p,i=c[f].next.p,o=t,r!==(s=e)&&i!==o&&Dr(r,i,o)>0!=Dr(r,i,s)>0&&Dr(o,s,r)>0!=Dr(o,s,i)>0)return!1;return!0}function Dr(t,e,n){return Yr(t[0],t[1],e[0],e[1],n[0],n[1])}function $r(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function qr(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function jr(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Gr(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Zr(t,e,n,r,i,o,s,a){var l,u,h,c,f=n-t,p=r-e,d=s-i,g=a-o,y=t-i,x=e-o,m=f*f+p*p,v=f*d+p*g,w=d*d+g*g,b=f*y+p*x,M=d*y+g*x,P=m*w-v*v,_=P,I=P;0===P?(u=0,_=1,c=M,I=w):(c=m*M-v*b,(u=v*M-w*b)<0?(u=0,c=M,I=w):u>_&&(u=_,c=M+v,I=w)),c<0?(c=0,-b<0?u=0:-b>m?u=_:(u=-b,_=m)):c>I&&(c=I,-b+v<0?u=0:-b+v>m?u=_:(u=-b+v,_=m));var A=(1-(h=0===c?0:c/I))*i+h*s-((1-(l=0===u?0:u/_))*t+l*n),S=(1-h)*o+h*a-((1-l)*e+l*r);return A*A+S*S}function Ur(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}const{PackUtil:Rr}=ne();class Jr{constructor(t,e){this.x=t,this.y=e}clone(){return new Jr(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 Jr(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}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 Jr(this.y,-this.x)}}function Hr(t,e,n,r){const i=e.x*r.y-e.y*r.x,o=n.x-t.x,s=n.y-t.y,a=(o*r.y-s*r.x)/i;return new Jr(t.x+a*e.x,t.y+a*e.y)}const Wr=[],Kr=[];function Qr(t){if(S(t[0]&&t[0].x)){const e=[];let n=0;for(let r=0;r<t.length;r++)Kr[n]?(Kr[n][0]=t[r].x,Kr[n][1]=t[r].y):Kr[n]=[t[r].x,t[r].y],e.push(Kr[n]),n++;t=e}try{const e=Vr(t,1/0);let n=[1/0,1/0],r=[-1/0,-1/0];for(let t=0;t<e.length;t++)e[t][0]<n[0]&&(n[0]=e[t][0]),e[t][0]>r[0]&&(r[0]=e[t][0]),e[t][1]<n[1]&&(n[1]=e[t][1]),e[t][1]>r[1]&&(r[1]=e[t][1]);const i=[];let o=[],s=0;for(let t=0;t<e.length;t++)t===e.length-1&&e[t][0]===e[0][0]&&e[t][1]===e[0][1]||(Pt(i,e[t],"EPSG:3857"),Wr[s]?(Wr[s].x=i[0],Wr[s].y=i[1]):Wr[s]=new Jr(i[0],i[1]),o.push(Wr[s]),s++);Rr.calculateSignedArea(o)<0&&(o=o.reverse());const a=function(t){let e,n=Number.MAX_VALUE;const r=function(t,r,i,o,s,a,l,u){var h=Hr(t,r,s,a),c=Hr(i,o,s,a),f=Hr(l,u,t,r),p=Hr(l,u,i,o),d=h.distance(c)*h.distance(f);0!==d&&d<n&&(e=[h,f,p,c],n=d)};var i=[];for(let e=0;e<t.length;e++)i.push(t[(e+1)%t.length].diff(t[e])),i[e].normalize();var o,s,a,l,u=new Jr(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new Jr(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let e=0;e<t.length;e++){var c=t[e];c.x<u.x&&(u.x=c.x,o=e),c.x>h.x&&(h.x=c.x,s=e),c.y<u.y&&(u.y=c.y,l=e),c.y>h.y&&(h.y=c.y,a=e)}var f=new Jr(0,-1),p=new Jr(0,1),d=new Jr(-1,0),g=new Jr(1,0);for(let e=0;e<t.length;e++){var y=[Math.acos(f.dot(i[o])),Math.acos(p.dot(i[s])),Math.acos(d.dot(i[a])),Math.acos(g.dot(i[l]))];switch(y.indexOf(Math.min.apply(Math,y))){case 0:(p=(f=i[o].clone()).clone()).negate(),(g=(d=f.orthogonal()).clone()).negate(),o=(o+1)%t.length;break;case 1:(f=(p=i[s].clone()).clone()).negate(),(g=(d=f.orthogonal()).clone()).negate(),s=(s+1)%t.length;break;case 2:(g=(d=i[a].clone()).clone()).negate(),(p=(f=g.orthogonal()).clone()).negate(),a=(a+1)%t.length;break;case 3:(d=(g=i[l].clone()).clone()).negate(),(p=(f=g.orthogonal()).clone()).negate(),l=(l+1)%t.length}r(t[o],f,t[s],p,t[a],d,t[l],g)}return e}(o);if(!a||4!==a.length)return null;const l=a[0].distance(a[1]),u=a[1].distance(a[2]),h=a.map((t=>[t.x,t.y]));return h.push(+(u>l)),h}catch(t){return null}}const ti=[];function ei(t,e){const n=Array.isArray(t&&t[0]&&t[0][0]);for(let r=0;r<t.length;r++)n?t[r]=ei(t[r]):(Pt(ti,t[r],e),t[r][0]=ti[0],t[r][1]=ti[1]);return t}const{PackUtil:ni}=ne();class ri extends kn{constructor(t,e,n,r,i,o){super(t,e,n,r,i),(e=e||{}).extent||(e.extent=8192),this.setData(e.data,o)}clearData(){delete this.index}setData(t,e){if(delete this.index,function(t){if(!t)return!0;if(Array.isArray(t)&&!t.length)return!0;if(t.features&&!t.features.length)return!0;return!1}(t))return this.empty=!0,void e();const n={maxZoom:24,tolerance:this.options.simplifyTolerance,extent:this.options.extent,buffer:S(this.options.tileBuffer)?this.options.tileBuffer:64,hasAltitude:!!this.options.hasAltitude,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5,disableFilter:!0};if(this.options.projection&&(n.projection=this.options.projection,"EPSG:4490"===n.projection&&(n.projection="EPSG:4326")),A(t)&&"{"!=t.substring(0,1)||t.url){const r=t.url?t.url:t;C.getJSON(r,t.url?t:{},((t,i)=>{if(t&&(console.error("Failed to fetch geojson:"+r),e(t)),!i)return void e(null,{extent:null,idMap:{}});let o=i;if(this.options.convertFn){o=new Function("data",this.options.convertFn+"\\nreturn convert(data)")(o)}const s=Array.isArray(o)?o:o.features;this._genOMBB(s);const{sample1000:a,idMap:l}=this._generateId(s);this._generate(a,l,o,n,e)}))}else{"string"==typeof t&&(t=JSON.parse(t));const r=Array.isArray(t)?t:t.features,i=r&&r.length;this._genOMBB(r);let o=r;if(r&&i>1e3){o=[];for(let t=0;t<i;t++)ii(r[t],o,t,i)}this._generate(o,null,t,n,e)}}_genOMBB(t){if(this.options.generateOMBB&&t)for(let e=0;e<t.length;e++){const n=t[e];if(n&&n.geometry&&n.geometry.coordinates)if("Polygon"===n.geometry.type){const t=n.geometry.coordinates[0];if(!t)continue;const e=Qr(t,t.length);n.properties=n.properties||{},n.properties[ee]=e}else if("MultiPolygon"===n.geometry.type){const t=n.geometry.coordinates;for(let e=0;e<t.length;e++){if(!t[e])continue;const r=t[e][0];if(!r)continue;const i=Qr(r,r.length);n.properties=n.properties||{},n.properties[ee]=n.properties[ee]||[],n.properties[ee][e]=i}}}}_generate(t,e,n,r,i){try{const o=t&&t.length?function(t){let e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];switch(t.type){case"FeatureCollection":const n=t.features.length;for(let r=0;r<n;r++)Gn(t.features[r],e);break;case"Feature":Gn(t,e);break;default:Zn(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new ut(t,e)}(n,this.options.geojsonvt||r),i(null,{extent:o,idMap:e})}catch(t){console.warn(t),i({error:t.message})}}_generateId(t){const e=[],n={};let r=0;const i=this.options.featureIdProperty;if(t){const o=t.length;t.forEach(((t,s)=>{!function(t,o,s){if(t&&("Feature"!==t.type||t.geometry)){if(S(t.id)||(t.id=r++),i){let e=i;F(i)&&(e=i[t.layer||"0"]),t.id=t.properties[e]}n[t.id]=I({},t),t.geometry?(n[t.id].geometry=I({},t.geometry),n[t.id].geometry.coordinates=null):t.coordinates&&(n[t.id].coordinates=null),ii(t,e,o,s)}}(t,s,o)}))}return{sample1000:e,idMap:n}}getTileFeatures(t,e){const n=t.tileInfo,r=[];if(!this.index)return this.empty?(setTimeout((function(){e(null,r,[])}),1),1):(setTimeout((function(){e({loading:!0})}),1),1);const i=this.index.getTile(n.z,n.x,n.y);if(!i||0===i.features.length)return setTimeout((function(){e(null,r,[])}),1),1;const o=[];for(let t=0,e=i.features.length;t<e;t++){const e=i.features[t];let n=e.layer;void 0===n&&(n="0"),o[n]={types:{}};o[n].types[e.type]=1,e.tags=e.tags||{},e.geometry.converted||(ni.convertGeometry(e),e.geometry.converted=1),r.push({type:e.type,layer:n,id:e.id,geometry:e.geometry,properties:e.tags,extent:this.options.extent})}for(const t in o)o[t].types=Object.keys(o[t].types).map((t=>+t));return setTimeout((function(){e(null,r,o)}),1),1}onRemove(){super.onRemove(),delete this.index}}function ii(t,e,n,r){const i=Math.floor(r/998);(0===n||n===r-1||(0===i||n%i==0)&&e.length<999)&&e.push(t)}var oi={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,u=l>>1,h=-7,c=n?i-1:0,f=n?-1:1,p=t[e+c];for(c+=f,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[e+c],c+=f,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},write:function(t,e,n,r,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+p]=255&s,p+=d,s/=256,u-=8);t[n+p-d]|=128*g}},si=li,ai=oi;function li(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}li.Varint=0,li.Fixed64=1,li.Bytes=2,li.Fixed32=5;var ui=4294967296,hi=1/ui,ci="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function fi(t){return t.type===li.Bytes?t.readVarint()+t.pos:t.pos+1}function pi(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function di(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function gi(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function yi(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function xi(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function mi(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function vi(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function wi(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function bi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Mi(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function Pi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function _i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ii(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Ai(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}li.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_i(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ai(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_i(this.buf,this.pos)+_i(this.buf,this.pos+4)*ui;return this.pos+=8,t},readSFixed64:function(){var t=_i(this.buf,this.pos)+Ai(this.buf,this.pos+4)*ui;return this.pos+=8,t},readFloat:function(){var t=ai.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ai.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return pi(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ci?function(t,e,n){return ci.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r="",i=e;for(;i<n;){var o,s,a,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>n)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),i+=h}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==li.Bytes)return t.push(this.readVarint(e));var n=fi(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==li.Bytes)return t.push(this.readSVarint());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==li.Bytes)return t.push(this.readBoolean());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==li.Bytes)return t.push(this.readFloat());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==li.Bytes)return t.push(this.readDouble());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==li.Bytes)return t.push(this.readFixed32());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==li.Bytes)return t.push(this.readSFixed32());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==li.Bytes)return t.push(this.readFixed64());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==li.Bytes)return t.push(this.readSFixed64());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===li.Varint)for(;this.buf[this.pos++]>127;);else if(e===li.Bytes)this.pos=this.readVarint()+this.pos;else if(e===li.Fixed32)this.pos+=4;else{if(e!==li.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ii(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ii(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ii(this.buf,-1&t,this.pos),Ii(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ii(this.buf,-1&t,this.pos),Ii(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&di(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),ai.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ai.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&di(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,li.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,gi,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,yi,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,vi,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,xi,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,mi,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,wi,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,bi,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Mi,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Pi,e)},writeBytesField:function(t,e){this.writeTag(t,li.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,li.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,li.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,li.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Si=yr(si),Ti=Fi;function Fi(t,e){this.x=t,this.y=e}Fi.prototype={clone:function(){return new Fi(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Fi.convert=function(t){return t instanceof Fi?t:Array.isArray(t)?new Fi(t[0],t[1]):t};var ki=Ti,Bi=Li;function Li(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(Ci,this,e)}function Ci(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function Yi(t){for(var e,n,r=0,i=0,o=t.length,s=o-1;i<o;s=i++)e=t[i],r+=((n=t[s]).x-e.x)*(e.y+n.y);return r}Li.types=["Unknown","Point","LineString","Polygon"],Li.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,i=0,o=0,s=0,a=[];t.pos<n;){if(i<=0){var l=t.readVarint();r=7&l,i=l>>3}if(i--,1===r||2===r)o+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&a.push(e),e=[]),e.push(new ki(o,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&a.push(e),a},Li.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(r<=0){var h=t.readVarint();n=7&h,r=h>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<s&&(s=i),i>a&&(a=i),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==n)throw new Error("unknown command "+n)}return[s,l,a,u]},Li.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=Li.types[this.type];function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+a)/o;t[e]=[360*(n.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(r=0;r<l.length;r++)c[r]=l[r][0];h(l=c);break;case 2:for(r=0;r<l.length;r++)h(l[r]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var s=Yi(t[o]);0!==s&&(void 0===r&&(r=s<0),r===s<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}n&&i.push(n);return i}(l),r=0;r<l.length;r++)for(i=0;i<l[r].length;i++)h(l[r][i])}1===l.length?l=l[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Vi=Bi,Oi=Xi;function Xi(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ni,this,e),this.length=this._features.length}function Ni(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}Xi.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Vi(this._pbf,e,this.extent,this._keys,this._values)};var Ei=Oi,zi=function(t,e){this.layers=t.readFields(Di,{},e)};function Di(t,e,n){if(3===t){var r=new Ei(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}var $i=zi;const qi=2,ji=new TextDecoder("utf-8");class Gi extends kn{constructor(t,e,n,r,i,o){super(t,e,n,r,i),e=e||{},o()}clearData(){this._abortRequests()}getTileFeatures(t,e){const n=t.tileInfo.url,r=t.fetchOptions||{},{altitudePropertyName:i,disableAltitudeWarning:o}=t,s=this._cache.get(n);if(s&&s.cacheIndex===t.workerCacheIndex){const{err:t,data:r}=s;return setTimeout((()=>{this._readTile(n,i,o,t,r,e)}),1)}const{tileArrayBuffer:a}=t;return a?setTimeout((()=>{this._readTile(n,i,o,null,a,e)}),1):(r.referrer=t.referrer,C.getArrayBuffer(n,r,((r,s)=>{this._cache&&(r?r.loading||this._cache.add(n,{err:r,data:s&&s.data,cacheIndex:t.workerCacheIndex}):s&&s.data&&this._cache.add(n,{err:null,data:s.data,cacheIndex:t.workerCacheIndex}),this._readTile(n,i,o,r,s&&s.data,e))})))}_readTile(t,e,n,r,i,o){if(r)return void o(r);let s;try{s=new $i(new Si(i))}catch(r){const e=ji.decode(i);return r.message+="\\n"+t+"\\n"+e,void o(r.message,[],[])}const a=[];if(!s.layers)return void o(null,a,[]);const l={};let u;for(const t in s.layers)if(h=s.layers,c=t,Object.prototype.hasOwnProperty.call(h,c)){l[t]={types:{}};const i=l[t].types;for(let o=0,l=s.layers[t].length;o<l;o++)try{u=s.layers[t].feature(o),i[u.type]=1;const r={type:u.type,layer:t,geometry:u.loadGeometry(),properties:u.properties,extent:u.extent};void 0!==u.id&&(r.id=u.id);let l=r.properties[ee];l&&(A(l)&&(l=JSON.parse(l)),r.properties[ee]=ei(l,"EPSG:3857"));const h=e&&r.properties[e];if(h){const t=Zi(h),e=[];Ui(r.geometry,t,e),e.length&&!n&&(console.warn("feature.geometry is not consistent with altitude values:"),console.warn(JSON.stringify(r,null,2)))}a.push(r)}catch(r){console.warn("error when load vt geometry:",r)}}var h,c;for(const t in l)l[t].types=Object.keys(l[t].types).map((t=>+t));o(null,a,l,{byteLength:i.byteLength})}abortTile(t,e){const n=this.requests[t];delete this.requests[t],n&&n.abort&&n.abort(),this._cancelLoadings(t),e()}onRemove(){super.onRemove(),this._abortRequests()}_abortRequests(){for(const t in this.requests){const e=this.requests[t];e&&e.abort&&e.abort()}this.requests={}}}function Zi(t){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new Float32Array(n.buffer)}function Ui(t,e,n,r){r||(r={index:0});for(let i=0;i<t.length;i++)if(Array.isArray(t[i]))Ui(t[i],e,n,r);else{const o=r.index;k(e[o])?n.push(qi):t[i].z=100*e[o],r.index++}}const{LRUCache:Ri}=ne();let Ji=0;const Hi=new Ri(128);class Wi{constructor(t){this._layers={},this._callbacks={},this.workerId=t}addLayer({actorId:t,mapId:e,layerId:n,params:r},i){if(this._getLayerById(e,n))return;const o=this._genKey(e,n),s=r.type,a=r.options,l=this.send.bind(this,t);this._layers[o]="GeoJSONVectorTileLayer"===s?new ri(n,a,l,Hi,{},i):new Gi(n,a,l,Hi,{},i)}removeLayer({mapId:t,layerId:e},n){const r=this._getLayerById(t,e),i=this._genKey(t,e);delete this._layers[i],r&&r.onRemove(n)}loadTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.loadTile(n,r)}abortTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.abortTile&&i.abortTile(n.url,r)}removeTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.removeTile(n,r)}updateStyle({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.updateStyle(n,r)}updateOptions({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.updateOptions(n,r)}setData({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.setData(n.data,r)}clearData({mapId:t,layerId:e},n){const r=this._getLayerById(t,e);r&&(r.clearData(n),this._resetCache())}receive(t){const e=t.callback,n=this._callbacks[e];delete this._callbacks[e],n&&t.error?n(new Error(t.error)):n&&n(null,t.data)}send(t,e,n,r,i){const o=i?\`${s}t}-${s}Ji++}\`:null;i&&(this._callbacks[o]=i),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:e,params:n,callback:String(o)},r||[])}_genKey(t,e){return\`${s}t}-${s}e}\`}_getLayerById(t,e){const n=this._genKey(t,e);return this._layers[n]}_resetCache(){Hi.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const n=t.data;if(this.dispatcher||(this.dispatcher=new Wi(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const r=n.command;this.dispatcher[r]({actorId:t.actorId,mapId:n.mapId,layerId:n.layerId,params:n.params},((t,n,i)=>{t&&404!==t.status&&204!==t.status&&!t.loading&&console.error(r,t),e(t,n,i)}))}}}`;
24
+ const s = "${", a = `function(t){let e;const n={width:100,height:10};let r=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),r=!0}catch(t){r=!1}function i(){if(!e){const{width:t,height:i}=n;r?e=new OffscreenCanvas(t,i):(e=document.createElement("canvas"),e.width=t,e.height=i)}return e}class o{constructor(t,e={}){if(!Array.isArray(t))return void console.error("colors is not array");if(t.length<2)return void console.error("colors.length should >1");this.colors=t;let r=1/0,i=-1/0;for(let e=0,n=t.length;e<n;e++){const n=t[e][0];r=Math.min(n,r),i=Math.max(n,i)}this.min=r,this.max=i,this.valueOffset=this.max-this.min,this.options=Object.assign({},n,e),this._initImgData()}getImageData(){return this.imgData}_initImgData(){const t=i(),{width:e,height:n}=this.options;t.width=e,t.height=n;const r=t.getContext("2d");r.clearRect(0,0,t.width,t.height);const o=r.createLinearGradient(0,0,t.width,0),{colors:s,valueOffset:a}=this;for(let t=0,e=s.length;t<e;t++){const[e,n]=s[t],r=(e-this.min)/a;o.addColorStop(r,n)}r.fillStyle=o,r.fillRect(0,0,t.width,t.height),this.imgData=r.getImageData(0,0,t.width,t.height)}getColor(t){t=Math.max(this.min,t);const e=((t=Math.min(t,this.max))-this.min)/this.valueOffset;let n=Math.round(e*this.imgData.width);n=Math.min(n,this.imgData.width-1);const r=4*n;return[this.imgData.data[r],this.imgData.data[r+1],this.imgData.data[r+2],this.imgData.data[r+3]]}}var s;function a(t){return null==t}function l(t){return!a(t)}function u(t){return""===t}function h(t,e){var n,r,i;if(w(t)){var o,s=t.stops&&"object"==typeof t.stops[0][0],a=s||l(t.property),u=s||!a,d=t.type||e||"exponential";if("exponential"===d)o=p;else if("interval"===d)o=f;else if("categorical"===d)o=c;else if("identity"===d)o=y;else if("color-interpolate"===d)o=g;else{if("calculate-expression"!==d)throw new Error('Unknown function type "'+d+'"');o=x}if(s){var m={},v=[];for(let e=0;e<t.stops.length;e++){var M=t.stops[e];void 0===m[M[0].zoom]&&(m[M[0].zoom]={zoom:M[0].zoom,type:t.type,property:t.property,default:t.default,stops:[]}),m[M[0].zoom].stops.push([M[0].value,M[1]])}for(let t in m)v.push([m[t].zoom,h(m[t])]);n=function(e,n){const r=p({stops:v,base:t.base},e)(e,n);return"function"==typeof r?r(e,n):r},r=!1,i=!1}else u?(n=function(e){const n=o(t,e);return"function"==typeof n?n(e):n},r=!0,i=!1):(n=function(e,n){const r=o(t,n?n[t.property]:null);return"function"==typeof r?r(e,n):r},r=!1,i=!0)}else n=function(){return t},r=!0,i=!0;return n.isZoomConstant=i,n.isFeatureConstant=r,n}function c(t,e){for(let n=0;n<t.stops.length;n++)if(e===t.stops[n][0])return t.stops[n][1];return t.default}function f(t,e){for(var n=0;n<t.stops.length&&!(e<t.stops[n][0]);n++);return t.stops[Math.max(n-1,0)][1]}function p(t,e){for(var n=l(t.base)&&!u(t.base)?t.base:1,r=0;!(r>=t.stops.length||e<=t.stops[r][0]);)r++;return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:m(e,n,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}"function"==typeof Map&&(s=new Map);const d={width:100,height:1};function g(t,e){const n=t.stops;if(n&&n.length>1){let t;if(s){const e=JSON.stringify(n);if(!s.has(e)){const t=new o(n,d);s.set(e,t)}t=s.get(e)}else t=new o(n,d);const[r,i,a,l]=t.getColor(e);return[r/255,i/255,a/255,l/255]}return n&&1===n.length?n[0][1]:null}function y(t,e){return n=e,r=t.default,l(n)?n:l(r)?r:l(i)?i:null;var n,r,i}function x(t,e){const n=String(t.property),r=t.expression,i=e;function o(e){return a(e)||u(e)||isNaN(e)?t.default:e}if(!l(e)||u(e)||isNaN(e)||e<0)return o(t.default);{const e=function t(e,n,r){const i=Number(r),o=String(n);return Array.isArray(e)?e.map((e=>t(e,o,i))):e===o?i:e}(r,n,i);return o(function e(n){if(!Array.isArray(n)){if("number"==typeof n)return n;throw new Error("Invalid expression format")}{const r=n[0];if(!["+","-","*","/"].includes(r))throw new Error(\`Unknown operator: ${s}r}\`);const i=n.slice(1).map((t=>e(t)));switch(r){case"+":return i.reduce(((t,e)=>t+e),0);case"-":return i.reduce(((t,e)=>t-e));case"*":return i.reduce(((t,e)=>t*e),1);case"/":return i.some((t=>0===t))?t.default:i.reduce(((t,e)=>t/e));default:throw new Error(\`Unsupported operator: ${s}r}\`)}}}(e))}}function m(t,e,n,r,i,o){return"function"==typeof i?function(){var s=i.apply(void 0,arguments),a=o.apply(void 0,arguments);return m(t,e,n,r,s,a)}:i.length?function(t,e,n,r,i,o){var s=[];for(let a=0;a<i.length;a++)s[a]=v(t,e,n,r,i[a],o[a]);return s}(t,e,n,r,i,o):v(t,e,n,r,i,o)}function v(t,e,n,r,i,o){var s,a=r-n,l=t-n;return i*(1-(s=1===e?l/a:(Math.pow(e,l)-1)/(Math.pow(e,a)-1)))+o*s}function w(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type||t.expression&&"calculate-expression"===t.type)}function M(t){return b(t,"interval")}function b(t,e){if(!w(t))return function(){return t};let n=!0,r=!0;const i=(t=JSON.parse(JSON.stringify(t))).stops;if(i)for(let t=0;t<i.length;t++)if(w(i[t][1])){const o=b(i[t][1],e);n=n&&o.isZoomConstant,r=r&&o.isFeatureConstant,i[t]=[i[t][0],o]}const o=h(t,e);return o.isZoomConstant=n&&o.isZoomConstant,o.isFeatureConstant=r&&o.isFeatureConstant,o}let P=0;const _="function"==typeof Object.assign;function I(t,...e){if(_)return Object.assign(t,...e),t;for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)t[e]=r[e]}return t}function A(t){return!k(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function S(t){return"number"==typeof t&&!isNaN(t)}function T(t){return!k(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function F(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function k(t){return null==t}function L(t){return w(t)&&t.property}const B="function"==typeof fetch&&"function"==typeof AbortController,C={jsonp:function(t,e){const n="_maptalks_jsonp_"+P++;t.match(/\\?/)?t+="&callback="+n:t+="?callback="+n;let r=document.createElement("script");return r.type="text/javascript",r.src=t,window[n]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(r),r=null,delete window[n]},document.getElementsByTagName("head")[0].appendChild(r),this},get:function(t,e,n){if(T(e)){const t=n;n=e,e=t}let r=(e=e||{}).errorLog;k(r)&&(r=!0),e.method&&(e.method=e.method.toUpperCase());const i="POST"===e.method;if(B){const i=new AbortController,o=e;o.signal=i.signal,o.referrerPolicy=o.referrerPolicy||"origin",o.method=o.method||"GET";const s=new Request(t,o);return e.returnJSON&&s.headers.set("Accept","application/json"),fetch(s).then((i=>{const o=this._parseResponse(i,e.returnJSON,e.responseType);o.message?(o.url=t,n(o)):o.then((t=>{"arraybuffer"===e.responseType?n(null,{data:t,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),contentType:i.headers.get("Content-Type")}):n(null,t)})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(r&&console.error("Fetch error:",t,e),n(e))}))})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(r&&console.error("Fetch error:",t,e),n(e))})),i}{const r=C._getClient(n);if(r.open(e.method||"GET",t,!0),e){for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);r.withCredentials="include"===e.credentials,e.responseType&&(r.responseType=e.responseType)}return r.send(i?e.body:null),r}},_parseResponse:(t,e,n)=>200!==t.status?{status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${s}t.status}): ${s}t.statusText}\`}:"arraybuffer"===n?t.arrayBuffer():e?t.json():t.text(),_wrapCallback:function(t,e){return function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?e({status:200,statusText:t.statusText,message:"http status 200 returned without content."}):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else e(null,t.responseText);else e({status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${s}t.status}): ${s}t.statusText}\`})}},_getClient:function(t){let e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return e.onreadystatechange=C._wrapCallback(e,t),e},getArrayBuffer(t,e,n){if(T(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",C.get(t,e,n)}};function Y(t,e,n,r,i=3){let o=r;const s=n-e>>1;let a,l=n-e;const u=t[e],h=t[e+1],c=t[n],f=t[n+1];for(let r=e+i;r<n;r+=i){const e=O(t[r],t[r+1],u,h,c,f);if(e>o)a=r,o=e;else if(e===o){const t=Math.abs(r-s);t<l&&(a=r,l=t)}}o>r&&(a-e>i&&Y(t,e,a,r,i),t[a+2]=o,n-a>i&&Y(t,a,n,r,i))}function O(t,e,n,r,i,o){let s=i-n,a=o-r;if(0!==s||0!==a){const l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return s=t-n,a=e-r,s*s+a*a}function V(t,e,n,r,i,o){const s={id:null==t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};i&&(s.layer=i);return function(t,e){const n=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)X(t,n,e);else if("Polygon"===r)X(t,n[0],e);else if("MultiLineString"===r)for(const r of n)X(t,r,e);else if("MultiPolygon"===r)for(const r of n)X(t,r[0],e)}(s,o?4:3),s}function X(t,e,n){for(let r=0;r<e.length;r+=n)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function E(t,e,n,r){if(r.layer=e,"FeatureCollection"===n.type)for(let e=0;e<n.features.length;e++)N(t,n.features[e],r,e);else"Feature"===n.type?N(t,n,r):N(t,{geometry:n},r)}function N(t,e,n,r){if(!e.geometry)return;const i=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2);let a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=r||0),"Point"===o)z(i,a,n);else if("MultiPoint"===o)for(const t of i)z(t,a,n);else if("LineString"===o)D(i,a,s,!1,n);else if("MultiLineString"===o){if(n.lineMetrics){for(const r of i)a=[],D(r,a,s,!1,n),t.push(V(l,"LineString",a,e.properties,n.layer,n.hasAltitude));return}$(i,a,s,!1,n)}else if("Polygon"===o)$(i,a,s,!0,n);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const i of e.geometry.geometries)N(t,{id:l,geometry:i,properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of i){const e=[];$(t,e,s,!0,n),a.push(e)}}t.push(V(l,o,a,e.properties,n.layer,n.hasAltitude))}function z(t,e,n){e.push(q(t[0]),j(t[1],n.projection),0),n.hasAltitude&&(t.length>2?e.push(t[2]):e.push(0))}function D(t,e,n,r,i){let o,s,a=0;for(let n=0;n<t.length;n++){const l=q(t[n][0]),u=j(t[n][1],i.projection);e.push(l,u,0),i.hasAltitude&&(t[n].length>2?e.push(t[n][2]):e.push(0)),n>0&&(a+=r?(o*u-l*s)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-s,2))),o=l,s=u}const l=i.hasAltitude?4:3,u=e.length-l;e[2]=1,Y(e,0,u,n,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function $(t,e,n,r,i){for(let o=0;o<t.length;o++){const s=[];D(t[o],s,n,r,i),e.push(s)}}function q(t){return t/360+.5}function j(t,e){if("EPSG:4326"===e)return(90-t)/360;const n=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return r<0?0:r>1?1:r}function G(t,e,n,r,i,o,s,a){if(r/=e,o>=(n/=e)&&s<r)return t;if(s<n||o>=r)return null;const l=[];for(const e of t){const t=e.geometry;let o=e.type;const s=0===i?e.minX:e.minY,u=0===i?e.maxX:e.maxY;if(s>=n&&u<r){l.push(e);continue}if(u<n||s>=r)continue;let h=[];if("Point"===o||"MultiPoint"===o)Z(t,h,n,r,i,a.hasAltitude);else if("LineString"===o)U(t,h,n,r,i,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)J(t,h,n,r,i,!1,a.hasAltitude);else if("Polygon"===o)J(t,h,n,r,i,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];J(e,t,n,r,i,!0,a.hasAltitude),t.length&&h.push(t)}if(h.length){if(a.lineMetrics&&"LineString"===o){for(const t of h)l.push(V(e.id,o,t,e.tags,e.layer,a.hasAltitude));continue}"LineString"!==o&&"MultiLineString"!==o||(1===h.length?(o="LineString",h=h[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===h.length?"Point":"MultiPoint"),l.push(V(e.id,o,h,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function Z(t,e,n,r,i,o){const s=o?4:3;for(let a=0;a<t.length;a+=s){const s=t[a+i];s>=n&&s<=r&&(H(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function U(t,e,n,r,i,o,s,a){let l=R(t);const u=0===i?W:K;let h,c,f=t.start;const p=a?4:3,d=o?t.length:t.length-p;for(let g=0;g<d;g+=p){const y=t[g],x=t[g+1],m=t[g+2];let v,w,M,b;o&&g===d-p?(v=t[0],w=t[1]):(v=t[g+p],w=t[g+p+1]),a&&(M=t[g+3],b=o&&g===d-p?t[3]:t[g+p+3]);const P=0===i?y:x,_=0===i?v:w;let I=!1;s&&(h=Math.sqrt(Math.pow(y-v,2)+Math.pow(x-w,2))),P<n?_>n&&(c=u(l,y,x,v,w,n),a&&l.push(Q(M,b,c)),s&&(l.start=f+h*c)):P>r?_<r&&(c=u(l,y,x,v,w,r),a&&l.push(Q(M,b,c)),s&&(l.start=f+h*c)):(H(l,y,x,m),a&&l.push(M)),_<n&&P>=n&&(c=u(l,y,x,v,w,n),a&&l.push(Q(M,b,c)),I=!0),_>r&&P<=r&&(c=u(l,y,x,v,w,r),a&&l.push(Q(M,b,c)),I=!0),!o&&I&&(s&&(l.end=f+h*c),e.push(l),l=R(t)),s&&(f+=h)}let g=t.length-p;if(!o){const e=t[g],o=t[g+1],s=t[g+2],u=0===i?e:o;if(u>=n&&u<=r&&H(l,e,o,s),u>=n&&u<=r&&a){const e=t[g+3];l.push(e)}}g=l.length-p,o&&g>=p&&(l[g]!==l[0]||l[g+1]!==l[1])&&(H(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function R(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,n,r,i,o,s){for(const a of t)U(a,e,n,r,i,o,!1,s)}function H(t,e,n,r){t.push(e,n,r)}function W(t,e,n,r,i,o){const s=(o-e)/(r-e);return H(t,o,n+(i-n)*s,1),s}function K(t,e,n,r,i,o){const s=(o-n)/(i-n);return H(t,e+(r-e)*s,o,1),s}function Q(t,e,n){return t+(e-t)*n}function tt(t,e,n){const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=o.type;let a;if("Point"===s||"MultiPoint"===s||"LineString"===s)a=et(o.geometry,e,n);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(et(t,e,n))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const r=[];for(const i of t)r.push(et(i,e,n));a.push(r)}}r.push(V(o.id,s,a,o.tags,o.layer,n))}return r}function et(t,e,n){const r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);const i=n?4:3;for(let o=0;o<t.length;o+=i)r.push(t[o]+e,t[o+1],t[o+2]),n&&r.push(t[o+3]);return r}function nt(t,e,n){if(t.transformed)return t;const r=1<<t.z,i=t.x,o=t.y,s=n?3:2;for(const a of t.features){const t=a.geometry,l=a.type;if(a.geometry=[],1===l)for(let l=0;l<t.length;l+=s)a.geometry.push(rt(t[l],t[l+1],e,r,i,o)),n&&a.geometry[a.geometry.length-1].push(t[l+2]);else for(let l=0;l<t.length;l++){const u=[];for(let a=0;a<t[l].length;a+=s)u.push(rt(t[l][a],t[l][a+1],e,r,i,o)),n&&u[u.length-1].push(t[l][a+2]);a.geometry.push(u)}}return t.transformed=!0,t}function rt(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function it(t,e,n,r,i){const o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)ot(s,e,o,i);return s}function ot(t,e,n,r){const i=e.geometry,o=e.type,s=[],a=r.hasAltitude?4:3;if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===o||"MultiPoint"===o)for(let e=0;e<i.length;e+=a)s.push(i[e],i[e+1]),r.hasAltitude&&s.push(i[e+3]),t.numPoints++,t.numSimplified++;else if("LineString"===o)at(s,i,t,n,!1,!1,r);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<i.length;e++)at(s,i[e],t,n,"Polygon"===o,0===e,r);else if("MultiPolygon"===o)for(let e=0;e<i.length;e++){const o=i[e];for(let e=0;e<o.length;e++)at(s,o[e],t,n,!0,0===e,r)}if(s.length){let n=e.tags||null;if("LineString"===o&&r.lineMetrics){n={};for(const t in e.tags)n[t]=e.tags[t];n.mapbox_clip_start=i.start/i.size,n.mapbox_clip_end=i.end/i.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:n};e.layer&&(a.layer=e.layer),null!==e.id&&(a.id=e.id),t.features.push(a)}}function st(t,e,n){return 0===t[e+2]&&t[e+3]>0&&n}function at(t,e,n,r,i,o,s){const a=r*r,{hasAltitude:l,disableFilter:u}=s,h=l?4:3;if(!u&&r>0&&e.size<(i?a:r))return void(n.numPoints+=e.length/h);const c=[];for(let t=0;t<e.length;t+=h)(0===r||e[t+2]>a||st(e,t,l))&&(n.numSimplified++,c.push(e[t],e[t+1]),l&&c.push(e[t+3])),n.numPoints++;i&&function(t,e,n){const r=n?3:2;let i=0;for(let e=0,n=t.length,o=n-r;e<n;o=e,e+=r)i+=(t[e]-t[o])*(t[e+1]+t[o+1]);if(i>0===e){const e=r,i=r-1,o=r-2;for(let s=0,a=t.length;s<a/2;s+=r){const r=t[s],l=t[s+1];let u;n&&(u=t[s+2]),t[s]=t[a-e-s],t[s+1]=t[a-i-s],n&&(t[s+2]=t[a-o-s]),t[a-e-s]=r,t[a-i-s]=l,n&&(t[a-o-s]=u)}}}(c,o,l),t.push(c)}C.getJSON=function(t,e,n){if(T(e)){const t=n;n=e,e=t}const r=function(t,e){const r="string"==typeof e?JSON.parse(e):e||null;n(t,r)};return e&&e.jsonp?C.jsonp(t,r):((e=e||{}).returnJSON=!0,C.get(t,e,r))};const lt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,hasAltitude:!1,disableFilter:!1,debug:0};class ut{constructor(t,e){const n=(e=this.options=function(t,e){for(const n in e)t[n]=e[n];return t}(Object.create(lt),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,e){const n=[];if(Array.isArray(t)){for(let r=0;r<t.length;r++)E(n,t[r].layer,t[r].data,e);return n}if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)N(n,t.features[r],e,r);else"Feature"===t.type?N(n,t,e):N(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){const n=e.buffer/e.extent;let r=t;const i=G(t,1,-1-n,n,0,-1,2,e),o=G(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=G(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=tt(i,1,e.hasAltitude).concat(r)),o&&(r=r.concat(tt(o,-1,e.hasAltitude)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,n,r,i,o,s){const a=[t,e,n,r],l=this.options,u=l.debug;for(;a.length;){r=a.pop(),n=a.pop(),e=a.pop(),t=a.pop();const h=1<<e,c=ht(e,n,r);let f=this.tiles[c];if(!f&&(u>1&&console.time("creation"),f=this.tiles[c]=it(t,e,n,r,l),this.tileCoords.push({z:e,x:n,y:r}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));const t=\`z${s}e}\`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){const t=i-e;if(n!==o>>t||r!==s>>t)continue}}if(f.source=null,0===t.length)continue;u>1&&console.time("clipping");const p=.5*l.buffer/l.extent,d=.5-p,g=.5+p,y=1+p;let x=null,m=null,v=null,w=null,M=G(t,h,n-p,n+g,0,f.minX,f.maxX,l),b=G(t,h,n+d,n+y,0,f.minX,f.maxX,l);t=null,M&&(x=G(M,h,r-p,r+g,1,f.minY,f.maxY,l),m=G(M,h,r+d,r+y,1,f.minY,f.maxY,l),M=null),b&&(v=G(b,h,r-p,r+g,1,f.minY,f.maxY,l),w=G(b,h,r+d,r+y,1,f.minY,f.maxY,l),b=null),u>1&&console.timeEnd("clipping"),a.push(x||[],e+1,2*n,2*r),a.push(m||[],e+1,2*n,2*r+1),a.push(v||[],e+1,2*n+1,2*r),a.push(w||[],e+1,2*n+1,2*r+1)}}getTile(t,e,n){t=+t,e=+e,n=+n;const r=this.options,{extent:i,debug:o}=r,{hasAltitude:s,wrapX:a}=r;if(t<0||t>24)return null;if(a){const n=1<<t;e=e+n&n-1}const l=ht(t,e,n);if(this.tiles[l])return nt(this.tiles[l],i,s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);let u,h=t,c=e,f=n;for(;!u&&h>0;)h--,c>>=1,f>>=1,u=this.tiles[ht(h,c,f)];return u&&u.source?(o>1&&(console.log("found parent tile z%d-%d-%d",h,c,f),console.time("drilling down")),this.splitTile(u.source,h,c,f,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[l]?nt(this.tiles[l],i,s):null):null}}function ht(t,e,n){return 32*((1<<t)*n+e)+t}function ct(t,e,n,r,i,o,s){const a=n&&Array.isArray(n[0]);for(let l=0,u=n.length;l<u;l++){t[e]=(a?n[l][0]:n[l].x)*r,t[e+1]=(a?n[l][1]:n[l].y)*r,s!==Float32Array&&(t[e]=Math.round(t[e]),t[e+1]=Math.round(t[e+1]));let h=i||0;Array.isArray(i)&&(h=i[l]),h=h?Math.round(r*h):0,t[e+2]=h,e+=3,o&&0!==l&&l!==u-1&&(t[e]=t[e-3],t[e+1]=t[e-2],t[e+2]=t[e-1],e+=3)}return t.trySetLength&&t.trySetLength(e),e}function ft(t,e,n,r){const i=t[3*e],o=t[3*e+1],s=t[3*n],a=t[3*n+1];return i===s&&(i<0||i>r)||o===a&&(o<0||o>r)}var pt="undefined"!=typeof Float32Array?Float32Array:Array;function dt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function gt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function yt(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function xt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function mt(t,e,n){return t[0]=e,t[1]=n,t}function vt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),function(){var t,e=(t=new pt(3),pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t)}(),function(){var t,e=(t=new pt(4),pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}(),function(){var t,e=(t=new pt(2),pt!=Float32Array&&(t[0]=0,t[1]=0),t)}();const wt=Math.PI/180,Mt=6378137*Math.PI/180,bt=85.0511287798;function Pt(t,e,n){if("EPSG:3857"===n)return function(t,e){const n=bt,r=e[0],i=Math.max(Math.min(n,e[1]),-n);let o;o=0===i?0:Math.log(Math.tan((90+i)*wt/2))/wt;return t[0]=r*Mt,t[1]=o*Mt,t}(t,e);if("EPSG:4326"===n||"EPSG:4490"===n||"identity"===n)return _t(t,e);if("baidu"===n)return _t(t,e);throw new Error("unsupported projection:"+n)}function _t(t,e){return t[0]=e[0],t[1]=e[1],t}function It(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){0===t?function(t,e,n,r,i,o,s,a,l,u){const h=1/(100*o[0]),c=1/(100*o[1]),f=u&&u[0]||0,p=u&&u[1]||0,d=[0,0];for(let i=t;i<e;i+=3){const t=i/3*2,e=r[i]-f,o=r[i+1]-p;n[t]=d[0]+e/s*h/a,n[t+1]=d[1]-o/s*c/l}}(e,n,r,i,0,s,a,l,u,d):1===t&&function(t,e,n,r,i,o,s,a,l,u,h){if(!t)return;let c,f,p,d;0===t[4]?(c=t[0],f=t[1],p=t[2],d=t[3]):(c=t[1],f=t[2],p=t[3],d=t[0]);const g=vt(c,f),y=vt(f,p),x=[],m=[],v=[];for(let t=e;t<n;t+=3){const e=t/3*2;mt(x,(o.x/l+i[t]/s)*a,o.y/l*a+(h?i[t+1]:-i[t+1])/s*a),"EPSG:4326"!==u&&"EPSG:4490"!==u||Pt(x,x,"EPSG:3857"),At(m,x,c,f),At(v,x,d,c),r[e]=vt(c,m)/g,r[e+1]=vt(c,v)/y}}(h,e,n,r,i,o,a,c,f,p,!!d)}function At(t,e,n,r){const i=n[0]-r[0],o=n[1]-r[1];let s=(e[0]-n[0])*(n[0]-r[0])+(e[1]-n[1])*(n[1]-r[1]);return s/=i*i+o*o,t[0]=n[0]+s*i,t[1]=n[1]+s*o,t}function St(t,e,n,r,i){const o=3*e[n-1],s=3*e[n-1]+1,a=t[o],l=t[s];return u=r,h=i,c=a,f=l,Math.sqrt((c-u)*(c-u)+(f-h)*(f-h));var u,h,c,f}function Tt(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let o=Ft(t,0,i,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u;if(r&&(o=function(t,e,n,r){const i=[];for(let n=0,o=e.length;n<o;n++){const s=Ft(t,e[n]*r,n<o-1?e[n+1]*r:t.length,r,!1);s===s.next&&(s.steiner=!0),i.push(zt(s))}i.sort(Vt);for(let t=0;t<i.length;t++)n=Xt(i[t],n);return n}(t,e,o,n)),t.length>80*n){a=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=n;o<i;o+=n){const n=t[o],i=t[o+1];n<a&&(a=n),i<l&&(l=i),n>e&&(e=n),i>r&&(r=i)}u=Math.max(e-a,r-l),u=0!==u?32767/u:0}return Lt(o,s,n,a,l,u,0),s}function Ft(t,e,n,r,i){let o;if(i===function(t,e,n,r){let i=0;for(let o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}(t,e,n,r)>0)for(let i=e;i<n;i+=r)o=Wt(i/r|0,t[i],t[i+1],o);else for(let i=n-r;i>=e;i-=r)o=Wt(i/r|0,t[i],t[i+1],o);return o&&Gt(o,o.next)&&(Kt(o),o=o.next),o}function kt(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!Gt(r,r.next)&&0!==jt(r.prev,r,r.next))r=r.next;else{if(Kt(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function Lt(t,e,n,r,i,o,s){if(!t)return;!s&&o&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=Nt(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n=1;do{let r,i=t;t=null;let o=null;for(e=0;i;){e++;let s=i,a=0;for(let t=0;t<n&&(a++,s=s.nextZ,s);t++);let l=n;for(;a>0||l>0&&s;)0!==a&&(0===l||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(e>1)}(i)}(t,r,i,o);let a=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ct(t,r,i,o):Bt(t))e.push(l.i,t.i,u.i),Kt(t),t=u.next,a=u.next;else if((t=u)===a){s?1===s?Lt(t=Yt(kt(t),e),e,n,r,i,o,2):2===s&&Ot(t,e,n,r,i,o):Lt(kt(t),e,n,r,i,o,1);break}}}function Bt(t){const e=t.prev,n=t,r=t.next;if(jt(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,h=Math.min(i,o,s),c=Math.min(a,l,u),f=Math.max(i,o,s),p=Math.max(a,l,u);let d=r.next;for(;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&$t(i,a,o,l,s,u,d.x,d.y)&&jt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ct(t,e,n,r){const i=t.prev,o=t,s=t.next;if(jt(i,o,s)>=0)return!1;const a=i.x,l=o.x,u=s.x,h=i.y,c=o.y,f=s.y,p=Math.min(a,l,u),d=Math.min(h,c,f),g=Math.max(a,l,u),y=Math.max(h,c,f),x=Nt(p,d,e,n,r),m=Nt(g,y,e,n,r);let v=t.prevZ,w=t.nextZ;for(;v&&v.z>=x&&w&&w.z<=m;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&$t(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&$t(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;v&&v.z>=x;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&$t(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;w&&w.z<=m;){if(w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&$t(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function Yt(t,e){let n=t;do{const r=n.prev,i=n.next.next;!Gt(r,i)&&Zt(r,n,n.next,i)&&Jt(r,i)&&Jt(i,r)&&(e.push(r.i,n.i,i.i),Kt(n),Kt(n.next),n=t=i),n=n.next}while(n!==t);return kt(n)}function Ot(t,e,n,r,i,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&qt(s,t)){let a=Ht(s,t);return s=kt(s,s.next),a=kt(a,a.next),Lt(s,e,n,r,i,o,0),void Lt(a,e,n,r,i,o,0)}t=t.next}s=s.next}while(s!==t)}function Vt(t,e){let n=t.x-e.x;if(0===n&&(n=t.y-e.y,0===n)){n=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return n}function Xt(t,e){const n=function(t,e){let n=e;const r=t.x,i=t.y;let o,s=-1/0;if(Gt(t,n))return n;do{if(Gt(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>s&&(s=t,o=n.x<n.next.x?n:n.next,t===r))return o}n=n.next}while(n!==e);if(!o)return null;const a=o,l=o.x,u=o.y;let h=1/0;n=o;do{if(r>=n.x&&n.x>=l&&r!==n.x&&Dt(i<u?r:s,i,l,u,i<u?s:r,i,n.x,n.y)){const e=Math.abs(i-n.y)/(r-n.x);Jt(n,t)&&(e<h||e===h&&(n.x>o.x||n.x===o.x&&Et(o,n)))&&(o=n,h=e)}n=n.next}while(n!==a);return o}(t,e);if(!n)return e;const r=Ht(n,t);return kt(r,r.next),kt(n,n.next)}function Et(t,e){return jt(t.prev,t,e.prev)<0&&jt(e.next,t,t.next)<0}function Nt(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zt(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Dt(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function $t(t,e,n,r,i,o,s,a){return!(t===s&&e===a)&&Dt(t,e,n,r,i,o,s,a)}function qt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Zt(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Jt(t,e)&&Jt(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(jt(t.prev,t,e.prev)||jt(t,e.prev,e))||Gt(t,e)&&jt(t.prev,t,t.next)>0&&jt(e.prev,e,e.next)>0)}function jt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Gt(t,e){return t.x===e.x&&t.y===e.y}function Zt(t,e,n,r){const i=Rt(jt(t,e,n)),o=Rt(jt(t,e,r)),s=Rt(jt(n,r,t)),a=Rt(jt(n,r,e));return i!==o&&s!==a||(!(0!==i||!Ut(t,n,e))||(!(0!==o||!Ut(t,r,e))||(!(0!==s||!Ut(n,t,r))||!(0!==a||!Ut(n,e,r)))))}function Ut(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Rt(t){return t>0?1:t<0?-1:0}function Jt(t,e){return jt(t.prev,t,t.next)<0?jt(t,e,t.next)>=0&&jt(t,t.prev,e)>=0:jt(t,e,t.prev)<0||jt(t,t.next,e)<0}function Ht(t,e){const n=Qt(t.i,t.x,t.y),r=Qt(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Wt(t,e,n,r){const i=Qt(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Kt(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 Qt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const te="__fea_idx";new Float32Array([-1e12])[0];const ee="maptalks_ombb";function ne(){return function(){if("undefined"!=typeof undefinedThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof undefined)return global;throw new Error("unable to locate global object")}().maptalks_vt_packers}const{PackUtil:re,ArrayPool:ie}=ne();function oe(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g,y){const x=e.getLength(),m=i/3;for(let n=2,r=x;n<r;n+=3)t[i+n-2]=e[n-2],t[i+n-1]=e[n-1],t[i+n-0]=e[n]-s;i+=x;for(let n=2,r=x;n<r;n+=3)t[i+n-2]=e[n-2],t[i+n-1]=e[n-1],t[i+n-0]=e[n]-a;i+=x,t.trySetLength(i+x),t.copyWithin(i,i-2*x,i-x),i+=x,t.trySetLength(i+x),t.copyWithin(i,i-2*x,i-x),i+=x,(n=n||[]).push(x/3);const v=n.getLength();for(let e=0;e<v;e++){se(m+(n[e-1]||0),m+n[e],t,x/3,l,r,u,h,c,f,o,p,d,g,y)}return i}function se(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){const g=o.getLength();let y,x;for(let s=t,a=e;s<a-1;s++)if(y=s,x=s+1,i===1/0||!ft(n,y,x,i))if((s-t)%2==1&&(y+=2*r,x+=2*r),d){let t=o.currentIndex;o[t++]=y+r,o[t++]=x,o[t++]=y,o[t++]=x+r,o[t++]=x,o[t++]=y+r,o.currentIndex=t}else{let t=o.currentIndex;o[t++]=y+r,o[t++]=y,o[t++]=x,o[t++]=x,o[t++]=x+r,o[t++]=y+r,o.currentIndex=t}s&&function(t,e,n,r,i,o,s,a,l,u,h,c){let f,p=0,d=0,g=0,y=0;const x=c?[1,3,4]:[2,3,4];for(let c=o.getLength()-1;c>=s;c--){const s=o[c],m=3*s+1,v=3*s+2,w=i[3*s],M=i[m],b=i[v];p||d||(p=Math.max(i[v],i[3*o[c-3]+2]),d=Math.min(i[v],i[3*o[c-3]+2]),f=p-d);let P=g;const _=c%6;0===t?(5===_&&(y=St(i,o,c,w,M)),P=_===x[0]||_===x[1]||_===x[2]?g:g+y):1===t&&(_===x[0]||_===x[1]||_===x[2]?P=0:5===_?(y=St(i,o,c,w,M),P=y):P=y);const I=P/u*(1/(100*h))/a;let A;A=1===e?b===p?1:0:"bottom"===n?b===p?f/100/l:0:b===p?0:-f/100/l,r[2*s]=I,r[2*s+1]=A,0===_&&(g+=y)}}(a,l,u,h,n,o,g,c[0],c[1],f,p,d)}function ae(t){const e=[t[0]];let n=t[0];for(let r=1;r<t.length;r++)Array.isArray(t[r])?t[r][0]===n[0]&&t[r][1]===n[1]&&t[r][2]===n[2]||e.push(t[r]):t[r].x===n.x&&t[r].y===n.y&&t[r].z===n.z||e.push(t[r]),n=t[r];return e}var le="undefined"!=typeof Float32Array?Float32Array:Array;function ue(){var t=new le(3);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function he(t,e,n){var r=new le(3);return r[0]=t,r[1]=e,r[2]=n,r}function ce(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function fe(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function pe(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function de(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function ge(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=i*l-o*a,t[1]=o*s-r*l,t[2]=r*a-i*s,t}var xe=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t};function me(){var t=new le(4);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ve(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+s]-e[3*s+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}!function(){var t=ue()}(),function(){var t,e=(t=new le(4),le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var we,Me=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},be=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=o*s),t};ue(),he(1,0,0),he(0,1,0),me(),me(),we=new le(9),le!=Float32Array&&(we[1]=0,we[2]=0,we[3]=0,we[5]=0,we[6]=0,we[7]=0),we[0]=1,we[4]=1,we[8]=1;\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */\nconst Pe=8,_e=[],Ie=[],Ae=[],Se=[];function Te(t,e,n){const r=ye(Ie,e,n),i=function(t,e,n,r,i,o,s,a,l,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(_e,n[0],n[1],n[2],...r,...e);t=ve(t,i),t=function(t){return t[3]<0?Me(t,t,-1):t}(t=be(t,t));const o=1/((1<<2*Pe-1)-1);if(t[3]<o){t[3]=o;const e=Math.sqrt(1-o*o);t[0]*=e,t[1]*=e,t[2]*=e}const s=n[3]>0?ye(Ae,n,e):ye(Ae,e,n);return ge(ye(Se,n,e),s)<0&&Me(t,t,-1),t}const Fe=[];const ke=[],Le=[],Be=[],Ce=[],Ye=[],Oe=[],Ve=[];function Xe(t,e,n,r,i,o){fe(Ce,t[3*e],t[3*e+1],t[3*e+2]),fe(Ye,t[3*n],t[3*n+1],t[3*n+2]),fe(Oe,t[3*r],t[3*r+1],t[3*r+2]);const s=xe(ke,Oe,Ye),a=xe(Le,Ce,Ye),l=ye(Be,s,a);de(Ve,l),i[3*e]=i[3*e]||0,i[3*n]=i[3*n]||0,i[3*r]=i[3*r]||0,i[3*e+1]=i[3*e+1]||0,i[3*n+1]=i[3*n+1]||0,i[3*r+1]=i[3*r+1]||0,i[3*e+2]=i[3*e+2]||0,i[3*n+2]=i[3*n+2]||0,i[3*r+2]=i[3*r+2]||0,i[3*e]+=Ve[0],i[3*n]+=Ve[0],i[3*r]+=Ve[0],i[3*e+1]+=Ve[1],i[3*n+1]+=Ve[1],i[3*r+1]+=Ve[1],i[3*e+2]+=Ve[2],i[3*n+2]+=Ve[2],i[3*r+2]+=Ve[2],o[e]+=1,o[n]+=1,o[r]+=1}\n/*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */function Ee(t,e,n){return t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t}function Ne(t,e,n){return t[0]=e[n],t[1]=e[n+1],t}const{StyleUtil:ze,PackUtil:De,ArrayPool:$e}=ne(),qe=$e.getInstance();function je(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0),qe.reset();const{altitudeScale:y,altitudeProperty:x,defaultAltitude:m,heightProperty:v,minHeightProperty:P,defaultHeight:_,tangent:I,uv:A,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,top:B,side:C,textureYOrigin:Y,topThickness:O}=e,V=function(t,e,{altitudeScale:n,altitudeProperty:r,defaultAltitude:i,heightProperty:o,minHeightProperty:s,defaultHeight:a},{center:l,side:u,top:h,topThickness:c,uvOrigin:f,uv:p,uvSize:d,topUVMode:g,sideUVMode:y,sideVerticalUVMode:x,textureYOrigin:m,tileRatio:v,centimeterToPoint:w,verticalCentimeterToPoint:M,positionType:b,res:P,glScale:_,projectionCode:I},A,T){let F=e/t[0].extent;e===1/0&&(F=1);const k=e===1/0,L=T.get(),B=T.get(),C=T.get(),Y=T.getProxy(),O=T.get(),V=T.get(),X=T.get(),E=!!p,N=!!h,z=!!u,D=E?T.get():null;function $(t,n,r,i,o,s){let a=n;if(N){const u=Tt(Y,r,3);if(0===u.length)return n;let h=Y.getLength(),p=O.currentIndex;for(let t=0;t<h;t++)O[p++]=Y[t];if(O.currentIndex=p,n+=Y.getLength(),s)for(let e=2,n=u.length;e<n;e+=3)u[e]+=t/3,u[e-1]+=t/3,u[e-2]+=t/3;else{let e;for(let n=2,r=u.length;n<r;n+=3)e=u[n-1],u[n-1]=u[n]+t/3,u[n]=e+t/3,u[n-2]+=t/3}h=u.length,p=V.currentIndex;for(let t=0;t<h;t++)V[p++]=u[t];V.currentIndex=p,E&&It(g||0,t,n,D,O,f,w,v,d[0],d[1],o,P,_,I,l),c>0&&!z&&(n=oe(O,Y,r,V,n,D,0,c,e,E,y||0,x||0,m,d,v,M,i<0?!s:s)),X.setLength(n/3),X.fill(1,a/3,n/3)}if(z){N&&(c=0),a=n,n=oe(O,Y,r,V,n,D,c,i,e,E,y||0,x||0,m,d,v,M,i<0?!s:s),X.setLength(n/3);const t=Y.getLength()/3;X.fill(1,a/3,a/3+t),X.fill(0,a/3+t,a/3+2*t),X.fill(1,a/3+2*t,a/3+3*t),X.fill(0,a/3+3*t,n/3)}return n}let q=-1/0,j=1/0,G=0;const Z=[-1,-1,e+1,e+1];let U=0,R=t.length;S(A)&&(U=A,R=A+1);let J=0,H=!1;const W=T.getProxy();let K=!1;for(;U<R;U++){const l=t[U],u=l.id;S(u)&&(Math.abs(u)>J&&(J=Math.abs(u)),u<0&&(H=!0));const h=l.geometry,c=l.properties[ee];let f=Array.isArray(c&&c[0]&&c[0][0])?c[0]:c;const{altitude:p,height:d}=re.getFeaAltitudeAndHeight(l,n,r,i,o,a,s);d<0?(K=!0,j=Math.min(p,j),q=Math.max(p-d,q)):(q=Math.max(p,q),j=Math.min(p-d,j));const g=O.getLength();let y=0,x=G;W.setLength(0),Y.setLength(0);const m=re.calculateSignedArea(h[0])<0;for(let t=0,n=h.length;t<n;t++){let r=h[t];m&&(r=r.reverse()),r=ae(r);const i=re.calculateSignedArea(r)<0;if(!i&&t>0&&(y++,f=c&&c[y],G=$(x,G,W,d*F,f,k),Y.setLength(0),W.setLength(0),x=G),e!==1/0&&(r=re.clipPolygon(r,Z)),!r.length){t===n-1&&(G=$(x,G,W,d*F,f,k));continue}const o=r.length;if(Array.isArray(r[0])?r[0][0]===r[o-1][0]&&r[0][1]===r[o-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[o-1].x&&r[0].y===r[o-1].y||r.push(r[0]),i){let t=W.currentIndex;W[t++]=Y.getLength()/3,W.currentIndex=t}ct(Y,Y.getLength(),r,F,p,!1,b),t===n-1&&(G=$(x,G,W,d*F,f,k))}const v=O.getLength()-g,w=(te+"").trim();for(let t=0;t<v/3;t++){let t=B.currentIndex;B[t++]=void 0===l[w]?U:l[w],B.currentIndex=t,t=L.currentIndex,L[t++]=U,L.currentIndex=t,S(u)&&(t=C.currentIndex,C[t++]=u,C.currentIndex=t)}}const Q=re.getUnsignedArrayType(B.getLength()?B[B.getLength()-1]:0),tt={hasNegativeHeight:K,maxAltitude:q===-1/0?0:q,minAltitude:j===1/0?0:j,vertices:O,verticeTypes:X,indices:V,pickingIds:ie.createTypedArray(B,Q),featureIndexes:L};if(C.getLength()){const t=H?re.getPosArrayType(J):re.getUnsignedArrayType(J);tt.featureIds=ie.createTypedArray(C,t)}else tt.featureIds=[];return D&&(D.setLength(O.getLength()/3*2),tt.uvs=D),tt}(t,n,{altitudeScale:y,altitudeProperty:x,defaultAltitude:m||0,heightProperty:v,minHeightProperty:P,defaultHeight:_||0},{center:g,top:B,side:C,topThickness:10*O||0,uv:A||I,uvSize:[i,i],uvOrigin:r,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,textureYOrigin:Y,tileRatio:a,centimeterToPoint:l,verticalCentimeterToPoint:u,positionType:d,res:o,glScale:s,projectionCode:f},p,qe),X=[],E=V.vertices.getLength()/3,N=De.getIndexArrayType(E),z=$e.createTypedArray(V.indices,N);delete V.indices,X.push(z.buffer,V.pickingIds.buffer);const D=Math.max(Math.abs(V.maxAltitude),Math.abs(V.minAltitude)),$=De.getPosArrayType(Math.max(512,D));V.vertices=$e.createTypedArray(V.vertices,$);const q=I?qe.getProxy():new Float32Array(3*E);q.setLength&&q.setLength(3*E);const j=function(t,e,n){const r=n||[];r.setLength&&r.setLength(t.length);const i=Fe;i.length<t.length/3&&(i.length=t.length/3),i.fill(0,0,t.length/3);const o=void 0===e.length?e:e.length;for(let n=0;n<o/3;n++)void 0===e.length?Xe(t,3*n,3*n+1,3*n+2,r,i):Xe(t,e[3*n],e[3*n+1],e[3*n+2],r,i);for(let t=0;t<r.length;t+=3){const e=i[t/3];0!==e?(r[t]/=e,r[t+1]/=e,r[t+2]/=e):(r[t]=0,r[t+1]=0,r[t+2]=0)}return r}(V.vertices,z,q);let G=!0;const Z=j.getLength?j.getLength():j.length;for(let t=0;t<Z;t++){j[t]=-j[t];const e=j[t]%1;1-Math.abs(e)>1e-6?G=!1:0!==e&&(j[t]=Math.round(j[t]))}if(V.normals=j,I){let t=qe.get();t.setLength(4*E),t=function(t,e,n,r,i){const o=t.length/3,s=i||new Array(4*o),a=[],l=[];for(let t=0;t<o;t++)a[t]=[0,0,0],l[t]=[0,0,0];const u=[0,0,0],h=[0,0,0],c=[0,0,0],f=[0,0],p=[0,0],d=[0,0],g=[0,0,0],y=[0,0,0];function x(e,r,i){Ee(u,t,3*e),Ee(h,t,3*r),Ee(c,t,3*i),Ne(f,n,2*e),Ne(p,n,2*r),Ne(d,n,2*i);const o=h[0]-u[0],s=c[0]-u[0],x=h[1]-u[1],m=c[1]-u[1],v=h[2]-u[2],w=c[2]-u[2],M=p[0]-f[0],b=d[0]-f[0],P=p[1]-f[1],_=d[1]-f[1],I=1/(M*_-b*P);fe(g,(_*o-P*s)*I,(_*x-P*m)*I,(_*v-P*w)*I),fe(y,(M*s-b*o)*I,(M*m-b*x)*I,(M*w-b*v)*I),pe(a[e],a[e],g),pe(a[r],a[r],g),pe(a[i],a[i],g),pe(l[e],l[e],y),pe(l[r],l[r],y),pe(l[i],l[i],y)}for(let t=0,e=r.length;t<e;t+=3)x(r[t+0],r[t+1],r[t+2]);const m=[],v=[],w=[],M=[];let b,P,_;function I(t){Ee(w,e,3*t),ce(M,w),P=a[t],ce(m,P),xe(m,m,function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}(w,w,ge(w,P))),de(m,m),ye(v,M,P),_=ge(v,l[t]),b=_<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,e=r.length;t<e;t+=3)I(r[t+0]),I(r[t+1]),I(r[t+2]);return s}(V.vertices,V.normals,V.uvs,z,t),t=function(t,e){const n=e.getLength(),r=new Float32Array(n),i=[],o=[],s=[];for(let a=0;a<n;a+=4){const n=a/4*3;dt(o,t[n]||0,t[n+1]||0,t[n+2]||0),yt(i,e[a]||0,e[a+1]||0,e[a+2]||0,e[a+3]||0),Te(s,o,i),gt(r.subarray(a,a+4),s)}return r}(V.normals,t),V.tangents=t,X.push(t.buffer),delete V.normals}if(V.normals&&(G&&(V.normals=$e.createTypedArray(V.normals,Int8Array)),X.push(V.normals.buffer)),V.uvs){const t=V.uvs;V.uvs=$e.createTypedArray(t,Float32Array),X.push(V.uvs.buffer)}const U=function(t,e,n,r){const i={},o={},s=r.getLength();if(L(e.polygonFill)){let a=M(e.polygonFill);const l=new Uint8Array(4*s);l.fill(255);for(let e=0;e<s;e++){const o=t[r[e]],s=o.properties||{};s.$layer=o.layer,s.$type=o.type;let u=a(n,s);w(u)&&(i.aColor=1,a=M(u),u=a(n,s)),delete s.$layer,delete s.$type,ze.normalizeColor(Ge,u),l[4*e]=Ge[0],l[4*e+1]=Ge[1],l[4*e+2]=Ge[2],l[4*e+3]=Ge[3]}o.aColor=l}if(L(e.polygonOpacity)){let a=b(e.polygonOpacity,"exponential");const l=new Uint8Array(s);l.fill(255);for(let e=0;e<s;e++){const o=t[r[e]],s=o.properties||{};s.$layer=o.layer,s.$type=o.type;let u=a(n,s);w(u)&&(i.aOpacity=1,a=M(u),u=a(n,s)),delete s.$layer,delete s.$type,l[e]=255*u}o.aOpacity=l}return o.dynamicAttributes=i,o}(t,h,c,V.featureIndexes),R=function(t,e,n,r,i){const o=[[],[]],s=L(r.topPolygonFill),a=L(r.bottomPolygonFill),l=[255,255,255,255],u=e.getLength();if(s||a){let h=s&&M(r.topPolygonFill),c=a&&M(r.bottomPolygonFill),f=null,p=null,d=null,g=null;for(let r=0;r<u;r++){if(1===t[r]&&!s||0===t[r]&&!a)continue;const u=1===t[r];if(u&&e[r]===f){t[r]=d;continue}if(!u&&e[r]===p){t[r]=g;continue}const y=n[e[r]],x=y.properties||{};x.$layer=y.layer,x.$type=y.type;let m=u?h:c,v=m(i,x);w(v)&&(m=M(v),v=m(i,x)),delete x.$layer,delete x.$type,ze.normalizeColor(Ge,v),xt(Ge,Ge,l);let b=Ze(o,Ge);b<0&&(b=o.length,o.push(gt([],Ge))),t[r]=b,u?(f=e[r],d=b):(p=e[r],g=b)}}return o.slice(2)}(V.verticeTypes,V.featureIndexes,t,h,c),J={data:{data:{aVertexColorType:R.length<=252?$e.createTypedArray(V.verticeTypes,Uint8Array):$e.createTypedArray(V.verticeTypes,Uint16Array),aPosition:V.vertices,aNormal:V.normals,aTexCoord0:V.uvs,aTangent:V.tangents,aPickingId:V.pickingIds},indices:z,properties:{maxAltitude:V.maxAltitude/100,minAltitude:V.minAltitude/100,hasNegativeHeight:V.hasNegativeHeight},dynamicAttributes:U.dynamicAttributes,vertexColors:R},buffers:X};return V.featureIds.length?(J.data.featureIds=V.featureIds,X.push(J.data.featureIds.buffer)):J.data.featureIds=[],U.aColor&&(J.data.data.aColor=U.aColor,J.buffers.push(U.aColor.buffer)),U.aOpacity&&(J.data.data.aOpacity=U.aOpacity,J.buffers.push(U.aOpacity.buffer)),J.buffers.push(J.data.data.aPosition.buffer),J.data.pickingIdIndiceMap=De.generatePickingIndiceIndex(J.data.data.aPickingId,J.data.indices),J}const Ge=[];function Ze(t,e){for(let i=0;i<t.length;i++)if(n=e,r=t[i],n[0]===r[0]&&n[1]===r[1]&&n[2]===r[2]&&n[3]===r[3])return i;var n,r;return-1}const{PackUtil:Ue,StyleUtil:Re,FilterUtil:Je}=ne();function He(t,e,n,r,{altitudeScale:i,altitudeProperty:o,defaultAltitude:s,heightProperty:a,minHeightProperty:l,defaultHeight:u,bottom:h}){const c=h,f=e/t[0].extent,p=2*function(t,e){let n=0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(S(r.geometry[0][0]))n+=3*r.geometry.length;else for(let t=0,e=r.geometry.length;t<e;t++){let e=3*r.geometry[t].length;3===r.type&&(e-=3),n+=e}}return n}(t)+3*t.length*2,d=[],g=new Int16Array(p),y=new Uint8Array(g.length/3*4);w(n)&&(n=Je.compileFilter(n));const x=[];function m(t,n,r){const i=n-t,o=g.subarray(t,n),s=g.subarray(n,n+i);s.set(o);for(let t=2,e=s.length;t<e;t+=3)s[t]=o[t]-r;const a=t/3,l=i/3;let u,h;for(let t=a,n=l+a;t<n;t++)t<n-1?(u=t,h=t+1):(u=t,h=a),ft(g,u,h,e)||(x.push(u,h),c&&x.push(u+l,h+l),We(g,u,e)||x.push(u,u+l));return n+i}let v=0,M=-1/0,b=1/0;const P=(te+"").trim(),_=[];for(let e=0,h=t.length;e<h;e++){const h=t[e],c=h.geometry;if(n){let t;t="function"==typeof n?n(h&&h.properties):n,Re.normalizeColor(_,t)}else dt(_,255,255,255);const p=v/3*4,{altitude:w,height:I}=Ue.getFeaAltitudeAndHeight(h,i,o,s,a,u,l);I<0?(b=Math.min(w,b),M=Math.max(w-I,M)):(b=Math.min(w-I,b),M=Math.max(w,M));let A=v;for(let t=0,e=c.length;t<e;t++){let e=c[t];const n=e.length;e[0][0]===e[n-1][0]&&e[0][1]===e[n-1][1]&&(e=e.slice(0,n-1)),v=ct(g,A,e,f,w),v=m(A,v,I*f),A=v}const S=A/3*4;for(let t=p;t<S;t+=4)y[t]=_[0],y[t+1]=_[1],y[t+2]=_[2],y[t+3]=255*(r||1);const T=x.length-d.length;for(let t=0;t<T;t++)d.push(h[P])}const I=x.reduce(((t,e)=>Math.max(t,e)),0),A=new(Ue.getIndexArrayType(I))(x),T=Ue.getUnsignedArrayType(t.length),F=Math.max(Math.abs(M,Math.abs(b)));return{aPosition:new(Ue.getPosArrayType(Math.max(512,F)))(g),indices:A,aPickingId:new T(d),aColor:y,maxAltitude:M===-1/0?0:M/100,minAltitude:b===1/0?0:b/100}}function We(t,e,n){const r=t[3*e],i=t[3*e+1];return r<0||r>n||i<0||i>n}function Ke(t,e,n,r){const i=He(t,e,n.lineColor,n.lineOpacity,r),{minAltitude:o,maxAltitude:s}=i;delete i.minAltitude,delete i.maxAltitude;const a=[i.aPosition.buffer,i.indices.buffer,i.aPickingId.buffer],l=i.indices;return delete i.indices,{data:{data:i,properties:{minAltitude:o,maxAltitude:s},indices:l},buffers:a}}\n/*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */const Qe=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function tn(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return\`(${s}"=="===e?nn(t[1],t[2],"===",!1):"!="===e?nn(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?nn(t[1],t[2],e,!0):"any"===e?on(t.slice(1),"||"):"all"===e?on(t.slice(1),"&&"):"none"===e?ln(on(t.slice(1),"||")):"in"===e?sn(t[1],t.slice(2)):"!in"===e?ln(sn(t[1],t.slice(2))):"has"===e?an(t[1]):"!has"===e?ln(an(t[1])):"contains"===e?function(t,e,n){const r=en(t);return void 0!==n?\`(${s}r} + '').indexOf("${s}e}") === ${s}n}\`:\`(${s}r} + '').indexOf("${s}e}") >= 0\`}(t[1],t[2],t[3]):"true"})\`}function en(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function nn(t,e,n,r){if("object"==typeof(i=t)&&i&&t.op)return function(t,e,n,r){const i=t.property,o=t.op;let s=en(i);return"length"!==o?(console.error(\`not support ${s}o} op\`),"false"):(s=\`((${s}s}+='').length)\`,rn(s,i,e,n,r))}(t,e,n,r);var i;return rn(en(t),t,e,n,r)}function rn(t,e,n,r,i){const o="$type"===e?Qe.indexOf(n):JSON.stringify(n);return(i?\`typeof ${s}t}=== typeof ${s}o}&&\`:"")+t+r+o}function on(t,e){return t.map(tn).join(e)}function sn(t,e){"$type"===t&&(e=e.map((t=>Qe.indexOf(t))));const n=JSON.stringify(e.sort(un)),r=en(t);return e.length<=200?\`${s}n}.indexOf(${s}r}) !== -1\`:\`function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${s}r}, ${s}n},0,${s}e.length-1})\`}function an(t){return"$id"===t?'"id" in f':\`${s}JSON.stringify(t)} in p\`}function ln(t){return\`!(${s}t})\`}function un(t,e){return t<e?-1:t>e?1:0}let hn=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),hn=!0}catch(t){hn=!1}var cn=hn;const{VectorPack:fn,PolygonPack:pn,NativeLinePack:dn,LinePack:gn,PointPack:yn,NativePointPack:xn,LineExtrusionPack:mn,CirclePack:vn,RoundTubePack:wn,SquareTubePack:Mn,FilterUtil:bn,PackUtil:Pn,StyleUtil:_n,TextUtil:In,DEFAULT_TEX_WIDTH:An,GlyphRequestor:Sn}=ne(),Tn="__original_properties",Fn="__fn-type_properties";class kn{constructor(t,e,n,r,i){this.id=t,this.options=e,this.upload=n,this._compileStyle(e.style),this.requests={},this._cache=r,this._styleCounter=1,this.loadings=i}updateStyle(t,e){this.options.style=t,this._styleCounter=t.styleCounter,this._compileStyle(t),e()}updateOptions(t,e){this.options=I(this.options,t),e()}loadTile(t,e){const n=this.loadings,r=t.tileInfo.url,i=this.options.debugTile;if(i){const{x:n,y:r,z:o}=t.tileInfo;let s=!1;for(let t=0;t<i.length;t++)if(n===i[t].x&&r===i[t].y&&o===i[t].z){s=!0;break}if(!s)return void e()}if(n[r])return void n[r].push({context:t,callback:e,ref:this});n[r]=[{context:t,callback:e,ref:this}];const o=this.options.featureIdProperty;this.requests[r]=this.getTileFeatures(t,((e,i,s,a)=>{const l=n[r];if(delete n[r],this.checkIfCanceled(r))return delete this.requests[r],void this._callWaitings(l,null,{canceled:!0});if(delete this.requests[r],(this.options.debug||o)&&i)for(let e=0;e<i.length;e++)if(this.options.debug&&(i[e]._debug_info={index:e,id:i[e].id,tileId:t.tileInfo.id}),o){const t=F(o)?o[i[e].layer]:o,n=i[e].properties;i[e].id=n&&n[t]||null}if(e)this._callWaitings(l,e);else if(i&&i.length){if(l)for(let t=0;t<l.length;t++)this._onTileLoad.call(l[t].ref,l[t].context,l[t].callback,r,s,i,a)}else this._callWaitings(l)}))}_onTileLoad(t,e,n,r,i,o){this._createTileData(r,i,t).then((n=>{n.canceled?e(null,{canceled:!0}):(n.data.styleCounter=t.styleCounter,o&&I(n.data,o),e(null,n.data,n.buffers))})).catch((t=>{e(t)}))}abortTile(t,e){delete this.requests[t],this._cancelLoadings(t),e()}_cancelLoadings(t){const e=this.loadings[t];if(e)for(let t=0;t<e.length;t++)e[t].callback(null,{canceled:!0});delete this.loadings[t]}_callWaitings(t,e,n){if(t)for(let r=0;r<t.length;r++)t[r].callback(e,n)}checkIfCanceled(t){return!this.requests[t]}onRemove(){this.loadings={},delete this._cache,this.requests={}}fetchIconGlyphs(t,e,n){if(this.options.workerGlyph&&cn){const r=[];if(t&&Object.keys(t).length){const e=new Promise((e=>{this.upload("fetchIconGlyphs",{icons:t},null,((t,n)=>{e({err:t,iconData:n})}))}));r.push(e)}if(e&&Object.keys(e).length){const t=new Promise((t=>{this._glyphRequestor||(this._glyphRequestor=new Sn),this._glyphRequestor.getGlyphs(e,((e,n)=>{t({err:e,glyphData:n})}))}));r.push(t)}Promise.all(r).then((t=>{const e={icons:null,glyphs:null};for(let r=0;r<t.length;r++){if(t[r].err)return void n(t[r].err);t[r].iconData?e.icons=t[r].iconData.icons:t[r].glyphData&&(e.glyphs=t[r].glyphData.glyphs)}return e})).then((t=>{n(null,t)}))}else this.upload("fetchIconGlyphs",{icons:t,glyphs:e},null,n)}_createTileData(t,e,n){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:r,tileInfo:i}=n,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this._updateLayerPluginConfig(t)),this.featurePlugins&&function(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];if(n)for(let e=0,r=n.length;e<r;e++)t.push(n[e])}t.length}(s,this.featurePlugins);const a={};for(let t=0;t<s.length;t++)Xn(e,n.tileInfo.z,s[t],a);const l=[],u=[];for(let t=0;t<e.length;t++){const n=e[t],r=a[t];if(r){u.fill(null);let t=0;for(const e in r){let i=0;const o=r[e].values();for(const t of o){let r=u[i];r||(r=Dn(n),u[i]=r),r.properties[e]=t,i++}i>t&&(t=i)}for(let e=0;e<t;e++)l.push(u[e])}else l.push(n)}const h=(e=l)[0].extent,c=i.z,f={x:i.extent2d.xmin*r,y:i.extent2d.ymax*r},p=[],d=[],g=[],y=this.options,x=[],m={},v=[Promise.resolve(n.styleCounter)];let w=0,M=-1;const b=[];let P=!1;for(let t=0;t<s.length;t++){M++;const r=s[t];r.type!==w&&(M=0,w=r.type);const a=0===r.type?p:d;jn(r.symbol,b,t),P=P||b[t]&&b[t].size>0;const{tileFeatures:l,tileFeaIndexes:u}=this._filterFeatures(c,r.type,r.filter,e,m,t);if(!l.length){a[M]=null;continue}const y=u[u.length-1],_=Pn.getIndexArrayType(y);a[M]={styledFeatures:new _(u)},g.push({idx:t,typeIdx:M}),x.push(a[M].styledFeatures.buffer);const A=I({},n,{extent:h,zoom:c,tilePoint:f});if(this.options.debugTile){const t=this.options.debugTile;for(let e=0;e<t.length;e++){const{x:n,y:r,z:o}=t[e];if(i.x===n&&i.y===r&&i.z===o){A.debugIndex=t[e].index;break}}}let S=this._createTileGeometry(l,r,A);o&&(S=S.then((t=>{if(!t)return null;if(t.data)t.data.layer=l[0].layer;else if(Array.isArray(t))for(let e=0;e<t.length;e++)t[e]&&t[e].data&&(t[e].data.layer=l[0].layer);return t}))),v.push(S)}return Promise.all(v).then((([n,...r])=>{if(n!==this._styleCounter)return{canceled:!0};function i(t,e){if(void 0!==t.data.ref)return;const n=s[g[e].idx],r=n.renderPlugin.dataConfig;if(t.data.type=r.type,t.data.filter=n.filter.def,r.altitudeOffset&&(t.data.properties.minAltitude+=r.altitudeOffset,t.data.properties.maxAltitude+=r.altitudeOffset),t.buffers&&t.buffers.length)for(let e=0;e<t.buffers.length;e++)x.push(t.buffers[e])}for(let t=0;t<r.length;t++){if(!r[t])continue;const e=r[t],n=0===s[g[t].idx].type?p:d;if(Array.isArray(e)){const r=[];for(let n=0;n<e.length;n++)e[n]&&(i(e[n],t),(void 0===e[n].data.ref||e[e[n].data.ref])&&r.push(e[n].data));r.length&&(n[g[t].typeIdx].data=r)}else i(e,t),n[g[t].typeIdx].data=e.data}const o={},a=t;if(y.features||y.schema||P){let t,n=!1;for(let r=0,i=e.length;r<i;r++)if(t=e[r],a[t.layer].properties||(a[t.layer].properties=Cn(t.properties)),t&&(y.features||P&&m[r]))if("id"===y.features)o[r]=t.id;else{y.pickingGeometry||delete t.geometry,delete t.extent,delete t.properties.$layer,delete t.properties.$type,delete t.__index;const e=t.originalFeature;if(e){const e=t.properties,n=I({},t.originalFeature);delete e[Tn],n.customProps=I({},e),t=n}const i=I({},t);if(P&&m[r]&&(!y.features||"transient"===y.features)){const i=m[r];for(let r=0;r<i.length;r++){const i=b[r];i&&i.forEach((r=>{const i=e?e.properties:t.properties;i[Fn]||(i[Fn]=new Set),i[Fn].add(r),n=!0}))}}o[r]=i}if(n)for(const t in o){const e=o[t],n=e.properties[Fn];if(n){delete e.properties[Fn],"transient"===y.features&&(e.fnTypeProps=I({},e.properties));for(const t in e.properties)n.has(t)||("transient"===y.features?delete e.fnTypeProps[t]:delete e.properties[t])}}}return{data:{styleCounter:n,schema:a,data:p,featureData:d,extent:h,features:o},buffers:x}})).catch((t=>{console.error(t)}))}_createTileGeometry(t,e,n){let r=t;const i=e.renderPlugin.dataConfig,o=e.symbol,s=this.options.tileSize,{extent:a,glScale:l,zScale:u,zoom:h,tilePoint:c,centimeterToPoint:f,verticalCentimeterToPoint:p}=n,d=a/s,g=i.type,y=n.debugIndex;let x=I({},i,{EXTENT:a,zoom:h,debugIndex:y,features:this.options.features,isWebGPU:this.options.isWebGPU});if("3d-extrusion"===g){Yn(o)&&(i.uv=1);const t=this.options.projectionCode,e=o.material&&o.material.textureWidth||An;return Promise.all([Promise.resolve(je(r,i,a,c,e,n.tileInfo.res,l,a/this.options.tileSize,f,p,o,h,t,y))])}if("3d-wireframe"===g)return Promise.all([Promise.resolve(Ke(r,a,o,i))]);if("point"===g){x=I(x,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:u*a/this.options.tileSize/l,pluginType:e.renderPlugin.type});let t=o;return Array.isArray(o)||(t=[o]),t=t.map(((t,e)=>(t&&(t.index={index:e},t.isIconText=function(t){return t.markerType||t.markerFile}(t)),t))).filter((t=>!!t)),Promise.all(t.map((t=>{const e=fn.genFnTypes(t);let n=r;return yn.needMerge(t,e,h)&&(n=yn.mergeLineFeatures(r,t,e,h)),new yn(n,t,x).load(d)})))}if("native-point"===g){const t=u*a/this.options.tileSize/l;return x.altitudeToTileScale=t,On(r,o,x,xn,d)}if("line"===g)return x=I(x,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:d}),On(r,o,x,gn,1,!0);if("native-line"===g)return On(r,o,x,dn,1,!0);if("fill"===g)return x=I(x,{requestor:this.fetchIconGlyphs.bind(this)}),On(r,o,x,pn);if("line-extrusion"===g){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=Yn(o);if(t&&(i.uv=1),x=I(x,{tileSize:s,zScale:u,glScale:l}),o.mergeOnProperty){const t=fn.genFnTypes(o);r=gn.mergeLineFeatures(r,o,t,x.zoom)}if(t){const t=[];if(!1!==i.top){const e=I({},x);e.side=!1,t.push(new mn(r,o,e))}return!1!==i.side&&(x.side=!0,x.top=!1,t.push(new mn(r,o,x))),Promise.all(t.map((t=>t.load())))}return Promise.all([new mn(r,o,x).load()])}if("circle"===g)return On(r,o,x,vn);if("round-tube"===g||"square-tube"===g){const t="round-tube"===g?wn:Mn;return x=I(x,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:"round-tube"===g?i.radialSegments||8:4,centimeterToPoint:f,verticalCentimeterToPoint:p,tileRatio:d,isTube:!0}),On(r,o,x,t)}return Promise.resolve([])}_filterFeatures(t,e,n,r,i,o){const s=(te+"").trim(),a=[],l=[],u=r.length;for(let h=0;h<u;h++)if((1===e||void 0===r[h].id||!this.styledFeatures[r[h].id])&&((!n.def||"default"===n.def)&&!i[h]||!0===n.def||n.def&&(void 0!==n.def.condition||Array.isArray(n.def))&&n(r[h],t))){const t=r[h];if(void 0===t[s]&&(t[s]=h),i[h]||(i[h]=[]),i[h].push(o),l.push(t),a.push(h),1===e)break}return{tileFeatures:l,tileFeaIndexes:a}}_compileStyle(t){const{style:e,featureStyle:n}=t,r={};n.forEach((t=>{Array.isArray(t.id)?(t.id.forEach((t=>{r[t]=1})),t.filter=["in","$id",...t.id]):(r[t.id]=1,t.filter=["==","$id",t.id])}));const i=bn.compileStyle(e);for(let t=0;t<e.length;t++)i[t].filter&&(i[t].filter.def=e[t].filter?e[t].filter.value||e[t].filter:void 0),i[t].type=0;const o=[],s=bn.compileStyle(n);for(let t=0;t<n.length;t++)s[t].type=1,s[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0,s[t].renderPlugin&&o.push(s[t]);this.pluginConfig=i,this.featurePlugins=o,this.styledFeatures=r}_updateLayerPluginConfig(t){let e=this._layerPlugins;this._layerPlugins||(e=this._layerPlugins={});const n=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],r=[];for(const o in t){const s=o;if(!e[o]){const r=[];for(let e=0;e<t[o].types.length;e++){const a=t[o].types[e],l=["all",["==","$layer",s],["==","$type",n[a]]],u={filter:(i=l,new Function("f",\`var p = (f && f.properties || {}); return ${s}tn(i)}\`)),renderPlugin:Ln(a),symbol:Bn(a)};u.filter.def=l,u.type=0,r.push(u)}e[s]=r}r.push(...e[s])}var i;return r}}function Ln(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 Bn(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 Cn(t){if(Array.isArray(t)||!F(t))return{};const e={};for(const n in t){const r=t[n];A(r)?e[n]="string":S(r)?e[n]="number":!0===r||!1===r?e[n]="boolean":Array.isArray(r)?e[n]="array":e[n]="object"}return e}function Yn(t){if(!t)return 0;let e=0;for(const n in t){if(("normalTexture"===n||"bumpTexture"===n)&&t[n])return 2;if(n.indexOf("Texture")>0&&t[n])e=1;else if(F(t[n])){const r=Yn(t[n]);if(2===r)return r;1===r&&(e=1)}}return e}function On(t,e,n,r,i,o){const s={},a=Array.isArray(e)?e:[e];let l=-1;for(let t=0;t<a.length;t++)s[t]=Vn(a[t]),!s[t]&&a[t]&&-1===l&&(l=t);const u=[];for(let e=0;e<a.length;e++){if(!a[e])continue;a[e].index={index:e};let h=t;if(o&&a[e].mergeOnProperty){const r=fn.genFnTypes(a[e]);h=gn.mergeLineFeatures(t,a[0],r,n.zoom)}s[e]||e===l?u.push(new r(h,a[e],n).load(i)):u.push({data:{ref:l,symbolIndex:{index:e}}})}return Promise.all(u)}function Vn(t){if(!t)return 0;for(const e in t)if(L(t[e]))return 1;return 0}function Xn(t,e,n,r){const i=n.customProperties;if(!i)return t;if(i)for(let t=0;t<i.length;t++)i[t].fn=bn.compileFilter(i[t].filter);for(let n=0;n<i.length;n++)for(let o=0,s=t.length;o<s;o++)if(i[n].fn(t[o],e))for(const t in i[n].properties){const e=i[n].properties[t];k(e)||(r[o]||(r[o]={}),r[o][t]||(r[o][t]=new Set),r[o][t].add(e))}}const En={get:(t,e)=>e in t?t[e]:t.originalFeature[e],has:(t,e)=>e in t||e in t.originalFeature},Nn={get:function(t,e){return e in t?t[e]:t[Tn][e]},has:(t,e)=>e in t||e in t[Tn]},zn={};function Dn(t){const e={};e.originalFeature=t;const n=new Proxy(e,En);return n.properties=new Proxy({},Nn),n.properties[Tn]=t.properties||zn,n}function $n(t,e,n){t[e]||(t[e]=new Set),t[e].add(n)}const qn=[];function jn(t,e,n){if(!t)return qn;for(const r in t){if(!t[r]||!_n.checkIfZoomFnTypeSymbol(r))continue;if(L(t[r]))$n(e,n,t[r].property);else{if("lineGradientProperty"===r){$n(e,n,t[r]);continue}if("textName"===r)if(A(t[r])){const i=In.resolveVarNames(t[r]);if(i)for(let t=0;t<i.length;t++)$n(e,n,i[t])}else if(bn.isExpression(t[r])){const i=[];In.resolveExpVarNames(i,t[r]);for(let t=0;t<i.length;t++)$n(e,n,i[t])}}const i=t[r].stops;if(i&&i.length)for(let t=0;t<i.length;t++)L(i[t][1])&&$n(e,t,i[t][1].property)}return e[n]}function Gn(t,e){Zn(t.geometry,e)}function Zn(t,e){if(t)switch(t.type){case"Point":Un(t.coordinates,e);break;case"MultiPoint":case"LineString":Rn(t.coordinates,e);break;case"MultiLineString":!function(t,e){for(let n=0,r=t.length;n<r;n++)Rn(t[n],e)}(t.coordinates,e);break;case"Polygon":Jn(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let n=0,r=t.length;n<r;n++)Jn(t[n],e)}(t.coordinates,e);break;case"GeometryCollection":const n=t.geometries.length;for(let r=0;r<n;r++)Zn(t.geometries[r],e)}}function Un(t,e){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Rn(t,e){for(let n=0,r=t.length;n<r;n++)Un(t[n],e)}function Jn(t,e){t.length&&Rn(t[0],e)}function Hn(t,e,n,r,i){Wn(t,e,n||0,r||t.length-1,i||Qn)}function Wn(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Wn(t,e,Math.max(n,Math.floor(e-s*l/o+u)),Math.min(r,Math.floor(e+(o-s)*l/o+u)),i)}var h=t[e],c=n,f=r;for(Kn(t,n,e),i(t[r],h)>0&&Kn(t,n,r);c<f;){for(Kn(t,c,f),c++,f--;i(t[c],h)<0;)c++;for(;i(t[f],h)>0;)f--}0===i(t[n],h)?Kn(t,n,f):Kn(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function Kn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Qn(t,e){return t<e?-1:t>e?1:0}class tr{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!cr(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?r(s):s;cr(t,a)&&(e.leaf?n.push(s):hr(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n}collides(t){let e=this.data;if(!cr(t,e))return!1;const n=[];for(;e;){for(let r=0;r<e.children.length;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(cr(t,o)){if(e.leaf||hr(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=fr([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let s,a,l;for(;n||i.length;){if(n||(n=i.pop(),a=i[i.length-1],s=o.pop(),l=!0),n.leaf){const r=er(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}l||n.leaf||!hr(n,r)?a?(s++,n=a.children[s],l=!1):n=null:(i.push(n),o.push(s),s=0,a=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,s=this._maxEntries;if(i<=s)return o=fr(t.slice(e,n+1)),nr(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,r-1))),o=fr([]),o.leaf=!1,o.height=r;const a=Math.ceil(i/s),l=a*Math.ceil(Math.sqrt(s));pr(t,e,n,l,this.compareMinX);for(let i=e;i<=n;i+=l){const e=Math.min(i+l-1,n);pr(t,i,e,a,this.compareMinY);for(let n=i;n<=e;n+=a){const i=Math.min(n+a-1,e);o.children.push(this._build(t,n,i,r-1))}}return nr(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=ar(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<s?(s=h,r=u<r?u:r,n=l):h===s&&u<r&&(r=u,n=l)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),ir(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),s=fr(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,nr(n,this.toBBox),nr(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}_splitRoot(t,e){this.data=fr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,nr(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let s=e;s<=n-e;s++){const e=rr(t,0,s,this.toBBox),a=rr(t,s,n,this.toBBox),l=ur(e,a),u=ar(e)+ar(a);l<i?(i=l,r=s,o=u<o?u:o):l===i&&u<o&&(o=u,r=s)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:or,i=t.leaf?this.compareMinY:sr;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=rr(t,0,e,i),s=rr(t,n-e,n,i);let a=lr(o)+lr(s);for(let r=e;r<n-e;r++){const e=t.children[r];ir(o,t.leaf?i(e):e),a+=lr(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];ir(s,t.leaf?i(e):e),a+=lr(s)}return a}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)ir(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():nr(t[n],this.toBBox)}}function er(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function nr(t,e){rr(t,0,t.children.length,e,t)}function rr(t,e,n,r,i){i||(i=fr(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<n;o++){const e=t.children[o];ir(i,t.leaf?r(e):e)}return i}function ir(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function or(t,e){return t.minX-e.minX}function sr(t,e){return t.minY-e.minY}function ar(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function lr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ur(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function hr(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function cr(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function fr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function pr(t,e,n,r,i){const o=[e,n];for(;o.length;){if((n=o.pop())-(e=o.pop())<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Hn(t,s,e,n,i),o.push(e,s,s,n)}}class dr{constructor(t=[],e=gr){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,r=e[t];for(;t>0;){const i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}_down(t){const{data:e,compare:n}=this,r=this.length>>1,i=e[t];for(;t<r;){let r=1+(t<<1),o=e[r];const s=r+1;if(s<this.length&&n(e[s],o)<0&&(r=s,o=e[s]),n(o,i)>=0)break;e[t]=o,t=r}e[t]=i}}function gr(t,e){return t<e?-1:t>e?1:0}function yr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xr={exports:{}},mr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,l=0,u=a-1;l<a;u=l++){var h=e[n+2*l+0],c=e[n+2*l+1],f=e[n+2*u+0],p=e[n+2*u+1];c>o!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s},vr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,l=0,u=a-1;l<a;u=l++){var h=e[l+n][0],c=e[l+n][1],f=e[u+n][0],p=e[u+n][1];c>o!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s};xr.exports=function(t,e,n,r){return e.length>0&&Array.isArray(e[0])?vr(t,e,n,r):mr(t,e,n,r)};var wr=xr.exports.nested=vr;xr.exports.flat=mr;const Mr=11102230246251565e-32,br=134217729,Pr=(3+8*Mr)*Mr;function _r(t,e,n,r,i){let o,s,a,l,u=e[0],h=r[0],c=0,f=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=r[++f]);let p=0;if(c<t&&f<n)for(h>u==h>-u?(s=u+o,a=o-(s-u),u=e[++c]):(s=h+o,a=o-(s-h),h=r[++f]),o=s,0!==a&&(i[p++]=a);c<t&&f<n;)h>u==h>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c]):(s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f]),o=s,0!==a&&(i[p++]=a);for(;c<t;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c],o=s,0!==a&&(i[p++]=a);for(;f<n;)s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f],o=s,0!==a&&(i[p++]=a);return 0===o&&0!==p||(i[p++]=o),p}function Ir(t){return new Float64Array(t)}const Ar=33306690738754716e-32,Sr=22204460492503146e-32,Tr=11093356479670487e-47,Fr=Ir(4),kr=Ir(8),Lr=Ir(12),Br=Ir(16),Cr=Ir(4);function Yr(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=Ar*u?l:-function(t,e,n,r,i,o,s){let a,l,u,h,c,f,p,d,g,y,x,m,v,w,M,b,P,_;const I=t-i,A=n-i,S=e-o,T=r-o;w=I*T,f=br*I,p=f-(f-I),d=I-p,f=br*T,g=f-(f-T),y=T-g,M=d*y-(w-p*g-d*g-p*y),b=S*A,f=br*S,p=f-(f-S),d=S-p,f=br*A,g=f-(f-A),y=A-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Fr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Fr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Fr[2]=m-(_-c)+(x-c),Fr[3]=_;let F=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,Fr),k=Sr*s;if(F>=k||-F>=k)return F;if(c=t-I,a=t-(I+c)+(c-i),c=n-A,u=n-(A+c)+(c-i),c=e-S,l=e-(S+c)+(c-o),c=r-T,h=r-(T+c)+(c-o),0===a&&0===l&&0===u&&0===h)return F;if(k=Tr*s+Pr*Math.abs(F),F+=I*h+T*a-(S*u+A*l),F>=k||-F>=k)return F;w=a*T,f=br*a,p=f-(f-a),d=a-p,f=br*T,g=f-(f-T),y=T-g,M=d*y-(w-p*g-d*g-p*y),b=l*A,f=br*l,p=f-(f-l),d=l-p,f=br*A,g=f-(f-A),y=A-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const L=_r(4,Fr,4,Cr,kr);w=I*h,f=br*I,p=f-(f-I),d=I-p,f=br*h,g=f-(f-h),y=h-g,M=d*y-(w-p*g-d*g-p*y),b=S*u,f=br*S,p=f-(f-S),d=S-p,f=br*u,g=f-(f-u),y=u-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const B=_r(L,kr,4,Cr,Lr);w=a*h,f=br*a,p=f-(f-a),d=a-p,f=br*h,g=f-(f-h),y=h-g,M=d*y-(w-p*g-d*g-p*y),b=l*u,f=br*l,p=f-(f-l),d=l-p,f=br*u,g=f-(f-u),y=u-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const C=_r(B,Lr,4,Cr,Br);return Br[C-1]}(t,e,n,r,i,o,u)}function Or(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var r=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;o<t.length;o++){var s=t[o];s[0]<e[0]&&(e=s),s[0]>r[0]&&(r=s),s[1]<n[1]&&(n=s),s[1]>i[1]&&(i=s)}var a=[e,n,r,i],l=a.slice();for(o=0;o<t.length;o++)wr(t[o],a)||l.push(t[o]);return function(t){t.sort(Ur);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&Dr(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&Dr(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(l)}(t),i=new tr(16);i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,e){return t[0]-e[0]},i.compareMinY=function(t,e){return t[1]-e[1]},i.load(t);for(var o,s=[],a=0;a<r.length;a++){var l=r[a];i.remove(l),o=qr(l,o),s.push(o)}var u=new tr(16);for(a=0;a<s.length;a++)u.insert($r(s[a]));for(var h=e*e,c=n*n;s.length;){var f=s.shift(),p=f.p,d=f.next.p,g=jr(p,d);if(!(g<c)){var y=g/h;(l=Vr(i,f.prev.p,p,d,f.next.next.p,y,u))&&Math.min(jr(l,p),jr(l,d))<=y&&(s.push(f),s.push(qr(l,f)),i.remove(l),u.remove(f),u.insert($r(f)),u.insert($r(f.next)))}}f=o;var x=[];do{x.push(f.p),f=f.next}while(f!==o);return x.push(f.p),x}function Vr(t,e,n,r,i,o,s){for(var a=new dr([],Xr),l=t.data;l;){for(var u=0;u<l.children.length;u++){var h=l.children[u],c=l.leaf?Gr(h,n,r):Er(n,r,h);c>o||a.push({node:h,dist:c})}for(;a.length&&!a.peek().node.children;){var f=a.pop(),p=f.node,d=Gr(p,e,n),g=Gr(p,r,i);if(f.dist<d&&f.dist<g&&zr(n,p,s)&&zr(r,p,s))return p}(l=a.pop())&&(l=l.node)}return null}function Xr(t,e){return t.dist-e.dist}function Er(t,e,n){if(Nr(t,n)||Nr(e,n))return 0;var r=Zr(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=Zr(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=Zr(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=Zr(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function Nr(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function zr(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),l=Math.min(t[1],e[1]),u=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),c=n.search({minX:a,minY:l,maxX:u,maxY:h}),f=0;f<c.length;f++)if(r=c[f].p,i=c[f].next.p,o=t,r!==(s=e)&&i!==o&&Dr(r,i,o)>0!=Dr(r,i,s)>0&&Dr(o,s,r)>0!=Dr(o,s,i)>0)return!1;return!0}function Dr(t,e,n){return Yr(t[0],t[1],e[0],e[1],n[0],n[1])}function $r(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function qr(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function jr(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Gr(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Zr(t,e,n,r,i,o,s,a){var l,u,h,c,f=n-t,p=r-e,d=s-i,g=a-o,y=t-i,x=e-o,m=f*f+p*p,v=f*d+p*g,w=d*d+g*g,M=f*y+p*x,b=d*y+g*x,P=m*w-v*v,_=P,I=P;0===P?(u=0,_=1,c=b,I=w):(c=m*b-v*M,(u=v*b-w*M)<0?(u=0,c=b,I=w):u>_&&(u=_,c=b+v,I=w)),c<0?(c=0,-M<0?u=0:-M>m?u=_:(u=-M,_=m)):c>I&&(c=I,-M+v<0?u=0:-M+v>m?u=_:(u=-M+v,_=m));var A=(1-(h=0===c?0:c/I))*i+h*s-((1-(l=0===u?0:u/_))*t+l*n),S=(1-h)*o+h*a-((1-l)*e+l*r);return A*A+S*S}function Ur(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}const{PackUtil:Rr}=ne();class Jr{constructor(t,e){this.x=t,this.y=e}clone(){return new Jr(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 Jr(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}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 Jr(this.y,-this.x)}}function Hr(t,e,n,r){const i=e.x*r.y-e.y*r.x,o=n.x-t.x,s=n.y-t.y,a=(o*r.y-s*r.x)/i;return new Jr(t.x+a*e.x,t.y+a*e.y)}const Wr=[],Kr=[];function Qr(t){if(S(t[0]&&t[0].x)){const e=[];let n=0;for(let r=0;r<t.length;r++)Kr[n]?(Kr[n][0]=t[r].x,Kr[n][1]=t[r].y):Kr[n]=[t[r].x,t[r].y],e.push(Kr[n]),n++;t=e}try{const e=Or(t,1/0);let n=[1/0,1/0],r=[-1/0,-1/0];for(let t=0;t<e.length;t++)e[t][0]<n[0]&&(n[0]=e[t][0]),e[t][0]>r[0]&&(r[0]=e[t][0]),e[t][1]<n[1]&&(n[1]=e[t][1]),e[t][1]>r[1]&&(r[1]=e[t][1]);const i=[];let o=[],s=0;for(let t=0;t<e.length;t++)t===e.length-1&&e[t][0]===e[0][0]&&e[t][1]===e[0][1]||(Pt(i,e[t],"EPSG:3857"),Wr[s]?(Wr[s].x=i[0],Wr[s].y=i[1]):Wr[s]=new Jr(i[0],i[1]),o.push(Wr[s]),s++);Rr.calculateSignedArea(o)<0&&(o=o.reverse());const a=function(t){let e,n=Number.MAX_VALUE;const r=function(t,r,i,o,s,a,l,u){var h=Hr(t,r,s,a),c=Hr(i,o,s,a),f=Hr(l,u,t,r),p=Hr(l,u,i,o),d=h.distance(c)*h.distance(f);0!==d&&d<n&&(e=[h,f,p,c],n=d)};var i=[];for(let e=0;e<t.length;e++)i.push(t[(e+1)%t.length].diff(t[e])),i[e].normalize();var o,s,a,l,u=new Jr(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new Jr(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let e=0;e<t.length;e++){var c=t[e];c.x<u.x&&(u.x=c.x,o=e),c.x>h.x&&(h.x=c.x,s=e),c.y<u.y&&(u.y=c.y,l=e),c.y>h.y&&(h.y=c.y,a=e)}var f=new Jr(0,-1),p=new Jr(0,1),d=new Jr(-1,0),g=new Jr(1,0);for(let e=0;e<t.length;e++){var y=[Math.acos(f.dot(i[o])),Math.acos(p.dot(i[s])),Math.acos(d.dot(i[a])),Math.acos(g.dot(i[l]))];switch(y.indexOf(Math.min.apply(Math,y))){case 0:(p=(f=i[o].clone()).clone()).negate(),(g=(d=f.orthogonal()).clone()).negate(),o=(o+1)%t.length;break;case 1:(f=(p=i[s].clone()).clone()).negate(),(g=(d=f.orthogonal()).clone()).negate(),s=(s+1)%t.length;break;case 2:(g=(d=i[a].clone()).clone()).negate(),(p=(f=g.orthogonal()).clone()).negate(),a=(a+1)%t.length;break;case 3:(d=(g=i[l].clone()).clone()).negate(),(p=(f=g.orthogonal()).clone()).negate(),l=(l+1)%t.length}r(t[o],f,t[s],p,t[a],d,t[l],g)}return e}(o);if(!a||4!==a.length)return null;const l=a[0].distance(a[1]),u=a[1].distance(a[2]),h=a.map((t=>[t.x,t.y]));return h.push(+(u>l)),h}catch(t){return null}}const ti=[];function ei(t,e){const n=Array.isArray(t&&t[0]&&t[0][0]);for(let r=0;r<t.length;r++)n?t[r]=ei(t[r]):(Pt(ti,t[r],e),t[r][0]=ti[0],t[r][1]=ti[1]);return t}const{PackUtil:ni}=ne();class ri extends kn{constructor(t,e,n,r,i,o){super(t,e,n,r,i),(e=e||{}).extent||(e.extent=8192),this.setData(e.data,o)}clearData(){delete this.index}setData(t,e){if(delete this.index,function(t){if(!t)return!0;if(Array.isArray(t)&&!t.length)return!0;if(t.features&&!t.features.length)return!0;return!1}(t))return this.empty=!0,void e();const n={maxZoom:24,tolerance:this.options.simplifyTolerance,extent:this.options.extent,buffer:S(this.options.tileBuffer)?this.options.tileBuffer:64,hasAltitude:!!this.options.hasAltitude,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5,disableFilter:!0};if(this.options.projection&&(n.projection=this.options.projection,"EPSG:4490"===n.projection&&(n.projection="EPSG:4326")),A(t)&&"{"!=t.substring(0,1)||t.url){const r=t.url?t.url:t;C.getJSON(r,t.url?t:{},((t,i)=>{if(t&&(console.error("Failed to fetch geojson:"+r),e(t)),!i)return void e(null,{extent:null,idMap:{}});let o=i;if(this.options.convertFn){o=new Function("data",this.options.convertFn+"\\nreturn convert(data)")(o)}const s=Array.isArray(o)?o:o.features;this._genOMBB(s);const{sample1000:a,idMap:l}=this._generateId(s);this._generate(a,l,o,n,e)}))}else{"string"==typeof t&&(t=JSON.parse(t));const r=Array.isArray(t)?t:t.features,i=r&&r.length;this._genOMBB(r);let o=r;if(r&&i>1e3){o=[];for(let t=0;t<i;t++)ii(r[t],o,t,i)}this._generate(o,null,t,n,e)}}_genOMBB(t){if(this.options.generateOMBB&&t)for(let e=0;e<t.length;e++){const n=t[e];if(n&&n.geometry&&n.geometry.coordinates)if("Polygon"===n.geometry.type){const t=n.geometry.coordinates[0];if(!t)continue;const e=Qr(t,t.length);n.properties=n.properties||{},n.properties[ee]=e}else if("MultiPolygon"===n.geometry.type){const t=n.geometry.coordinates;for(let e=0;e<t.length;e++){if(!t[e])continue;const r=t[e][0];if(!r)continue;const i=Qr(r,r.length);n.properties=n.properties||{},n.properties[ee]=n.properties[ee]||[],n.properties[ee][e]=i}}}}_generate(t,e,n,r,i){try{const o=t&&t.length?function(t){let e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];switch(t.type){case"FeatureCollection":const n=t.features.length;for(let r=0;r<n;r++)Gn(t.features[r],e);break;case"Feature":Gn(t,e);break;default:Zn(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new ut(t,e)}(n,this.options.geojsonvt||r),i(null,{extent:o,idMap:e})}catch(t){console.warn(t),i({error:t.message})}}_generateId(t){const e=[],n={};let r=0;const i=this.options.featureIdProperty;if(t){const o=t.length;t.forEach(((t,s)=>{!function(t,o,s){if(t&&("Feature"!==t.type||t.geometry)){if(S(t.id)||(t.id=r++),i){let e=i;F(i)&&(e=i[t.layer||"0"]),t.id=t.properties[e]}n[t.id]=I({},t),t.geometry?(n[t.id].geometry=I({},t.geometry),n[t.id].geometry.coordinates=null):t.coordinates&&(n[t.id].coordinates=null),ii(t,e,o,s)}}(t,s,o)}))}return{sample1000:e,idMap:n}}getTileFeatures(t,e){const n=t.tileInfo,r=[];if(!this.index)return this.empty?(setTimeout((function(){e(null,r,[])}),1),1):(setTimeout((function(){e({loading:!0})}),1),1);const i=this.index.getTile(n.z,n.x,n.y);if(!i||0===i.features.length)return setTimeout((function(){e(null,r,[])}),1),1;const o=[];for(let t=0,e=i.features.length;t<e;t++){const e=i.features[t];let n=e.layer;void 0===n&&(n="0"),o[n]={types:{}};o[n].types[e.type]=1,e.tags=e.tags||{},e.geometry.converted||(ni.convertGeometry(e),e.geometry.converted=1),r.push({type:e.type,layer:n,id:e.id,geometry:e.geometry,properties:e.tags,extent:this.options.extent})}for(const t in o)o[t].types=Object.keys(o[t].types).map((t=>+t));return setTimeout((function(){e(null,r,o)}),1),1}onRemove(){super.onRemove(),delete this.index}}function ii(t,e,n,r){const i=Math.floor(r/998);(0===n||n===r-1||(0===i||n%i==0)&&e.length<999)&&e.push(t)}var oi={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,u=l>>1,h=-7,c=n?i-1:0,f=n?-1:1,p=t[e+c];for(c+=f,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[e+c],c+=f,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},write:function(t,e,n,r,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+p]=255&s,p+=d,s/=256,u-=8);t[n+p-d]|=128*g}},si=li,ai=oi;function li(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}li.Varint=0,li.Fixed64=1,li.Bytes=2,li.Fixed32=5;var ui=4294967296,hi=1/ui,ci="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function fi(t){return t.type===li.Bytes?t.readVarint()+t.pos:t.pos+1}function pi(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function di(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function gi(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function yi(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function xi(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function mi(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function vi(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function wi(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function Mi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function bi(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function Pi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function _i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ii(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Ai(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}li.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_i(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ai(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_i(this.buf,this.pos)+_i(this.buf,this.pos+4)*ui;return this.pos+=8,t},readSFixed64:function(){var t=_i(this.buf,this.pos)+Ai(this.buf,this.pos+4)*ui;return this.pos+=8,t},readFloat:function(){var t=ai.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ai.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return pi(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ci?function(t,e,n){return ci.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r="",i=e;for(;i<n;){var o,s,a,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>n)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),i+=h}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==li.Bytes)return t.push(this.readVarint(e));var n=fi(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==li.Bytes)return t.push(this.readSVarint());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==li.Bytes)return t.push(this.readBoolean());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==li.Bytes)return t.push(this.readFloat());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==li.Bytes)return t.push(this.readDouble());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==li.Bytes)return t.push(this.readFixed32());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==li.Bytes)return t.push(this.readSFixed32());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==li.Bytes)return t.push(this.readFixed64());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==li.Bytes)return t.push(this.readSFixed64());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===li.Varint)for(;this.buf[this.pos++]>127;);else if(e===li.Bytes)this.pos=this.readVarint()+this.pos;else if(e===li.Fixed32)this.pos+=4;else{if(e!==li.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ii(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ii(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ii(this.buf,-1&t,this.pos),Ii(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ii(this.buf,-1&t,this.pos),Ii(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&di(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),ai.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ai.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&di(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,li.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,gi,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,yi,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,vi,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,xi,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,mi,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,wi,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Mi,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,bi,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Pi,e)},writeBytesField:function(t,e){this.writeTag(t,li.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,li.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,li.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,li.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Si=yr(si),Ti=Fi;function Fi(t,e){this.x=t,this.y=e}Fi.prototype={clone:function(){return new Fi(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Fi.convert=function(t){return t instanceof Fi?t:Array.isArray(t)?new Fi(t[0],t[1]):t};var ki=Ti,Li=Bi;function Bi(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(Ci,this,e)}function Ci(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function Yi(t){for(var e,n,r=0,i=0,o=t.length,s=o-1;i<o;s=i++)e=t[i],r+=((n=t[s]).x-e.x)*(e.y+n.y);return r}Bi.types=["Unknown","Point","LineString","Polygon"],Bi.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,i=0,o=0,s=0,a=[];t.pos<n;){if(i<=0){var l=t.readVarint();r=7&l,i=l>>3}if(i--,1===r||2===r)o+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&a.push(e),e=[]),e.push(new ki(o,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&a.push(e),a},Bi.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(r<=0){var h=t.readVarint();n=7&h,r=h>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<s&&(s=i),i>a&&(a=i),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==n)throw new Error("unknown command "+n)}return[s,l,a,u]},Bi.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=Bi.types[this.type];function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+a)/o;t[e]=[360*(n.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(r=0;r<l.length;r++)c[r]=l[r][0];h(l=c);break;case 2:for(r=0;r<l.length;r++)h(l[r]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var s=Yi(t[o]);0!==s&&(void 0===r&&(r=s<0),r===s<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}n&&i.push(n);return i}(l),r=0;r<l.length;r++)for(i=0;i<l[r].length;i++)h(l[r][i])}1===l.length?l=l[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Oi=Li,Vi=Xi;function Xi(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ei,this,e),this.length=this._features.length}function Ei(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}Xi.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Oi(this._pbf,e,this.extent,this._keys,this._values)};var Ni=Vi,zi=function(t,e){this.layers=t.readFields(Di,{},e)};function Di(t,e,n){if(3===t){var r=new Ni(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}var $i=zi;const qi=2,ji=new TextDecoder("utf-8");class Gi extends kn{constructor(t,e,n,r,i,o){super(t,e,n,r,i),e=e||{},o()}clearData(){this._abortRequests()}getTileFeatures(t,e){const n=t.tileInfo.url,r=t.fetchOptions||{},{altitudePropertyName:i,disableAltitudeWarning:o}=t,s=this._cache.get(n);if(s&&s.cacheIndex===t.workerCacheIndex){const{err:t,data:r}=s;return setTimeout((()=>{this._readTile(n,i,o,t,r,e)}),1)}const{tileArrayBuffer:a}=t;return a?setTimeout((()=>{this._readTile(n,i,o,null,a,e)}),1):(r.referrer=t.referrer,r.errorLog=t.loadTileErrorLog,C.getArrayBuffer(n,r,((r,s)=>{this._cache&&(r?r.loading||this._cache.add(n,{err:r,data:s&&s.data,cacheIndex:t.workerCacheIndex}):s&&s.data&&this._cache.add(n,{err:null,data:s.data,cacheIndex:t.workerCacheIndex}),this._readTile(n,i,o,r,s&&s.data,e))})))}_readTile(t,e,n,r,i,o){if(r)return void o(r);let s;try{s=new $i(new Si(i))}catch(r){const e=ji.decode(i);return r.message+="\\n"+t+"\\n"+e,void o(r.message,[],[])}const a=[];if(!s.layers)return void o(null,a,[]);const l={};let u;for(const t in s.layers)if(h=s.layers,c=t,Object.prototype.hasOwnProperty.call(h,c)){l[t]={types:{}};const i=l[t].types;for(let o=0,l=s.layers[t].length;o<l;o++)try{u=s.layers[t].feature(o),i[u.type]=1;const r={type:u.type,layer:t,geometry:u.loadGeometry(),properties:u.properties,extent:u.extent};void 0!==u.id&&(r.id=u.id);let l=r.properties[ee];l&&(A(l)&&(l=JSON.parse(l)),r.properties[ee]=ei(l,"EPSG:3857"));const h=e&&r.properties[e];if(h){const t=Zi(h),e=[];Ui(r.geometry,t,e),e.length&&!n&&(console.warn("feature.geometry is not consistent with altitude values:"),console.warn(JSON.stringify(r,null,2)))}a.push(r)}catch(r){console.warn("error when load vt geometry:",r)}}var h,c;for(const t in l)l[t].types=Object.keys(l[t].types).map((t=>+t));o(null,a,l,{byteLength:i.byteLength})}abortTile(t,e){const n=this.requests[t];delete this.requests[t],n&&n.abort&&n.abort(),this._cancelLoadings(t),e()}onRemove(){super.onRemove(),this._abortRequests()}_abortRequests(){for(const t in this.requests){const e=this.requests[t];e&&e.abort&&e.abort()}this.requests={}}}function Zi(t){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new Float32Array(n.buffer)}function Ui(t,e,n,r){r||(r={index:0});for(let i=0;i<t.length;i++)if(Array.isArray(t[i]))Ui(t[i],e,n,r);else{const o=r.index;k(e[o])?n.push(qi):t[i].z=100*e[o],r.index++}}const{LRUCache:Ri}=ne();let Ji=0;const Hi=new Ri(128);class Wi{constructor(t){this._layers={},this._callbacks={},this.workerId=t}addLayer({actorId:t,mapId:e,layerId:n,params:r},i){if(this._getLayerById(e,n))return;const o=this._genKey(e,n),s=r.type,a=r.options,l=this.send.bind(this,t);this._layers[o]="GeoJSONVectorTileLayer"===s?new ri(n,a,l,Hi,{},i):new Gi(n,a,l,Hi,{},i)}removeLayer({mapId:t,layerId:e},n){const r=this._getLayerById(t,e),i=this._genKey(t,e);delete this._layers[i],r&&r.onRemove(n)}loadTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.loadTile(n,r)}abortTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.abortTile&&i.abortTile(n.url,r)}removeTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.removeTile(n,r)}updateStyle({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.updateStyle(n,r)}updateOptions({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.updateOptions(n,r)}setData({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.setData(n.data,r)}clearData({mapId:t,layerId:e},n){const r=this._getLayerById(t,e);r&&(r.clearData(n),this._resetCache())}receive(t){const e=t.callback,n=this._callbacks[e];delete this._callbacks[e],n&&t.error?n(new Error(t.error)):n&&n(null,t.data)}send(t,e,n,r,i){const o=i?\`${s}t}-${s}Ji++}\`:null;i&&(this._callbacks[o]=i),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:e,params:n,callback:String(o)},r||[])}_genKey(t,e){return\`${s}t}-${s}e}\`}_getLayerById(t,e){const n=this._genKey(t,e);return this._layers[n]}_resetCache(){Hi.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const n=t.data;if(this.dispatcher||(this.dispatcher=new Wi(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const r=n.command,i=(n.params||{}).loadTileErrorLog,o=(n.params||{}).loadTileErrorLogIgnoreCodes||[];this.dispatcher[r]({actorId:t.actorId,mapId:n.mapId,layerId:n.layerId,params:n.params},((t,n,s)=>{if(i&&t&&!t.loading){const e=t.status;S(e)&&-1===o.indexOf(e)&&console.error(r,t)}e(t,n,s)}))}}}`;
25
25
  function l(e) {
26
26
  const t = function() {
27
27
  return "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : void 0;
@@ -423,7 +423,7 @@
423
423
  * Codes from mapbox-gl-js
424
424
  * github.com/mapbox/mapbox-gl-js
425
425
  * MIT License
426
- */ class O {
426
+ */ class k {
427
427
  constructor(e, t, {pixelRatio: n}) {
428
428
  this.paddedRect = e, this.pixelRatio = n || 1, this.padding = t;
429
429
  }
@@ -437,7 +437,7 @@
437
437
  return [ (this.paddedRect.w - 2 * this.padding) / this.pixelRatio, (this.paddedRect.h - 2 * this.padding) / this.pixelRatio ];
438
438
  }
439
439
  }
440
- class k {
440
+ class O {
441
441
  constructor(e) {
442
442
  this.glyphMap = e, this.build();
443
443
  }
@@ -452,7 +452,7 @@
452
452
  w: i.data.width + 2 * o,
453
453
  h: i.data.height + 2 * o
454
454
  };
455
- r.push(s), n[t] = new O(s, o, i);
455
+ r.push(s), n[t] = new k(s, o, i);
456
456
  }
457
457
  if (i.pack(r, {
458
458
  inPlace: !0
@@ -1282,11 +1282,11 @@
1282
1282
  if (!("channels" in Ie[Ce])) throw new Error("missing channels property: " + Ce);
1283
1283
  if (!("labels" in Ie[Ce])) throw new Error("missing channel labels property: " + Ce);
1284
1284
  if (Ie[Ce].labels.length !== Ie[Ce].channels) throw new Error("channel and label counts mismatch: " + Ce);
1285
- var Oe = Ie[Ce].channels, ke = Ie[Ce].labels;
1285
+ var ke = Ie[Ce].channels, Oe = Ie[Ce].labels;
1286
1286
  delete Ie[Ce].channels, delete Ie[Ce].labels, Object.defineProperty(Ie[Ce], "channels", {
1287
- value: Oe
1288
- }), Object.defineProperty(Ie[Ce], "labels", {
1289
1287
  value: ke
1288
+ }), Object.defineProperty(Ie[Ce], "labels", {
1289
+ value: Oe
1290
1290
  });
1291
1291
  }
1292
1292
  Ie.rgb.hsl = function(e) {
@@ -2042,7 +2042,7 @@
2042
2042
  */ var It = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, Ct = {
2043
2043
  exports: {}
2044
2044
  };
2045
- function Ot(e, ...t) {
2045
+ function kt(e, ...t) {
2046
2046
  for (const n of t) for (const t in n) e[t] = n[t];
2047
2047
  return e;
2048
2048
  }
@@ -2135,12 +2135,12 @@
2135
2135
  }, i && r) if (e.exports == i) r.exports = s; else for (a in s) s.hasOwnProperty(a) && (i[a] = s[a]); else n.punycode = s;
2136
2136
  }(It);
2137
2137
  }(Ct, Ct.exports);
2138
- class kt extends Error {
2138
+ class Ot extends Error {
2139
2139
  constructor(e, t) {
2140
2140
  super(t), this.message = t, this.key = e;
2141
2141
  }
2142
2142
  }
2143
- var Rt = kt;
2143
+ var Rt = Ot;
2144
2144
  class Ft {
2145
2145
  constructor(e, t = []) {
2146
2146
  this.parent = e, this.bindings = {};
@@ -2903,7 +2903,7 @@
2903
2903
  }
2904
2904
  }
2905
2905
  var Cn = In;
2906
- class On {
2906
+ class kn {
2907
2907
  constructor(e, t, n) {
2908
2908
  this.type = Gt, this.locale = n, this.caseSensitive = e, this.diacriticSensitive = t;
2909
2909
  }
@@ -2916,7 +2916,7 @@
2916
2916
  const r = t.parse(void 0 !== n["diacritic-sensitive"] && n["diacritic-sensitive"], 1, Nt);
2917
2917
  if (!r) return null;
2918
2918
  let o = null;
2919
- return n.locale && (o = t.parse(n.locale, 1, Lt), !o) ? null : new On(i, r, o);
2919
+ return n.locale && (o = t.parse(n.locale, 1, Lt), !o) ? null : new kn(i, r, o);
2920
2920
  }
2921
2921
  evaluate(e) {
2922
2922
  return new an(this.caseSensitive.evaluate(e), this.diacriticSensitive.evaluate(e), this.locale ? this.locale.evaluate(e) : null);
@@ -2933,7 +2933,7 @@
2933
2933
  this.locale && (e.locale = this.locale.serialize()), [ "collator", e ];
2934
2934
  }
2935
2935
  }
2936
- const kn = 8192;
2936
+ const On = 8192;
2937
2937
  function Rn(e, t) {
2938
2938
  e[0] = Math.min(e[0], t[0]), e[1] = Math.min(e[1], t[1]), e[2] = Math.max(e[2], t[0]),
2939
2939
  e[3] = Math.max(e[3], t[1]);
@@ -2945,7 +2945,7 @@
2945
2945
  const n = (180 + e[0]) / 360, i = (r = e[1], (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + r * Math.PI / 360))) / 360);
2946
2946
  var r;
2947
2947
  const o = Math.pow(2, t.z);
2948
- return [ Math.round(n * o * kn), Math.round(i * o * kn) ];
2948
+ return [ Math.round(n * o * On), Math.round(i * o * On) ];
2949
2949
  }
2950
2950
  function Dn(e, t, n) {
2951
2951
  const i = e[0] - t[0], r = e[1] - t[1], o = e[0] - n[0], s = e[1] - n[1];
@@ -3018,7 +3018,7 @@
3018
3018
  Rn(t, e);
3019
3019
  }
3020
3020
  function Xn(e, t, n, i) {
3021
- const r = Math.pow(2, i.z) * kn, o = [ i.x * kn, i.y * kn ], s = [];
3021
+ const r = Math.pow(2, i.z) * On, o = [ i.x * On, i.y * On ], s = [];
3022
3022
  if (!e) return s;
3023
3023
  for (const i of e) for (const e of i) {
3024
3024
  const i = [ e.x + o[0], e.y + o[1] ];
@@ -3027,7 +3027,7 @@
3027
3027
  return s;
3028
3028
  }
3029
3029
  function $n(e, t, n, i) {
3030
- const r = Math.pow(2, i.z) * kn, o = [ i.x * kn, i.y * kn ], s = [];
3030
+ const r = Math.pow(2, i.z) * On, o = [ i.x * On, i.y * On ], s = [];
3031
3031
  if (!e) return s;
3032
3032
  for (const n of e) {
3033
3033
  const e = [];
@@ -3214,7 +3214,7 @@
3214
3214
  function ii(e) {
3215
3215
  if (e instanceof ei) return ii(e.boundExpression);
3216
3216
  if (e instanceof Cn && "error" === e.name) return !1;
3217
- if (e instanceof On) return !1;
3217
+ if (e instanceof kn) return !1;
3218
3218
  if (e instanceof qn) return !1;
3219
3219
  const t = e instanceof wn || e instanceof vn;
3220
3220
  let n = !0;
@@ -3408,9 +3408,9 @@
3408
3408
  }
3409
3409
  static interpolationFactor(e, t, n, i) {
3410
3410
  let r = 0;
3411
- if ("exponential" === e.name) r = Oi(t, e.base, n, i); else if ("linear" === e.name) r = Oi(t, 1, n, i); else if ("cubic-bezier" === e.name) {
3411
+ if ("exponential" === e.name) r = ki(t, e.base, n, i); else if ("linear" === e.name) r = ki(t, 1, n, i); else if ("cubic-bezier" === e.name) {
3412
3412
  const o = e.controlPoints;
3413
- r = new ai(o[0], o[1], o[2], o[3]).solve(Oi(t, 1, n, i));
3413
+ r = new ai(o[0], o[1], o[2], o[3]).solve(ki(t, 1, n, i));
3414
3414
  }
3415
3415
  return r;
3416
3416
  }
@@ -3478,11 +3478,11 @@
3478
3478
  return t;
3479
3479
  }
3480
3480
  }
3481
- function Oi(e, t, n, i) {
3481
+ function ki(e, t, n, i) {
3482
3482
  const r = i - n, o = e - n;
3483
3483
  return 0 === r ? 0 : 1 === t ? o / r : (Math.pow(t, o) - 1) / (Math.pow(t, r) - 1);
3484
3484
  }
3485
- var ki = Ci;
3485
+ var Oi = Ci;
3486
3486
  class Ri {
3487
3487
  constructor(e, t) {
3488
3488
  this.type = e, this.args = t;
@@ -3960,14 +3960,14 @@
3960
3960
  boolean: vn,
3961
3961
  case: Wi,
3962
3962
  coalesce: Fi,
3963
- collator: On,
3963
+ collator: kn,
3964
3964
  format: An,
3965
3965
  image: bn,
3966
3966
  in: zi,
3967
3967
  "index-of": Ui,
3968
- interpolate: ki,
3969
- "interpolate-hcl": ki,
3970
- "interpolate-lab": ki,
3968
+ interpolate: Oi,
3969
+ "interpolate-hcl": Oi,
3970
+ "interpolate-lab": Oi,
3971
3971
  length: rr,
3972
3972
  let: Di,
3973
3973
  literal: mn,
@@ -4170,7 +4170,7 @@
4170
4170
  }
4171
4171
  function yr(e, t) {
4172
4172
  const n = "color" === t.type, i = e.stops && "object" == typeof e.stops[0][0], r = i || void 0 !== e.property, o = i || !r, s = e.type || (dr(t) ? "exponential" : "interval");
4173
- if (n && ((e = Ot({}, e)).stops && (e.stops = e.stops.map((e => [ e[0], sn.parse(e[1]) ]))),
4173
+ if (n && ((e = kt({}, e)).stops && (e.stops = e.stops.map((e => [ e[0], sn.parse(e[1]) ]))),
4174
4174
  e.default ? e.default = sn.parse(e.default) : e.default = sn.parse(t.default)),
4175
4175
  e.colorSpace && "rgb" !== e.colorSpace && !Ii[e.colorSpace]) throw new Error(`Unknown color space: ${e.colorSpace}`);
4176
4176
  let a, l, h;
@@ -4202,7 +4202,7 @@
4202
4202
  return {
4203
4203
  kind: "composite",
4204
4204
  interpolationType: o,
4205
- interpolationFactor: ki.interpolationFactor.bind(void 0, o),
4205
+ interpolationFactor: Oi.interpolationFactor.bind(void 0, o),
4206
4206
  zoomStops: r.map((e => e[0])),
4207
4207
  evaluate: ({zoom: n}, i) => Ar({
4208
4208
  stops: r,
@@ -4218,7 +4218,7 @@
4218
4218
  return {
4219
4219
  kind: "camera",
4220
4220
  interpolationType: n,
4221
- interpolationFactor: ki.interpolationFactor.bind(void 0, n),
4221
+ interpolationFactor: Oi.interpolationFactor.bind(void 0, n),
4222
4222
  zoomStops: e.stops.map((e => e[0])),
4223
4223
  evaluate: ({zoom: n}) => a(e, t, n, l, h)
4224
4224
  };
@@ -4344,7 +4344,7 @@
4344
4344
  return this._styleExpression.evaluate(e, t, n, i, r, o);
4345
4345
  }
4346
4346
  interpolationFactor(e, t, n) {
4347
- return this.interpolationType ? ki.interpolationFactor(this.interpolationType, e, t, n) : 0;
4347
+ return this.interpolationType ? Oi.interpolationFactor(this.interpolationType, e, t, n) : 0;
4348
4348
  }
4349
4349
  }
4350
4350
  function Ir(e, t) {
@@ -4357,17 +4357,17 @@
4357
4357
  if (!r && !function(e) {
4358
4358
  return !!e.expression && e.expression.parameters.indexOf("zoom") > -1;
4359
4359
  }(t)) return fr([ new Rt("", "zoom expressions not supported") ]);
4360
- const o = Or(n);
4360
+ const o = kr(n);
4361
4361
  if (!o && !r) return fr([ new Rt("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') ]);
4362
4362
  if (o instanceof Rt) return fr([ o ]);
4363
- if (o instanceof ki && !dr(t)) return fr([ new Rt("", '"interpolate" expressions cannot be used with this property') ]);
4363
+ if (o instanceof Oi && !dr(t)) return fr([ new Rt("", '"interpolate" expressions cannot be used with this property') ]);
4364
4364
  if (!o) return ur(new Mr(i ? "constant" : "source", e.value));
4365
- const s = o instanceof ki ? o.interpolation : void 0;
4365
+ const s = o instanceof Oi ? o.interpolation : void 0;
4366
4366
  return ur(new Pr(i ? "camera" : "composite", e.value, o.labels, s));
4367
4367
  }
4368
4368
  class Cr {
4369
4369
  constructor(e, t) {
4370
- this._parameters = e, this._specification = t, Ot(this, yr(this._parameters, this._specification));
4370
+ this._parameters = e, this._specification = t, kt(this, yr(this._parameters, this._specification));
4371
4371
  }
4372
4372
  static deserialize(e) {
4373
4373
  return new Cr(e._parameters, e._specification);
@@ -4379,21 +4379,21 @@
4379
4379
  };
4380
4380
  }
4381
4381
  }
4382
- function Or(e) {
4382
+ function kr(e) {
4383
4383
  let t = null;
4384
- if (e instanceof Di) t = Or(e.result); else if (e instanceof Fi) {
4385
- for (const n of e.args) if (t = Or(n), t) break;
4386
- } else (e instanceof si || e instanceof ki) && e.input instanceof Cn && "zoom" === e.input.name && (t = e);
4384
+ if (e instanceof Di) t = kr(e.result); else if (e instanceof Fi) {
4385
+ for (const n of e.args) if (t = kr(n), t) break;
4386
+ } else (e instanceof si || e instanceof Oi) && e.input instanceof Cn && "zoom" === e.input.name && (t = e);
4387
4387
  return t instanceof Rt || e.eachChild((e => {
4388
- const n = Or(e);
4388
+ const n = kr(e);
4389
4389
  n instanceof Rt ? t = n : !t && n ? t = new Rt("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : t && n && t !== n && (t = new Rt("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));
4390
4390
  })), t;
4391
4391
  }
4392
- function kr(e) {
4393
- if (Array.isArray(e)) return e.map(kr);
4392
+ function Or(e) {
4393
+ if (Array.isArray(e)) return e.map(Or);
4394
4394
  if (e instanceof Object && !(e instanceof Number || e instanceof String || e instanceof Boolean)) {
4395
4395
  const t = {};
4396
- for (const n in e) t[n] = kr(e[n]);
4396
+ for (const n in e) t[n] = Or(e[n]);
4397
4397
  return t;
4398
4398
  }
4399
4399
  return function(e) {
@@ -4411,7 +4411,7 @@
4411
4411
  try {
4412
4412
  i = function(e) {
4413
4413
  if (!Dr(e)) return e;
4414
- let t = kr(e);
4414
+ let t = Or(e);
4415
4415
  return Er(t), t = Fr(t), t;
4416
4416
  }(n);
4417
4417
  } catch (e) {
@@ -4942,7 +4942,7 @@
4942
4942
  height: r
4943
4943
  }, o);
4944
4944
  }
4945
- this.iconAtlas = new k(e);
4945
+ this.iconAtlas = new O(e);
4946
4946
  }
4947
4947
  if (n && Object.keys(n).length) {
4948
4948
  for (const e in n) {
@@ -5101,7 +5101,7 @@
5101
5101
  }
5102
5102
  function yo(e) {
5103
5103
  let t = e.positions, n = e.image && e.image.format || "alpha";
5104
- if (e instanceof k) {
5104
+ if (e instanceof O) {
5105
5105
  t = {};
5106
5106
  for (const n in e.positions) {
5107
5107
  const i = e.positions[n];
@@ -5243,7 +5243,7 @@
5243
5243
  },
5244
5244
  templateKeys: Po
5245
5245
  });
5246
- const Oo = {
5246
+ const ko = {
5247
5247
  "Latin-1 Supplement": e => e >= 128 && e <= 255,
5248
5248
  Arabic: e => e >= 1536 && e <= 1791,
5249
5249
  "Arabic Supplement": e => e >= 1872 && e <= 1919,
@@ -5293,22 +5293,22 @@
5293
5293
  "Arabic Presentation Forms-B": e => e >= 65136 && e <= 65279,
5294
5294
  "Halfwidth and Fullwidth Forms": e => e >= 65280 && e <= 65519
5295
5295
  };
5296
- function ko(e) {
5297
- return !(Oo.Arabic(e) || Oo["Arabic Supplement"](e) || Oo["Arabic Extended-A"](e) || Oo["Arabic Presentation Forms-A"](e) || Oo["Arabic Presentation Forms-B"](e));
5296
+ function Oo(e) {
5297
+ return !(ko.Arabic(e) || ko["Arabic Supplement"](e) || ko["Arabic Extended-A"](e) || ko["Arabic Presentation Forms-A"](e) || ko["Arabic Presentation Forms-B"](e));
5298
5298
  }
5299
5299
  function Ro(e) {
5300
- return !!(!(e < 11904) && (Oo["Bopomofo Extended"](e) || Oo.Bopomofo(e) || Oo["CJK Compatibility Forms"](e) || Oo["CJK Compatibility Ideographs"](e) || Oo["CJK Compatibility"](e) || Oo["CJK Radicals Supplement"](e) || Oo["CJK Strokes"](e) || Oo["CJK Symbols and Punctuation"](e) || Oo["CJK Unified Ideographs Extension A"](e) || Oo["CJK Unified Ideographs"](e) || Oo["Enclosed CJK Letters and Months"](e) || Oo["Halfwidth and Fullwidth Forms"](e) || Oo.Hiragana(e) || Oo["Ideographic Description Characters"](e) || Oo["Kangxi Radicals"](e) || Oo["Katakana Phonetic Extensions"](e) || Oo.Katakana(e) || Oo["Vertical Forms"](e) || Oo["Yi Radicals"](e) || Oo["Yi Syllables"](e)));
5300
+ return !!(!(e < 11904) && (ko["Bopomofo Extended"](e) || ko.Bopomofo(e) || ko["CJK Compatibility Forms"](e) || ko["CJK Compatibility Ideographs"](e) || ko["CJK Compatibility"](e) || ko["CJK Radicals Supplement"](e) || ko["CJK Strokes"](e) || ko["CJK Symbols and Punctuation"](e) || ko["CJK Unified Ideographs Extension A"](e) || ko["CJK Unified Ideographs"](e) || ko["Enclosed CJK Letters and Months"](e) || ko["Halfwidth and Fullwidth Forms"](e) || ko.Hiragana(e) || ko["Ideographic Description Characters"](e) || ko["Kangxi Radicals"](e) || ko["Katakana Phonetic Extensions"](e) || ko.Katakana(e) || ko["Vertical Forms"](e) || ko["Yi Radicals"](e) || ko["Yi Syllables"](e)));
5301
5301
  }
5302
5302
  function Fo(e) {
5303
- return !!(746 === e || 747 === e || !(e < 4352) && (Oo["Bopomofo Extended"](e) || Oo.Bopomofo(e) || Oo["CJK Compatibility Forms"](e) && !(e >= 65097 && e <= 65103) || Oo["CJK Compatibility Ideographs"](e) || Oo["CJK Compatibility"](e) || Oo["CJK Radicals Supplement"](e) || Oo["CJK Strokes"](e) || !(!Oo["CJK Symbols and Punctuation"](e) || e >= 12296 && e <= 12305 || e >= 12308 && e <= 12319 || 12336 === e) || Oo["CJK Unified Ideographs Extension A"](e) || Oo["CJK Unified Ideographs"](e) || Oo["Enclosed CJK Letters and Months"](e) || Oo["Hangul Compatibility Jamo"](e) || Oo["Hangul Jamo Extended-A"](e) || Oo["Hangul Jamo Extended-B"](e) || Oo["Hangul Jamo"](e) || Oo["Hangul Syllables"](e) || Oo.Hiragana(e) || Oo["Ideographic Description Characters"](e) || Oo.Kanbun(e) || Oo["Kangxi Radicals"](e) || Oo["Katakana Phonetic Extensions"](e) || Oo.Katakana(e) && 12540 !== e || !(!Oo["Halfwidth and Fullwidth Forms"](e) || 65288 === e || 65289 === e || 65293 === e || e >= 65306 && e <= 65310 || 65339 === e || 65341 === e || 65343 === e || e >= 65371 && e <= 65503 || 65507 === e || e >= 65512 && e <= 65519) || !(!Oo["Small Form Variants"](e) || e >= 65112 && e <= 65118 || e >= 65123 && e <= 65126) || Oo["Unified Canadian Aboriginal Syllabics"](e) || Oo["Unified Canadian Aboriginal Syllabics Extended"](e) || Oo["Vertical Forms"](e) || Oo["Yijing Hexagram Symbols"](e) || Oo["Yi Syllables"](e) || Oo["Yi Radicals"](e)));
5303
+ return !!(746 === e || 747 === e || !(e < 4352) && (ko["Bopomofo Extended"](e) || ko.Bopomofo(e) || ko["CJK Compatibility Forms"](e) && !(e >= 65097 && e <= 65103) || ko["CJK Compatibility Ideographs"](e) || ko["CJK Compatibility"](e) || ko["CJK Radicals Supplement"](e) || ko["CJK Strokes"](e) || !(!ko["CJK Symbols and Punctuation"](e) || e >= 12296 && e <= 12305 || e >= 12308 && e <= 12319 || 12336 === e) || ko["CJK Unified Ideographs Extension A"](e) || ko["CJK Unified Ideographs"](e) || ko["Enclosed CJK Letters and Months"](e) || ko["Hangul Compatibility Jamo"](e) || ko["Hangul Jamo Extended-A"](e) || ko["Hangul Jamo Extended-B"](e) || ko["Hangul Jamo"](e) || ko["Hangul Syllables"](e) || ko.Hiragana(e) || ko["Ideographic Description Characters"](e) || ko.Kanbun(e) || ko["Kangxi Radicals"](e) || ko["Katakana Phonetic Extensions"](e) || ko.Katakana(e) && 12540 !== e || !(!ko["Halfwidth and Fullwidth Forms"](e) || 65288 === e || 65289 === e || 65293 === e || e >= 65306 && e <= 65310 || 65339 === e || 65341 === e || 65343 === e || e >= 65371 && e <= 65503 || 65507 === e || e >= 65512 && e <= 65519) || !(!ko["Small Form Variants"](e) || e >= 65112 && e <= 65118 || e >= 65123 && e <= 65126) || ko["Unified Canadian Aboriginal Syllabics"](e) || ko["Unified Canadian Aboriginal Syllabics Extended"](e) || ko["Vertical Forms"](e) || ko["Yijing Hexagram Symbols"](e) || ko["Yi Syllables"](e) || ko["Yi Radicals"](e)));
5304
5304
  }
5305
5305
  function Eo(e) {
5306
5306
  return !(Fo(e) || function(e) {
5307
- return !!(Oo["Latin-1 Supplement"](e) && (167 === e || 169 === e || 174 === e || 177 === e || 188 === e || 189 === e || 190 === e || 215 === e || 247 === e) || Oo["General Punctuation"](e) && (8214 === e || 8224 === e || 8225 === e || 8240 === e || 8241 === e || 8251 === e || 8252 === e || 8258 === e || 8263 === e || 8264 === e || 8265 === e || 8273 === e) || Oo["Letterlike Symbols"](e) || Oo["Number Forms"](e) || Oo["Miscellaneous Technical"](e) && (e >= 8960 && e <= 8967 || e >= 8972 && e <= 8991 || e >= 8996 && e <= 9e3 || 9003 === e || e >= 9085 && e <= 9114 || e >= 9150 && e <= 9165 || 9167 === e || e >= 9169 && e <= 9179 || e >= 9186 && e <= 9215) || Oo["Control Pictures"](e) && 9251 !== e || Oo["Optical Character Recognition"](e) || Oo["Enclosed Alphanumerics"](e) || Oo["Geometric Shapes"](e) || Oo["Miscellaneous Symbols"](e) && !(e >= 9754 && e <= 9759) || Oo["Miscellaneous Symbols and Arrows"](e) && (e >= 11026 && e <= 11055 || e >= 11088 && e <= 11097 || e >= 11192 && e <= 11243) || Oo["CJK Symbols and Punctuation"](e) || Oo.Katakana(e) || Oo["Private Use Area"](e) || Oo["CJK Compatibility Forms"](e) || Oo["Small Form Variants"](e) || Oo["Halfwidth and Fullwidth Forms"](e) || 8734 === e || 8756 === e || 8757 === e || e >= 9984 && e <= 10087 || e >= 10102 && e <= 10131 || 65532 === e || 65533 === e);
5307
+ return !!(ko["Latin-1 Supplement"](e) && (167 === e || 169 === e || 174 === e || 177 === e || 188 === e || 189 === e || 190 === e || 215 === e || 247 === e) || ko["General Punctuation"](e) && (8214 === e || 8224 === e || 8225 === e || 8240 === e || 8241 === e || 8251 === e || 8252 === e || 8258 === e || 8263 === e || 8264 === e || 8265 === e || 8273 === e) || ko["Letterlike Symbols"](e) || ko["Number Forms"](e) || ko["Miscellaneous Technical"](e) && (e >= 8960 && e <= 8967 || e >= 8972 && e <= 8991 || e >= 8996 && e <= 9e3 || 9003 === e || e >= 9085 && e <= 9114 || e >= 9150 && e <= 9165 || 9167 === e || e >= 9169 && e <= 9179 || e >= 9186 && e <= 9215) || ko["Control Pictures"](e) && 9251 !== e || ko["Optical Character Recognition"](e) || ko["Enclosed Alphanumerics"](e) || ko["Geometric Shapes"](e) || ko["Miscellaneous Symbols"](e) && !(e >= 9754 && e <= 9759) || ko["Miscellaneous Symbols and Arrows"](e) && (e >= 11026 && e <= 11055 || e >= 11088 && e <= 11097 || e >= 11192 && e <= 11243) || ko["CJK Symbols and Punctuation"](e) || ko.Katakana(e) || ko["Private Use Area"](e) || ko["CJK Compatibility Forms"](e) || ko["Small Form Variants"](e) || ko["Halfwidth and Fullwidth Forms"](e) || 8734 === e || 8756 === e || 8757 === e || e >= 9984 && e <= 10087 || e >= 10102 && e <= 10131 || 65532 === e || 65533 === e);
5308
5308
  }(e));
5309
5309
  }
5310
5310
  function Do(e) {
5311
- return e >= 1424 && e <= 2303 || Oo["Arabic Presentation Forms-A"](e) || Oo["Arabic Presentation Forms-B"](e);
5311
+ return e >= 1424 && e <= 2303 || ko["Arabic Presentation Forms-A"](e) || ko["Arabic Presentation Forms-B"](e);
5312
5312
  }
5313
5313
  const Ho = [ [ 9, 9 ], [ 32, 32 ], [ 5760, 5760 ], [ 8192, 8198 ], [ 8200, 8202 ], [ 8287, 12288 ], [ 6158, 6158 ], [ 8203, 8205 ] ];
5314
5314
  function Lo(e) {
@@ -5604,7 +5604,7 @@
5604
5604
  const {font: e, text: r} = h.glyph;
5605
5605
  if ("" === r) return null;
5606
5606
  const o = 24, u = this.textSize[0] / o, f = 24, d = l.textKeepUpright, p = "map" === l.textRotationAlignment && "line" === l.textPlacement && !l.isIconText, g = t.glyphMap[e], m = Qo(n ? n(null, c) : l.textHorizontalAlignment, i ? i(null, c) : l.textVerticalAlignment), y = 1.2 * f, x = function(e) {
5607
- for (let t = 0; t < e.length; t++) if (!ko(e.charAt(t).charCodeAt(0))) return !1;
5607
+ for (let t = 0; t < e.length; t++) if (!Oo(e.charAt(t).charCodeAt(0))) return !1;
5608
5608
  return !0;
5609
5609
  }(r), _ = x && l.textLetterSpacing / u || 0, v = [ l.textDx / u || 0, l.textDy / u || 0 ], A = ((s ? s(null, c) : l.textWrapWidth) || 10 * f) / u, b = {};
5610
5610
  b.horizontal = Uo(r, g, A, y, m, 0, _, v, f, zo, this.options.isVector3D), x && p && d && (b.vertical = Uo(r, g, A, y, m, 0, _, v, f, Vo)),
@@ -6332,7 +6332,7 @@
6332
6332
  for (let n = 0; n < e.length; n++) if (Fo(e.charAt(n).charCodeAt(0))) t = 0; else if (t++,
6333
6333
  t >= 1) return !1;
6334
6334
  return !0;
6335
- }(e.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: x, textSizeFn: _, textHaloFillFn: v, textHaloRadiusFn: A, textHaloOpacityFn: b, textDxFn: T, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: O, textRotationFn: k, textAllowOverlapFn: R, textIgnorePlacementFn: F, textOpacityFn: E, markerWidthFn: D, markerHeightFn: H, markerDxFn: L, markerDyFn: N, markerPitchAlignmentFn: z, markerRotationAlignmentFn: V, markerRotationFn: U, markerAllowOverlapFn: G, markerIgnorePlacementFn: B, markerOpacityFn: j} = this._fnTypes;
6335
+ }(e.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: x, textSizeFn: _, textHaloFillFn: v, textHaloRadiusFn: A, textHaloOpacityFn: b, textDxFn: T, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: k, textRotationFn: O, textAllowOverlapFn: R, textIgnorePlacementFn: F, textOpacityFn: E, markerWidthFn: D, markerHeightFn: H, markerDxFn: L, markerDyFn: N, markerPitchAlignmentFn: z, markerRotationAlignmentFn: V, markerRotationFn: U, markerAllowOverlapFn: G, markerIgnorePlacementFn: B, markerOpacityFn: j} = this._fnTypes;
6336
6336
  let W, X, $, Y, q, Z = [ 0, 0, 0, 0 ], K = 14, J = [ 0, 0, 0, 0 ], Q = 0, ee = 0, te = 0, ne = 0, re = 0, oe = 0, se = 0, ae = 0, le = 0, he = 0, ce = 0, ue = 0, fe = 0, de = 0;
6337
6337
  if (g) {
6338
6338
  const t = e.getIconAndGlyph().glyph.font;
@@ -6363,8 +6363,8 @@
6363
6363
  }(r.horizontal, p, this.glyphAtlas.positions[t]), x && (Z = x(null, d), ie(Z) ? this.dynamicAttrs.aTextFill = 1 : Z = ht([], Z)),
6364
6364
  _ && (K = _(this.options.zoom, d), M(K) && (K = 14)), v && (J = v(null, d), ie(J) ? this.dynamicAttrs.aTextHaloFill = 1 : J = ht([], J)),
6365
6365
  A && (Q = A(null, d)), b && (ee = 255 * b(null, d)), T && (te = T(null, d) || 0),
6366
- I && (ne = I(null, d) || 0), C && (he = +("map" === C(null, d))), O && (ue = +("map" === O(null, d))),
6367
- k && (de = P(k(null, d), 0, 360) * Math.PI / 180);
6366
+ I && (ne = I(null, d) || 0), C && (he = +("map" === C(null, d))), k && (ue = +("map" === k(null, d))),
6367
+ O && (de = P(O(null, d), 0, 360) * Math.PI / 180);
6368
6368
  }
6369
6369
  m && (Y = i ? function(e) {
6370
6370
  const t = e.image, n = e.top - 1 / t.pixelRatio, i = e.left - 1 / t.pixelRatio, r = e.bottom + 1 / t.pixelRatio, s = e.right + 1 / t.pixelRatio;
@@ -6461,7 +6461,7 @@
6461
6461
  }
6462
6462
  }
6463
6463
  _fillFnTypeData(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g, m, y, x, _, v, A) {
6464
- const {textFillFn: b, textSizeFn: T, textHaloFillFn: S, textHaloRadiusFn: w, textDxFn: P, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: O, textRotationFn: k, textAllowOverlapFn: R, textIgnorePlacementFn: F, textOpacityFn: E, textHaloOpacityFn: D, markerWidthFn: H, markerHeightFn: L, markerDxFn: N, markerDyFn: z, markerPitchAlignmentFn: V, markerRotationAlignmentFn: U, markerRotationFn: G, markerAllowOverlapFn: B, markerIgnorePlacementFn: j, markerOpacityFn: W} = this._fnTypes;
6464
+ const {textFillFn: b, textSizeFn: T, textHaloFillFn: S, textHaloRadiusFn: w, textDxFn: P, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: k, textRotationFn: O, textAllowOverlapFn: R, textIgnorePlacementFn: F, textOpacityFn: E, textHaloOpacityFn: D, markerWidthFn: H, markerHeightFn: L, markerDxFn: N, markerDyFn: z, markerPitchAlignmentFn: V, markerRotationAlignmentFn: U, markerRotationFn: G, markerAllowOverlapFn: B, markerIgnorePlacementFn: j, markerOpacityFn: W} = this._fnTypes;
6465
6465
  if (b) {
6466
6466
  let n = e.aTextFill.currentIndex;
6467
6467
  e.aTextFill[n++] = t[0], e.aTextFill[n++] = t[1], e.aTextFill[n++] = t[2], e.aTextFill[n++] = t[3],
@@ -6524,7 +6524,7 @@
6524
6524
  e.aPitchAlign[t++] = p, e.aPitchAlign.currentIndex = t, t = e.aPitchAlign.currentIndex,
6525
6525
  e.aPitchAlign[t++] = g, e.aPitchAlign.currentIndex = t;
6526
6526
  }
6527
- if (U || O) if (X) {
6527
+ if (U || k) if (X) {
6528
6528
  let t = e.aRotationAlign.currentIndex;
6529
6529
  e.aRotationAlign[t++] = y, e.aRotationAlign.currentIndex = t;
6530
6530
  } else {
@@ -6532,7 +6532,7 @@
6532
6532
  e.aRotationAlign[t++] = m, e.aRotationAlign.currentIndex = t, t = e.aRotationAlign.currentIndex,
6533
6533
  e.aRotationAlign[t++] = y, e.aRotationAlign.currentIndex = t;
6534
6534
  }
6535
- if (G || k) if (X) {
6535
+ if (G || O) if (X) {
6536
6536
  let t = e.aRotation.currentIndex;
6537
6537
  e.aRotation[t++] = 9362 * _, e.aRotation.currentIndex = t;
6538
6538
  } else {
@@ -6678,10 +6678,10 @@
6678
6678
  function Cs(e, t, n, i, r) {
6679
6679
  return e[0] = t, e[1] = n, e[2] = i, e[3] = r, e;
6680
6680
  }
6681
- function Os(e, t, n) {
6681
+ function ks(e, t, n) {
6682
6682
  return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e;
6683
6683
  }
6684
- function ks(e, t, n) {
6684
+ function Os(e, t, n) {
6685
6685
  return e[0] = t, e[1] = n, e;
6686
6686
  }
6687
6687
  Math.hypot || (Math.hypot = function() {
@@ -7047,7 +7047,7 @@
7047
7047
  const Gs = [], Bs = [];
7048
7048
  function js(e, t, n) {
7049
7049
  const i = e.mag(), r = t.mag();
7050
- ks(Gs, n.x, n.y), ks(Bs, t.x, t.y);
7050
+ Os(Gs, n.x, n.y), Os(Bs, t.x, t.y);
7051
7051
  const o = (a = Bs, (s = Gs)[0] * a[0] + s[1] * a[1]);
7052
7052
  var s, a;
7053
7053
  return -Math.sign(o) * Math.sqrt(r * r - i * i);
@@ -7124,7 +7124,7 @@
7124
7124
  * https://github.com/Turfjs/turf
7125
7125
  * MIT LICENSE
7126
7126
  */ (e, t, n, i) > 0) for (let r = t; r < n; r += i) o = Ca(r / i | 0, e[r], e[r + 1], o); else for (let r = n - i; r >= t; r -= i) o = Ca(r / i | 0, e[r], e[r + 1], o);
7127
- return o && Ta(o, o.next) && (Oa(o), o = o.next), o;
7127
+ return o && Ta(o, o.next) && (ka(o), o = o.next), o;
7128
7128
  }
7129
7129
  function la(e, t) {
7130
7130
  if (!e) return e;
@@ -7132,7 +7132,7 @@
7132
7132
  let n, i = e;
7133
7133
  do {
7134
7134
  if (n = !1, i.steiner || !Ta(i, i.next) && 0 !== ba(i.prev, i, i.next)) i = i.next; else {
7135
- if (Oa(i), i = t = i.prev, i === i.next) break;
7135
+ if (ka(i), i = t = i.prev, i === i.next) break;
7136
7136
  n = !0;
7137
7137
  }
7138
7138
  } while (n || i !== t);
@@ -7169,7 +7169,7 @@
7169
7169
  let a = e;
7170
7170
  for (;e.prev !== e.next; ) {
7171
7171
  const l = e.prev, h = e.next;
7172
- if (o ? ua(e, i, r, o) : ca(e)) t.push(l.i, e.i, h.i), Oa(e), e = h.next, a = h.next; else if ((e = h) === a) {
7172
+ if (o ? ua(e, i, r, o) : ca(e)) t.push(l.i, e.i, h.i), ka(e), e = h.next, a = h.next; else if ((e = h) === a) {
7173
7173
  s ? 1 === s ? ha(e = fa(la(e), t), t, n, i, r, o, 2) : 2 === s && da(e, t, n, i, r, o) : ha(la(e), t, n, i, r, o, 1);
7174
7174
  break;
7175
7175
  }
@@ -7211,7 +7211,7 @@
7211
7211
  do {
7212
7212
  const i = n.prev, r = n.next.next;
7213
7213
  !Ta(i, r) && Sa(i, n, n.next, r) && Pa(i, r) && Pa(r, i) && (t.push(i.i, n.i, r.i),
7214
- Oa(n), Oa(n.next), n = e = r), n = n.next;
7214
+ ka(n), ka(n.next), n = e = r), n = n.next;
7215
7215
  } while (n !== e);
7216
7216
  return la(n);
7217
7217
  }
@@ -7323,20 +7323,20 @@
7323
7323
  return ba(e.prev, e, e.next) < 0 ? ba(e, t, e.next) >= 0 && ba(e, e.prev, t) >= 0 : ba(e, t, e.prev) < 0 || ba(e, e.next, t) < 0;
7324
7324
  }
7325
7325
  function Ia(e, t) {
7326
- const n = ka(e.i, e.x, e.y), i = ka(t.i, t.x, t.y), r = e.next, o = t.prev;
7326
+ const n = Oa(e.i, e.x, e.y), i = Oa(t.i, t.x, t.y), r = e.next, o = t.prev;
7327
7327
  return e.next = t, t.prev = e, n.next = r, r.prev = n, i.next = n, n.prev = i, o.next = i,
7328
7328
  i.prev = o, i;
7329
7329
  }
7330
7330
  function Ca(e, t, n, i) {
7331
- const r = ka(e, t, n);
7331
+ const r = Oa(e, t, n);
7332
7332
  return i ? (r.next = i.next, r.prev = i, i.next.prev = r, i.next = r) : (r.prev = r,
7333
7333
  r.next = r), r;
7334
7334
  }
7335
- function Oa(e) {
7335
+ function ka(e) {
7336
7336
  e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ),
7337
7337
  e.nextZ && (e.nextZ.prevZ = e.prevZ);
7338
7338
  }
7339
- function ka(e, t, n) {
7339
+ function Oa(e, t, n) {
7340
7340
  return {
7341
7341
  i: e,
7342
7342
  x: t,
@@ -7458,7 +7458,7 @@
7458
7458
  fillData(e, t, n, i, r, o, s, a) {
7459
7459
  const {lineWidthFn: l, lineColorFn: h, lineOpacityFn: c, linePatternAnimSpeedFn: u, linePatternGapFn: f} = this._fnTypes, d = r.length;
7460
7460
  for (let o = 0; o < d; o++) {
7461
- this.fillPosition(e, t, n, i), Os(r[o], r[o], Rs);
7461
+ this.fillPosition(e, t, n, i), ks(r[o], r[o], Rs);
7462
7462
  let d = e.aTubeNormal.currentIndex;
7463
7463
  for (let t = 0; t < r[o].length; t++) e.aTubeNormal[d++] = r[o][t];
7464
7464
  if (e.aTubeNormal.currentIndex = d, d = e.aLinesofar.currentIndex, e.aLinesofar[d++] = s,
@@ -7492,7 +7492,7 @@
7492
7492
  }
7493
7493
  const Xa = [], $a = [], Ya = [], qa = [], Za = [];
7494
7494
  function Ka(e, t, n, i, r, o, s, a) {
7495
- Ms($a, n, i, r), Ms(Ya, o, s, 0), Is(qa, $a, Ya), Ps(Ya, Ya), Ps(qa, qa), ks(Xa, e, t);
7495
+ Ms($a, n, i, r), Ms(Ya, o, s, 0), Is(qa, $a, Ya), Ps(Ya, Ya), Ps(qa, qa), Os(Xa, e, t);
7496
7496
  const l = function(e) {
7497
7497
  var t = e[0], n = e[1];
7498
7498
  return Math.hypot(t, n);
@@ -7689,7 +7689,6 @@
7689
7689
  lineCap: 1,
7690
7690
  linePatternFile: 1
7691
7691
  }, ul = {
7692
- visible: 1,
7693
7692
  textHorizontalAlignment: 1,
7694
7693
  textVerticalAlignment: 1,
7695
7694
  textWrapWidth: 1,
@@ -8524,7 +8523,7 @@
8524
8523
  };
8525
8524
  var I = d.exports, C = {
8526
8525
  exports: {}
8527
- }, O = {
8526
+ }, k = {
8528
8527
  aliceblue: [ 240, 248, 255 ],
8529
8528
  antiquewhite: [ 250, 235, 215 ],
8530
8529
  aqua: [ 0, 255, 255 ],
@@ -8673,8 +8672,8 @@
8673
8672
  whitesmoke: [ 245, 245, 245 ],
8674
8673
  yellow: [ 255, 255, 0 ],
8675
8674
  yellowgreen: [ 154, 205, 50 ]
8676
- }, k = {};
8677
- for (var R in O) O.hasOwnProperty(R) && (k[O[R]] = R);
8675
+ }, O = {};
8676
+ for (var R in k) k.hasOwnProperty(R) && (O[k[R]] = R);
8678
8677
  var F = C.exports = {
8679
8678
  rgb: {
8680
8679
  channels: 3,
@@ -8765,16 +8764,16 @@
8765
8764
  var t, n = e[0] / 255, i = e[1] / 255, r = e[2] / 255;
8766
8765
  return [ 100 * ((1 - n - (t = Math.min(1 - n, 1 - i, 1 - r))) / (1 - t) || 0), 100 * ((1 - i - t) / (1 - t) || 0), 100 * ((1 - r - t) / (1 - t) || 0), 100 * t ];
8767
8766
  }, F.rgb.keyword = function(e) {
8768
- var t = k[e];
8767
+ var t = O[e];
8769
8768
  if (t) return t;
8770
8769
  var n, i, r, o = 1 / 0;
8771
- for (var s in O) if (O.hasOwnProperty(s)) {
8772
- var a = O[s], l = (i = e, r = a, Math.pow(i[0] - r[0], 2) + Math.pow(i[1] - r[1], 2) + Math.pow(i[2] - r[2], 2));
8770
+ for (var s in k) if (k.hasOwnProperty(s)) {
8771
+ var a = k[s], l = (i = e, r = a, Math.pow(i[0] - r[0], 2) + Math.pow(i[1] - r[1], 2) + Math.pow(i[2] - r[2], 2));
8773
8772
  l < o && (o = l, n = s);
8774
8773
  }
8775
8774
  return n;
8776
8775
  }, F.keyword.rgb = function(e) {
8777
- return O[e];
8776
+ return k[e];
8778
8777
  }, F.rgb.xyz = function(e) {
8779
8778
  var t = e[0] / 255, n = e[1] / 255, i = e[2] / 255;
8780
8779
  return [ 100 * (.4124 * (t = t > .04045 ? Math.pow((t + .055) / 1.055, 2.4) : t / 12.92) + .3576 * (n = n > .04045 ? Math.pow((n + .055) / 1.055, 2.4) : n / 12.92) + .1805 * (i = i > .04045 ? Math.pow((i + .055) / 1.055, 2.4) : i / 12.92)), 100 * (.2126 * t + .7152 * n + .0722 * i), 100 * (.0193 * t + .1192 * n + .9505 * i) ];
@@ -9480,10 +9479,10 @@
9480
9479
  return e && "object" == typeof e && (e.stops || e.property && "identity" === e.type || e.expression && "calculate-expression" === e.type);
9481
9480
  }
9482
9481
  function Pe(e) {
9483
- return Oe(e, "exponential");
9482
+ return ke(e, "exponential");
9484
9483
  }
9485
9484
  function Ie(e) {
9486
- return Oe(e, "interval");
9485
+ return ke(e, "interval");
9487
9486
  }
9488
9487
  function Ce(e, t) {
9489
9488
  if (!e) return null;
@@ -9513,23 +9512,23 @@
9513
9512
  l(o)) : s[o] = e[o];
9514
9513
  return n ? s : e;
9515
9514
  }
9516
- function Oe(e, t) {
9515
+ function ke(e, t) {
9517
9516
  if (!Me(e)) return function() {
9518
9517
  return e;
9519
9518
  };
9520
9519
  let n = !0, i = !0;
9521
9520
  const r = (e = JSON.parse(JSON.stringify(e))).stops;
9522
9521
  if (r) for (let e = 0; e < r.length; e++) if (Me(r[e][1])) {
9523
- const o = Oe(r[e][1], t);
9522
+ const o = ke(r[e][1], t);
9524
9523
  n = n && o.isZoomConstant, i = i && o.isFeatureConstant, r[e] = [ r[e][0], o ];
9525
9524
  }
9526
9525
  const o = me(e, t);
9527
9526
  return o.isZoomConstant = n && o.isZoomConstant, o.isFeatureConstant = i && o.isFeatureConstant,
9528
9527
  o;
9529
9528
  }
9530
- let ke = 0;
9529
+ let Oe = 0;
9531
9530
  function Re() {
9532
- return ke++;
9531
+ return Oe++;
9533
9532
  }
9534
9533
  const Fe = "function" == typeof Object.assign;
9535
9534
  function Ee(e, ...t) {
@@ -9597,37 +9596,38 @@
9597
9596
  const e = n;
9598
9597
  n = t, t = e;
9599
9598
  }
9600
- (t = t || {}).method && (t.method = t.method.toUpperCase());
9601
- const i = "POST" === t.method;
9599
+ let i = (t = t || {}).errorLog;
9600
+ ze(i) && (i = !0), t.method && (t.method = t.method.toUpperCase());
9601
+ const r = "POST" === t.method;
9602
9602
  if (We) {
9603
- const i = new AbortController, r = t;
9604
- r.signal = i.signal, r.referrerPolicy = r.referrerPolicy || "origin", r.method = r.method || "GET";
9605
- const o = new Request(e, r);
9606
- return t.returnJSON && o.headers.set("Accept", "application/json"), fetch(o).then((i => {
9607
- const r = this._parseResponse(i, t.returnJSON, t.responseType);
9608
- r.message ? (r.url = e, n(r)) : r.then((e => {
9603
+ const r = new AbortController, o = t;
9604
+ o.signal = r.signal, o.referrerPolicy = o.referrerPolicy || "origin", o.method = o.method || "GET";
9605
+ const s = new Request(e, o);
9606
+ return t.returnJSON && s.headers.set("Accept", "application/json"), fetch(s).then((r => {
9607
+ const o = this._parseResponse(r, t.returnJSON, t.responseType);
9608
+ o.message ? (o.url = e, n(o)) : o.then((e => {
9609
9609
  "arraybuffer" === t.responseType ? n(null, {
9610
9610
  data: e,
9611
- cacheControl: i.headers.get("Cache-Control"),
9612
- expires: i.headers.get("Expires"),
9613
- contentType: i.headers.get("Content-Type")
9611
+ cacheControl: r.headers.get("Cache-Control"),
9612
+ expires: r.headers.get("Expires"),
9613
+ contentType: r.headers.get("Content-Type")
9614
9614
  }) : n(null, e);
9615
9615
  })).catch((t => {
9616
- t.code && t.code === DOMException.ABORT_ERR || (console.error("Fetch error:", e, t),
9616
+ t.code && t.code === DOMException.ABORT_ERR || (i && console.error("Fetch error:", e, t),
9617
9617
  n(t));
9618
9618
  }));
9619
9619
  })).catch((t => {
9620
- t.code && t.code === DOMException.ABORT_ERR || (console.error("Fetch error:", e, t),
9620
+ t.code && t.code === DOMException.ABORT_ERR || (i && console.error("Fetch error:", e, t),
9621
9621
  n(t));
9622
- })), i;
9622
+ })), r;
9623
9623
  }
9624
9624
  {
9625
- const r = Xe._getClient(n);
9626
- if (r.open(t.method || "GET", e, !0), t) {
9627
- for (const e in t.headers) r.setRequestHeader(e, t.headers[e]);
9628
- r.withCredentials = "include" === t.credentials, t.responseType && (r.responseType = t.responseType);
9625
+ const i = Xe._getClient(n);
9626
+ if (i.open(t.method || "GET", e, !0), t) {
9627
+ for (const e in t.headers) i.setRequestHeader(e, t.headers[e]);
9628
+ i.withCredentials = "include" === t.credentials, t.responseType && (i.responseType = t.responseType);
9629
9629
  }
9630
- return r.send(i ? t.body : null), r;
9630
+ return i.send(r ? t.body : null), i;
9631
9631
  }
9632
9632
  },
9633
9633
  _parseResponse: (e, t, n) => 200 !== e.status ? {
@@ -10300,10 +10300,10 @@
10300
10300
  function Ct(e) {
10301
10301
  return "number" == typeof e && !isNaN(e);
10302
10302
  }
10303
- function Ot(e) {
10303
+ function kt(e) {
10304
10304
  return e && (e.markerFile || e.markerType) && void 0 !== e.textName;
10305
10305
  }
10306
- function kt(e, t) {
10306
+ function Ot(e, t) {
10307
10307
  return Object.prototype.hasOwnProperty.call(e, t);
10308
10308
  }
10309
10309
  function Rt(e, t) {
@@ -10360,14 +10360,16 @@
10360
10360
  this.clearTileCaches(), super.clear();
10361
10361
  }
10362
10362
  setStyle() {
10363
- if (this._groundPainter && this._groundPainter.update(), this._workerConn) {
10363
+ this._groundPainter && this._groundPainter.update(), this._workerConn ? (this._workerUpdateTimeout && clearTimeout(this._workerUpdateTimeout),
10364
+ this._workerUpdateTimeout = setTimeout((() => {
10365
+ if (!this.layer) return;
10364
10366
  this._styleCounter++, this._preservePrevTiles();
10365
10367
  const e = this.layer._getComputedStyle();
10366
10368
  e.styleCounter = this._styleCounter, this._workersyncing = !0, this._workerConn.updateStyle(e, (e => {
10367
10369
  if (this._workersyncing = !1, e) throw new Error(e);
10368
10370
  this._needRetire = !0, this._initPlugins(), this.setToRedraw(), this.layer.fire("refreshstyle");
10369
10371
  }));
10370
- } else this._initPlugins();
10372
+ }), 10)) : this._initPlugins();
10371
10373
  }
10372
10374
  _preservePrevTiles() {
10373
10375
  if (this._prevTilesInView) for (const e in this._prevTilesInView) {
@@ -10571,7 +10573,7 @@
10571
10573
  keys: {},
10572
10574
  tiles: [ e ]
10573
10575
  }, this._requestingMVT[t].keys[e.id] = 1;
10574
- const h = this.layer.options.fetchOptions, c = window && window.location.href, u = this.layer.options.altitudePropertyName, f = this.layer.options.disableAltitudeWarning, d = {
10576
+ const h = this.layer.options.fetchOptions, c = window && window.location.href, u = this.layer.options.altitudePropertyName, f = this.layer.options.disableAltitudeWarning, d = this.layer.options.loadTileErrorLog, p = this.layer.options.loadTileErrorLogIgnoreCodes, g = {
10575
10577
  tileInfo: {
10576
10578
  res: e.res,
10577
10579
  x: e.x,
@@ -10583,6 +10585,8 @@
10583
10585
  },
10584
10586
  glScale: l,
10585
10587
  disableAltitudeWarning: f,
10588
+ loadTileErrorLog: d,
10589
+ loadTileErrorLogIgnoreCodes: p,
10586
10590
  altitudePropertyName: u,
10587
10591
  zScale: this._zScale,
10588
10592
  centimeterToPoint: s,
@@ -10593,10 +10597,10 @@
10593
10597
  workerCacheIndex: this._workerCacheIndex,
10594
10598
  command: "loadTile"
10595
10599
  };
10596
- this.loadTileArrayBuffer && Le(this.loadTileArrayBuffer) ? this.loadTileArrayBuffer(d.tileInfo.url, e, ((e, n) => {
10597
- e ? this._onReceiveMVTData(t, e) : n && n instanceof ArrayBuffer ? (d.tileArrayBuffer = n,
10598
- this._workerConn.loadTile(d, this._onReceiveMVTData.bind(this, t))) : console.error("loadTileArrayBuffer return data is not ArrayBuffer:", n);
10599
- }), d) : this._workerConn.loadTile(d, this._onReceiveMVTData.bind(this, t));
10600
+ this.loadTileArrayBuffer && Le(this.loadTileArrayBuffer) ? this.loadTileArrayBuffer(g.tileInfo.url, e, ((e, n) => {
10601
+ e ? this._onReceiveMVTData(t, e) : n && n instanceof ArrayBuffer ? (g.tileArrayBuffer = n,
10602
+ this._workerConn.loadTile(g, this._onReceiveMVTData.bind(this, t))) : console.error("loadTileArrayBuffer return data is not ArrayBuffer:", n);
10603
+ }), g) : this._workerConn.loadTile(g, this._onReceiveMVTData.bind(this, t));
10600
10604
  }
10601
10605
  return {};
10602
10606
  }
@@ -11068,7 +11072,7 @@
11068
11072
  tileInfo: e,
11069
11073
  tileZoom: this._tileZoom
11070
11074
  }, p = r.createTile(d);
11071
- n[h].geometry && (t.data[h] = 1), !this._needRetire && p.retire && r.supportRenderMode("taa") && (this._needRetire = !0);
11075
+ n[h].geometry && (t.data[h] = "geometry created"), !this._needRetire && p.retire && r.supportRenderMode("taa") && (this._needRetire = !0);
11072
11076
  }));
11073
11077
  }
11074
11078
  checkTileInQueue(e) {
@@ -12125,7 +12129,9 @@
12125
12129
  tileStackStartDepth: 3,
12126
12130
  tileStackDepth: 2,
12127
12131
  altitudePropertyName: null,
12128
- disableAltitudeWarning: !1
12132
+ disableAltitudeWarning: !1,
12133
+ loadTileErrorLog: !0,
12134
+ loadTileErrorLogIgnoreCodes: [ 404, 204 ]
12129
12135
  }), rn.registerRenderer("gl", jt), rn.registerRenderer("canvas", null);
12130
12136
  const cn = new r.Size(1, 1);
12131
12137
  class un extends r.OverlayLayer {
@@ -12422,7 +12428,7 @@
12422
12428
  if (!e) return "true";
12423
12429
  const t = e[0];
12424
12430
  if (e.length <= 1) return "any" === t ? "false" : "true";
12425
- return `(${"==" === t ? In(e[1], e[2], "===", !1) : "!=" === t ? In(e[1], e[2], "!==", !1) : "<" === t || ">" === t || "<=" === t || ">=" === t ? In(e[1], e[2], t, !0) : "any" === t ? On(e.slice(1), "||") : "all" === t ? On(e.slice(1), "&&") : "none" === t ? Fn(On(e.slice(1), "||")) : "in" === t ? kn(e[1], e.slice(2)) : "!in" === t ? Fn(kn(e[1], e.slice(2))) : "has" === t ? Rn(e[1]) : "!has" === t ? Fn(Rn(e[1])) : "contains" === t ? function(e, t, n) {
12431
+ return `(${"==" === t ? In(e[1], e[2], "===", !1) : "!=" === t ? In(e[1], e[2], "!==", !1) : "<" === t || ">" === t || "<=" === t || ">=" === t ? In(e[1], e[2], t, !0) : "any" === t ? kn(e.slice(1), "||") : "all" === t ? kn(e.slice(1), "&&") : "none" === t ? Fn(kn(e.slice(1), "||")) : "in" === t ? On(e[1], e.slice(2)) : "!in" === t ? Fn(On(e[1], e.slice(2))) : "has" === t ? Rn(e[1]) : "!has" === t ? Fn(Rn(e[1])) : "contains" === t ? function(e, t, n) {
12426
12432
  const i = Pn(e);
12427
12433
  return void 0 !== n ? `(${i} + '').indexOf("${t}") === ${n}` : `(${i} + '').indexOf("${t}") >= 0`;
12428
12434
  }(e[1], e[2], e[3]) : "true"})`;
@@ -12444,10 +12450,10 @@
12444
12450
  const o = "$type" === t ? wn.indexOf(n) : JSON.stringify(n);
12445
12451
  return (r ? `typeof ${e}=== typeof ${o}&&` : "") + e + i + o;
12446
12452
  }
12447
- function On(e, t) {
12453
+ function kn(e, t) {
12448
12454
  return e.map(Mn).join(t);
12449
12455
  }
12450
- function kn(e, t) {
12456
+ function On(e, t) {
12451
12457
  "$type" === e && (t = t.map((e => wn.indexOf(e))));
12452
12458
  const n = JSON.stringify(t.sort(En)), i = Pn(e);
12453
12459
  return t.length <= 200 ? `${n}.indexOf(${i}) !== -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; }(${i}, ${n},0,${t.length - 1})`;
@@ -13110,7 +13116,7 @@
13110
13116
  const r = pi.set(t, n)._multi(i / e.res);
13111
13117
  return e.extent2d.contains(r);
13112
13118
  }
13113
- const {SYMBOLS_NEED_REBUILD_IN_VT: xi, StyleUtil: _i, FuncTypeUtil: vi} = h(), {loginIBLResOnCanvas: Ai, logoutIBLResOnCanvas: bi, getIBLResOnCanvas: Ti} = n.reshader.pbr.PBRUtils, Si = "__gl_textures", wi = [], Mi = new r.Point(0, 0), Pi = new r.Point(0, 0), Ii = new Float32Array(1), Ci = [], Oi = e => 0 === e.properties.level, ki = e => e.properties.level > 0;
13119
+ const {SYMBOLS_NEED_REBUILD_IN_VT: xi, StyleUtil: _i, FuncTypeUtil: vi} = h(), {loginIBLResOnCanvas: Ai, logoutIBLResOnCanvas: bi, getIBLResOnCanvas: Ti} = n.reshader.pbr.PBRUtils, Si = "__gl_textures", wi = [], Mi = new r.Point(0, 0), Pi = new r.Point(0, 0), Ii = new Float32Array(1), Ci = [], ki = e => 0 === e.properties.level, Oi = e => e.properties.level > 0;
13114
13120
  class Ri {
13115
13121
  static getBloomSymbol() {
13116
13122
  return [ "bloom" ];
@@ -13118,7 +13124,7 @@
13118
13124
  constructor(e, t, i, r, o, s) {
13119
13125
  this._is2D = !0, this.regl = e, this.layer = t, this.canvas = (e._gl || e.context).canvas,
13120
13126
  this.sceneConfig = r || {}, this.dataConfig = s || {}, this.pluginIndex = o, this.scene = new n.reshader.Scene,
13121
- this.pickingFBO = t.getRenderer().pickingFBO, this.level0Filter = Oi, this.levelNFilter = ki,
13127
+ this.pickingFBO = t.getRenderer().pickingFBO, this.level0Filter = ki, this.levelNFilter = Oi,
13122
13128
  this.loginTextureCache(), this.symbolDef = Array.isArray(i) ? i.map((e => bt(e))) : [ bt(i) ],
13123
13129
  this._compileSymbols(), this.pickingViewport = {
13124
13130
  x: 0,
@@ -13467,7 +13473,7 @@
13467
13473
  return delete this._fnTypeConfigs, this.setToRedraw(!1), n;
13468
13474
  }
13469
13475
  _isNeedRefreshStyle(e, t) {
13470
- for (const n in t) if (kt(t, n)) {
13476
+ for (const n in t) if (Ot(t, n)) {
13471
13477
  if (_i.isFnTypeSymbol(t[n]) && !this.layer.options.features && (!e[n] || e[n].property !== t[n].property)) return !0;
13472
13478
  if (xi[n] && !se(t[n], e[n])) return !0;
13473
13479
  }
@@ -13530,7 +13536,7 @@
13530
13536
  }
13531
13537
  logoutTextureCache() {
13532
13538
  const e = (Si + "").trim(), t = this.getMap(), n = this._myTextures;
13533
- if (n) for (const i in n) kt(n, i) && t[e][i] && (t[e][i].count--, t[e][i].count <= 0 && delete t[e][i]);
13539
+ if (n) for (const i in n) Ot(n, i) && t[e][i] && (t[e][i].count--, t[e][i].count <= 0 && delete t[e][i]);
13534
13540
  t[e].count--, t[e].count <= 0 && (t[e] = {});
13535
13541
  }
13536
13542
  getCachedTexture(e) {
@@ -15152,7 +15158,7 @@
15152
15158
  const Sr = 224, wr = 600, Mr = 100, Pr = new Uint8Array(1), Ir = [], Cr = {
15153
15159
  collides: 0,
15154
15160
  boxes: []
15155
- }, Or = [], kr = [];
15161
+ }, kr = [], Or = [];
15156
15162
  class Rr extends Di {
15157
15163
  createGeometry(...e) {
15158
15164
  const t = super.createGeometry(...e);
@@ -15169,7 +15175,7 @@
15169
15175
  addMesh(e, t, n) {
15170
15176
  if (e && !this.isEnableCollision()) {
15171
15177
  let t = e;
15172
- Array.isArray(t) || (Or[0] = e, t = Or);
15178
+ Array.isArray(t) || (kr[0] = e, t = kr);
15173
15179
  for (let e = 0; e < t.length; e++) {
15174
15180
  const n = t[e].defines;
15175
15181
  delete n.ENABLE_COLLISION, t[e].setDefines(n);
@@ -15422,9 +15428,9 @@
15422
15428
  }
15423
15429
  isCollides(e) {
15424
15430
  const t = this.layer, i = t.getMap(), r = i.getDevicePixelRatio();
15425
- if (n.vec4.scale(kr, e, 1 / r), i.isOffscreen(kr)) return -1;
15431
+ if (n.vec4.scale(Or, e, 1 / r), i.isOffscreen(Or)) return -1;
15426
15432
  const o = t.getCollisionIndex(), s = this.sceneConfig.collisionBufferSize || t.options.collisionBufferSize || 0;
15427
- return s && (e = Hr(kr, e, s)), +o.collides(e);
15433
+ return s && (e = Hr(Or, e, s)), +o.collides(e);
15428
15434
  }
15429
15435
  insertCollisionBox(e) {
15430
15436
  const t = this.layer, n = t.getCollisionIndex(), i = this.sceneConfig.collisionBufferSize || t.options.collisionBufferSize || 0;
@@ -15444,9 +15450,9 @@
15444
15450
  aVisible: [],
15445
15451
  indices: []
15446
15452
  }, r = this.sceneConfig.collisionBufferSize || this.layer.options.collisionBufferSize || 0;
15447
- r && (e = Hr(kr, e, r));
15453
+ r && (e = Hr(Or, e, r));
15448
15454
  const o = this.getMap(), s = o.getDevicePixelRatio();
15449
- if (n.vec4.scale(kr, e, 1 / s), o.isOffscreen(kr)) return;
15455
+ if (n.vec4.scale(Or, e, 1 / s), o.isOffscreen(Or)) return;
15450
15456
  const a = i.aPosition.length / 2;
15451
15457
  i.aPosition.push(e[0], e[1], e[2], e[1], e[2], e[3], e[0], e[3]), i.aVisible.push(t, t, t, t),
15452
15458
  i.indices.push(a, a + 1, a + 1, a + 2, a + 2, a + 3, a + 3, a);
@@ -15701,8 +15707,8 @@
15701
15707
  m = _t(.5 + .5 * (1 - (1 - a / g) * s.markerPerspectiveRatio), 0, 4);
15702
15708
  }
15703
15709
  const {aShape: y, aMarkerDx: x, aMarkerDy: _, aMarkerWidth: v, aMarkerHeight: A, aPitchAlign: b, aRotationAlign: T, aRotation: S} = l, w = x ? x[i] : h.markerDx, M = _ ? _[i] : h.markerDy, P = b ? b[2 * i] : s.markerPitchWithMap, I = T ? T[2 * i] : s.markerRotateWithMap, C = n.vec2.set(so, w || 0, -(M || 0));
15704
- let O = n.vec2.set(no, y[2 * i] / 10, y[2 * i + 1] / 10), k = n.vec2.set(io, y[2 * i + 2] / 10, y[2 * i + 3] / 10), R = n.vec2.set(ro, y[2 * i + 4] / 10, y[2 * i + 5] / 10), F = n.vec2.set(oo, y[2 * i + 6] / 10, y[2 * i + 7] / 10);
15705
- 0 === s.flipY && 1 === P && (n.vec2.multiply(O, O, ao), n.vec2.multiply(k, k, ao),
15710
+ let k = n.vec2.set(no, y[2 * i] / 10, y[2 * i + 1] / 10), O = n.vec2.set(io, y[2 * i + 2] / 10, y[2 * i + 3] / 10), R = n.vec2.set(ro, y[2 * i + 4] / 10, y[2 * i + 5] / 10), F = n.vec2.set(oo, y[2 * i + 6] / 10, y[2 * i + 7] / 10);
15711
+ 0 === s.flipY && 1 === P && (n.vec2.multiply(k, k, ao), n.vec2.multiply(O, O, ao),
15706
15712
  n.vec2.multiply(R, R, ao), n.vec2.multiply(F, F, ao));
15707
15713
  const [E, D] = Vi(t.geometry);
15708
15714
  let H = v ? v[i] : h.markerWidth;
@@ -15711,22 +15717,22 @@
15711
15717
  At(L) && (L = D || qr);
15712
15718
  const N = n.vec2.set(lo, H / Zr, L / Zr);
15713
15719
  let z;
15714
- n.vec2.mul(O, O, N), n.vec2.mul(k, k, N), n.vec2.mul(R, R, N), n.vec2.mul(F, F, N),
15720
+ n.vec2.mul(k, k, N), n.vec2.mul(O, O, N), n.vec2.mul(R, R, N), n.vec2.mul(F, F, N),
15715
15721
  z = S ? S[2 * i] / 9362 : -(h.markerRotation || 0) * Math.PI / 180;
15716
15722
  const V = -z, U = o.getBearing() * Math.PI / 180;
15717
15723
  if (U * I || V) {
15718
15724
  const e = $r(to, V, U, I, P);
15719
- O = n.vec2.transformMat2(O, O, e), k = n.vec2.transformMat2(k, k, e), R = n.vec2.transformMat2(R, R, e),
15725
+ k = n.vec2.transformMat2(k, k, e), O = n.vec2.transformMat2(O, O, e), R = n.vec2.transformMat2(R, R, e),
15720
15726
  F = n.vec2.transformMat2(F, F, e);
15721
15727
  }
15722
- 1 === P ? Wr(e, f, O, k, R, F, r, C, s, o, g, m) : (n.vec2.multiply(O, O, ao), n.vec2.multiply(k, k, ao),
15723
- n.vec2.multiply(R, R, ao), n.vec2.multiply(F, F, ao), Xr(e, p, O, k, R, F, C, m));
15728
+ 1 === P ? Wr(e, f, k, O, R, F, r, C, s, o, g, m) : (n.vec2.multiply(k, k, ao), n.vec2.multiply(O, O, ao),
15729
+ n.vec2.multiply(R, R, ao), n.vec2.multiply(F, F, ao), Xr(e, p, k, O, R, F, C, m));
15724
15730
  const G = this.getMap().getDevicePixelRatio();
15725
15731
  return 1 !== G && (e[0] *= G, e[1] *= G, e[2] *= G, e[3] *= G), e;
15726
15732
  }
15727
15733
  const {PackUtil: co} = h(), uo = 1, fo = [], po = [], go = [], mo = [], yo = [], xo = [], _o = [ 1, -1 ];
15728
15734
  function vo(e, t, i, r, o, s, a, l, h) {
15729
- const c = r.material.uniforms, u = h.cameraToCenterDistance, f = r.geometry.properties, d = this.getSymbol(f.symbolIndex), p = "line" === d.textPlacement && !Ot(d), g = Kr, m = i[2];
15735
+ const c = r.material.uniforms, u = h.cameraToCenterDistance, f = r.geometry.properties, d = this.getSymbol(f.symbolIndex), p = "line" === d.textPlacement && !kt(d), g = Kr, m = i[2];
15730
15736
  let y = 1;
15731
15737
  if (c.textPerspectiveRatio) {
15732
15738
  y = _t(.5 + .5 * (1 - (1 - u / m) * c.textPerspectiveRatio), 0, 4);
@@ -15738,7 +15744,7 @@
15738
15744
  const I = v ? P : c.textPitchWithMap;
15739
15745
  let C;
15740
15746
  A && (C = T ? A[2 * a + 1] : A[a]);
15741
- const O = A ? C : c.textRotateWithMap, k = n.vec2.set(xo, w || 0, -(M || 0));
15747
+ const k = A ? C : c.textRotateWithMap, O = n.vec2.set(xo, w || 0, -(M || 0));
15742
15748
  if (p) {
15743
15749
  const {aOffset: r, aShape: o} = f, s = r.length !== o.length;
15744
15750
  let u, d, p, g;
@@ -15748,9 +15754,9 @@
15748
15754
  d = n.vec2.set(go, r[2 * a + 2] / 10, r[2 * a + 3] / 10), p = n.vec2.set(mo, r[2 * a + 4] / 10, r[2 * a + 5] / 10),
15749
15755
  g = n.vec2.set(yo, r[2 * a + 6] / 10, r[2 * a + 7] / 10)), 1 === I) {
15750
15756
  const n = Be(h.getResolution(), h);
15751
- Wr(e, t, u, d, p, g, l, k, c, h, m, y, s, n);
15757
+ Wr(e, t, u, d, p, g, l, O, c, h, m, y, s, n);
15752
15758
  } else n.vec2.multiply(u, u, _o), n.vec2.multiply(d, d, _o), n.vec2.multiply(p, p, _o),
15753
- n.vec2.multiply(g, g, _o), Xr(e, i, u, d, p, g, k, y);
15759
+ n.vec2.multiply(g, g, _o), Xr(e, i, u, d, p, g, O, y);
15754
15760
  } else {
15755
15761
  const {aShape: r} = f;
15756
15762
  let s, u = n.vec2.set(po, r[2 * a] / 10, -r[2 * a + 1] / 10), x = n.vec2.set(go, r[2 * a + 2] / 10, -r[2 * a + 3] / 10), _ = n.vec2.set(mo, r[2 * a + 4] / 10, -r[2 * a + 5] / 10), v = n.vec2.set(yo, r[2 * a + 6] / 10, -r[2 * a + 7] / 10);
@@ -15758,13 +15764,13 @@
15758
15764
  n.vec2.multiply(_, _, _o), n.vec2.multiply(v, v, _o)), s = b ? T && b.length > T.length ? b[2 * a + 1] / 9362 : b[a] / 9362 : (d.textRotation || 0) * Math.PI / 180;
15759
15765
  const A = p ? 0 : h.getBearing() * Math.PI / 180;
15760
15766
  if (s || A) {
15761
- const e = $r(fo, s, A, O, I);
15767
+ const e = $r(fo, s, A, k, I);
15762
15768
  u = n.vec2.transformMat2(u, u, e), x = n.vec2.transformMat2(x, x, e), _ = n.vec2.transformMat2(_, _, e),
15763
15769
  v = n.vec2.transformMat2(v, v, e);
15764
15770
  }
15765
15771
  const S = o / g;
15766
15772
  n.vec2.scale(u, u, S), n.vec2.scale(x, x, S), n.vec2.scale(_, _, S), n.vec2.scale(v, v, S),
15767
- 1 === I ? Wr(e, t, u, x, _, v, l, k, c, h, m, y) : Xr(e, i, u, x, _, v, k, y);
15773
+ 1 === I ? Wr(e, t, u, x, _, v, l, O, c, h, m, y) : Xr(e, i, u, x, _, v, O, y);
15768
15774
  }
15769
15775
  s = s || 0, e[0] -= s + uo, e[1] -= s + uo, e[2] += s + uo, e[3] += s + uo;
15770
15776
  const R = this.getMap().getDevicePixelRatio();
@@ -15913,7 +15919,7 @@
15913
15919
  n.data.aAltitude && (e.HAS_ALTITUDE = 1), n.properties.aOffset && n.properties.aShape && n.properties.aOffset.length !== n.properties.aShape.length && (e.HAS_OFFSET_Z = 1);
15914
15920
  }
15915
15921
  function Io(e, t, n) {
15916
- const i = e.properties, r = this.getSymbol(i.symbolIndex), o = "line" === i.textPlacement && !Ot(r), {aPosition: s, aShape: a} = e.data, l = s.length / e.desc.positionSize;
15922
+ const i = e.properties, r = this.getSymbol(i.symbolIndex), o = "line" === i.textPlacement && !kt(r), {aPosition: s, aShape: a} = e.data, l = s.length / e.desc.positionSize;
15917
15923
  if (i.vertexCount = l, i.aPickingId = e.data.aPickingId, i.aCount || (i.aCount = e.data.aCount,
15918
15924
  delete e.data.aCount), t || o) {
15919
15925
  let e = a;
@@ -15956,7 +15962,7 @@
15956
15962
  Tt(t, "textSize", n, "textSize", bo.textSize), Tt(t, "textDx", n, "textDx", bo.textDx),
15957
15963
  Tt(t, "textDy", n, "textDy", bo.textDy), Tt(t, "textRotation", n, "textRotation", bo.textRotation, (e => e * Math.PI / 180));
15958
15964
  }
15959
- function Oo(e) {
15965
+ function ko(e) {
15960
15966
  const t = [];
15961
15967
  return {
15962
15968
  uniforms: [ {
@@ -16011,7 +16017,7 @@
16011
16017
  }
16012
16018
  };
16013
16019
  }
16014
- function ko(e, t) {
16020
+ function Oo(e, t) {
16015
16021
  const n = Pe(t.textFill), i = Pe(t.textSize), r = Pe(t.textHaloFill), o = Pe(t.textHaloRadius), s = Pe(t.textHaloOpacity), a = Pe(t.textDx), l = Pe(t.textDy), h = Pe(t.textOpacity), c = Ie(t.textPitchAlignment), u = Ie(t.textRotationAlignment), f = Pe(t.textRotation), d = Ie(t.textAllowOverlapFn), p = Ie(t.textIgnorePlacement), g = {}, m = new Int16Array(1), y = new Uint16Array(1);
16016
16022
  return [ {
16017
16023
  attrName: "aTextFill",
@@ -16143,7 +16149,7 @@
16143
16149
  const Ro = [], Fo = [], Eo = [], Do = [];
16144
16150
  function Ho(e, t, n, i, r, o, s) {
16145
16151
  e = 1 === e ? 1 : 0;
16146
- const a = this.getMap(), l = t.geometry.properties, h = this.getSymbol(l.symbolIndex), c = "line" === l.textPlacement && !Ot(h), {aTextSize: u, aTextHalo: f, aShape: d} = l;
16152
+ const a = this.getMap(), l = t.geometry.properties, h = this.getSymbol(l.symbolIndex), c = "line" === l.textPlacement && !kt(h), {aTextSize: u, aTextHalo: f, aShape: d} = l;
16147
16153
  let p = u ? u[n[r]] : h.textSize;
16148
16154
  null == p && (p = bo.textSize);
16149
16155
  const g = f ? f[2 * n[r]] : t.properties.textHaloRadius, m = Ao(Eo, t, n[r]), {aProjectedAnchor: y} = t.geometry.properties;
@@ -16711,7 +16717,7 @@
16711
16717
  this._shaderDefines = e;
16712
16718
  }
16713
16719
  createFnTypeConfig(e, t) {
16714
- const n = qo.call(this, e, t), i = ko.call(this, e, t);
16720
+ const n = qo.call(this, e, t), i = Oo.call(this, e, t);
16715
16721
  for (let e = i.length - 1; e >= 0; e--) {
16716
16722
  const t = i[e].attrName;
16717
16723
  "aTextDx" !== t && "aTextDy" !== t && "aPitchAlign" !== t && "aRotation" !== t && "aRotationAlign" !== t && "aColorOpacity" !== t && "aOverlap" !== t || i.splice(e, 1);
@@ -16809,7 +16815,7 @@
16809
16815
  for (let t = 0; t < e.length; t++) {
16810
16816
  if (!this.isMeshIterable(e[t])) continue;
16811
16817
  const n = e[t].geometry, {symbolIndex: i} = n.properties;
16812
- Ot(this.getSymbolDef(i)) && Qo.call(this, this.getMap(), n);
16818
+ kt(this.getSymbolDef(i)) && Qo.call(this, this.getMap(), n);
16813
16819
  }
16814
16820
  const t = this.getMap().getZoom();
16815
16821
  for (let n = 0; n < e.length; n++) {
@@ -17103,13 +17109,13 @@
17103
17109
  let A = v > 0 ? 1 : -1, b = 0;
17104
17110
  f && (A *= -1, b = Math.PI), A < 0 && (b += Math.PI);
17105
17111
  const T = h + c, S = Math.abs(v);
17106
- let w = A > 0 ? l : l + 1, M = ai.convert(i), P = ai.convert(i), I = ai.convert(r), C = ai.convert(r), O = 0, k = 0;
17107
- for (;O + k <= S; ) {
17112
+ let w = A > 0 ? l : l + 1, M = ai.convert(i), P = ai.convert(i), I = ai.convert(r), C = ai.convert(r), k = 0, O = 0;
17113
+ for (;k + O <= S; ) {
17108
17114
  if (w += A, w < h || w >= T) return null;
17109
17115
  P.x = M.x, P.y = M.y, C.x = I.x, C.y = I.y, M.x = n[3 * w], M.y = n[3 * w + 1],
17110
- I.x = x[3 * w], I.y = x[3 * w + 1], O += k, k = P.dist(M) / d;
17116
+ I.x = x[3 * w], I.y = x[3 * w + 1], k += O, O = P.dist(M) / d;
17111
17117
  }
17112
- const R = (S - O) / k, F = g && g.getRenderer(), E = F && F.getTerrainHelper(), D = t.properties.tile.terrainTileInfos;
17118
+ const R = (S - k) / O, F = g && g.getRenderer(), E = F && F.getTerrainHelper(), D = t.properties.tile.terrainTileInfos;
17113
17119
  if (!y && E) {
17114
17120
  const {extent: n} = t.properties.tile, i = g.getTileSize().width / n, r = g.getMap();
17115
17121
  let o = I.sub(C).mult(R)._add(C);
@@ -17151,7 +17157,7 @@
17151
17157
  }, ws = function(e) {
17152
17158
  const t = this.layer.getRenderer(), n = e.properties.tile.z, i = t.getCurrentTileZoom();
17153
17159
  return !this._isHalo0(e) && !t.isForeground(e) && "line" === e.geometry.properties.textPlacement && n < i;
17154
- }, Ms = [ 0, 0, 3 ], Ps = [], Is = [], Cs = [], Os = [], ks = [], Rs = [], Fs = [], Es = [], Ds = [ 1, -1 ], Hs = new Int16Array(3), Ls = [], Ns = [], zs = [], Vs = [], Us = [], Gs = [], Bs = [], js = {}, Ws = {}, Xs = {}, $s = [], Ys = [], qs = n.mat4.identity([]), Zs = [];
17160
+ }, Ms = [ 0, 0, 3 ], Ps = [], Is = [], Cs = [], ks = [], Os = [], Rs = [], Fs = [], Es = [], Ds = [ 1, -1 ], Hs = new Int16Array(3), Ls = [], Ns = [], zs = [], Vs = [], Us = [], Gs = [], Bs = [], js = {}, Ws = {}, Xs = {}, $s = [], Ys = [], qs = n.mat4.identity([]), Zs = [];
17155
17161
  class Ks extends Rr {
17156
17162
  static getBloomSymbol() {
17157
17163
  return [ "textBloom" ];
@@ -17220,7 +17226,7 @@
17220
17226
  return !1;
17221
17227
  }
17222
17228
  createFnTypeConfig(e, t) {
17223
- return ko(e, t);
17229
+ return Oo(e, t);
17224
17230
  }
17225
17231
  isBloom(e) {
17226
17232
  return !!this.getSymbol(e.properties.symbolIndex)[Ks.getBloomSymbol()[0]];
@@ -17375,27 +17381,27 @@
17375
17381
  A || (A = p.properties.aProjectedAnchor = new Array(x.length / g * 3));
17376
17382
  const b = p.properties.aTextSize, T = !a, S = t[i], w = S * g;
17377
17383
  let M;
17378
- M = p.data.aAltitude ? n.vec3.set(Os, x[w], x[w + 1], _[S]) : _s.unpackPosition(Os, x[w], x[w + 1], x[w + 2]);
17379
- const P = hi(ks, M, s, d.width, d.height), I = p.properties.aTerrainAltitude;
17384
+ M = p.data.aAltitude ? n.vec3.set(ks, x[w], x[w + 1], _[S]) : _s.unpackPosition(ks, x[w], x[w + 1], x[w + 2]);
17385
+ const P = hi(Os, M, s, d.width, d.height), I = p.properties.aTerrainAltitude;
17380
17386
  let C;
17381
17387
  if (I) {
17382
17388
  const e = I[S];
17383
17389
  if (e === ht) return A[3 * S] = lt, A[3 * S + 1] = lt, A[3 * S + 2] = lt, !1;
17384
17390
  e ? (C = n.vec3.set(Ys, ...M), C[2] = 100 * e, C = hi(C, C, s, d.width, d.height)) : C = P;
17385
17391
  } else C = P;
17386
- const O = d.getDevicePixelRatio();
17387
- if (n.vec4.scale(Zs, C, 1 / O), d.isOffscreen(Zs)) return f || Js(y, t, i, r), A[3 * S] = lt,
17392
+ const k = d.getDevicePixelRatio();
17393
+ if (n.vec4.scale(Zs, C, 1 / k), d.isOffscreen(Zs)) return f || Js(y, t, i, r), A[3 * S] = lt,
17388
17394
  A[3 * S + 1] = lt, A[3 * S + 2] = lt, !1;
17389
17395
  T && (M = P), A[3 * S] = C[0], A[3 * S + 1] = C[1], A[3 * S + 2] = C[2];
17390
- const k = T ? 1 : p.properties.tileExtent / this.layer.getTileSize().width;
17396
+ const O = T ? 1 : p.properties.tileExtent / this.layer.getTileSize().width;
17391
17397
  let R = !0;
17392
- const F = t[i], E = t[r - 1], D = b ? b[F] : e.properties.textSize, H = this._updateNormal(e, D, o, F, E, M, Os, k, a);
17398
+ const F = t[i], E = t[r - 1], D = b ? b[F] : e.properties.textSize, H = this._updateNormal(e, D, o, F, E, M, ks, O, a);
17393
17399
  if (null === H) return Js(y, t, i, r), !1;
17394
17400
  const L = E - F <= 3, N = Math.floor(H / 2), z = H % 2;
17395
17401
  for (let a = i; a < r; a += 6) {
17396
17402
  const l = t[a];
17397
17403
  let d;
17398
- if (d = N || a !== i || L || u ? N || a !== r - 6 || L || u ? us.call(this, Is, e, D, o, l, M, Os, k, N, C, this.layer, s, c) : Bs : Gs,
17404
+ if (d = N || a !== i || L || u ? N || a !== r - 6 || L || u ? us.call(this, Is, e, D, o, l, M, ks, O, N, C, this.layer, s, c) : Bs : Gs,
17399
17405
  !d) {
17400
17406
  R = !1, f || Js(y, t, i, r);
17401
17407
  break;
@@ -17449,7 +17455,7 @@
17449
17455
  init() {
17450
17456
  const e = this.regl;
17451
17457
  this.renderer = new n.reshader.Renderer(e);
17452
- const {uniforms: t, extraCommandProps: i} = Oo.call(this, this.canvas, this.sceneConfig), r = this.canvas, o = {
17458
+ const {uniforms: t, extraCommandProps: i} = ko.call(this, this.canvas, this.sceneConfig), r = this.canvas, o = {
17453
17459
  x: (e, t) => t.viewport ? t.viewport.x : 0,
17454
17460
  y: (e, t) => t.viewport ? t.viewport.y : 0,
17455
17461
  width: (e, t) => t.viewport ? t.viewport.width : r ? r.width : 1,
@@ -18099,7 +18105,7 @@
18099
18105
  _updateMaterial() {
18100
18106
  this.material && this.material.dispose();
18101
18107
  const e = this.layer instanceof r.TileLayer, t = this.getSymbols()[0].material, i = {};
18102
- for (const n in t) kt(t, n) && (i[n] = t[n], "uvRotation" === n && (i[n] = i[n] * Math.PI / 180,
18108
+ for (const n in t) Ot(t, n) && (i[n] = t[n], "uvRotation" === n && (i[n] = i[n] * Math.PI / 180,
18103
18109
  e || (i[n] *= -1)));
18104
18110
  this.material = new n.reshader.PhongMaterial(i);
18105
18111
  }
@@ -18351,7 +18357,7 @@
18351
18357
  }
18352
18358
  const t = this.layer instanceof r.TileLayer, i = this.dataConfig, o = e || this.getSymbols()[0].material, s = {};
18353
18359
  let a = !1;
18354
- for (const e in o) if (kt(o, e)) if (e.indexOf("Texture") > 0) {
18360
+ for (const e in o) if (Ot(o, e)) if (e.indexOf("Texture") > 0) {
18355
18361
  let t = o[e];
18356
18362
  if (!t) {
18357
18363
  s[e] = void 0;
@@ -18395,7 +18401,7 @@
18395
18401
  }
18396
18402
  }
18397
18403
  var Ca = "#include <gl2_vert>\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\nuniform mat4 projViewModelMatrix;\nuniform mat4 positionMatrix;\nuniform vec2 centiMeterToLocal;\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aTubeNormal;\n#ifdef HAS_LINE_WIDTH\nattribute float aLineWidth;\n#else\nuniform float lineWidth;\n#endif\n#include <vt_position_vert>\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#else\nuniform mat4 modelViewMatrix;\nuniform mat3 modelNormalMatrix;\nuniform mat4 modelMatrix;\n#if defined(HAS_PATTERN)\nuniform float resolution;\nuniform float tileResolution;\nuniform float tileRatio;\nattribute float aLinesofar;\nvarying highp float vLinesofar;\nattribute vec4 aTexInfo;\nvarying vec4 vTexInfo;\nvarying float vNormalY;\nvarying float vPatternHeight;\nattribute float aNormalDistance;\n#if defined(HAS_PATTERN_ANIM)\nattribute float aLinePatternAnimSpeed;\nvarying float vLinePatternAnimSpeed;\n#endif\n#if defined(HAS_PATTERN_GAP)\nattribute float aLinePatternGap;\nvarying float vLinePatternGap;\n#endif\n#endif\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\n#endif\nvarying float vOpacity;\nvarying vec3 vModelNormal;\nvarying vec4 vViewVertex;\nvarying vec3 vModelVertex;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#include <highlight_vert>\nvoid main() {\n \n#ifdef HAS_LINE_WIDTH\nfloat c = aLineWidth;\n#else\nfloat c = lineWidth;\n#endif\nfloat d = c / 2.;\n vec3 e = aTubeNormal.xyz / EXTRUDE_SCALE;\n vec3 f = unpackVTPosition();\n vec4 h = vec4(f, 1.);\n h.xy += e.xy * d * centiMeterToLocal;\n h.z += e.z * d;\n gl_Position = projViewModelMatrix * h;\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#else\nvViewVertex = modelViewMatrix * h;\n vec3 i = normalize(e);\n vModelNormal = modelNormalMatrix * i;\n vModelVertex = (modelMatrix * h).xyz;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(h);\n#endif\n#ifdef HAS_COLOR\nvColor = aColor / 255.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_PATTERN\nfloat j = tileResolution / resolution;\n float k = aLinesofar - d * centiMeterToLocal.y * aNormalDistance / EXTRUDE_SCALE;\n vLinesofar = k / tileRatio * j;\n vTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\n vPatternHeight = c * centiMeterToLocal.x / tileRatio * j;\n vNormalY = aTubeNormal.w / EXTRUDE_SCALE;\n#if defined(HAS_PATTERN_ANIM)\nvLinePatternAnimSpeed = aLinePatternAnimSpeed / 127.;\n#endif\n#if defined(HAS_PATTERN_GAP)\nvLinePatternGap = aLinePatternGap / 10.0;\n#endif\n#endif\nhighlight_setVarying();\n#endif\n}";
18398
- const {StyleUtil: Oa} = h(), {getPBRUniforms: ka} = n.reshader.pbr.PBRUtils;
18404
+ const {StyleUtil: ka} = h(), {getPBRUniforms: Oa} = n.reshader.pbr.PBRUtils;
18399
18405
  class Ra extends Di {
18400
18406
  needToRedraw() {
18401
18407
  return super.needToRedraw() || this.isAnimating();
@@ -18432,7 +18438,7 @@
18432
18438
  tileRatio: u
18433
18439
  };
18434
18440
  Tt(f, "lineColor", h, "lineColor", "#fff", Mt(this.colorCache)), Tt(f, "linePatternGapColor", h, "linePatternGapColor", [ 1, 1, 1, 1 ], Mt(this.colorCache)),
18435
- Tt(f, "lineWidth", h, "lineWidth", 2, (e => Oa.getTubeSizeScale(this.dataConfig.metric) * e)),
18441
+ Tt(f, "lineWidth", h, "lineWidth", 2, (e => ka.getTubeSizeScale(this.dataConfig.metric) * e)),
18436
18442
  Tt(f, "lineOpacity", h, "lineOpacity", 1), Tt(f, "linePatternAnimSpeed", h, "linePatternAnimSpeed", 0),
18437
18443
  Tt(f, "linePatternGap", h, "linePatternGap", 0), Tt(f, "metallicFactor", h, "metallicFactor", 0),
18438
18444
  Tt(f, "roughnessFactor", h, "roughnessFactor", .4), Tt(f, "emissiveFactor", h, "emissiveFactor", [ 0, 0, 0 ]),
@@ -18547,7 +18553,7 @@
18547
18553
  };
18548
18554
  }
18549
18555
  getUniformValues(e, t) {
18550
- const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = ka(e, n, i, null, t && t.jitter), o = e.projViewMatrix, s = e.viewMatrix;
18556
+ const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = Oa(e, n, i, null, t && t.jitter), o = e.projViewMatrix, s = e.viewMatrix;
18551
18557
  return r.projViewMatrix = o, r.viewMatrix = s, r.resolution = e.getResolution(),
18552
18558
  r.currentTime = this.layer.getRenderer().getFrameTimestamp() || 0, this.setIncludeUniformValues(r, t),
18553
18559
  r;
@@ -18739,10 +18745,10 @@
18739
18745
  }
18740
18746
  return C;
18741
18747
  }));
18742
- const O = this.layer.getRenderer().getZScale(), k = [], R = [];
18748
+ const k = this.layer.getRenderer().getZScale(), O = [], R = [];
18743
18749
  return I.setLocalTransform((() => {
18744
18750
  const e = this.layer.options.altitude || 0;
18745
- return n.vec3.copy(R, p), R[2] += 100 * e * O, n.mat4.translate(k, i, R), k;
18751
+ return n.vec3.copy(R, p), R[2] += 100 * e * k, n.mat4.translate(O, i, R), O;
18746
18752
  })), A.generateBuffers(this.regl, {
18747
18753
  excludeElementsInVAO: !0
18748
18754
  }), d.instance_color && (P.HAS_INSTANCE_COLOR = 1), d.aTerrainAltitude && (P.HAS_INSTANCE_TERRAIN_ALTITUDE = 1,
@@ -18784,12 +18790,12 @@
18784
18790
  const [i, r, o] = T;
18785
18791
  let s = e + a;
18786
18792
  d ? n.vec3.set(S, f[s], f[s + 1], d[s / a]) : Da.unpackPosition(S, f[s], f[s + 1], f[s + 2]);
18787
- const [h, I, C] = S, O = p[e / a], k = g.set(i * w, r * w, o * M), R = m.set(h * w, I * w, C * M), F = k.distanceTo(R), E = u.arrangeAlongLine(k, R, F, l, 1, c);
18793
+ const [h, I, C] = S, k = p[e / a], O = g.set(i * w, r * w, o * M), R = m.set(h * w, I * w, C * M), F = O.distanceTo(R), E = u.arrangeAlongLine(O, R, F, l, 1, c);
18788
18794
  for (let e = 0; e < E.length; e++) {
18789
18795
  const t = E[e];
18790
18796
  g.set(i, r, o), m.set(h, I, C);
18791
18797
  const n = Ka(g, m, t.t);
18792
- y.push(n.x, n.y), x.push(n.z), _.push(O), v.push(-t.rotationZ * Math.PI / 180),
18798
+ y.push(n.x, n.y), x.push(n.z), _.push(k), v.push(-t.rotationZ * Math.PI / 180),
18793
18799
  A.push(t.rotationXY * Math.PI / 180), b.push(...t.scale);
18794
18800
  }
18795
18801
  }
@@ -18875,24 +18881,24 @@
18875
18881
  t[0] < _ && (_ = t[0]), t[0] > b && (b = t[0]), t[1] < v && (v = t[1]), t[1] > T && (T = t[1]),
18876
18882
  t[2] < A && (A = t[2]), t[2] > S && (S = t[2]);
18877
18883
  }
18878
- const P = (_ + b) / 2, I = (v + T) / 2, C = (A + S) / 2, O = [], k = this._hasFuncType(), R = [ 0, 0, 1 ], F = [ 0, 0, 0 ];
18884
+ const P = (_ + b) / 2, I = (v + T) / 2, C = (A + S) / 2, k = [], O = this._hasFuncType(), R = [ 0, 0, 1 ], F = [ 0, 0, 0 ];
18879
18885
  for (let t = 0; t < g; t++) {
18880
18886
  d ? n.vec3.set(M, h[t * s], h[t * s + 1], d[t]) : Da.unpackPosition(M, h[t * s], h[t * s + 1], h[t * s + 2]);
18881
18887
  const i = M[0], r = M[1], o = n.vec3.set(w, i * m - P, -r * m - I, (M[2] + x) * y - C), g = n.vec3.set(Va, 1, 1, 1);
18882
18888
  p && (n.vec3.set(g, p[3 * t], p[3 * t + 1], p[3 * t + 2]), n.mat4.fromScaling(Ua, g));
18883
18889
  const _ = u && u[t] || 0, v = f && f[t] || 0;
18884
18890
  if (_ || v) {
18885
- n.mat4.fromRotation(O, v, R);
18891
+ n.mat4.fromRotation(k, v, R);
18886
18892
  const e = n.vec3.set(Ha, Math.cos(v), Math.sin(v), 0), t = n.vec3.rotateZ(e, e, F, 90 * Math.PI / 180);
18887
- n.mat4.rotate(O, O, _, t), p && n.mat4.multiply(O, O, Ua);
18893
+ n.mat4.rotate(k, k, _, t), p && n.mat4.multiply(k, k, Ua);
18888
18894
  const i = n.mat4.fromTranslation(Ya, o);
18889
- n.mat4.multiply(O, i, O);
18890
- } else n.mat4.fromTranslation(O, o), p && n.mat4.multiply(O, O, Ua);
18891
- if (k) {
18895
+ n.mat4.multiply(k, i, k);
18896
+ } else n.mat4.fromTranslation(k, o), p && n.mat4.multiply(k, k, Ua);
18897
+ if (O) {
18892
18898
  const e = this._getSymbolTRSMatrix(Ya, a, c, t);
18893
- n.mat4.multiply(O, O, e);
18899
+ n.mat4.multiply(k, k, e);
18894
18900
  }
18895
- l("instance_vectorA", t, O, 0), l("instance_vectorB", t, O, 1), l("instance_vectorC", t, O, 2),
18901
+ l("instance_vectorA", t, k, 0), l("instance_vectorB", t, k, 1), l("instance_vectorC", t, k, 2),
18896
18902
  e.aPickingId[t] = c[t];
18897
18903
  }
18898
18904
  return n.vec3.set(w, P, I, C), w;
@@ -19821,10 +19827,10 @@
19821
19827
  const Cl = Gn("native-line", sa);
19822
19828
  Cl.registerAt(rn);
19823
19829
  Gn("native-point", na).registerAt(rn);
19824
- const Ol = Gn("phong", ba);
19825
- Ol.registerAt(rn);
19826
- const kl = Gn("wireframe", Sa);
19830
+ const kl = Gn("phong", ba);
19827
19831
  kl.registerAt(rn);
19832
+ const Ol = Gn("wireframe", Sa);
19833
+ Ol.registerAt(rn);
19828
19834
  const Rl = Gn("lit", Ia);
19829
19835
  Rl.registerAt(rn);
19830
19836
  const Fl = Gn("tube", Ra);
@@ -21037,11 +21043,11 @@
21037
21043
  function Ch(e, t, n, i, r) {
21038
21044
  return e[0] = t, e[1] = n, e[2] = i, e[3] = r, e;
21039
21045
  }
21040
- function Oh(e, t, n) {
21046
+ function kh(e, t, n) {
21041
21047
  return e[0] = t[0] / n[0], e[1] = t[1] / n[1], e[2] = t[2] / n[2], e[3] = t[3] / n[3],
21042
21048
  e;
21043
21049
  }
21044
- function kh(e, t, n) {
21050
+ function Oh(e, t, n) {
21045
21051
  return e[0] = t, e[1] = n, e;
21046
21052
  }
21047
21053
  function Rh(e, t) {
@@ -21084,7 +21090,7 @@
21084
21090
  const g = Rh(u, f), m = Rh(f, d), y = [], x = [], _ = [];
21085
21091
  for (let e = t; e < n; e += 3) {
21086
21092
  const t = e / 3 * 2;
21087
- kh(y, (o.x / l + r[e] / s) * a, o.y / l * a + (c ? r[e + 1] : -r[e + 1]) / s * a),
21093
+ Oh(y, (o.x / l + r[e] / s) * a, o.y / l * a + (c ? r[e + 1] : -r[e + 1]) / s * a),
21088
21094
  "EPSG:4326" !== h && "EPSG:4490" !== h || Hh(y, y), Nh(x, y, u, f), Nh(_, y, p, u),
21089
21095
  i[t] = Rh(u, x) / g, i[t + 1] = Rh(u, _) / m;
21090
21096
  }
@@ -21471,9 +21477,9 @@
21471
21477
  var e, t = (e = new yc(4), yc != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0,
21472
21478
  e[3] = 0), e);
21473
21479
  }();
21474
- var Cc, Oc = function(e, t, n) {
21480
+ var Cc, kc = function(e, t, n) {
21475
21481
  return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e;
21476
- }, kc = function(e, t) {
21482
+ }, Oc = function(e, t) {
21477
21483
  var n = t[0], i = t[1], r = t[2], o = t[3], s = n * n + i * i + r * r + o * o;
21478
21484
  return s > 0 && (s = 1 / Math.sqrt(s), e[0] = n * s, e[1] = i * s, e[2] = r * s,
21479
21485
  e[3] = o * s), e;
@@ -21492,8 +21498,8 @@
21492
21498
  e[8] = h, e;
21493
21499
  }(Fc, n[0], n[1], n[2], ...i, ...t);
21494
21500
  e = Ic(e, r), e = function(e) {
21495
- return e[3] < 0 ? Oc(e, e, -1) : e;
21496
- }(e = kc(e, e));
21501
+ return e[3] < 0 ? kc(e, e, -1) : e;
21502
+ }(e = Oc(e, e));
21497
21503
  const o = 1 / ((1 << 2 * Rc - 1) - 1);
21498
21504
  if (e[3] < o) {
21499
21505
  e[3] = o;
@@ -21501,7 +21507,7 @@
21501
21507
  e[0] *= t, e[1] *= t, e[2] *= t;
21502
21508
  }
21503
21509
  const s = n[3] > 0 ? wc(Dc, n, t) : wc(Dc, t, n);
21504
- return Sc(wc(Hc, n, t), s) < 0 && Oc(e, e, -1), e;
21510
+ return Sc(wc(Hc, n, t), s) < 0 && kc(e, e, -1), e;
21505
21511
  }
21506
21512
  const Nc = [];
21507
21513
  const zc = [], Vc = [], Uc = [], Gc = [], Bc = [], jc = [], Wc = [];
@@ -21531,10 +21537,10 @@
21531
21537
  const {StyleUtil: qc, PackUtil: Zc, ArrayPool: Kc} = h(), Jc = Kc.getInstance();
21532
21538
  function Qc(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
21533
21539
  void 0 === t.top && (t.top = !0), void 0 === t.side && (t.side = !0), Jc.reset();
21534
- const {altitudeScale: m, altitudeProperty: y, defaultAltitude: x, heightProperty: _, minHeightProperty: v, defaultHeight: A, tangent: b, uv: T, topUVMode: S, sideUVMode: w, sideVerticalUVMode: M, top: P, side: I, textureYOrigin: C, topThickness: O} = t, k = !!g, R = function(e, t, {altitudeScale: n, altitudeProperty: i, defaultAltitude: r, heightProperty: o, minHeightProperty: s, defaultHeight: a}, {center: l, side: h, top: c, topThickness: u, uvOrigin: f, uv: d, uvSize: p, topUVMode: g, sideUVMode: m, sideVerticalUVMode: y, textureYOrigin: x, tileRatio: _, centimeterToPoint: v, verticalCentimeterToPoint: A, positionType: b, res: T, glScale: S, projectionCode: w}, M, P) {
21540
+ const {altitudeScale: m, altitudeProperty: y, defaultAltitude: x, heightProperty: _, minHeightProperty: v, defaultHeight: A, tangent: b, uv: T, topUVMode: S, sideUVMode: w, sideVerticalUVMode: M, top: P, side: I, textureYOrigin: C, topThickness: k} = t, O = !!g, R = function(e, t, {altitudeScale: n, altitudeProperty: i, defaultAltitude: r, heightProperty: o, minHeightProperty: s, defaultHeight: a}, {center: l, side: h, top: c, topThickness: u, uvOrigin: f, uv: d, uvSize: p, topUVMode: g, sideUVMode: m, sideVerticalUVMode: y, textureYOrigin: x, tileRatio: _, centimeterToPoint: v, verticalCentimeterToPoint: A, positionType: b, res: T, glScale: S, projectionCode: w}, M, P) {
21535
21541
  let I = t / e[0].extent;
21536
21542
  t === 1 / 0 && (I = 1);
21537
- const C = t === 1 / 0, O = P.get(), k = P.get(), R = P.get(), F = P.getProxy(), E = P.get(), D = P.get(), H = P.get(), L = !!d, N = !!c, z = !!h, V = L ? P.get() : null;
21543
+ const C = t === 1 / 0, k = P.get(), O = P.get(), R = P.get(), F = P.getProxy(), E = P.get(), D = P.get(), H = P.get(), L = !!d, N = !!c, z = !!h, V = L ? P.get() : null;
21538
21544
  function U(e, n, i, r, o, s) {
21539
21545
  let a = n;
21540
21546
  if (N) {
@@ -21601,20 +21607,20 @@
21601
21607
  }
21602
21608
  const _ = E.getLength() - g, v = (at + "").trim();
21603
21609
  for (let e = 0; e < _ / 3; e++) {
21604
- let e = k.currentIndex;
21605
- k[e++] = void 0 === l[v] ? X : l[v], k.currentIndex = e, e = O.currentIndex, O[e++] = X,
21606
- O.currentIndex = e, He(h) && (e = R.currentIndex, R[e++] = h, R.currentIndex = e);
21610
+ let e = O.currentIndex;
21611
+ O[e++] = void 0 === l[v] ? X : l[v], O.currentIndex = e, e = k.currentIndex, k[e++] = X,
21612
+ k.currentIndex = e, He(h) && (e = R.currentIndex, R[e++] = h, R.currentIndex = e);
21607
21613
  }
21608
21614
  }
21609
- const J = fc.getUnsignedArrayType(k.getLength() ? k[k.getLength() - 1] : 0), Q = {
21615
+ const J = fc.getUnsignedArrayType(O.getLength() ? O[O.getLength() - 1] : 0), Q = {
21610
21616
  hasNegativeHeight: K,
21611
21617
  maxAltitude: G === -1 / 0 ? 0 : G,
21612
21618
  minAltitude: B === 1 / 0 ? 0 : B,
21613
21619
  vertices: E,
21614
21620
  verticeTypes: H,
21615
21621
  indices: D,
21616
- pickingIds: dc.createTypedArray(k, J),
21617
- featureIndexes: O
21622
+ pickingIds: dc.createTypedArray(O, J),
21623
+ featureIndexes: k
21618
21624
  };
21619
21625
  if (R.getLength()) {
21620
21626
  const e = q ? fc.getPosArrayType(Y) : fc.getUnsignedArrayType(Y);
@@ -21632,7 +21638,7 @@
21632
21638
  center: g,
21633
21639
  top: P,
21634
21640
  side: I,
21635
- topThickness: 10 * O || 0,
21641
+ topThickness: 10 * k || 0,
21636
21642
  uv: T || b,
21637
21643
  uvSize: [ r, r ],
21638
21644
  uvOrigin: i,
@@ -21669,7 +21675,7 @@
21669
21675
  let U = !0;
21670
21676
  const G = V.getLength ? V.getLength() : V.length;
21671
21677
  for (let e = 0; e < G; e++) {
21672
- k || (V[e] = -V[e]);
21678
+ O || (V[e] = -V[e]);
21673
21679
  const t = V[e] % 1;
21674
21680
  1 - Math.abs(t) > 1e-6 ? U = !1 : 0 !== t && (V[e] = Math.round(V[e]));
21675
21681
  }
@@ -21766,7 +21772,7 @@
21766
21772
  y.$layer = m.layer, y.$type = m.type;
21767
21773
  let x = h ? c : u, _ = x(r, y);
21768
21774
  Me(_) && (x = Ie(_), _ = x(r, y)), delete y.$layer, delete y.$type, qc.normalizeColor(eu, _),
21769
- Oh(eu, eu, l);
21775
+ kh(eu, eu, l);
21770
21776
  let v = tu(o, eu);
21771
21777
  v < 0 && (v = o.length, o.push(Ih([], eu))), e[i] = v, h ? (f = t[i], p = v) : (d = t[i],
21772
21778
  g = v);
@@ -22144,15 +22150,15 @@
22144
22150
  0 !== a && (r[d++] = a);
22145
22151
  return 0 === o && 0 !== d || (r[d++] = o), d;
22146
22152
  }
22147
- function Ou(e) {
22153
+ function ku(e) {
22148
22154
  return new Float64Array(e);
22149
22155
  }
22150
- const ku = 33306690738754716e-32, Ru = 22204460492503146e-32, Fu = 11093356479670487e-47, Eu = Ou(4), Du = Ou(8), Hu = Ou(12), Lu = Ou(16), Nu = Ou(4);
22156
+ const Ou = 33306690738754716e-32, Ru = 22204460492503146e-32, Fu = 11093356479670487e-47, Eu = ku(4), Du = ku(8), Hu = ku(12), Lu = ku(16), Nu = ku(4);
22151
22157
  function zu(e, t, n, i, r, o) {
22152
22158
  const s = (t - o) * (n - r), a = (e - r) * (i - o), l = s - a;
22153
22159
  if (0 === s || 0 === a || s > 0 != a > 0) return l;
22154
22160
  const h = Math.abs(s + a);
22155
- return Math.abs(l) >= ku * h ? l : -function(e, t, n, i, r, o, s) {
22161
+ return Math.abs(l) >= Ou * h ? l : -function(e, t, n, i, r, o, s) {
22156
22162
  let a, l, h, c, u, f, d, p, g, m, y, x, _, v, A, b, T, S;
22157
22163
  const w = e - r, M = n - r, P = t - o, I = i - o;
22158
22164
  v = w * I, f = Pu * w, d = f - (f - w), p = w - d, f = Pu * I, g = f - (f - I),
@@ -22165,25 +22171,25 @@
22165
22171
  let n = t[0];
22166
22172
  for (let i = 1; i < e; i++) n += t[i];
22167
22173
  return n;
22168
- }(4, Eu), O = Ru * s;
22169
- if (C >= O || -C >= O) return C;
22174
+ }(4, Eu), k = Ru * s;
22175
+ if (C >= k || -C >= k) return C;
22170
22176
  if (u = e - w, a = e - (w + u) + (u - r), u = n - M, h = n - (M + u) + (u - r),
22171
22177
  u = t - P, l = t - (P + u) + (u - o), u = i - I, c = i - (I + u) + (u - o), 0 === a && 0 === l && 0 === h && 0 === c) return C;
22172
- if (O = Fu * s + Iu * Math.abs(C), C += w * c + I * a - (P * h + M * l), C >= O || -C >= O) return C;
22178
+ if (k = Fu * s + Iu * Math.abs(C), C += w * c + I * a - (P * h + M * l), C >= k || -C >= k) return C;
22173
22179
  v = a * I, f = Pu * a, d = f - (f - a), p = a - d, f = Pu * I, g = f - (f - I),
22174
22180
  m = I - g, A = p * m - (v - d * g - p * g - d * m), b = l * M, f = Pu * l, d = f - (f - l),
22175
22181
  p = l - d, f = Pu * M, g = f - (f - M), m = M - g, T = p * m - (b - d * g - p * g - d * m),
22176
22182
  y = A - T, u = A - y, Nu[0] = A - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
22177
22183
  y = _ - b, u = _ - y, Nu[1] = _ - (y + u) + (u - b), S = x + y, u = S - x, Nu[2] = x - (S - u) + (y - u),
22178
22184
  Nu[3] = S;
22179
- const k = Cu(4, Eu, 4, Nu, Du);
22185
+ const O = Cu(4, Eu, 4, Nu, Du);
22180
22186
  v = w * c, f = Pu * w, d = f - (f - w), p = w - d, f = Pu * c, g = f - (f - c),
22181
22187
  m = c - g, A = p * m - (v - d * g - p * g - d * m), b = P * h, f = Pu * P, d = f - (f - P),
22182
22188
  p = P - d, f = Pu * h, g = f - (f - h), m = h - g, T = p * m - (b - d * g - p * g - d * m),
22183
22189
  y = A - T, u = A - y, Nu[0] = A - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
22184
22190
  y = _ - b, u = _ - y, Nu[1] = _ - (y + u) + (u - b), S = x + y, u = S - x, Nu[2] = x - (S - u) + (y - u),
22185
22191
  Nu[3] = S;
22186
- const R = Cu(k, Du, 4, Nu, Hu);
22192
+ const R = Cu(O, Du, 4, Nu, Hu);
22187
22193
  v = a * c, f = Pu * a, d = f - (f - a), p = a - d, f = Pu * c, g = f - (f - c),
22188
22194
  m = c - g, A = p * m - (v - d * g - p * g - d * m), b = l * h, f = Pu * l, d = f - (f - l),
22189
22195
  p = l - d, f = Pu * h, g = f - (f - h), m = h - g, T = p * m - (b - d * g - p * g - d * m),
@@ -22669,11 +22675,11 @@
22669
22675
  e.GeoJSONVectorTileLayer = Gl, e.HeatmapPlugin = Hl, e.IconPainter = ss, e.IconPlugin = Pl,
22670
22676
  e.LineGradientPlugin = Ml, e.LinePainter = cr, e.LinePlugin = wl, e.LineStringLayer = xh,
22671
22677
  e.LitPlugin = Rl, e.MapboxVectorTileLayer = Vl, e.NativeLinePainter = sa, e.NativeLinePlugin = Cl,
22672
- e.NativePointPainter = na, e.PackUtil = uf, e.PhongPainter = ba, e.PhongPlugin = Ol,
22678
+ e.NativePointPainter = na, e.PackUtil = uf, e.PhongPainter = ba, e.PhongPlugin = kl,
22673
22679
  e.PointLayer = mh, e.PolygonLayer = Ah, e.SYMBOLS_NEED_REBUILD_IN_VECTOR = pf, e.SYMBOLS_NEED_REBUILD_IN_VT = df,
22674
22680
  e.TerrainFlatMaskPainter = Tl, e.TerrainFlatMaskPlugin = zl, e.TextPainter = Ks,
22675
22681
  e.TextPlugin = Il, e.TubePlugin = Fl, e.Vector3DLayer = un, e.VectorTileLayer = rn,
22676
- e.VectorTileLayerRenderer = jt, e.WaterPlugin = Ll, e.WireframePainter = Sa, e.WireframePlugin = kl,
22677
- "undefined" != typeof console && console.log("@maptalks/vt v0.108.5");
22682
+ e.VectorTileLayerRenderer = jt, e.WaterPlugin = Ll, e.WireframePainter = Sa, e.WireframePlugin = Ol,
22683
+ "undefined" != typeof console && console.log("@maptalks/vt v0.109.0");
22678
22684
  }));
22679
22685
  //# sourceMappingURL=maptalks.vt.js.map