diff --git a/build/maplibre_worker.js b/build/maplibre_worker.js index fa927d228d0..ef3fa29b440 100644 --- a/build/maplibre_worker.js +++ b/build/maplibre_worker.js @@ -1,4 +1,4 @@ 'use strict'; // Generated by tasks/util/bundle_maplibre_worker.js - do not edit. -module.exports = "var D1=Object.defineProperty,_1=Object.defineProperties;var A1=Object.getOwnPropertyDescriptors;var lh=Object.getOwnPropertySymbols;var S1=Object.prototype.hasOwnProperty,E1=Object.prototype.propertyIsEnumerable;var uh=(t,e,r)=>e in t?D1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xe=(t,e)=>{for(var r in e||(e={}))S1.call(e,r)&&uh(t,r,e[r]);if(lh)for(var r of lh(e))E1.call(e,r)&&uh(t,r,e[r]);return t},Si=(t,e)=>_1(t,A1(e));var et=(t,e,r)=>new Promise((i,n)=>{var a=l=>{try{o(r.next(l))}catch(u){n(u)}},s=l=>{try{o(r.throw(l))}catch(u){n(u)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(a,s);o((r=r.apply(t,e)).next())});var F1=Object.create,Dp=Object.defineProperty,T1=Object.getOwnPropertyDescriptor,k1=Object.getOwnPropertyNames,I1=Object.getPrototypeOf,_p=Object.prototype.hasOwnProperty,ml=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),C1=(t,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(var n=k1(e),a=0,s=n.length,o;ae[l]).bind(null,o),enumerable:!(i=T1(e,o))||i.enumerable});return t},M1=(t,e,r)=>(r=t==null?{}:F1(I1(t)),C1(e||!t||!t.__esModule||!_p.call(t,\"default\")?Dp(r,\"default\",{value:t,enumerable:!0}):r,t));function M(t,e){this.x=t,this.y=e}M.prototype={clone(){return new M(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:M},M.convert=function(t){if(t instanceof M)return t;if(Array.isArray(t))return new M(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new M(+t.x,+t.y);throw Error(\"Expected [x, y] or {x, y} point format\")};function B1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var Ei;function P1(){return Ei!=null||(Ei=typeof OffscreenCanvas<\"u\"&&!!new OffscreenCanvas(1,1).getContext(\"2d\")&&typeof createImageBitmap==\"function\"),Ei}var Xn;function z1(){if(Xn==null&&(Xn=!1,P1())){let t=new OffscreenCanvas(5,5).getContext(\"2d\",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){Xn=!0;break}}}return Xn||!1}var fe=typeof Float32Array<\"u\"?Float32Array:Array;function L1(){var t=new fe(9);return fe!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Ap(){var t=new fe(3);return fe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function V1(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function hh(t,e,r){var i=new fe(3);return i[0]=t,i[1]=e,i[2]=r,i}function O1(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function R1(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ks(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}var $1=V1;(function(){var t=Ap();return function(e,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=i*s,t[2]=n*s,t[3]=a*s,t}function q1(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}(function(){var t=N1();return function(e,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o1e-6?(p=Math.acos(f),d=Math.sin(p),y=Math.sin((1-i)*p)/d,m=Math.sin(i*p)/d):(y=1-i,m=i),t[0]=y*n+m*l,t[1]=y*a+m*u,t[2]=y*s+m*h,t[3]=y*o+m*c,t}function G1(t,e){var r=e[0]+e[4]+e[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[n*3+n]&&(n=2);var a=(n+1)%3,s=(n+2)%3;i=Math.sqrt(e[n*3+n]-e[a*3+a]-e[s*3+s]+1),t[n]=.5*i,i=.5/i,t[3]=(e[a*3+s]-e[s*3+a])*i,t[a]=(e[a*3+n]+e[n*3+a])*i,t[s]=(e[s*3+n]+e[n*3+s])*i}return t}var ph=U1;(function(){var t=Ap(),e=hh(1,0,0),r=hh(0,1,0);return function(i,n,a){var s=R1(n,a);return s<-.999999?(ks(t,e,n),$1(t)<1e-6&&ks(t,r,n),O1(t,t),j1(i,t,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(ks(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+s,ph(i,i))}})(),(function(){var t=ch(),e=ch();return function(r,i,n,a,s,o){return Is(t,i,s,o),Is(e,n,a,o),Is(r,t,e,2*o*(1-o)),r}})(),(function(){var t=L1();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],ph(e,G1(e,t))}})();function X1(){var t=new fe(2);return fe!=Float32Array&&(t[0]=0,t[1]=0),t}(function(){var t=X1();return function(e,r,i,n,a,s){var o,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function W1(t,e,r,i){return B1(t,e,r,i)}var D5=W1(.25,.1,.25,1);function en(t,e,r){return Math.min(r,Math.max(e,t))}function Z1(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function Xt(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function H1(t){return Math.log(t)/Math.LN2%1==0}function xn(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}function K1(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function to(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r(e.y-t.y)*(r.x-t.x)}function vr(t){return typeof WorkerGlobalScope<\"u\"&&t!==void 0&&t instanceof WorkerGlobalScope}function Ba(t){return typeof ImageBitmap<\"u\"&&t instanceof ImageBitmap}function J1(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),h=Math.min(t.width,e+i),c=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}function Q1(t,e,r,i,n){return et(this,null,function*(){if(typeof VideoFrame>\"u\")throw Error(\"VideoFrame not supported\");let a=new VideoFrame(t,{timestamp:0});try{let s=a==null?void 0:a.format;if(!s||!(s.startsWith(\"BGR\")||s.startsWith(\"RGB\")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith(\"BGR\"),l=new Uint8ClampedArray(i*n*4);if(yield a.copyTo(l,J1(t,e,r,i,n)),o)for(let u=0;u{t.removeEventListener(e,r,i)}}}function yh(t){return t*Math.PI/180}var mh=\"AbortError\",gl=class extends Error{constructor(t=mh){super(t instanceof Error?t.message:t),this.name=mh,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function xl(t){return t instanceof Error&&t.name===\"AbortError\"}function e0(t){if(t.aborted)throw new gl(t.reason)}var vl={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:\"\"};function r0(t){return vl.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf(\"://\"))]}function Fp(t,e){vl.REGISTERED_PROTOCOLS[t]=e}function Tp(t){delete vl.REGISTERED_PROTOCOLS[t]}var gh=\"global-dispatcher\",ga=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function kp(){var t;if(vr(self))return(t=self.worker)==null?void 0:t.referrer;if(window.location.protocol===\"blob:\")try{return window.parent.location.href}catch(e){}return window.location.href}var i0=t=>{var e;return t.startsWith(\"file:\")||((e=kp())==null?void 0:e.startsWith(\"file:\"))&&!/^\\w+:/.test(t)};function n0(t,e){return et(this,null,function*(){let r=new Request(t.url,{method:t.method||\"GET\",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:kp(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type===\"json\"&&!r.headers.has(\"Accept\")&&r.headers.set(\"Accept\",\"application/json\");let i;try{i=yield fetch(r)}catch(s){throw xl(s)?s:new ga(0,tn(s).message,t.url,new Blob)}if(!i.ok){let s=yield i.blob();throw new ga(i.status,i.statusText,t.url,s)}let n;n=t.type===\"arrayBuffer\"||t.type===\"image\"?i.arrayBuffer():t.type===\"json\"?i.json():i.text();let a=yield n;return e0(e.signal),{data:a,cacheControl:i.headers.get(\"Cache-Control\"),expires:i.headers.get(\"Expires\"),etag:i.headers.get(\"ETag\")}})}function a0(t,e){return new Promise((r,i)=>{var a;let n=new XMLHttpRequest;n.open(t.method||\"GET\",t.url,!0),(t.type===\"arrayBuffer\"||t.type===\"image\")&&(n.responseType=\"arraybuffer\");for(let s in t.headers)n.setRequestHeader(s,t.headers[s]);t.type===\"json\"&&(n.responseType=\"text\",(a=t.headers)!=null&&a.Accept||n.setRequestHeader(\"Accept\",\"application/json\")),n.withCredentials=t.credentials===\"include\",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let s=n.response;if(t.type===\"json\")try{s=JSON.parse(n.response)}catch(o){i(o);return}r({data:s,cacheControl:n.getResponseHeader(\"Cache-Control\"),expires:n.getResponseHeader(\"Expires\"),etag:n.getResponseHeader(\"ETag\")})}else{let s=new Blob([n.response],{type:n.getResponseHeader(\"Content-Type\")});i(new ga(n.status,n.statusText,t.url,s))}},e.signal.addEventListener(\"abort\",()=>{n.abort(),i(new gl(e.signal.reason))}),n.send(t.body)})}var Pa=function(t,e){return et(this,null,function*(){var r,i;if(t.url.includes(\"://\")&&!/^https?:|^file:/.test(t.url)){let n=r0(t.url);if(n){let a=yield n(t,e);return!a.data&&t.type===\"arrayBuffer\"?Xt(a,{data:new ArrayBuffer(0)}):a}if(vr(self)&&((r=self.worker)!=null&&r.actor))return self.worker.actor.sendAsync({type:\"GR\",data:t,targetMapId:gh},e)}if(!i0(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,\"signal\"))return n0(t,e);if(vr(self)&&((i=self.worker)!=null&&i.actor))return self.worker.actor.sendAsync({type:\"GR\",data:t,mustQueue:!0,targetMapId:gh},e)}return a0(t,e)})},Ip=(t,e)=>Pa(Xt(t,{type:\"json\"}),e),Cp=(t,e)=>Pa(Xt(t,{type:\"arrayBuffer\"}),e);function xh(t,e,r){var i;(i=r[t])!=null&&i.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function Cs(t,e,r){if(r!=null&&r[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}var Mp=class{constructor(t,e={}){Xt(this,e),this.type=t}},xa=class extends Mp{constructor(t,e={}){super(\"error\",Xt({error:t},e))}},s0=class{on(t,e){return this._listeners||(this._listeners={}),xh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return Cs(t,e,this._listeners),Cs(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),xh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){var n,a,s,o,l,u;let r=typeof t==\"string\"?new Mp(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let h=(s=(a=(n=this._listeners)==null?void 0:n[i])==null?void 0:a.slice())!=null?s:[];for(let f of h)f.call(this,r);let c=(u=(l=(o=this._oneTimeListeners)==null?void 0:o[i])==null?void 0:l.slice())!=null?u:[];for(let f of c)Cs(i,f,this._oneTimeListeners),f.call(this,r);let p=this._eventedParent;p&&(Xt(r,typeof this._eventedParentData==\"function\"?this._eventedParentData():this._eventedParentData),p.fire(r))}else r instanceof xa&&console.error(r.error);return this}listens(t){var e,r,i,n,a;return!!((r=(e=this._listeners)==null?void 0:e[t])!=null&&r.length||(n=(i=this._oneTimeListeners)==null?void 0:i[t])!=null&&n.length||(a=this._eventedParent)!=null&&a.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},Bp={$version:8,$root:{version:{required:!0,type:\"enum\",values:[8]},name:{type:\"string\"},metadata:{type:\"*\"},center:{type:\"array\",value:\"number\",length:2},centerAltitude:{type:\"number\"},zoom:{type:\"number\"},bearing:{type:\"number\",default:0,period:360,units:\"degrees\"},pitch:{type:\"number\",default:0,units:\"degrees\"},roll:{type:\"number\",default:0,units:\"degrees\"},state:{type:\"state\",default:{}},light:{type:\"light\"},sky:{type:\"sky\"},projection:{type:\"projection\"},terrain:{type:\"terrain\"},sources:{required:!0,type:\"sources\"},sprite:{type:\"sprite\"},glyphs:{type:\"string\"},\"font-faces\":{type:\"fontFaces\"},transition:{type:\"transition\"},layers:{required:!0,type:\"array\",value:\"layer\"}},sources:{\"*\":{type:\"source\"}},source:[\"source_vector\",\"source_raster\",\"source_raster_dem\",\"source_geojson\",\"source_video\",\"source_image\"],source_vector:{type:{required:!0,type:\"enum\",values:{vector:{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:\"enum\",values:{xyz:{},tms:{}},default:\"xyz\"},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},attribution:{type:\"string\"},promoteId:{type:\"promoteId\"},volatile:{type:\"boolean\",default:!1},encoding:{type:\"enum\",values:{mvt:{},mlt:{}},default:\"mvt\"},\"*\":{type:\"*\"}},source_raster:{type:{required:!0,type:\"enum\",values:{raster:{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},scheme:{type:\"enum\",values:{xyz:{},tms:{}},default:\"xyz\"},attribution:{type:\"string\"},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_raster_dem:{type:{required:!0,type:\"enum\",values:{\"raster-dem\":{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},attribution:{type:\"string\"},encoding:{type:\"enum\",values:{terrarium:{},mapbox:{},custom:{}},default:\"mapbox\"},redFactor:{type:\"number\",default:1},blueFactor:{type:\"number\",default:1},greenFactor:{type:\"number\",default:1},baseShift:{type:\"number\",default:0},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_geojson:{type:{required:!0,type:\"enum\",values:{geojson:{}}},data:{required:!0,type:\"*\"},maxzoom:{type:\"number\",default:18},attribution:{type:\"string\"},buffer:{type:\"number\",default:128,maximum:512,minimum:0},filter:{type:\"filter\"},tolerance:{type:\"number\",default:.375},cluster:{type:\"boolean\",default:!1},clusterRadius:{type:\"number\",default:50,minimum:0},clusterMaxZoom:{type:\"number\"},clusterMinPoints:{type:\"number\"},clusterProperties:{type:\"*\"},lineMetrics:{type:\"boolean\",default:!1},generateId:{type:\"boolean\",default:!1},promoteId:{type:\"promoteId\"}},source_video:{type:{required:!0,type:\"enum\",values:{video:{}}},urls:{required:!0,type:\"array\",value:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},source_image:{type:{required:!0,type:\"enum\",values:{image:{}}},url:{type:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},layer:{id:{type:\"string\",required:!0},type:{type:\"enum\",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},\"fill-extrusion\":{},raster:{},hillshade:{},\"color-relief\":{},background:{}},required:!0},metadata:{type:\"*\"},source:{type:\"string\"},\"source-layer\":{type:\"string\"},minzoom:{type:\"number\",minimum:0,maximum:24},maxzoom:{type:\"number\",minimum:0,maximum:24},filter:{type:\"filter\"},layout:{type:\"layout\"},paint:{type:\"paint\"}},layout:[\"layout_fill\",\"layout_line\",\"layout_circle\",\"layout_heatmap\",\"layout_fill-extrusion\",\"layout_symbol\",\"layout_raster\",\"layout_hillshade\",\"layout_color-relief\",\"layout_background\"],layout_background:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_fill:{\"fill-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_circle:{\"circle-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_heatmap:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_fill-extrusion\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-rounded-corner-distance\":{type:\"number\",default:0,minimum:0,units:\"meters\",\"property-type\":\"constant\"}},layout_line:{\"line-cap\":{type:\"enum\",values:{butt:{},round:{},square:{}},default:\"butt\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-join\":{type:\"enum\",values:{bevel:{},round:{},miter:{}},default:\"miter\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-miter-limit\":{type:\"number\",default:2,requires:[{\"line-join\":\"miter\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-round-limit\":{type:\"number\",default:1.05,requires:[{\"line-join\":\"round\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_symbol:{\"symbol-placement\":{type:\"enum\",values:{point:{},line:{},\"line-center\":{}},default:\"point\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-spacing\":{type:\"number\",default:250,minimum:1,units:\"pixels\",requires:[{\"symbol-placement\":\"line\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-avoid-edges\":{type:\"boolean\",default:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"symbol-z-order\":{type:\"enum\",values:{auto:{},\"viewport-y\":{},source:{}},default:\"auto\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-allow-overlap\":{type:\"boolean\",default:!1,requires:[\"icon-image\",{\"!\":\"icon-overlap\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-overlap\":{type:\"enum\",values:{never:{},always:{},cooperative:{}},requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-ignore-placement\":{type:\"boolean\",default:!1,requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-optional\":{type:\"boolean\",default:!1,requires:[\"icon-image\",\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-rotation-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-size\":{type:\"number\",default:1,minimum:0,units:\"factor of the original icon size\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-text-fit\":{type:\"enum\",values:{none:{},width:{},height:{},both:{}},default:\"none\",requires:[\"icon-image\",\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-text-fit-padding\":{type:\"array\",value:\"number\",length:4,default:[0,0,0,0],units:\"pixels\",requires:[\"icon-image\",\"text-field\",{\"icon-text-fit\":[\"both\",\"width\",\"height\"]}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-image\":{type:\"resolvedImage\",tokens:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-padding\":{type:\"padding\",default:[2],units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-keep-upright\":{type:\"boolean\",default:!1,requires:[\"icon-image\",{\"icon-rotation-alignment\":\"map\"},{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-offset\":{type:\"array\",value:\"number\",length:2,default:[0,0],requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-anchor\":{type:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},default:\"center\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-rotation-alignment\":{type:\"enum\",values:{map:{},viewport:{},\"viewport-glyph\":{},auto:{}},default:\"auto\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-field\":{type:\"formatted\",default:\"\",tokens:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-font\":{type:\"array\",value:\"string\",default:[\"Open Sans Regular\",\"Arial Unicode MS Regular\"],requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-size\":{type:\"number\",default:16,minimum:0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-max-width\":{type:\"number\",default:10,minimum:0,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-line-height\":{type:\"number\",default:1.2,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-letter-spacing\":{type:\"number\",default:0,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-justify\":{type:\"enum\",values:{auto:{},left:{},center:{},right:{}},default:\"center\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-radial-offset\":{type:\"number\",units:\"ems\",default:0,requires:[\"text-field\"],\"property-type\":\"data-driven\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]}},\"text-variable-anchor\":{type:\"array\",value:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-variable-anchor-offset\":{type:\"variableAnchorOffsetCollection\",requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-anchor\":{type:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},default:\"center\",requires:[\"text-field\",{\"!\":\"text-variable-anchor\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-max-angle\":{type:\"number\",default:45,units:\"degrees\",requires:[\"text-field\",{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-writing-mode\":{type:\"array\",value:\"enum\",values:{horizontal:{},vertical:{}},requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-padding\":{type:\"number\",default:2,minimum:0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-keep-upright\":{type:\"boolean\",default:!0,requires:[\"text-field\",{\"text-rotation-alignment\":\"map\"},{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-transform\":{type:\"enum\",values:{none:{},uppercase:{},lowercase:{}},default:\"none\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-offset\":{type:\"array\",value:\"number\",units:\"ems\",length:2,default:[0,0],requires:[\"text-field\",{\"!\":\"text-radial-offset\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-allow-overlap\":{type:\"boolean\",default:!1,requires:[\"text-field\",{\"!\":\"text-overlap\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-overlap\":{type:\"enum\",values:{never:{},always:{},cooperative:{}},requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-ignore-placement\":{type:\"boolean\",default:!1,requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-optional\":{type:\"boolean\",default:!1,requires:[\"text-field\",\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-height-offset\":{type:\"number\",default:0,units:\"meters\",requires:[{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"symbol-height-anchor\":{type:\"enum\",values:{ground:{},absolute:{}},default:\"ground\",requires:[\"symbol-height-offset\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_raster:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_hillshade:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_color-relief\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},filter:{type:\"boolean\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},filter_operator:{type:\"enum\",values:{\"==\":{},\"!=\":{},\">\":{},\">=\":{},\"<\":{},\"<=\":{},in:{},\"!in\":{},all:{},any:{},none:{},has:{},\"!has\":{}}},geometry_type:{type:\"enum\",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:\"expression\"},stops:{type:\"array\",value:\"function_stop\"},base:{type:\"number\",default:1,minimum:0},property:{type:\"string\",default:\"$zoom\"},type:{type:\"enum\",values:{identity:{},exponential:{},interval:{},categorical:{}},default:\"exponential\"},colorSpace:{type:\"enum\",values:{rgb:{},lab:{},hcl:{}},default:\"rgb\"},default:{type:\"*\",required:!1}},function_stop:{type:\"array\",minimum:0,maximum:24,value:[\"number\",\"color\"],length:2},expression:{type:\"array\",value:\"expression_name\",minimum:1},light:{anchor:{type:\"enum\",default:\"viewport\",values:{map:{},viewport:{}},\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]}},position:{type:\"array\",default:[1.15,210,30],length:3,value:\"number\",\"property-type\":\"data-constant\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]}},color:{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},intensity:{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},sky:{\"sky-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#88C6FC\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-ground-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-fog-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"sky-horizon-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"atmosphere-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},terrain:{source:{type:\"string\",required:!0},exaggeration:{type:\"number\",minimum:0,default:1}},projection:{type:{type:\"projectionDefinition\",default:\"mercator\",\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]}}},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_heatmap\",\"paint_fill-extrusion\",\"paint_symbol\",\"paint_raster\",\"paint_hillshade\",\"paint_color-relief\",\"paint_background\"],paint_fill:{\"fill-antialias\":{type:\"boolean\",default:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-outline-color\":{type:\"color\",transition:!0,requires:[{\"!\":\"fill-pattern\"},{\"fill-antialias\":!0}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"}},\"paint_fill-extrusion\":{\"fill-extrusion-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"fill-extrusion-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-extrusion-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"fill-extrusion-height\":{type:\"number\",default:0,units:\"meters\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-base\":{type:\"number\",default:0,units:\"meters\",transition:!0,requires:[\"fill-extrusion-height\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-vertical-gradient\":{type:\"boolean\",default:!0,transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_line:{\"line-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"line-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"line-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-width\":{type:\"number\",default:1,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-gap-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-offset\":{type:\"number\",default:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-dasharray\":{type:\"array\",value:\"number\",minimum:0,transition:!0,units:\"line widths\",requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-gradient\":{type:\"color\",transition:!1,requires:[{\"!\":\"line-dasharray\"},{\"!\":\"line-pattern\"},{source:\"geojson\",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[\"line-progress\"]},\"property-type\":\"color-ramp\"}},paint_circle:{\"circle-radius\":{type:\"number\",default:5,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-blur\":{type:\"number\",default:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"circle-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-scale\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-stroke-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"}},paint_heatmap:{\"heatmap-radius\":{type:\"number\",default:30,minimum:1,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-weight\":{type:\"number\",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-intensity\":{type:\"number\",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"heatmap-color\":{type:\"color\",default:[\"interpolate\",[\"linear\"],[\"heatmap-density\"],0,\"rgba(0, 0, 255, 0)\",.1,\"royalblue\",.3,\"cyan\",.5,\"lime\",.7,\"yellow\",1,\"red\"],transition:!1,expression:{interpolated:!0,parameters:[\"heatmap-density\"]},\"property-type\":\"color-ramp\"},\"heatmap-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_symbol:{\"icon-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"icon-image\",\"icon-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-color\":{type:\"color\",default:\"#000000\",transition:!0,overridable:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"text-field\",\"text-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_raster:{\"raster-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-hue-rotate\":{type:\"number\",default:0,period:360,transition:!0,units:\"degrees\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-min\":{type:\"number\",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-max\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-saturation\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-contrast\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-resampling\":{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-fade-duration\":{type:\"number\",default:300,minimum:0,transition:!1,units:\"milliseconds\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_hillshade:{\"hillshade-illumination-direction\":{type:\"numberArray\",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-altitude\":{type:\"numberArray\",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-exaggeration\":{type:\"number\",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-shadow-color\":{type:\"colorArray\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-highlight-color\":{type:\"colorArray\",default:\"#FFFFFF\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-accent-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-method\":{type:\"enum\",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:\"standard\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},\"paint_color-relief\":{\"color-relief-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"color-relief-color\":{type:\"color\",transition:!1,expression:{interpolated:!0,parameters:[\"elevation\"]},\"property-type\":\"color-ramp\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_background:{\"background-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"background-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"background-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"cross-faded\"},\"background-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},transition:{duration:{type:\"number\",default:300,minimum:0,units:\"milliseconds\"},delay:{type:\"number\",default:0,minimum:0,units:\"milliseconds\"}},\"property-type\":{\"data-driven\":{type:\"property-type\"},\"cross-faded\":{type:\"property-type\"},\"cross-faded-data-driven\":{type:\"property-type\"},\"color-ramp\":{type:\"property-type\"},\"data-constant\":{type:\"property-type\"},constant:{type:\"property-type\"}},promoteId:{\"*\":{type:\"string\"}},interpolation:{type:\"array\",value:\"interpolation_name\",minimum:1},interpolation_name:{type:\"enum\",values:{linear:{syntax:{overloads:[{parameters:[],\"output-type\":\"interpolation\"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[\"base\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"base\",type:\"number literal\"}]}},\"cubic-bezier\":{syntax:{overloads:[{parameters:[\"x1\",\"y1\",\"x2\",\"y2\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"x1\",type:\"number literal\"},{name:\"y1\",type:\"number literal\"},{name:\"x2\",type:\"number literal\"},{name:\"y2\",type:\"number literal\"}]}}}}},D=Bp,Pp=[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"],E=class{constructor(t,e,r,i,n=\"error\"){this.message=(t?`${t}: `:\"\")+r,i&&(this.identifier=i),this.severity=n,e!=null&&e.__line__&&(this.line=e.__line__)}},vn={kind:\"null\"},I={kind:\"number\"},W={kind:\"string\"},Q={kind:\"boolean\"},pe={kind:\"color\"},za={kind:\"projectionDefinition\"},mr={kind:\"object\"},H={kind:\"value\"},o0={kind:\"error\"},La={kind:\"collator\"},bn={kind:\"formatted\"},Va={kind:\"padding\"},rn={kind:\"colorArray\"},Oa={kind:\"numberArray\"},wn={kind:\"resolvedImage\"},Ra={kind:\"variableAnchorOffsetCollection\"};function Ut(t,e){return{kind:\"array\",itemType:t,N:e}}function mt(t){if(t.kind===\"array\"){let e=mt(t.itemType);return typeof t.N==\"number\"?`array<${e}, ${t.N}>`:t.itemType.kind===\"value\"?\"array\":`array<${e}>`}return t.kind}var l0=[vn,I,W,Q,pe,za,bn,mr,Ut(H),Va,Oa,rn,wn,Ra];function nn(t,e){if(e.kind===\"error\")return null;if(t.kind===\"array\"){if(e.kind===\"array\"&&(e.N===0&&e.itemType.kind===\"value\"||!nn(t.itemType,e.itemType))&&(typeof t.N!=\"number\"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind===\"value\"){for(let r of l0)if(!nn(r,e))return null}}return`Expected ${mt(t)} but found ${mt(e)} instead.`}function bl(t,e){return e.some(r=>r.kind===t.kind)}function gr(t,e){return e.some(r=>r===\"null\"?t===null:r===\"array\"?Array.isArray(t):r===\"object\"?t&&!Array.isArray(t)&&typeof t==\"object\":r===typeof t)}function Ye(t,e){return t.kind===\"array\"&&e.kind===\"array\"?t.itemType.kind===e.itemType.kind&&typeof t.N==\"number\":t.kind===e.kind}var zp=.96422,Lp=.82521,Vp=4/29,eo=6/29,Op=3*eo*eo,u0=Math.PI/180,h0=180/Math.PI;function Rp(t){return t%=360,t<0&&(t+=360),t}function $p([t,e,r,i]){t=Ms(t),e=Ms(e),r=Ms(r);let n,a,s=Bs((.2225045*t+.7168786*e+.0606169*r)/1);t===e&&e===r?n=a=s:(n=Bs((.4360747*t+.3850649*e+.1430804*r)/zp),a=Bs((.0139322*t+.0971045*e+.7141733*r)/Lp));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Ms(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Bs(t){return t>.008856451679035631?t**(1/3):t/Op+Vp}function Np([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*zs(n),a=zp*zs(a),s=Lp*zs(s),[Ps(3.1338561*a-1.6168667*n-.4906146*s),Ps(-.9787684*a+1.9161415*n+.033454*s),Ps(.0719453*a-.2289914*n+1.4052427*s),i]}function Ps(t){return t=t<=.00304?12.92*t:1.055*t**(1/2.4)-.055,t<0?0:t>1?1:t}function zs(t){return t>eo?t*t*t:Op*(t-Vp)}function c0(t){let[e,r,i,n]=$p(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?Rp(Math.atan2(i,r)*h0):NaN,a,e,n]}function p0([t,e,r,i]){return t=isNaN(t)?0:t*u0,Np([r,Math.cos(t)*e,Math.sin(t)*e,i])}function f0([t,e,r,i]){t=Rp(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var d0=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function Yi(t,e){return d0(t,e)?t[e]:void 0}function y0(t){if(t=t.toLowerCase().trim(),t===\"transparent\")return[0,0,0,0];let e=Yi(m0,t);if(e){let[i,n,a]=e;return[i/255,n/255,a/255,1]}if(t.startsWith(\"#\")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let i=t.length<6?1:2,n=1;return[Yn(t.slice(n,n+=i)),Yn(t.slice(n,n+=i)),Yn(t.slice(n,n+=i)),Yn(t.slice(n,n+i)||\"ff\")]}if(t.startsWith(\"rgb\")){let i=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(i){let[n,a,s,o,l,u,h,c,p,f,d,y]=i,m=[o||\" \",h||\" \",f].join(\"\");if(m===\" \"||m===\" /\"||m===\",,\"||m===\",,,\"){let g=[s,u,p].join(\"\"),x=g===\"%%%\"?100:g===\"\"?255:0;if(x){let v=[Rr(+a/x,0,1),Rr(+l/x,0,1),Rr(+c/x,0,1),d?vh(+d,y):1];if(bh(v))return v}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[i,n,a,s,o,l,u,h,c]=r,p=[a||\" \",o||\" \",u].join(\"\");if(p===\" \"||p===\" /\"||p===\",,\"||p===\",,,\"){let f=[+n,Rr(+s,0,100),Rr(+l,0,100),h?vh(+h,c):1];if(bh(f))return f0(f)}}}function Yn(t){return parseInt(t.padEnd(2,t),16)/255}function vh(t,e){return Rr(e?t/100:t,0,1)}function Rr(t,e,r){return Math.min(Math.max(e,t),r)}function bh(t){return!t.some(Number.isNaN)}var m0={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function er(t,e,r){return t+r*(e-t)}function ti(t,e,r){return t.map((i,n)=>er(i,e[n],r))}function g0(t){return t===\"rgb\"||t===\"hcl\"||t===\"lab\"}var Bt,xt=(Bt=class{constructor(e,r,i,n=1,a=!0){this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter(\"rgb\",[e,r,i,n]))}static parse(e){if(e instanceof Bt)return e;if(typeof e!=\"string\")return;let r=y0(e);if(r)return new Bt(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter(\"rgb\",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter(\"hcl\",c0(this.rgb))}get lab(){return this.overwriteGetter(\"lab\",$p(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(\",\")},${n})`}static interpolate(e,r,i,n=\"rgb\"){switch(n){case\"rgb\":{let[a,s,o,l]=ti(e.rgb,r.rgb,i);return new Bt(a,s,o,l,!1)}case\"hcl\":{let[a,s,o,l]=e.hcl,[u,h,c,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=h)):(f=a,(c===1||c===0)&&(d=s));let[y,m,g,x]=p0([f,d!=null?d:er(s,h,i),er(o,c,i),er(l,p,i)]);return new Bt(y,m,g,x,!1)}case\"lab\":{let[a,s,o,l]=Np(ti(e.lab,r.lab,i));return new Bt(a,s,o,l,!1)}}}},Bt.black=new Bt(0,0,0,1),Bt.white=new Bt(1,1,1,1),Bt.transparent=new Bt(0,0,0,0),Bt.red=new Bt(1,0,0,1),Bt),x0=[\"bottom\",\"center\",\"top\"],ro=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},Le=class ha{constructor(e){this.sections=e}static fromString(e){return new ha([new ro(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof ha?e:ha.fromString(e)}toString(){return this.sections.length===0?\"\":this.sections.map(e=>e.text).join(\"\")}},Ee=class Ri{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ri)return e;if(typeof e==\"number\")return new Ri([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!=\"number\")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Ri(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Ri(ti(e.values,r.values,i))}},Fe=class $i{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof $i)return e;if(typeof e==\"number\")return new $i([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!=\"number\")return;return new $i(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new $i(ti(e.values,r.values,i))}},ue=class Ni{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ni)return e;if(typeof e==\"string\"){let i=xt.parse(e);return i?new Ni([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!=\"string\")return;let n=xt.parse(i);if(!n)return;r.push(n)}return new Ni(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n=\"rgb\"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s=0&&t<=255&&typeof e==\"number\"&&e>=0&&e<=255&&typeof r==\"number\"&&r>=0&&r<=255?i===void 0||typeof i==\"number\"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(\", \")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i==\"number\"?[t,e,r,i]:[t,e,r]).join(\", \")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ei(t){if(t===null||typeof t==\"string\"||typeof t==\"boolean\"||typeof t==\"number\"||t instanceof Sr||t instanceof xt||t instanceof wl||t instanceof Le||t instanceof Ee||t instanceof Fe||t instanceof ue||t instanceof Ae||t instanceof Se)return!0;if(Array.isArray(t)){for(let e of t)if(!ei(e))return!1;return!0}if(typeof t==\"object\"){for(let e in t)if(!ei(t[e]))return!1;return!0}return!1}function St(t){if(t===null)return vn;if(typeof t==\"string\")return W;if(typeof t==\"boolean\")return Q;if(typeof t==\"number\")return I;if(t instanceof xt)return pe;if(t instanceof Sr)return za;if(t instanceof wl)return La;if(t instanceof Le)return bn;if(t instanceof Ee)return Va;if(t instanceof Fe)return Oa;if(t instanceof ue)return rn;if(t instanceof Ae)return Ra;if(t instanceof Se)return wn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=St(i);if(!r)r=n;else{if(r===n)continue;r=H;break}}return Ut(r||H,e)}return mr}function Wi(t){let e=typeof t;return t===null?\"\":e===\"string\"||e===\"number\"||e===\"boolean\"?String(t):t instanceof xt||t instanceof Sr||t instanceof Le||t instanceof Ee||t instanceof Fe||t instanceof ue||t instanceof Ae||t instanceof Se?t.toString():JSON.stringify(t)}var ri=class jp{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=St(i),a=r.expectedType;return n.kind===\"array\"&&n.N===0&&a&&a.kind===\"array\"&&(typeof a.N!=\"number\"||a.N===0)&&(n=a),new jp(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},b0=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],Gp=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&\"id\"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type==\"number\"?b0[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&\"geometry\"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=xt.parse(t),this._parseColorCache.set(t,e)),e}};function $a(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||ee)a=s-1;else throw new ft(\"Input is not a number.\",r);return 0}var Dl=class Xp{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");let i=r.parse(e[1],1,I);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!==\"value\"&&(a=r.expectedType);for(let s=1;s=o)return r.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.',u);let c=r.parse(l,h,a);if(!c)return null;a||(a=c.type),n.push([o,c])}return new Xp(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[$a(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function w0(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var De=class io{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name===\"exponential\")a=Ls(r,e.base,i,n);else if(e.name===\"linear\")a=Ls(r,1,i,n);else if(e.name===\"cubic-bezier\"){let s=e.controlPoints;a=w0(s[0],s[1],s[2],s[3])(Ls(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error(\"Expected an interpolation type expression.\",1);if(n[0]===\"linear\")n={name:\"linear\"};else if(n[0]===\"exponential\"){let u=n[1];if(typeof u!=\"number\")return r.error(\"Exponential interpolation requires a numeric base.\",1,1);n={name:\"exponential\",base:u}}else if(n[0]===\"cubic-bezier\"){let u=n.slice(1);if(u.length!==4||u.some(h=>typeof h!=\"number\"||h<0||h>1))return r.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\",1);n={name:\"cubic-bezier\",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");if(a=r.parse(a,2,I),!a)return null;let o=[],l=null;(i===\"interpolate-hcl\"||i===\"interpolate-lab\")&&r.expectedType!=rn?l=pe:r.expectedType&&r.expectedType.kind!==\"value\"&&(l=r.expectedType);for(let u=0;u=h)return r.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.',p);let d=r.parse(c,f,l);if(!d)return null;l||(l=d.type),o.push([h,d])}return!Ye(l,I)&&!Ye(l,za)&&!Ye(l,pe)&&!Ye(l,Va)&&!Ye(l,Oa)&&!Ye(l,rn)&&!Ye(l,Ra)&&!Ye(l,Ut(I))?r.error(`Type ${mt(l)} is not interpolatable.`):new io(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=$a(r,n,this.key),o=r[s],l=r[s+1],u=io.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(e),c=i[s+1].evaluate(e);switch(this.operator){case\"interpolate\":switch(this.type.kind){case\"number\":return er(h,c,u);case\"color\":return xt.interpolate(h,c,u);case\"padding\":return Ee.interpolate(h,c,u);case\"colorArray\":return ue.interpolate(h,c,u);case\"numberArray\":return Fe.interpolate(h,c,u);case\"variableAnchorOffsetCollection\":return Ae.interpolate(h,c,u,this.key);case\"array\":return ti(h,c,u);case\"projectionDefinition\":return Sr.interpolate(h,c,u)}case\"interpolate-hcl\":switch(this.type.kind){case\"color\":return xt.interpolate(h,c,u,\"hcl\");case\"colorArray\":return ue.interpolate(h,c,u,\"hcl\")}case\"interpolate-lab\":switch(this.type.kind){case\"color\":return xt.interpolate(h,c,u,\"lab\");case\"colorArray\":return ue.interpolate(h,c,u,\"lab\")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Ls(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var br={color:xt.interpolate,number:er,padding:Ee.interpolate,numberArray:Fe.interpolate,colorArray:ue.interpolate,variableAnchorOffsetCollection:Ae.interpolate,array:ti},Yp=class Wp{constructor(e){this.type=bn,this.sections=e}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[1];if(!Array.isArray(i)&&typeof i==\"object\")return r.error(\"First argument must be an image or text section.\");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o==\"object\"&&!Array.isArray(o)){a=!1;let l=null;if(o[\"font-scale\"]&&(l=r.parse(o[\"font-scale\"],1,I),!l))return null;let u=null;if(o[\"text-font\"]&&(u=r.parse(o[\"text-font\"],1,Ut(W)),!u))return null;let h=null;if(o[\"text-color\"]&&(h=r.parse(o[\"text-color\"],1,pe),!h))return null;let c=null;if(o[\"vertical-align\"]){if(typeof o[\"vertical-align\"]==\"string\"&&!x0.includes(o[\"vertical-align\"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o[\"vertical-align\"]}' instead.`);if(c=r.parse(o[\"vertical-align\"],1,W),!c)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=r.parse(e[s],1,H);if(!l)return null;let u=l.type.kind;if(u!==\"string\"&&u!==\"value\"&&u!==\"null\"&&u!==\"resolvedImage\")return r.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Wp(n)}evaluate(e){return new Le(this.sections.map(r=>{let i=r.content.evaluate(e);return St(i)===wn?new ro(\"\",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new ro(Wi(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(\",\"):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}};function Zp(t,e,r=0,i=t.length-1,n=D0){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);Zp(t,e,Math.max(r,Math.floor(e-u*c/l+p)),Math.min(i,Math.floor(e+(l-u)*c/l+p)),n)}let a=t[e],s=r,o=i;for(ki(t,r,e),n(t[i],a)>0&&ki(t,r,i);s0;)o--}n(t[r],a)===0?ki(t,r,o):(o++,ki(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function ki(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function D0(t,e){return te)}function Na(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=A0(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a2){let u=e[1];if(typeof u!=\"string\"||!(u in Wn)||u===\"object\")return r.error('The item type argument of \"array\" must be one of string, number, boolean',1);o=Wn[u],i++}else o=H;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=\"number\"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to \"array\" must be a positive integer literal',2);l=e[2],i++}n=Ut(o,l)}else{if(!Wn[a])throw Error(`Types doesn't contain name = ${a}`);n=Wn[a]}let s=[];for(;ie.outputDefined())}},wh={\"to-boolean\":Q,\"to-color\":pe,\"to-number\":I,\"to-string\":W},jr=class Kp{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[0];if(!wh[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i===\"to-boolean\"||i===\"to-string\")&&e.length!==2)return r.error(\"Expected one argument.\");let n=wh[i],a=[];for(let s=1;s4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:qp(r[0],r[1],r[2],r[3]),!i))return new xt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ft(i||`Could not parse color from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"padding\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ee.parse(r);if(n)return n}throw new ft(`Could not parse padding from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"numberArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Fe.parse(r);if(n)return n}throw new ft(`Could not parse numberArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"colorArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=ue.parse(r);if(n)return n}throw new ft(`Could not parse colorArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"variableAnchorOffsetCollection\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ae.parse(r);if(n)return n}throw new ft(`Could not parse variableAnchorOffsetCollection from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"number\":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new ft(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case\"formatted\":return Le.fromString(Wi(this.args[0].evaluate(e)));case\"resolvedImage\":return Se.fromString(Wi(this.args[0].evaluate(e)));case\"projectionDefinition\":{let r=this.args[0].evaluate(e);if(Sr.parse(r))return r;throw new ft(`Could not parse projectionDefinition from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}default:return Wi(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Jp=class Qp{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a=i.length)throw new ft(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new ft(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},E0=class nf{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=Q}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,H);return!i||!n?null:bl(i.type,[Q,W,I,vn,H])?new nf(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!gr(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${mt(St(r))} instead.`,this.key);if(!gr(i,[\"string\",\"array\"]))throw new ft(`Expected second argument to be of type array or string, but found ${mt(St(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},F0=class no{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=I}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,H);if(!i||!n)return null;if(!bl(i.type,[Q,W,I,vn,H]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new no(i,n,r.key,a):null}return new no(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!gr(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${mt(St(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),gr(i,[\"string\"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(gr(i,[\"array\"]))return i.indexOf(r,n);throw new ft(`Expected second argument to be of type array or string, but found ${mt(St(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},T0=class af{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error(\"Expected an even number of arguments.\");let i,n;r.expectedType&&r.expectedType.kind!==\"value\"&&(n=r.expectedType);let a={},s=[];for(let u=2;u2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d==\"number\"&&Math.floor(d)!==d)return p.error(\"Numeric branch labels must be integer values.\");if(!i)i=St(d);else if(p.checkSubtype(i,St(d)))return null;if(a[String(d)]!==void 0)return p.error(\"Branch labels must be unique.\");a[String(d)]=s.length}let f=r.parse(c,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,H);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!==\"value\"&&r.concat(1).checkSubtype(i,o.type)?null:new af(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(St(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},k0=class sf{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error(\"Expected an odd number of arguments.\");let i;r.expectedType&&r.expectedType.kind!==\"value\"&&(i=r.expectedType);let n=[];for(let s=1;sr.outputDefined())&&this.otherwise.outputDefined()}},I0=class ao{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,H),n=r.parse(e[2],2,I);if(!i||!n)return null;if(!bl(i.type,[Ut(H),W,H]))return r.error(`Expected first argument to be of type array or string, but found ${mt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new ao(i.type,i,n,r.key,a):null}return new ao(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),gr(r,[\"string\"]))return[...r].slice(i,n).join(\"\");if(gr(r,[\"array\"]))return r.slice(i,n);throw new ft(`Expected first argument to be of type array or string, but found ${mt(St(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},of=class so{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=null,n=r.expectedType;n&&n.kind!==\"value\"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:\"omit\"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error(\"No output type\");return n&&a.some(s=>nn(n,s.type))?new so(H,a):new so(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof Se&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function Dh(t,e){return t===\"==\"||t===\"!=\"?e.kind===\"boolean\"||e.kind===\"string\"||e.kind===\"number\"||e.kind===\"null\"||e.kind===\"value\":e.kind===\"string\"||e.kind===\"number\"||e.kind===\"value\"}function C0(t,e,r){return e===r}function M0(t,e,r){return e!==r}function B0(t,e,r){return er}function z0(t,e,r){return e<=r}function L0(t,e,r){return e>=r}function lf(t,e,r,i){return i.compare(e,r)===0}function V0(t,e,r,i){return!lf(t,e,r,i)}function O0(t,e,r,i){return i.compare(e,r)<0}function R0(t,e,r,i){return i.compare(e,r)>0}function $0(t,e,r,i){return i.compare(e,r)<=0}function N0(t,e,r,i){return i.compare(e,r)>=0}function li(t,e,r){let i=t!==\"==\"&&t!==\"!=\";return class uf{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=Q,this.hasUntypedArgument=a.type.kind===\"value\"||s.type.kind===\"value\"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error(\"Expected two or three arguments.\");let o=a[0],l=s.parse(a[1],1,H);if(!l)return null;if(!Dh(o,l.type))return s.concat(1).error(`\"${o}\" comparisons are not supported for type '${mt(l.type)}'.`);let u=s.parse(a[2],2,H);if(!u)return null;if(!Dh(o,u.type))return s.concat(2).error(`\"${o}\" comparisons are not supported for type '${mt(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(`Cannot compare types '${mt(l.type)}' and '${mt(u.type)}'.`);i&&(l.type.kind===\"value\"&&u.type.kind!==\"value\"?l=new Be(u.type,[l],s.key):l.type.kind!==\"value\"&&u.type.kind===\"value\"&&(u=new Be(l.type,[u],s.key)));let h=null;if(a.length===4){if(l.type.kind!==\"string\"&&u.type.kind!==\"string\"&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(\"Cannot use collator to compare non-string types.\");if(h=s.parse(a[3],3,La),!h)return null}return new uf(l,u,s.key,h)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=St(s),u=St(o);if(l.kind!==u.kind||l.kind!==\"string\"&&l.kind!==\"number\")throw new ft(`Expected arguments for \"${t}\" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=St(s),u=St(o);if(l.kind!==\"string\"||u.kind!==\"string\")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var U0=li(\"==\",C0,lf),q0=li(\"!=\",M0,V0),j0=li(\"<\",B0,O0),G0=li(\">\",P0,R0),X0=li(\"<=\",z0,$0),Y0=li(\">=\",L0,N0),hf=class cf{constructor(e,r,i){this.type=La,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error(\"Expected one argument.\");let i=e[1];if(typeof i!=\"object\"||Array.isArray(i))return r.error(\"Collator options argument must be an object.\");let n=r.parse(i[\"case-sensitive\"]!==void 0&&i[\"case-sensitive\"],1,Q);if(!n)return null;let a=r.parse(i[\"diacritic-sensitive\"]!==void 0&&i[\"diacritic-sensitive\"],1,Q);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,W),!s)?null:new cf(n,a,s)}evaluate(e){return new wl(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},W0=class pf{constructor(e,r,i,n,a,s){this.type=W,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,I);if(!i)return null;let n=e[2];if(typeof n!=\"object\"||Array.isArray(n))return r.error(\"NumberFormat options argument must be an object.\");let a=null;if(n.locale&&(a=r.parse(n.locale,1,W),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,W),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,W),!o))return null;if(s&&o)return r.error(\"NumberFormat options `currency` and `unit` are mutually exclusive\");let l=null;if(n[\"min-fraction-digits\"]&&(l=r.parse(n[\"min-fraction-digits\"],1,I),!l))return null;let u=null;return n[\"max-fraction-digits\"]&&(u=r.parse(n[\"max-fraction-digits\"],1,I),!u)?null:new pf(i,a,s,o,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?\"currency\":this.unit?\"unit\":\"decimal\",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},Z0=class ff{constructor(e){this.type=wn,this.input=e}static parse(e,r){if(e.length!==2)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,W);return i?new ff(i):r.error(\"No image name provided.\")}evaluate(e){let r=this.input.evaluate(e),i=Se.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},H0=class df{constructor(e,r){this.input=e,this.key=r,this.type=I}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!==\"array\"&&i.type.kind!==\"string\"&&i.type.kind!==\"value\"?r.error(`Expected argument of type string or array, but found ${mt(i.type)} instead.`):new df(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r==\"string\")return[...r].length;if(Array.isArray(r))return r.length;throw new ft(`Expected value to be of type string or array, but found ${mt(St(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},_e=8192;function K0(t,e){let r=J0(t[0]),i=tm(t[1]),n=2**e.z;return[Math.round(r*n*_e),Math.round(i*n*_e)]}function _l(t,e){let r=2**e.z,i=(t[0]/_e+e.x)/r,n=(t[1]/_e+e.y)/r;return[Q0(i),em(n)]}function J0(t){return(180+t)/360}function Q0(t){return t*360-180}function tm(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function em(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function Dn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function an(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function rm(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function im(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function Ua(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return om([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(_h(t,e,r,i)&&_h(r,i,t,e))}function nm(t,e,r){for(let i of r)for(let n=0;n0&&c<0||h<0&&c>0}function Al(t,e,r){let i=[];for(let n=0;nr[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}Dn(e,t)}function lm(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function Ah(t,e,r,i){let n=2**i.z*_e,a=[i.x*_e,i.y*_e],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];gf(u,e,r,n),s.push(u)}return s}function Sh(t,e,r,i){let n=2**i.z*_e,a=[i.x*_e,i.y*_e],s=[];for(let o of t){let l=[];for(let u of o){let h=[u.x+a[0],u.y+a[1]];Dn(e,h),l.push(h)}s.push(l)}if(e[2]-e[0]<=n/2){lm(e);for(let o of s)for(let l of o)gf(l,e,r,n)}return s}function um(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=Al(e.coordinates,i,n),s=Ah(t.geometry(),r,i,n);if(!an(r,i))return!1;for(let o of s)if(!ui(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=mf(e.coordinates,i,n),s=Ah(t.geometry(),r,i,n);if(!an(r,i))return!1;for(let o of s)if(!am(o,a))return!1}return!0}function hm(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=Al(e.coordinates,i,n),s=Sh(t.geometry(),r,i,n);if(!an(r,i))return!1;for(let o of s)if(!yf(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=mf(e.coordinates,i,n),s=Sh(t.geometry(),r,i,n);if(!an(r,i))return!1;for(let o of s)if(!sm(o,a))return!1}return!0}var Sl=class pa{constructor(e,r){this.type=Q,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type===\"FeatureCollection\"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s===\"Polygon\"&&n.push(o),s===\"MultiPolygon\"&&n.push(...o)}if(n.length)return new pa(i,{type:\"MultiPolygon\",coordinates:n})}else if(i.type===\"Feature\"){let n=i.geometry.type;if(n===\"Polygon\"||n===\"MultiPolygon\")return new pa(i,i.geometry)}else if(i.type===\"Polygon\"||i.type===\"MultiPolygon\")return new pa(i,i)}return r.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===\"Point\")return um(e,this.geometries);if(e.geometryType()===\"LineString\")return hm(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},xf=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}},Eh=Math.PI/180,El=class{constructor(t){let e=Eh*6378.137*1e3,r=Math.cos(t*Eh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-u)*this.ky;let f=h*h+c*c;f180;)t-=360;return t}};function vf(t,e){return e[0]-t[0]}function va(t){return t[1]-t[0]+1}function Ve(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];let r=va(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function lo(t,e){if(!Ve(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)Dn(r,t[i]);return r}function uo(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)Dn(e,i);return e}function Fh(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Fl(t,e,r){if(!Fh(t)||!Fh(e))return NaN;let i=0,n=0;return t[2]e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]=i)return i;if(an(n,a)){if(Th(t,e))return 0}else if(Th(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,h=u-1;l0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],h=e?50:100;if(va(u)<=h){if(!Ve(u,t.length))return NaN;if(e){let c=dm(t,u,r,i);if(isNaN(c)||c===0)return c;a=Math.min(a,c)}else for(let c=u[0];c<=u[1];++c){let p=fm(t[c],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let c=oo(u,e);kh(s,a,i,t,o,c[0]),kh(s,a,i,t,o,c[1])}}return a}function wa(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new xf([[0,[0,t.length-1],[0,r.length-1]]],vf);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=e?50:100,p=i?50:100;if(va(u)<=c&&va(h)<=p){if(!Ve(u,t.length)&&Ve(h,r.length))return NaN;let f;if(e&&i)f=cm(t,u,r,h,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=h[0];y<=h[1];++y)if(f=dr(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(h[0],h[1]+1);for(let y=u[0];y<=u[1];++y)if(f=dr(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=pm(t,u,r,h,n),s=Math.min(s,f)}else{let f=oo(u,e),d=oo(h,i);Zn(o,s,n,t,r,f[0],d[0]),Zn(o,s,n,t,r,f[0],d[1]),Zn(o,s,n,t,r,f[1],d[0]),Zn(o,s,n,t,r,f[1],d[1])}}return s}function mm(t,e){let r=t.geometry(),i=r.flat().map(s=>_l([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new El(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,wa(i,!1,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,wa(i,!1,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,ba(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function gm(t,e){let r=t.geometry(),i=r.flat().map(s=>_l([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new El(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,wa(i,!0,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,wa(i,!0,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,ba(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function xm(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=Na(r,0).map(s=>s.map(o=>o.map(l=>_l([l.x,l.y],t.canonical)))),n=new El(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case\"Point\":a=Math.min(a,ba([s.coordinates],!1,o,n,a));break;case\"LineString\":a=Math.min(a,ba(s.coordinates,!0,o,n,a));break;case\"Polygon\":a=Math.min(a,ym(o,s.coordinates,n,a))}if(a===0)return a}return a}function Vs(t){return t.type===\"MultiPolygon\"?t.coordinates.map(e=>({type:\"Polygon\",coordinates:e})):t.type===\"MultiLineString\"?t.coordinates.map(e=>({type:\"LineString\",coordinates:e})):t.type===\"MultiPoint\"?t.coordinates.map(e=>({type:\"Point\",coordinates:e})):[t]}var kl=class fa{constructor(e,r){this.type=I,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type===\"FeatureCollection\")return new fa(i,i.features.map(n=>Vs(n.geometry)).flat());if(i.type===\"Feature\")return new fa(i,Vs(i.geometry));if(\"type\"in i&&\"coordinates\"in i)return new fa(i,Vs(i))}return r.error(\"'distance' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===\"Point\")return mm(e,this.geometries);if(e.geometryType()===\"LineString\")return gm(e,this.geometries);if(e.geometryType()===\"Polygon\")return xm(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},vm=class bf{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=H;break}this.type=Ut(r!=null?r:H,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=St(i);if(n.kind===\"array\"){let a=i,s=r.concat(1),o=[];for(let l=0;lr.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},Il=class wf{constructor(e){this.key=e,this.type=H}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error(\"Global state property must be defined.\"):typeof i==\"string\"?new wf(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){var i,n;let r=(i=e.globals)==null?void 0:i.globalState;return!r||Object.keys(r).length===0?null:(n=Yi(r,this.key))!=null?n:null}eachChild(){}outputDefined(){return!1}},Yr={\"==\":U0,\"!=\":q0,\">\":G0,\"<\":j0,\">=\":Y0,\"<=\":X0,array:Be,at:S0,boolean:Be,case:k0,coalesce:of,collator:hf,format:Yp,image:Z0,in:E0,\"index-of\":F0,interpolate:De,\"interpolate-hcl\":De,\"interpolate-lab\":De,length:H0,let:Jp,literal:ri,match:T0,number:Be,\"number-format\":W0,object:Be,semiliteral:vm,slice:I0,step:Dl,string:Be,\"to-boolean\":jr,\"to-color\":jr,\"to-number\":jr,\"to-string\":jr,var:tf,within:Sl,distance:kl,\"global-state\":Il},ve=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},bm=class Df{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new Df(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},_f=class Af{constructor(e,r,i=[],n,a=new bm,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(\"\"),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r==null?this._parse(e,a):this.concat(r,i,n)._parse(e,a)}_parse(e,r){(e===null||typeof e==\"string\"||typeof e==\"boolean\"||typeof e==\"number\")&&(e=[\"literal\",e]);let i=this.key;function n(a,s,o){return o===\"assert\"?new Be(s,[a],i):o===\"coerce\"?new jr(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');let a=e[0];if(typeof a!=\"string\")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use [\"literal\", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind===\"string\"||l.kind===\"number\"||l.kind===\"boolean\"||l.kind===\"object\"||l.kind===\"array\")&&u.kind===\"value\")o=n(o,l,r.typeAnnotation||\"assert\");else if(l.kind===\"projectionDefinition\"&&[\"string\",\"array\",\"value\"].includes(u.kind)||[\"color\",\"formatted\",\"resolvedImage\"].includes(l.kind)&&[\"value\",\"string\"].includes(u.kind)||[\"padding\",\"numberArray\"].includes(l.kind)&&[\"value\",\"number\",\"array\"].includes(u.kind)||l.kind===\"colorArray\"&&[\"value\",\"string\",\"array\"].includes(u.kind)||l.kind===\"variableAnchorOffsetCollection\"&&[\"value\",\"array\"].includes(u.kind))o=n(o,l,r.typeAnnotation||\"coerce\");else if(this.checkSubtype(l,u))return null}if(!(o instanceof ri)&&o.type.kind!==\"resolvedImage\"&&this._isConstant(o)){let l=new Gp;try{o=new ri(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression \"${a}\". If you wanted a literal array, use [\"literal\", [...]].`,0)}return e===void 0?this.error(\"'undefined' value invalid. Use null instead.\"):typeof e==\"object\"?this.error('Bare objects invalid. Use [\"literal\", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e==\"number\"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new Af(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join(\"\")}`;this.errors.push(new ve(i,e))}checkSubtype(e,r){let i=nn(e,r);return i&&this.error(i),i}},Er=class Ui{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=Ui.definitions[i];if(!n)return r.error(`Unknown expression \"${i}\". If you wanted a literal array, use [\"literal\", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,h]of o){l=new _f(r.registry,Da,r.path,null,r.scope);let c=[],p=!1;for(let f=1;fDm(c)).join(\" | \"),h=[];for(let c=1;c>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function hr(t){return{type:t}}Er.register(Yr,{error:[o0,[W],(t,[e],r)=>{throw new ft(e.evaluate(t),r)}],typeof:[W,[H],(t,[e])=>mt(St(e.evaluate(t)))],\"to-rgba\":[Ut(I,4),[pe],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[pe,[I,I,I],Ih],rgba:[pe,[I,I,I,I],Ih],has:{type:Q,overloads:[[[W],(t,[e])=>Ch(e.evaluate(t),t.properties())],[[W,mr],(t,[e,r])=>Ch(e.evaluate(t),r.evaluate(t))]]},get:{type:H,overloads:[[[W],(t,[e])=>Os(e.evaluate(t),t.properties())],[[W,mr],(t,[e,r])=>Os(e.evaluate(t),r.evaluate(t))]]},\"feature-state\":[H,[W],(t,[e])=>Os(e.evaluate(t),t.featureState||{})],properties:[mr,[],t=>t.properties()],\"geometry-type\":[W,[],t=>t.geometryType()],id:[H,[],t=>t.id()],zoom:[I,[],t=>t.globals.zoom],\"heatmap-density\":[I,[],t=>t.globals.heatmapDensity||0],elevation:[I,[],t=>t.globals.elevation||0],\"line-progress\":[I,[],t=>t.globals.lineProgress||0],accumulated:[H,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],\"+\":[I,hr(I),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],\"*\":[I,hr(I),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],\"-\":{type:I,overloads:[[[I,I],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[I],(t,[e])=>-e.evaluate(t)]]},\"/\":[I,[I,I],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],\"%\":[I,[I,I],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[I,[],()=>Math.LN2],pi:[I,[],()=>Math.PI],e:[I,[],()=>Math.E],\"^\":[I,[I,I],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[I,[I],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[I,[I],(t,[e])=>Math.log(e.evaluate(t))],log2:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[I,[I],(t,[e])=>Math.sin(e.evaluate(t))],cos:[I,[I],(t,[e])=>Math.cos(e.evaluate(t))],tan:[I,[I],(t,[e])=>Math.tan(e.evaluate(t))],asin:[I,[I],(t,[e])=>Math.asin(e.evaluate(t))],acos:[I,[I],(t,[e])=>Math.acos(e.evaluate(t))],atan:[I,[I],(t,[e])=>Math.atan(e.evaluate(t))],min:[I,hr(I),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[I,hr(I),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[I,[I],(t,[e])=>Math.abs(e.evaluate(t))],round:[I,[I],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[I,[I],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[I,[I],(t,[e])=>Math.ceil(e.evaluate(t))],\"filter-==\":[Q,[W,H],(t,[e,r])=>t.properties()[e.value]===r.value],\"filter-id-==\":[Q,[H],(t,[e])=>t.id()===e.value],\"filter-type-==\":[Q,[W],(t,[e])=>t.geometryType()===e.value],\"filter-<\":[Q,[W,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{let r=t.id(),i=e.value;return typeof r==typeof i&&r\":[Q,[W,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],\"filter-id->\":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],\"filter-<=\":[Q,[W,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],\"filter-id-<=\":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],\"filter->=\":[Q,[W,H],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],\"filter-id->=\":[Q,[H],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],\"filter-has\":[Q,[H],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],\"filter-has-id\":[Q,[],t=>t.id()!==null&&t.id()!==void 0],\"filter-type-in\":[Q,[Ut(W)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],\"filter-id-in\":[Q,[Ut(H)],(t,[e])=>e.value.indexOf(t.id())>=0],\"filter-in-small\":[Q,[W,Ut(H)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],\"filter-in-large\":[Q,[W,Ut(H)],(t,[e,r])=>wm(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Q,overloads:[[[Q,Q],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[hr(Q),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:Q,overloads:[[[Q,Q],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[hr(Q),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},\"!\":[Q,[Q],(t,[e])=>!e.evaluate(t)],\"is-supported-script\":[Q,[W],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[W,[W],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[W,[W],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[W,hr(H),(t,e)=>e.map(r=>Wi(r.evaluate(t))).join(\"\")],split:[Ut(W),[W,W],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[W,[Ut(W),W],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],\"resolved-locale\":[W,[La],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Dm(t){return Array.isArray(t)?`(${t.map(mt).join(\", \")})`:`(${mt(t.type)}...)`}function Da(t){if(t instanceof tf)return Da(t.boundExpression);if(t instanceof Er&&t.name===\"error\"||t instanceof hf||t instanceof Sl||t instanceof kl||t instanceof Il)return!1;let e=t instanceof jr||t instanceof Be,r=!0;return t.eachChild(i=>{r&&(r=e?Da(i):i instanceof ri)}),r?qa(t)&&ja(t,[\"zoom\",\"heatmap-density\",\"elevation\",\"line-progress\",\"accumulated\",\"is-supported-script\"]):!1}function qa(t){if(t instanceof Er&&(t.name===\"get\"&&t.args.length===1||t.name===\"feature-state\"||t.name===\"has\"&&t.args.length===1||t.name===\"properties\"||t.name===\"geometry-type\"||t.name===\"id\"||/^filter-/.test(t.name))||t instanceof Sl||t instanceof kl)return!1;let e=!0;return t.eachChild(r=>{e&&!qa(r)&&(e=!1)}),e}function sn(t){if(t instanceof Er&&t.name===\"feature-state\")return!1;let e=!0;return t.eachChild(r=>{e&&!sn(r)&&(e=!1)}),e}function ja(t,e){if(t instanceof Er&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!ja(i,e)&&(r=!1)}),r}function ii(t){return t[\"property-type\"]===\"data-driven\"||t[\"property-type\"]===\"cross-faded-data-driven\"}function Sf(t){return!!t.expression&&t.expression.parameters.indexOf(\"zoom\")>-1}function Cl(t){return!!t.expression&&t.expression.interpolated}var Ml=/^(.*)-transition$/;function on(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function J(t){return t instanceof Number?\"number\":t instanceof String?\"string\":t instanceof Boolean?\"boolean\":Array.isArray(t)?\"array\":t===null?\"null\":typeof t}function Ga(t){return typeof t==\"object\"&&!!t&&!Array.isArray(t)&&St(t)===mr}function _m(t){return t}function Am(t){switch(t.type){case\"color\":return xt.parse;case\"padding\":return Ee.parse;case\"numberArray\":return Fe.parse;case\"colorArray\":return ue.parse;default:return null}}function Sm(t){switch(t){case\"exponential\":return Ff;case\"interval\":return Fm;case\"categorical\":return Em;case\"identity\":return Tm;default:throw Error(`Unknown function type \"${t}\"`)}}function Ef(t,e){let r=t.stops&&typeof t.stops[0][0]==\"object\",i=r||t.property!==void 0,n=r||!i,a=t.type||(Cl(e)?\"exponential\":\"interval\"),s=Am(e);if(s&&(t=on({},t),t.stops&&(t.stops=t.stops.map(h=>[h[0],s(h[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!g0(t.colorSpace))throw Error(`Unknown color space: \"${t.colorSpace}\"`);let o=Sm(a),l,u;if(a===\"categorical\"){l=Object.create(null);for(let h of t.stops)l[h[0]]=h[1];u=typeof t.stops[0][0]}if(r){let h={},c=[];for(let d=0;dd[0]),evaluate({zoom:d},y){return Ff({stops:p,base:t.base},e,d).evaluate(d,y)}}}if(n){let h=a===\"exponential\"?{name:\"exponential\",base:t.base===void 0?1:t.base}:null;return{kind:\"camera\",interpolationType:h,interpolationFactor:De.interpolationFactor.bind(void 0,h),zoomStops:t.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(t,e,c,l,u)}}return{kind:\"source\",evaluate(h,c){let p=c&&c.properties?c.properties[t.property]:void 0;return p===void 0?_n(t.default,e.default):o(t,e,p,l,u)}}}function _n(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function Em(t,e,r,i,n){return _n(typeof r===n?i[r]:void 0,t.default,e.default)}function Fm(t,e,r){if(J(r)!==\"number\")return _n(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=$a(t.stops.map(a=>a[0]),r,\"\");return t.stops[n][1]}function Ff(t,e,r){let i=t.base===void 0?1:t.base;if(J(r)!==\"number\")return _n(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=$a(t.stops.map(h=>h[0]),r,\"\"),s=km(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=br[e.type]||_m;return typeof o.evaluate==\"function\"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function Tm(t,e,r){switch(e.type){case\"color\":r=xt.parse(r);break;case\"formatted\":r=Le.fromString(r.toString());break;case\"resolvedImage\":r=Se.fromString(r.toString());break;case\"padding\":r=Ee.parse(r);break;case\"colorArray\":r=ue.parse(r);break;case\"numberArray\":r=Fe.parse(r);break;default:J(r)!==e.type&&(e.type!==\"enum\"||!e.values[r])&&(r=void 0)}return _n(r,t.default,e.default)}function km(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}function ho(t){return{result:\"success\",value:t}}function Nr(t){return{result:\"error\",value:t}}var Bl=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new Gp,this._defaultValue=r?Bf(r):null,this._enumValues=r&&r.type===\"enum\"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s==\"number\"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ft(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(\", \")}, but found ${JSON.stringify(s)} instead.`,\"\");return s}catch(s){let o=s instanceof ft?s.path:\"\",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<\"u\"&&console.warn(Tf(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function Tf(t,e,r,i){return`${t}${e}: ${r}${i==null?\"\":` Falling back to ${String(i)}.`}`}function kf(t){if(!t)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. \"layers[3].paint.line-width\".')}function Xa(t){return Array.isArray(t)&&t.length>0&&typeof t[0]==\"string\"&&t[0]in Yr}function ar(t,e,r,i){kf(e);let n=new _f(Yr,Da,[],r?Mm(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type===\"string\"?{typeAnnotation:\"coerce\"}:void 0);return a?ho(new Bl(a,e,r,i)):Nr(n.errors)}var ln=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!==\"constant\"&&!sn(e.expression),this.globalStateRefs=An(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},_a=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!==\"camera\"&&!sn(e.expression),this.globalStateRefs=An(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?De.interpolationFactor(this.interpolationType,t,e,r):0}};function Im(t){return t._styleExpression!==void 0}function If(t,e,r,i){let n=ar(t,e,r,i);if(n.result===\"error\")return n;let a=n.value.expression,s=qa(a);if(!s&&!ii(r))return Nr([new ve(\"\",\"data expressions not supported\")]);let o=ja(a,[\"zoom\"]);if(!o&&!Sf(r))return Nr([new ve(\"\",\"zoom expressions not supported\")]);let l=da(a);if(!l&&!o)return Nr([new ve(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);if(l instanceof ve)return Nr([l]);if(l instanceof De&&!Cl(r))return Nr([new ve(\"\",'\"interpolate\" expressions cannot be used with this property')]);if(!l)return ho(s?new ln(\"constant\",n.value,i):new ln(\"source\",n.value,i));let u=l instanceof De?l.interpolation:void 0;return ho(s?new _a(\"camera\",n.value,l.labels,u,i):new _a(\"composite\",n.value,l.labels,u,i))}var Cf=class Mf{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,kf(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=Bf(i),this._warningHistory={};let n=Ef(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<\"u\"&&console.warn(Tf(this._rootKey,\"\",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new Mf(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function Cm(t,e,r,i){if(Ga(t))return new Cf(t,e,r);if(Xa(t)){let n=If(t,e,r,i);if(n.result===\"error\")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(\", \"));return n.value}{let n=t;return r.type===\"color\"&&typeof t==\"string\"?n=xt.parse(t):r.type===\"padding\"&&(typeof t==\"number\"||Array.isArray(t))?n=Ee.parse(t):r.type===\"numberArray\"&&(typeof t==\"number\"||Array.isArray(t))?n=Fe.parse(t):r.type===\"colorArray\"&&(typeof t==\"string\"||Array.isArray(t))?n=ue.parse(t):r.type===\"variableAnchorOffsetCollection\"&&Array.isArray(t)?n=Ae.parse(t):r.type===\"projectionDefinition\"&&typeof t==\"string\"&&(n=Sr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:\"constant\",evaluate:()=>n}}}function da(t){let e=null;if(t instanceof Jp)e=da(t.result);else if(t instanceof of){for(let r of t.args)if(e=da(r),e)break}else(t instanceof Dl||t instanceof De)&&t.input instanceof Er&&t.input.name===\"zoom\"&&(e=t);return e instanceof ve||t.eachChild(r=>{let i=da(r);i instanceof ve?e=i:!e&&i?e=new ve(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.'):e&&i&&e!==i&&(e=new ve(\"\",'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.'))}),e}function An(t,e=new Set){return t instanceof Il&&e.add(t.key),t.eachChild(r=>{An(r,e)}),e}function Mm(t){let e={color:pe,string:W,number:I,enum:W,boolean:Q,formatted:bn,padding:Va,numberArray:Oa,colorArray:rn,projectionDefinition:za,resolvedImage:wn,variableAnchorOffsetCollection:Ra};return t.type===\"array\"?Ut(e[t.value]||H,t.length):e[t.type]}function Bf(t){if(t.type===\"color\"&&Ga(t.default))return new xt(0,0,0,0);switch(t.type){case\"color\":return xt.parse(t.default)||null;case\"padding\":return Ee.parse(t.default)||null;case\"numberArray\":return Fe.parse(t.default)||null;case\"colorArray\":return ue.parse(t.default)||null;case\"variableAnchorOffsetCollection\":return Ae.parse(t.default)||null;case\"projectionDefinition\":return Sr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function ni(t,e){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=t!=null?t:{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:e}}function Bm(t){let e=!1;for(let r of t){let i=Pf(r);if(i===\"expression\")return\"expression\";i===\"legacy\"&&(e=!0)}return e?\"legacy\":\"neutral\"}function Pf(t){if(typeof t==\"boolean\")return\"neutral\";if(!Array.isArray(t)||t.length===0)return\"legacy\";switch(t[0]){case\"has\":return t.length<2||t[1]===\"$id\"||t[1]===\"$type\"?\"legacy\":t.length===2?\"neutral\":\"expression\";case\"in\":return t.length>=3&&(typeof t[1]!=\"string\"||Array.isArray(t[2]))?\"expression\":\"legacy\";case\"!in\":case\"!has\":return\"legacy\";case\"==\":case\"!=\":case\">\":case\">=\":case\"<\":case\"<=\":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?\"expression\":\"legacy\";case\"none\":return\"legacy\";case\"any\":case\"all\":return Bm(t.slice(1));default:return\"expression\"}}function Pl(t){return Pf(t)!==\"legacy\"}function Mh(t){return t===\"$type\"?[\"geometry-type\"]:t===\"$id\"?[\"id\"]:[\"get\",t]}function Pm(t){switch(t[0]){case\"==\":case\"!=\":case\"<\":case\"<=\":case\">\":case\">=\":return t.length!==3||typeof t[1]!=\"string\"?null:[t[0],Mh(t[1]),t[2]];case\"in\":case\"!in\":{if(t.length<2||typeof t[1]!=\"string\")return null;let e=[\"in\",Mh(t[1]),[\"literal\",t.slice(2)]];return t[0]===\"!in\"?[\"!\",e]:e}case\"has\":case\"!has\":{if(t.length!==2||typeof t[1]!=\"string\"||t[1]===\"$type\"||t[1]===\"$id\")return null;let e=[\"has\",t[1]];return t[0]===\"!has\"?[\"!\",e]:e}default:return null}}function zf(t){if((t[0]===\"<\"||t[0]===\"<=\"||t[0]===\">\"||t[0]===\">=\")&&t[1]===\"$type\")return`\"$type\" cannot be use with operator \"${t[0]}\"`;let e=Pm(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function Rs(t,e,r){let i=r[t];return Array.isArray(i)?Pl(i)?zl(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function zl(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case\"all\":case\"any\":case\"none\":for(let r=1;r\"u\")return;let i=r.path.map(n=>`[${n}]`).join(\"\");console.warn(`${e}${i}: ${zf(r.legacyFilter)}`)}var Lm={type:\"boolean\",default:!1,transition:!1,\"property-type\":\"data-driven\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]}};function ai(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Pl(t)?zm(t,e):t=Aa(t);let i=ar(t,e,Lm,r);if(i.result===\"error\")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(\", \"));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:Lf(t),getGlobalStateRefs:()=>An(i.value.expression)}}function Vm(t,e){return te)}function Lf(t){if(!Array.isArray(t))return!1;if(t[0]===\"within\"||t[0]===\"distance\")return!0;for(let e=1;e\"||e===\"<=\"||e===\">=\"?$s(t[1],t[2],e):e===\"any\"?Om(t.slice(1)):e===\"all\"?[\"all\"].concat(t.slice(1).map(Aa)):e===\"none\"?[\"all\"].concat(t.slice(1).map(Aa).map(Hn)):e===\"in\"?Bh(t[1],t.slice(2)):e===\"!in\"?Hn(Bh(t[1],t.slice(2))):e===\"has\"?Ph(t[1]):e!==\"!has\"||Hn(Ph(t[1]))}function $s(t,e,r){switch(t){case\"$type\":return[`filter-type-${r}`,e];case\"$id\":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Om(t){return[\"any\"].concat(t.map(Aa))}function Bh(t,e){if(e.length===0)return!1;switch(t){case\"$type\":return[\"filter-type-in\",[\"literal\",e]];case\"$id\":return[\"filter-id-in\",[\"literal\",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?[\"filter-in-large\",t,[\"literal\",e.sort(Vm)]]:[\"filter-in-small\",t,[\"literal\",e]]}}function Ph(t){switch(t){case\"$type\":return!0;case\"$id\":return[\"filter-has-id\"];default:return[\"filter-has\",t]}}function Hn(t){return[\"!\",t]}function Vf(t){let e=t.key,r=t.value;return r?[new E(e,r,\"constants have been deprecated as of v8\")]:[]}function _t(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function wr(t){if(Array.isArray(t))return t.map(wr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=wr(t[r]);return e}return _t(t)}function ee(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=J(r);if(u!==\"object\")return[new E(e,r,`object expected, ${u} found`)];for(let h in r){let c=h.split(\".\")[0],p=Yi(i,c)||i[\"*\"],f;if(Yi(n,c))f=n[c];else if(Yi(i,c)){if(r[h]===void 0)continue;f=o}else if(n[\"*\"])f=n[\"*\"];else if(i[\"*\"])f=o;else{l.push(new E(e,r[h],`unknown property \"${h}\"`));continue}l=l.concat(f({key:(e&&`${e}.`)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h,validateSpec:o},r))}for(let h in i)n[h]||i[h].required&&i[h].default===void 0&&r[h]===void 0&&l.push(new E(e,r,`missing required property \"${h}\"`));return l}function Ll(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(J(e)!==\"array\")return[new E(s,e,`array expected, ${J(e)} found`)];if(r.length&&e.length!==r.length)return[new E(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),J(r.value)===\"object\"&&(l=r.value);let u=[];for(let h=0;hi.maximum?[new E(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new E(e,r,`number expected, ${n} found`)]}function Of(t){let e=t.valueSpec,r=_t(t.value.type),i,n={},a,s,o=r!==\"categorical\"&&t.value.property===void 0,l=!o,u=J(t.value.stops)===\"array\"&&J(t.value.stops[0])===\"array\"&&J(t.value.stops[0][0])===\"object\",h=ee({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:c,default:d}});return r===\"identity\"&&o&&h.push(new E(t.key,t.value,'missing required property \"property\"')),r!==\"identity\"&&!t.value.stops&&h.push(new E(t.key,t.value,'missing required property \"stops\"')),r===\"exponential\"&&t.valueSpec.expression&&!Cl(t.valueSpec)&&h.push(new E(t.key,t.value,\"exponential functions not supported\")),t.styleSpec.$version>=8&&(l&&!ii(t.valueSpec)?h.push(new E(t.key,t.value,\"property functions not supported\")):o&&!Sf(t.valueSpec)&&h.push(new E(t.key,t.value,\"zoom functions not supported\"))),(r===\"categorical\"||u)&&t.value.property===void 0&&h.push(new E(t.key,t.value,'\"property\" property is required')),h;function c(y){if(r===\"identity\")return[new E(y.key,y.value,'identity function may not have a \"stops\" property')];let m=[],g=y.value;return m=m.concat(Ll({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),J(g)===\"array\"&&g.length===0&&m.push(new E(y.key,g,\"array must have at least one stop\")),m}function p(y){let m=[],g=y.value,x=y.key;if(J(g)!==\"array\")return[new E(x,g,`array expected, ${J(g)} found`)];if(g.length!==2)return[new E(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(J(g[0])!==\"object\")return[new E(x,g,`object expected, ${J(g[0])} found`)];if(g[0].zoom===void 0)return[new E(x,g,\"object stop key must have zoom\")];if(g[0].value===void 0)return[new E(x,g,\"object stop key must have value\")];if(s&&s>_t(g[0].zoom))return[new E(x,g[0].zoom,\"stop zoom values must appear in ascending order\")];_t(g[0].zoom)!==s&&(s=_t(g[0].zoom),a=void 0,n={}),m=m.concat(ee({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:Ya,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return Xa(wr(g[1]))?m.concat([new E(`${x}[1]`,g[1],\"expressions are not allowed in function stops.\")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=J(y.value),x=_t(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new E(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!==\"number\"&&g!==\"string\"&&g!==\"boolean\")return[new E(y.key,v,\"stop domain value must be a number, string, or boolean\")];if(g!==\"number\"&&r!==\"categorical\"){let b=`number expected, ${g} found`;return ii(e)&&r===void 0&&(b+='\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.'),[new E(y.key,v,b)]}return r===\"categorical\"&&g===\"number\"&&(!isFinite(x)||Math.floor(x)!==x)?[new E(y.key,v,`integer expected, found ${x}`)]:r!==\"categorical\"&&g===\"number\"&&a!==void 0&&xnew E(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext===\"property\"&&t.propertyKey===\"text-font\"&&!r.outputDefined())return[new E(t.key,t.value,`Invalid data expression for \"${t.propertyKey}\". Output values must be contained as literals within the expression.`)];if(t.expressionContext===\"property\"&&t.propertyType===\"layout\"&&!sn(r))return[new E(t.key,t.value,'\"feature-state\" data expressions are not supported with layout properties.')];if(t.expressionContext===\"filter\"&&!sn(r))return[new E(t.key,t.value,'\"feature-state\" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf(\"cluster\")===0){if(!ja(r,[\"zoom\",\"feature-state\"]))return[new E(t.key,t.value,'\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')];if(t.expressionContext===\"cluster-initial\"&&!qa(r))return[new E(t.key,t.value,\"Feature data expressions are not supported with initial expression part of cluster properties.\")]}return[]}function Rm(t){let e=t.value,r=t.key,i=J(e);return i===\"boolean\"?[]:[new E(r,e,`boolean expected, ${i} found`)]}function co(t){let e=t.key,r=t.value,i=J(r);return i===\"string\"?xt.parse(String(r))?[]:[new E(e,r,`color expected, \"${r}\" found`)]:[new E(e,r,`color expected, ${i} found`)]}function un(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(_t(r))===-1&&n.push(new E(e,r,`expected one of [${i.values.join(\", \")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(_t(r))===-1&&n.push(new E(e,r,`expected one of [${Object.keys(i.values).join(\", \")}], ${JSON.stringify(r)} found`)),n}function $m(t,e){let r=t;for(let i of e)r=r[i];return r}function Nm(t,e){let r=zl(e);return r?[new E(`${t.key}${r.path.map(i=>`[${i}]`).join(\"\")}`,$m(t.value,r.path),zf(r.legacyFilter),null,\"warning\")]:[]}function Vl(t){let e=wr(t.value);return Pl(e)?[...Nm(t,e),...si(on({},t,{expressionContext:\"filter\",valueSpec:{value:\"boolean\"}}))]:Rf(t)}function Rf(t){let e=t.value,r=t.key;if(J(e)!==\"array\")return[new E(r,e,`array expected, ${J(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new E(r,e,\"filter array must have at least 1 element\")];switch(a=a.concat(un({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),_t(e[0])){case\"<\":case\"<=\":case\">\":case\">=\":e.length>=2&&_t(e[1])===\"$type\"&&a.push(new E(r,e,`\"$type\" cannot be use with operator \"${e[0]}\"`));case\"==\":case\"!=\":e.length!==3&&a.push(new E(r,e,`filter array for operator \"${e[0]}\" must have 3 elements`));case\"in\":case\"!in\":e.length>=2&&(n=J(e[1]),n!==\"string\"&&a.push(new E(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s{c in r&&e.push(new E(i,r[c],`\"${c}\" is prohibited for ref layers`))});let h;n.layers.forEach(c=>{_t(c.id)===o&&(h=c)}),h?h.ref?e.push(new E(i,r.ref,\"ref cannot reference another ref layer\")):s=_t(h.type):e.push(new E(i,r.ref,`ref layer \"${o}\" not found`))}else if(s!==\"background\")if(!r.source)e.push(new E(i,r,'missing required property \"source\"'));else{let h=n.sources&&n.sources[r.source],c=h&&_t(h.type);h?c===\"vector\"&&s===\"raster\"?e.push(new E(i,r.source,`layer \"${r.id}\" requires a raster source`)):c!==\"raster-dem\"&&s===\"hillshade\"||c!==\"raster-dem\"&&s===\"color-relief\"?e.push(new E(i,r.source,`layer \"${r.id}\" requires a raster-dem source`)):c===\"raster\"&&s!==\"raster\"?e.push(new E(i,r.source,`layer \"${r.id}\" requires a vector source`)):c===\"vector\"&&!r[\"source-layer\"]?e.push(new E(i,r,`layer \"${r.id}\" must specify a \"source-layer\"`)):c===\"raster-dem\"&&s!==\"hillshade\"&&s!==\"color-relief\"?e.push(new E(i,r.source,\"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\")):s===\"line\"&&r.paint&&r.paint[\"line-gradient\"]&&(c!==\"geojson\"||!h.lineMetrics)&&e.push(new E(i,r,`layer \"${r.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new E(i,r.source,`source \"${r.source}\" not found`))}return s===\"raster\"&&((l=r.paint)!=null&&l.resampling)&&((u=r.paint)!=null&&u[\"raster-resampling\"])&&e.push(new E(i,r.paint,`layer \"${r.id}\" redundantly specifies \"resampling\" and \"raster-resampling\" paint properties, but only one is allowed. It is advised to use \"resampling\".`)),e=e.concat(ee({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{\"*\"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:\"type\"})},filter:Vl,layout(h){return ee({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{\"*\"(c){return Uf(on({layerType:s},c))}}})},paint(h){return ee({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{\"*\"(c){return Nf(on({layerType:s},c))}}})}}})),e}function ir(t){let e=t.value,r=t.key,i=J(e);return i===\"string\"?[]:[new E(r,e,`string expected, ${i} found`)]}function Um(t){var c;let e=(c=t.sourceName)!=null?c:\"\",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=J(r);if(r===void 0)return s;if(o!==\"object\")return s.push(new E(\"source_raster_dem\",r,`object expected, ${o} found`)),s;let l=_t(r.encoding)===\"custom\",u=[\"redFactor\",\"greenFactor\",\"blueFactor\",\"baseShift\"],h=t.value.encoding?`\"${t.value.encoding}\"`:\"Default\";for(let p in r)!l&&u.includes(p)?s.push(new E(p,r[p],`In \"${e}\": \"${p}\" is only valid when \"encoding\" is set to \"custom\". ${h} encoding found`)):n[p]?s=s.concat(t.validateSpec({key:p,value:r[p],valueSpec:n[p],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new E(p,r[p],`unknown property \"${p}\"`));return s}var zh={promoteId:qm};function jf(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new E(r,e,'\"type\" is required')];let s=_t(e.type),o;switch(s){case\"vector\":case\"raster\":return o=ee({key:r,value:e,valueSpec:i[`source_${s.replace(\"-\",\"_\")}`],style:t.style,styleSpec:i,objectElementValidators:zh,validateSpec:a}),o;case\"raster-dem\":return o=Um({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case\"geojson\":if(o=ee({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:zh}),e.cluster)for(let l in e.clusterProperties){let[u,h]=e.clusterProperties[l],c=typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u;o.push(...si({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:\"cluster-map\"})),o.push(...si({key:`${r}.${l}.reduce`,value:c,validateSpec:a,expressionContext:\"cluster-reduce\"}))}return o;case\"video\":return ee({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case\"image\":return ee({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case\"canvas\":return[new E(r,null,\"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.\",\"source.canvas\")];default:return un({key:`${r}.type`,value:e.type,valueSpec:{values:[\"vector\",\"raster\",\"raster-dem\",\"geojson\",\"video\",\"image\"]},style:n,validateSpec:a,styleSpec:i})}}function qm({key:t,value:e}){if(J(e)===\"string\")return ir({key:t,value:e});{let r=[];for(let i in e)r.push(...ir({key:`${t}.${i}`,value:e[i]}));return r}}function Gf(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=J(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new E(\"light\",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(Ml);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property \"${o}\"`)])}return a}function Xf(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=J(e);if(e===void 0)return[];if(a!==\"object\")return[new E(\"sky\",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(Ml);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new E(o,e[o],`unknown property \"${o}\"`)])}return s}function Yf(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=J(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new E(\"terrain\",e,`object expected, ${s} found`)]),a;for(let o in e)a=i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property \"${o}\"`)]);return a}function jm(t){return ir(t).length===0?[]:si(t)}function Gm(t){return ir(t).length===0?[]:si(t)}function Xm(t){let e=t.key,r=t.value;if(J(r)===\"array\"){if(r.length<1||r.length>4)return[new E(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:\"number\"},n=[];for(let a=0;a[new E(t,e,'invalid unicode range, expected a value such as \"U+26\", \"U+0-10FFFF\" or \"U+4??\"')],n=r.match(tg);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Lh||u>Lh?[new E(t,e,\"unicode range is out of bounds, the maximum code point is U+10FFFF\")]:l>u?[new E(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function Hf(t){var o,l;let e=(o=t.key)!=null?o:\"font-faces\",r=t.value,i=t.validateSpec,n=(l=t.styleSpec)!=null?l:Bp,a=t.style;if(!po(r))return[new E(e,r,`object expected, ${J(r)} found`)];let s=[];for(let u in r){let h=r[u],c=J(h);if(c===\"string\")s.push(...ir({key:`${e}.${u}`,value:h}));else if(c===\"array\"){let p={url:{type:\"string\",required:!0},\"unicode-range\":{type:\"array\",value:\"string\"}};for(let[f,d]of h.entries()){let y=`${e}.${u}[${f}]`;s.push(...ee({key:y,value:d,valueSpec:p,styleSpec:n,style:a,validateSpec:i}));let m=po(d)?d[\"unicode-range\"]:void 0;if(J(m)===\"array\")for(let[g,x]of m.entries())s.push(...eg(`${y}.unicode-range[${g}]`,x))}}else s.push(new E(`${e}.${u}`,h,`string or array expected, ${c} found`))}return s}var Vh={\"*\"(){return[]},array:Ll,boolean:Rm,number:Ya,color:co,constants:Vf,enum:un,filter:Vl,function:Of,layer:qf,object:ee,source:jf,light:Gf,sky:Xf,terrain:Yf,projection:Hm,projectionDefinition:Km,string:ir,formatted:jm,resolvedImage:Gm,padding:Xm,numberArray:Ym,colorArray:Wm,variableAnchorOffsetCollection:Zm,sprite:Wf,state:Zf,fontFaces:Hf};function Zi(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=Zi,r.expression&&Ga(_t(e))?Of(t):r.expression&&Xa(wr(e))?si(t):r.type&&Vh[r.type]?Vh[r.type](t):ee(on({},t,{valueSpec:r.type?i[r.type]:r}))}function Kf(t){let e=t.value,r=t.key,i=ir(t);return i.length||(e.indexOf(\"{fontstack}\")===-1&&i.push(new E(r,e,'\"glyphs\" url must include a \"{fontstack}\" token')),e.indexOf(\"{range}\")===-1&&i.push(new E(r,e,'\"glyphs\" url must include a \"{range}\" token'))),i}function te(t,e=D){let r=[];return r=r.concat(Zi({key:\"\",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Zi,objectElementValidators:{glyphs:Kf,\"*\"(){return[]}}})),t.constants&&(r=r.concat(Vf({key:\"constants\",value:t.constants,style:t,styleSpec:e,validateSpec:Zi}))),Jf(r)}te.source=ae(ne(jf)),te.sprite=ae(ne(Wf)),te.glyphs=ae(ne(Kf)),te.fontFaces=ae(ne(Hf)),te.light=ae(ne(Gf)),te.sky=ae(ne(Xf)),te.terrain=ae(ne(Yf)),te.state=ae(ne(Zf)),te.layer=ae(ne(qf)),te.filter=ae(ne(Vl)),te.paintProperty=ae(ne(Nf)),te.layoutProperty=ae(ne(Uf));function ne(t){return function(e){return t(Object.assign({},e,{validateSpec:Zi}))}}function Jf(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function ae(t){return function(...e){return Jf(t.apply(this,e))}}var rg={type:\"enum\",\"property-type\":\"data-constant\",expression:{interpolated:!1,parameters:[\"global-state\"]},values:{visible:{},none:{}},transition:!1,default:\"visible\"},ig=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){var t;return(t=this._literalValue)!=null?t:this._compiledValue.evaluate({})}setValue(t){if(t==null||t===\"visible\"||t===\"none\"){this._literalValue=t===\"none\"?\"none\":\"visible\",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=ar(t,this._rootKey,rg,this._globalState);if(e.result===\"error\")throw this._literalValue=\"visible\",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(\", \"));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=An(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function ng(t,e,r){return new ig(t,e,r)}var Oh=te,_5=new Set(Object.keys(D).filter(t=>t.startsWith(\"source_\")).map(t=>t.slice(7).replaceAll(\"_\",\"-\")));function ag(t,e){let r=!1;for(let i of e){if(i.severity===\"warning\"){Mt(i.message);continue}t.fire(new xa(Error(i.message))),r=!0}return r}function sg(t,e,r,i){return(i==null?void 0:i.validate)!==!1&&ag(t,e(Xe({styleSpec:D},r)))}var fo=class Qf{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u=c[f+0]&&n>=c[f+1])?(o[p]=!0,s.push(h[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=c;f++)for(let d=h;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;sr?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},hn=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=Cm(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind===\"source\"||this.expression.kind===\"composite\"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}readsGlobalState(t){let e=this.getGlobalStateRefs();return t.some(r=>e.has(r))}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},yo=class{constructor(t,e,r){this.property=t,this.value=new hn(t,void 0,e,r)}transitioned(t,e){return e.value===this.value?e:new $h(this.property,this.value,e,Xt({},t.transition,this.transition),t.now)}untransitioned(){return new $h(this.property,this.value,null,{},0)}},lg=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return Je(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new yo(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new hn(this._values[t].property,e===null?void 0:Je(e),this._propertyRootKey(t),this._globalState)}setValues(t){for(let e in t){let r=t[e];e.endsWith(\"-transition\")?this.setTransition(e.slice(0,-11),r):to(this._values[e].value.value,r)||this.setValue(e,r)}}getTransition(t){return Je(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new yo(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=Je(e)||void 0}retainPriorGlobalState(t,e,r){for(let i of Object.keys(r._values))for(let n=r._values[i];n;n=n.prior){let{value:a}=n;a.property.specification.transition&&!a.isDataDriven()&&a.expression._globalState===this._globalState&&a.readsGlobalState(t)&&(n.value=new hn(a.property,a.value,this._propertyRootKey(i),e))}}applyGlobalStateChange(t,e,r,i){this.retainPriorGlobalState(t,e,r);let n=!1;for(let a of Object.keys(this._values)){let{value:s}=this._values[a];s.readsGlobalState(t)&&(this.setValue(a,s.value),n=!0)}return n?this.transitioned(i,r):r}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}-transition`]=i)}return t}transitioned(t,e){let r=new Nh(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new Nh(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},$h=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(ii.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},id=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind===\"constant\"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new st(Math.floor(e.zoom-1),e)),t.expression.evaluate(new st(Math.floor(e.zoom),e)),t.expression.evaluate(new st(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Za=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Yt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new hn(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new yo(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};C(\"DataDrivenProperty\",U),C(\"DataConstantProperty\",R),C(\"CrossFadedDataDrivenProperty\",cn),C(\"CrossFadedProperty\",id),C(\"ColorRampProperty\",Za);var qh=\" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?\",Ns=\" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?\",ye=class extends s0{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=ng(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!==\"custom\"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!==\"background\"&&(this.source=t.source,this.sourceLayer=t[\"source-layer\"],this.filter=t.filter,this._featureFilter=ai(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new ug(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new lg(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Wa(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=ai(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){var e;if(t===\"visibility\")return this.visibility;if((e=this._transitionablePaint)!=null&&e.hasProperty(t))throw Error(t+qh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property \"${t}\" on layer type \"${this.type}\" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){var e;let t=new globalThis.Map;if(this._transitionablePaint)for(let r in this._transitionablePaint._values){let i=this._transitionablePaint._values[r].value;for(let n of i.getGlobalStateRefs()){let a=(e=t.get(n))!=null?e:[];a.push({name:r,value:i.value}),t.set(n,a)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){var i;if(t===\"visibility\"){this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility();return}if((i=this._transitionablePaint)!=null&&i.hasProperty(t)){this.fire(new xa(Error(t+qh)));return}e!=null&&this._validate(Oh.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){var e,r;if(t.endsWith(\"-transition\")){let i=t.slice(0,-11);if(i===\"visibility\"||(e=this._unevaluatedLayout)!=null&&e.hasProperty(i))throw Error(t+Ns);return this._transitionablePaint.getTransition(i)}if(t===\"visibility\"||(r=this._unevaluatedLayout)!=null&&r.hasProperty(t))throw Error(t+Ns);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){var i;if(t===\"visibility\"||(i=this._unevaluatedLayout)!=null&&i.hasProperty(t))return this.fire(new xa(Error(t+Ns))),!1;if(e!=null&&this._validate(Oh.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(\"-transition\"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let n=this._transitionablePaint._values[t],a=n.property.specification[\"property-type\"]===\"cross-faded-data-driven\",s=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let l=this._transitionablePaint._values[t].value;return l.isDataDriven()||s||a||this._handleOverridablePaintPropertyUpdate(t,o,l)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility===\"none\"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}retainPriorGlobalState(t,e){var r;(r=this._transitionablePaint)==null||r.retainPriorGlobalState(t,e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){var e,r;let t={id:this.id,type:this.type,source:this.source,\"source-layer\":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)==null?void 0:e.serialize(),paint:(r=this._transitionablePaint)==null?void 0:r.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),K1(t,(i,n)=>i!==void 0&&!(n===\"layout\"&&!Object.keys(i).length)&&!(n===\"paint\"&&!Object.keys(i).length))}_validate(t,e,r,i,n={}){return sg(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof le&&ii(e.property.specification)&&(e.value.kind===\"source\"||e.value.kind===\"composite\")&&e.value.isStateDependent)return!0}return!1}},jh,hg=()=>jh||(jh=new Yt({\"raster-opacity\":new R(D.paint_raster[\"raster-opacity\"],\"raster-opacity\"),\"raster-hue-rotate\":new R(D.paint_raster[\"raster-hue-rotate\"],\"raster-hue-rotate\"),\"raster-brightness-min\":new R(D.paint_raster[\"raster-brightness-min\"],\"raster-brightness-min\"),\"raster-brightness-max\":new R(D.paint_raster[\"raster-brightness-max\"],\"raster-brightness-max\"),\"raster-saturation\":new R(D.paint_raster[\"raster-saturation\"],\"raster-saturation\"),\"raster-contrast\":new R(D.paint_raster[\"raster-contrast\"],\"raster-contrast\"),resampling:new R(D.paint_raster.resampling,\"resampling\"),\"raster-resampling\":new R(D.paint_raster[\"raster-resampling\"],\"raster-resampling\"),\"raster-fade-duration\":new R(D.paint_raster[\"raster-fade-duration\"],\"raster-fade-duration\")})),cg={get paint(){return hg()}};var pg=class extends ye{constructor(t,e){super(t,cg,e)}},fg={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Sn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},vt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error(\"_refreshViews() must be implemented by each concrete StructArray layout\")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function Et(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=dg(n.type),s=r=Gh(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:Gh(r,Math.max(i,e)),alignment:e}}function dg(t){return fg[t].BYTES_PER_ELEMENT}function Gh(t,e){return Math.ceil(t/e)*e}var pn=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};pn.prototype.bytesPerElement=4,C(\"StructArrayLayout2i4\",pn);var mo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};mo.prototype.bytesPerElement=6,C(\"StructArrayLayout3i6\",mo);var Xh=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Xh.prototype.bytesPerElement=8,C(\"StructArrayLayout4i8\",Xh);var go=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};go.prototype.bytesPerElement=12,C(\"StructArrayLayout2i4i12\",go);var xo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*4,l=t*8;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,t}};xo.prototype.bytesPerElement=8,C(\"StructArrayLayout2i4ub8\",xo);var fn=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};fn.prototype.bytesPerElement=8,C(\"StructArrayLayout2f8\",fn);var vo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,h){let c=t*10;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};vo.prototype.bytesPerElement=20,C(\"StructArrayLayout10ui20\",vo);var bo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};bo.prototype.bytesPerElement=16,C(\"StructArrayLayout8ui16\",bo);var wo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,h,c,p)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[y+6]=f,t}};wo.prototype.bytesPerElement=28,C(\"StructArrayLayout4i4ui4i1f28\",wo);var Do=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};Do.prototype.bytesPerElement=12,C(\"StructArrayLayout3f12\",Do);var _o=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};_o.prototype.bytesPerElement=4,C(\"StructArrayLayout1ul4\",_o);var Ao=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let h=t*10,c=t*5;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,t}};Ao.prototype.bytesPerElement=20,C(\"StructArrayLayout6i1ul2ui20\",Ao);var So=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};So.prototype.bytesPerElement=12,C(\"StructArrayLayout2i2i2i12\",So);var Yh=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};Yh.prototype.bytesPerElement=16,C(\"StructArrayLayout2f1f2i16\",Yh);var Eo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};Eo.prototype.bytesPerElement=16,C(\"StructArrayLayout2ub2f2i16\",Eo);var Fo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};Fo.prototype.bytesPerElement=6,C(\"StructArrayLayout3ui6\",Fo);var To=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let v=t*26,b=t*13,w=t*52;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=h,this.float32[b+7]=c,this.float32[b+8]=p,this.uint8[w+36]=f,this.uint8[w+37]=d,this.uint8[w+38]=y,this.uint32[b+10]=m,this.int16[v+22]=g,this.float32[b+12]=x,t}};To.prototype.bytesPerElement=52,C(\"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52\",To);var ko=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,A,S,T,L,O,B){let V=this.length;return this.resize(V+1),this.emplace(V,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,A,S,T,L,O,B)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,A,S,T,L,O,B,V){let F=t*34,$=t*17;return this.int16[F+0]=e,this.int16[F+1]=r,this.int16[F+2]=i,this.int16[F+3]=n,this.int16[F+4]=a,this.int16[F+5]=s,this.int16[F+6]=o,this.int16[F+7]=l,this.uint16[F+8]=u,this.uint16[F+9]=h,this.uint16[F+10]=c,this.uint16[F+11]=p,this.uint16[F+12]=f,this.uint16[F+13]=d,this.uint16[F+14]=y,this.uint16[F+15]=m,this.uint16[F+16]=g,this.uint16[F+17]=x,this.uint16[F+18]=v,this.uint16[F+19]=b,this.uint16[F+20]=w,this.uint16[F+21]=_,this.uint16[F+22]=A,this.uint32[$+12]=S,this.float32[$+13]=T,this.float32[$+14]=L,this.uint16[F+30]=O,this.uint16[F+31]=B,this.float32[$+16]=V,t}};ko.prototype.bytesPerElement=68,C(\"StructArrayLayout8i15ui1ul2f2ui1f68\",ko);var Sa=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};Sa.prototype.bytesPerElement=4,C(\"StructArrayLayout1f4\",Sa);var Io=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};Io.prototype.bytesPerElement=12,C(\"StructArrayLayout1ui2f12\",Io);var Co=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};Co.prototype.bytesPerElement=8,C(\"StructArrayLayout1ul2ui8\",Co);var Mo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};Mo.prototype.bytesPerElement=4,C(\"StructArrayLayout2ui4\",Mo);var Wh=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};Wh.prototype.bytesPerElement=2,C(\"StructArrayLayout1ui2\",Wh);var Bo=class extends vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};Bo.prototype.bytesPerElement=16,C(\"StructArrayLayout4f16\",Bo);var nd=class extends Sn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new M(this.anchorPointX,this.anchorPointY)}};nd.prototype.size=20;var Rl=class extends Ao{get(t){return new nd(this,t)}};C(\"CollisionBoxArray\",Rl);var ad=class extends Sn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};ad.prototype.size=52;var sd=class extends To{get(t){return new ad(this,t)}};C(\"PlacedSymbolArray\",sd);var od=class extends Sn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};od.prototype.size=68;var ld=class extends ko{get(t){return new od(this,t)}};C(\"SymbolInstanceArray\",ld);var ud=class extends Sa{getoffsetX(t){return this.float32[t*1+0]}};C(\"GlyphOffsetArray\",ud);var hd=class extends mo{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};C(\"SymbolLineVertexArray\",hd);var cd=class extends Sn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};cd.prototype.size=12;var pd=class extends Io{get(t){return new cd(this,t)}};C(\"TextAnchorOffsetArray\",pd);var fd=class extends Sn{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};fd.prototype.size=8;var dd=class extends Co{get(t){return new fd(this,t)}};C(\"FeatureIndexArray\",dd);var yg=class extends pn{};var mg=class extends pn{},gg=class extends pn{},xg=class extends go{},vg=class extends xo{},bg=class extends fn{},Vr=class extends vo{},Zh=class extends bo{},wg=class extends wo{},Dg=class extends Do{},_g=class extends _o{},Hh=class extends So{};var Ag=class extends Eo{};var En=class extends Fo{},Po=class extends Mo{};var zo=Et([{name:\"a_pos\",components:2,type:\"Int16\"}],4),Sg=zo.members;zo.size,zo.alignment;var ie=class Ur{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>Ur.MAX_VERTEX_ARRAY_LENGTH&&Mt(`Max vertices per segment is ${Ur.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${Ur.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>Ur.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new Ur([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};ie.MAX_VERTEX_ARRAY_LENGTH=2**16-1,C(\"SegmentVector\",ie);function Kh(t,e){return t=en(Math.floor(t),0,255),e=en(Math.floor(e),0,255),256*t+e}var Eg=Et([{name:\"a_pattern_from\",components:4,type:\"Uint16\"},{name:\"a_pattern_to\",components:4,type:\"Uint16\"},{name:\"a_pixel_ratio_from\",components:1,type:\"Uint16\"},{name:\"a_pixel_ratio_to\",components:1,type:\"Uint16\"}]),Fg=Et([{name:\"a_dasharray_from\",components:4,type:\"Uint16\"},{name:\"a_dasharray_to\",components:4,type:\"Uint16\"}]),Tg=ml(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,h=461845907,c,p=0;p>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)&4294967295,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,a){case 3:c^=(i.charCodeAt(p+2)&255)<<16;case 2:c^=(i.charCodeAt(p+1)&255)<<8;case 1:c^=i.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)&4294967295,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)&4294967295,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),kg=ml(((t,e)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=r})),Ea=M1(ml(((t,e)=>{var r=Tg(),i=kg();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),yd=class md{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Jh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error(\"Trying to get index, but feature positions are not indexed\");let r=Jh(e),i=0,n=this.ids.length-1;for(;i>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Lo(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new md;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Jh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Ea.default)(String(t))}function Lo(t,e,r,i){for(;r>1],a=r-1,s=i+1;for(;;){do a++;while(t[a]n);if(a>=s)break;Kn(t,a,s),Kn(e,3*a,3*s),Kn(e,3*a+1,3*s+1),Kn(e,3*a+2,3*s+2)}s-r`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type===\"color\"?new Cg(t,e):new Nl(t,e)}},fr=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i===\"u_pattern_to\"?n=this.patternTo:i===\"u_pattern_from\"?n=this.patternFrom:i===\"u_dasharray_to\"?n=this.dashTo:i===\"u_dasharray_from\"?n=this.dashFrom:i===\"u_pixel_ratio_to\"?n=this.pixelRatioTo:i===\"u_pixel_ratio_from\"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith(\"u_pattern\")||r.startsWith(\"u_dasharray_\")?new Ig(t,e):new Nl(t,e)}},Ce=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:\"Float32\",components:r===\"color\"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new st(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type===\"color\"){let i=Vo(r);for(let n=t;n`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:\"Float32\",components:r===\"color\"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new st(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new st(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(this.zoom,n),r,i),s=this.expression.evaluate(new st(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type===\"color\"){let n=Vo(r),a=Vo(i);for(let s=t;s`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof Ce||r instanceof ce)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof Ze){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof qi||r instanceof fr||r instanceof ce)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof qi||n instanceof fr||n instanceof ce){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof Ze){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof Ce||r instanceof ce)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof Ce||r instanceof ce||r instanceof Ze)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof Ce||e instanceof ce||e instanceof Ze)&&e.destroy()}}},Dr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new vd(i,e,r);this.needsUpload=!1,this._featureMap=new yd,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function Mg(t,e){return{\"text-opacity\":[\"opacity\"],\"icon-opacity\":[\"opacity\"],\"text-color\":[\"fill_color\"],\"icon-color\":[\"fill_color\"],\"text-halo-color\":[\"halo_color\"],\"icon-halo-color\":[\"halo_color\"],\"text-halo-blur\":[\"halo_blur\"],\"icon-halo-blur\":[\"halo_blur\"],\"text-halo-width\":[\"halo_width\"],\"icon-halo-width\":[\"halo_width\"],\"line-gap-width\":[\"gapwidth\"],\"line-dasharray\":[\"dasharray_to\",\"dasharray_from\"],\"line-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-extrusion-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"]}[t]||[t.replace(`${e}-`,\"\").replace(/-/g,\"_\")]}function Bg(t){return{\"line-pattern\":{source:Vr,composite:Vr},\"fill-pattern\":{source:Vr,composite:Vr},\"fill-extrusion-pattern\":{source:Vr,composite:Vr},\"line-dasharray\":{source:Zh,composite:Zh}}[t]}function Qh(t,e,r){var n;let i={color:{source:fn,composite:Bo},number:{source:Sa,composite:fn}};return((n=Bg(t))==null?void 0:n[r])||i[e][r]}C(\"ConstantBinder\",qi),C(\"CrossFadedConstantBinder\",fr),C(\"SourceExpressionBinder\",Ce),C(\"CrossFadedPatternBinder\",gd),C(\"CrossFadedDasharrayBinder\",xd),C(\"CompositeExpressionBinder\",ce),C(\"ProgramConfiguration\",vd,{omit:[\"_buffers\"]}),C(\"ProgramConfigurationSet\",Dr);var Oo=2**14-1,tc=-Oo-1;function Fr(t){let e=gt/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=en(a,tc,Oo),n.y=en(s,tc,Oo),(an.x+1||sn.y+1)&&Mt(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}return r}function hi(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Fr(t):[]}}var ec=-32768;function Pg(t,e,r,i,n){t.emplaceBack(ec+e*8+i,ec+r*8+n)}var Ul=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new mg,this.indexArray=new En,this.segments=new ie,this.programConfigurations=new Dr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type===\"heatmap\";if(i.type===\"circle\"){let c=i;a=c.layout.get(\"circle-sort-key\"),s=!a.isConstant(),o||(o=c.paint.get(\"circle-pitch-alignment\")===\"map\")}let l=o?e.subdivisionGranularity.circle:1,u=new st(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:p,index:f,sourceLayerIndex:d}of t){let y=hi(c,h);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:c.properties,type:c.type,sourceLayerIndex:d,index:f,geometry:h?y.geometry:Fr(c),patterns:{},sortKey:m};n.push(g)}s&&n.sort((c,p)=>c.sortKey-p.sortKey);for(let c of n){let{geometry:p,index:f,sourceLayerIndex:d}=c,y=t[f].feature;this.addFeature(c,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Sg),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,h=l.y;if(u<0||u>=8192||h<0||h>=8192)continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;for(let f=0;f=3){for(let n of i)if(oi(t,n))return!0}if(Vg(t,i,r))return!0}return!1}function Vg(t,e,r){if(t.length>1){if(ql(t,e))return!0;for(let i of e)if(Ro(i,t,r))return!0}for(let i of t)if(Ro(i,e,r))return!0;return!1}function ql(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function rc(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function oi(t,e){let r=!1;for(let i=0,n=t.length-1;ie.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function Rg(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new M(e,r),new M(e,n),new M(i,n),new M(i,r)];if(t.length>2){for(let s of a)if(oi(t,s))return!0}for(let s=0;sn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return!1;let a=Qe(t,e,r[0]);return a!==Qe(t,e,r[1])||a!==Qe(t,e,r[2])||a!==Qe(t,e,r[3])}function Wr(t,e,r){let i=e.paint.get(t).value;return i.kind===\"constant\"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ka(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ja(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=M.convert(e)._mult(n);r===\"viewport\"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function Ng(t){let e=[];for(let r=0;rjl(n,e,r,i))}var ic,Wg=()=>ic||(ic=new Yt({\"circle-sort-key\":new U(D.layout_circle[\"circle-sort-key\"],\"circle-sort-key\")})),nc,Zg=()=>nc||(nc=new Yt({\"circle-radius\":new U(D.paint_circle[\"circle-radius\"],\"circle-radius\"),\"circle-color\":new U(D.paint_circle[\"circle-color\"],\"circle-color\"),\"circle-blur\":new U(D.paint_circle[\"circle-blur\"],\"circle-blur\"),\"circle-opacity\":new U(D.paint_circle[\"circle-opacity\"],\"circle-opacity\"),\"circle-translate\":new R(D.paint_circle[\"circle-translate\"],\"circle-translate\"),\"circle-translate-anchor\":new R(D.paint_circle[\"circle-translate-anchor\"],\"circle-translate-anchor\"),\"circle-pitch-scale\":new R(D.paint_circle[\"circle-pitch-scale\"],\"circle-pitch-scale\"),\"circle-pitch-alignment\":new R(D.paint_circle[\"circle-pitch-alignment\"],\"circle-pitch-alignment\"),\"circle-stroke-width\":new U(D.paint_circle[\"circle-stroke-width\"],\"circle-stroke-width\"),\"circle-stroke-color\":new U(D.paint_circle[\"circle-stroke-color\"],\"circle-stroke-color\"),\"circle-stroke-opacity\":new U(D.paint_circle[\"circle-stroke-opacity\"],\"circle-stroke-opacity\")})),Hg={get paint(){return Zg()},get layout(){return Wg()}};var Kg=class extends ye{constructor(t,e){super(t,Hg,e)}createBucket(t){return new Ul(t)}queryRadius(t){let e=t;return Wr(\"circle-radius\",this,e)+Wr(\"circle-stroke-width\",this,e)+Ka(this.paint.get(\"circle-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Ja(t,this.paint.get(\"circle-translate\"),this.paint.get(\"circle-translate-anchor\"),-n.bearingInRadians,a),u=this.paint.get(\"circle-radius\").evaluate(e,r)+this.paint.get(\"circle-stroke-width\").evaluate(e,r),h=this.paint.get(\"circle-pitch-scale\"),c=this.paint.get(\"circle-pitch-alignment\"),p,f;return c===\"map\"?(p=l,f=u*a):(p=Yg(l,n,s,o),f=u),Dd({queryGeometry:p,size:f,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},i)}},_d=class extends Ul{};C(\"HeatmapBucket\",_d,{omit:[\"layers\"]});var ac,Jg=()=>ac||(ac=new Yt({\"heatmap-radius\":new U(D.paint_heatmap[\"heatmap-radius\"],\"heatmap-radius\"),\"heatmap-weight\":new U(D.paint_heatmap[\"heatmap-weight\"],\"heatmap-weight\"),\"heatmap-intensity\":new R(D.paint_heatmap[\"heatmap-intensity\"],\"heatmap-intensity\"),\"heatmap-color\":new Za(D.paint_heatmap[\"heatmap-color\"],\"heatmap-color\"),\"heatmap-opacity\":new R(D.paint_heatmap[\"heatmap-opacity\"],\"heatmap-opacity\")})),Qg={get paint(){return Jg()}};function Gl(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function Ad(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Gl({},{width:e,height:r},i);Xl(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function Xl(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError(\"out of range source coordinates for image copy\");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError(\"out of range destination coordinates for image copy\");let s=t.data,o=e.data;if(s===o)throw Error(\"srcData equals dstData, so image is already copied\");for(let l=0;l{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;ssc||(sc=new Yt({\"hillshade-illumination-direction\":new R(D.paint_hillshade[\"hillshade-illumination-direction\"],\"hillshade-illumination-direction\"),\"hillshade-illumination-altitude\":new R(D.paint_hillshade[\"hillshade-illumination-altitude\"],\"hillshade-illumination-altitude\"),\"hillshade-illumination-anchor\":new R(D.paint_hillshade[\"hillshade-illumination-anchor\"],\"hillshade-illumination-anchor\"),\"hillshade-exaggeration\":new R(D.paint_hillshade[\"hillshade-exaggeration\"],\"hillshade-exaggeration\"),\"hillshade-shadow-color\":new R(D.paint_hillshade[\"hillshade-shadow-color\"],\"hillshade-shadow-color\"),\"hillshade-highlight-color\":new R(D.paint_hillshade[\"hillshade-highlight-color\"],\"hillshade-highlight-color\"),\"hillshade-accent-color\":new R(D.paint_hillshade[\"hillshade-accent-color\"],\"hillshade-accent-color\"),\"hillshade-method\":new R(D.paint_hillshade[\"hillshade-method\"],\"hillshade-method\"),resampling:new R(D.paint_hillshade.resampling,\"resampling\")})),nx={get paint(){return ix()}};var ax=class extends ye{constructor(t,e){super(t,nx,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get(\"hillshade-illumination-direction\").values,e=this.paint.get(\"hillshade-illumination-altitude\").values,r=this.paint.get(\"hillshade-highlight-color\").values,i=this.paint.get(\"hillshade-shadow-color\").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(yh);return{directionRadians:t.map(yh),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get(\"hillshade-exaggeration\")!==0&&!this.isHidden()}},oc,sx=()=>oc||(oc=new Yt({\"color-relief-opacity\":new R(D[\"paint_color-relief\"][\"color-relief-opacity\"],\"color-relief-opacity\"),\"color-relief-color\":new Za(D[\"paint_color-relief\"][\"color-relief-color\"],\"color-relief-color\"),resampling:new R(D[\"paint_color-relief\"].resampling,\"resampling\")})),ox={get paint(){return sx()}};function Jn(t){return\"data\"in t}var lc=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){var u;let{width:i,height:n}=t,a=(((u=this.size)==null?void 0:u[0])!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!(e!=null&&e.useMipmap),a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&(e==null?void 0:e.premultiply)!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let h=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,h,o.RGBA8,i,n),Jn(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=t;l&&c&&(c=Us(c)),c&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,c)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else Jn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:h,y:c}=r||{x:0,y:0};Jn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,h,c,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,h,c,o))}this.useMipmap&&!(Jn(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=Us(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=Us(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),(r===n.LINEAR_MIPMAP_NEAREST||r===n.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},ze,Yl=(ze=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError(\"DEM tiles must be square\");if(i&&![\"mapbox\",\"terrarium\",\"custom\"].includes(i)){Mt(`\"${i}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),ze.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case\"terrarium\":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case\"custom\":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;hthis.max&&(this.max=f),f=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,h=this._unpackAtIndex(a,s),c=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return Fd(e,this.getUnpackVector())}getPixels(){return new Ht({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error(\"dem dimension mismatch\");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let h=s;h80*r){o=t[0],l=t[1];let h=o,c=l;for(let p=r;ph&&(h=f),d>c&&(c=d)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return Uo(a,s,o,l,u),s}function Td(t,e,r,i,n){let a=null;if(n===Tx(t,e,r,i)>0)for(let s=e;s=e;s-=i)a=cc(s/i|0,t[s],t[s+1],a);return a&&yn(a,a.next)&&(gn(a),a=a.next),a}function _r(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(dn.size===0||!dn.has(i))&&(yn(i,i.next)||Tt(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),No=!0,gn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Uo(t,e,r,i,n){n&&Dx(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Tt(o,t,l)<0&&(n?px(t,r,i,n):cx(t))){e.push(o.i,t.i,l.i),gn(t),t=l,a=l;continue}if(t=l,t===a){if(No=!1,t=_r(t),No){a=t;continue}if(!s){t=fx(t,e),a=t,s=!0;continue}dx(t,e,r,i,n);break}}}function cx(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,h=Math.min(n,a,s),c=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&(n!==d.x||o!==d.y)&&ka(n,o,a,l,s,u,d.x,d.y)&&Tt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function px(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,h=n.y,c=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(h,c,p),y=Math.max(o,l,u),m=Math.max(h,c,p),g=Xo(f,d,e,r,i),x=Xo(y,m,e,r,i),v=t.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||h!==v.y)&&ka(o,h,l,c,u,p,v.x,v.y)&&Tt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=t.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||h!==b.y)&&ka(o,h,l,c,u,p,b.x,b.y)&&Tt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function fx(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;Id(n,r,r.next,a,!1)&&mn(n,a)&&mn(a,n)&&(e.push(n.i,r.i,a.i),gn(r),gn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?_r(r):r}function dx(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&Sx(a,s)){let o=Cd(a,s);a=_r(a,a.next),o=_r(o,o.next),Uo(a,e,r,i,n),Uo(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var qo=!1;function yx(t,e,r,i){let n=[];for(let a=0,s=e.length;as&&(s=r.x),r.yo&&(o=r.y),h.xs&&(s=h.x),h.yo&&(o=h.y),r=h}while(++l<16&&r!==e);Go[i]=r;let u=i*4;Dt[u]=n,Dt[u+1]=a,Dt[u+2]=s,Dt[u+3]=o}while(r!==e)}function vx(t,e){let r=t.z*4;e.xDt[r+2]&&(Dt[r+2]=e.x),e.y>Dt[r+3]&&(Dt[r+3]=e.y)}function uc(t){let e=Go[t];for(;e.prev.next!==e;)e=e.next;return Go[t]=e,e}function hc(t){let e=jo[t];for(;e.prev.next!==e;)e=e.next;return jo[t]=e,e}function bx(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(yn(t,r))return r;for(let p=0,f=0;pDt[f+3]||Dt[f]>i||Dt[f+2]<=a)continue;let d=uc(p);r=hc(p);do{if(r.prev.next===r){if(yn(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.xi||Dt[f+3]h)continue;let d=uc(p);r=hc(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&ka(ni)&&(ys.x||r.x===s.x&&wx(s,r)))&&(s=r,c=y)}r=r.next}while(r!==d)}return s}function wx(t,e){return Tt(t.prev,t,e.prev)<0&&Tt(e.next,t,t.next)<0}var oe=[],Ii=[],cr=new Uint32Array,Ci=new Uint32Array,Mi=new Uint32Array(256);function Dx(t,e,r,i){let n=t,a=0;do n.z=Xo(n.x,n.y,e,r,i),oe[a++]=n,n=n.next;while(n!==t);_x(a);let s=null;for(let o=0;o=0&&oe[n].z>i;)oe[n+1]=oe[n],n--;oe[n+1]=r}return}cr.length>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Mi[o];Mi[o]=s,s+=l}for(let o=0;o>>a&255]++;i[u]=e[o],n[u]=l}}function Xo(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Ax(t){let e=t,r=t;do(e.x=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function Sx(t,e){let r=yn(t,e)&&Tt(t.prev,t,t.next)>0&&Tt(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||mn(t,e)&&mn(e,t)&&(Tt(t.prev,t,e.prev)!==0||Tt(t,e.prev,e)!==0))&&!Ex(t,e)&&(r||Fx(t,e))}function Tt(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function yn(t,e){return t.x===e.x&&t.y===e.y}function Id(t,e,r,i,n=!0){let a=Tt(t,e,r),s=Tt(t,e,i),o=Tt(r,i,t),l=Tt(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&ta(t,r,e)||s===0&&ta(t,i,e)||o===0&&ta(r,t,i)||l===0&&ta(r,e,i)):!1}function ta(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ex(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.xa&&o.y>a||s.y=0&&Tt(t,t.prev,e)>=0:Tt(t,e,t.prev)<0||Tt(t,t.next,e)<0}function Fx(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function Cd(t,e){let r=Yo(t.i,t.x,t.y),i=Yo(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function cc(t,e,r,i){let n=Yo(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function gn(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),qo&&vx(t.prev,t.next)}function Yo(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Tx(t,e,r,i){let n=0;for(let a=e,s=r-i;at)throw Error(\"Min granularity must not be greater than base granularity.\");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<32767||e>32767)throw Error(\"Vertex coordinates are out of signed 16 bit integer range.\");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i),a=this._vertexDictionary.get(n);if(a!==void 0)return a;let s=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,s),this._vertexBuffer.push(r,i),s}_subdivideTrianglesScanline(t,e){if(this._granularity<2)return Bx(this._vertexBuffer,Mx(t,e));let r=[],i=t.length;for(let n=0;n=1||b<=0)||m&&(ln)){h>=i&&h<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let A=o+f*v,S=l+d*v;a.push(this._vertexToIndex(A,S))}let w=o+f*Math.max(v,0),_=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,h,w,_),!m&&b<1){let A=o+f*b,S=l+d*b;a.push(this._vertexToIndex(A,S))}(m||h>=i&&h<=n)&&a.push(r[(s+1)%3]),!m&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,o,l,u,h,c,p,_,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,h=u?Math.min(e,i):Math.min(a,s),c=u?Math.max(e,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(u?e=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let h=n-r,c=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+c*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o=1||m<=0){let A=e-a,S=r-s,T=(l-s)/S,L=(u-s)/S,O=a+A*Math.min(T,L);x=Math.floor(Math.min(O,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(O,o)/this._granularityCellSize)-1,b=o0?u:l;if(b)for(let A=x;A<=v;A++){let S=A*this._granularityCellSize;t.push(this._vertexToIndex(S,_))}else for(let A=v;A>=x;A--){let S=A*this._granularityCellSize;t.push(this._vertexToIndex(S,_))}}_generateOutline(t,e){let r=[],i=0;for(let n of t){let a=this._granularity<2?this._ringPathIndices(n,i,e):this._pointArrayToIndices(yr(n,this._granularity,!0));i+=n.length;let s=[];for(let o=1;o=2&&Bd(t)&&i.push(i[0]),i}_handlePoles(t){let e=!1,r=!1;this._canonical&&(this._canonical.y===0&&(e=!0),this._canonical.y===(1<n==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=gt,a=t.length;for(let s=2;s=2&&((o=this._canonical)==null?void 0:o.z)===0&&(a=this._removeTrianglesOutsideTileX(a),s=s.map(l=>this._removeLinesOutsideTileX(l))),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:s}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,T=x>0?(Math.floor(_/n)+1)*n:(Math.ceil(_/n)-1)*n,L=Math.abs(w-S),O=Math.abs(_-T),B=Math.abs(w-f),V=Math.abs(_-d),F=y?L/v:1/0,$=m?O/b:1/0;if((B<=L||!y)&&(V<=O||!m))break;if(F<$&&y||!m){w=S,_+=x*F;let G=new M(w,Math.round(_));(a[a.length-1].x!==G.x||a[a.length-1].y!==G.y)&&a.push(G)}else{w+=g*$,_=T;let G=new M(Math.round(w),_);(a[a.length-1].x!==G.x||a[a.length-1].y!==G.y)&&a.push(G)}}let A=new M(f,d);(a[a.length-1].x!==A.x||a[a.length-1].y!==A.y)&&a.push(A)}return a}function Bd(t){return!t[0].equals(t[t.length-1])}function Cx(t){let e=[],r=[];for(let i of t)if(i.length!==0){i!==t[0]&&e.push(r.length/2);for(let n of i)r.push(n.x),r.push(n.y)}return{flattened:r,holeIndices:e}}function Mx(t,e){let r=Array(t.length);for(let i=0;i0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function Px(t,e,r){if(e.length===0)throw Error(\"Subdivision vertex ring is empty.\");let i=0,n=t[e[0]*2];for(let l=1;l=0?s-1:a-1,u=(o+1)%a,h=t[e[l]*2],c=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(hp)x=!1;else{let v=g-y,b=-(m-d),w=y((p-d)*v+(f-y)*b)*w&&(x=!0)}if(x){let v=e[l],b=e[s],w=e[o];v!==b&&v!==w&&b!==w&&r.push(w,b,v),s--,s<0&&(s=a-1)}else{let v=e[u],b=e[s],w=e[o];v!==b&&v!==w&&b!==w&&r.push(w,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function Pd(t,e,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(uie.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=Ji(s,i,a,o,p,y,u),b=Ji(s,i,a,o,f,m,u),w=Ji(s,i,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+w-l),u.primitiveLength++}}function Lx(t,e,r,i,n,a){let s=[];for(let c=0;cie.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,h=0);let x=Ji(s,i,a,o,f,y,u),v=Ji(s,i,a,o,d,m,u);r.emplaceBack(h+x-l,h+v-l),u.primitiveLength++}}var zd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new gg,this.indexArray=new En,this.indexArray2=new Po,this.programConfigurations=new Dr(t.layers,t.zoom),this.segments=new ie,this.segments2=new ie,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Fa(\"fill\",this.layers,e);let i=this.layers[0].layout.get(\"fill-sort-key\"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Fr(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let f=Wl(\"fill\",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,h,r,{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get(\"fill-pattern\").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Mt(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer \"${t}\"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ux),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of Na(e,500)){let o=Md(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;Pd((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};C(\"FillBucket\",zd,{omit:[\"layers\",\"patternFeatures\"]});var pc,Vx=()=>pc||(pc=new Yt({\"fill-sort-key\":new U(D.layout_fill[\"fill-sort-key\"],\"fill-sort-key\")})),fc,Ox=()=>fc||(fc=new Yt({\"fill-antialias\":new R(D.paint_fill[\"fill-antialias\"],\"fill-antialias\"),\"fill-opacity\":new U(D.paint_fill[\"fill-opacity\"],\"fill-opacity\"),\"fill-layer-opacity\":new R(D.paint_fill[\"fill-layer-opacity\"],\"fill-layer-opacity\"),\"fill-color\":new U(D.paint_fill[\"fill-color\"],\"fill-color\"),\"fill-outline-color\":new U(D.paint_fill[\"fill-outline-color\"],\"fill-outline-color\"),\"fill-translate\":new R(D.paint_fill[\"fill-translate\"],\"fill-translate\"),\"fill-translate-anchor\":new R(D.paint_fill[\"fill-translate-anchor\"],\"fill-translate-anchor\"),\"fill-pattern\":new cn(D.paint_fill[\"fill-pattern\"],\"fill-pattern\")})),Rx={get paint(){return Ox()},get layout(){return Vx()}};var $x=class extends ye{constructor(t,e){super(t,Rx,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values[\"fill-outline-color\"];r.value.kind===\"constant\"&&r.value.value===void 0&&(this.paint._values[\"fill-outline-color\"]=this.paint._values[\"fill-color\"])}createBucket(t){return new zd(t)}queryRadius(){return Ka(this.paint.get(\"fill-translate\"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:r,pixelsToTileUnits:i}){return bd(Ja(t,this.paint.get(\"fill-translate\"),this.paint.get(\"fill-translate-anchor\"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},Wo=Et([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_normal_ed\",components:4,type:\"Int16\"}],4),Nx=Et([{name:\"a_centroid\",components:2,type:\"Int16\"}],4),Ux=Wo.members;Wo.size,Wo.alignment;var Ia=class Zo{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new Zo;return r.extend(e(new M(this.minX,this.minY))),r.extend(e(new M(this.maxX,this.minY))),r.extend(e(new M(this.minX,this.maxY))),r.extend(e(new M(this.maxX,this.maxY))),r}static fromPoints(e){let r=new Zo;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},A5=Ia.fromPoints([new M(0,0),new M(gt,gt)]);function Ho(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function dc(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var Fn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new M(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new M(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error(\"feature has no geometry\");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),no&&(o=n),au&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(c){return[(c.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+a)*2/i)*Math.PI))-90]}function l(c){return c.map(o)}let u;if(this.type===1){let c=[];for(let f of s)c.push(f[0]);let p=l(c);u=c.length===1?{type:\"Point\",coordinates:p[0]}:{type:\"MultiPoint\",coordinates:p}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:\"LineString\",coordinates:c[0]}:{type:\"MultiLineString\",coordinates:c}}else if(this.type===3){let c=Ld(s),p=[];for(let f of c)p.push(f.map(l));u=p.length===1?{type:\"Polygon\",coordinates:p[0]}:{type:\"MultiPolygon\",coordinates:p}}else throw Error(\"unknown feature type\");let h={type:\"Feature\",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};Fn.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];function Ld(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a=this._features.length)throw Error(\"feature index out of bounds\");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Fn(this._pbf,e,this.extent,this._keys,this._values)}};function Gx(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos90||this.lat<-90)throw Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}wrap(){return new Gi(Z1(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return Vd*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof Gi)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Gi(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==\"object\"&&e)return new Gi(Number(\"lng\"in e?e.lng:e.lon),Number(e.lat));throw Error(\"`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]\")}},Od=2*Math.PI*Vd;function Rd(t){return Od*Math.cos(t*Math.PI/180)}function Xx(t){return(180+t)/360}function Yx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Wx(t,e){return t/Rd(e)}function Zx(t){return t*360-180}function Ko(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Hx(t,e){return t*Rd(Ko(e))}function Kx(t){return 1/Math.cos(t*Math.PI/180)}var Hl=class $d{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=yc.convert(e);return new $d(Xx(i.lng),Yx(i.lat),Wx(r,i.lat))}toLngLat(){return new yc(Zx(this.x),Ko(this.y))}toAltitude(){return Hx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Od*Kx(Ko(this.y))}};function Jx(t,e,r){let i=1/(1<r2(r,e))}function e2(t,e){let r=Qx(gt/2,gt/2,e),i=Hl.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function n2(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let h=.2,c=Math.min(n,o*h,l*h),p=r.add(a.mult(c)),f=r.add(s.mult(c)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(c/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var Gs=8192;function Bi(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*Gs)*2+s,n*Gs*2,a*Gs*2,Math.round(o))}var Nd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new xg,this.centroidVertexArray=new yg,this.indexArray=new En,this.programConfigurations=new Dr(t.layers,t.zoom),this.segments=new ie,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=Fa(\"fill-extrusion\",this.layers,e);let i=new st(this.zoom),n=this.layers[0],a=n.layout.get(\"fill-extrusion-rounded-corner-distance\"),s=a>0?e2(a,r):0,o=n._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!n._featureFilter.filter(i,p,r))continue;let f={id:u,sourceLayerIndex:c,index:h,geometry:t2(o?p.geometry:Fr(l),s),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(Wl(\"fill-extrusion\",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,h,r,{},e.subdivisionGranularity),e.featureIndex.insert(l,f.geometry,h,c,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ux),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Nx.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){for(let s of Na(e,500)){let o={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(o,i,t,s,a);let u=this.layoutVertexArray.length-l,h=Math.floor(o.x/o.sampleCount),c=Math.floor(o.y/o.sampleCount);for(let p=0;p{Bi(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0;for(let i=1;iie.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=n.sub(a)._perp()._unit(),o=a.dist(n);r+o>32768&&(r=0),Bi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,0,r),Bi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,1,r),r+=o,Bi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,r),Bi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,r);let l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function a2(t,e){for(let r=0;rmc||(mc=new Yt({\"fill-extrusion-rounded-corner-distance\":new R(D[\"layout_fill-extrusion\"][\"fill-extrusion-rounded-corner-distance\"],\"fill-extrusion-rounded-corner-distance\")})),gc,o2=()=>gc||(gc=new Yt({\"fill-extrusion-opacity\":new R(D[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"],\"fill-extrusion-opacity\"),\"fill-extrusion-color\":new U(D[\"paint_fill-extrusion\"][\"fill-extrusion-color\"],\"fill-extrusion-color\"),\"fill-extrusion-translate\":new R(D[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"],\"fill-extrusion-translate\"),\"fill-extrusion-translate-anchor\":new R(D[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"],\"fill-extrusion-translate-anchor\"),\"fill-extrusion-pattern\":new cn(D[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"],\"fill-extrusion-pattern\"),\"fill-extrusion-height\":new U(D[\"paint_fill-extrusion\"][\"fill-extrusion-height\"],\"fill-extrusion-height\"),\"fill-extrusion-base\":new U(D[\"paint_fill-extrusion\"][\"fill-extrusion-base\"],\"fill-extrusion-base\"),\"fill-extrusion-vertical-gradient\":new R(D[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"],\"fill-extrusion-vertical-gradient\")})),l2={get paint(){return o2()},get layout(){return s2()}};var u2=class extends ye{constructor(t,e){super(t,l2,e)}createBucket(t){return new Nd(t)}queryRadius(){return Ka(this.paint.get(\"fill-extrusion-translate\"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=Ja(t,this.paint.get(\"fill-extrusion-translate\"),this.paint.get(\"fill-extrusion-translate-anchor\"),-n.bearingInRadians,a),l=this.paint.get(\"fill-extrusion-height\").evaluate(e,r),u=this.paint.get(\"fill-extrusion-base\").evaluate(e,r),h=p2(o,s,0),c=c2(i,u,l,s),p=c[0],f=c[1];return h2(p,f,h)}};function Pi(t,e){return t.x*e.x+t.y*e.y}function xc(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r>1),s=r-e,o,l=t[e],u=t[e+1],h=t[r],c=t[r+1];for(let p=e+3;pn){o=p,n=f;continue}if(f===n){let d=Math.abs(p-a);di&&(o-e>3&&Jo(t,e,o,i),t[o+2]=n,r-o>3&&Jo(t,o,r,i))}function f2(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function Ct(t,e,r,i){let n={type:e,geom:r},a={id:t!=null?t:null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case\"Point\":case\"MultiPoint\":zi(a,n.geom);break;case\"LineString\":zi(a,n.geom.points);break;case\"Polygon\":zi(a,n.geom[0].points);break;case\"MultiLineString\":for(let s of n.geom)zi(a,s.points);break;case\"MultiPolygon\":for(let s of n.geom)zi(a,s[0].points)}return a}function Kl(t){let e=t;t.points.length>64&&(e.points=new Float64Array(t.points))}function zi(t,e){for(let r=0;r1024)throw Error(\"GeometryCollection nesting exceeds supported depth: 1024\");if(e.geometry.type===\"GeometryCollection\"){y2(t,e,e.geometry,r,i,n+1);return}if(!((o=e.geometry.coordinates)!=null&&o.length))return;let a=d2(e,r,i),s=(r.tolerance/((1<0&&(s+=i?(n*h-u*a)/2:Math.sqrt((u-n)**2+(h-a)**2)),n=u,a=h}let o=e.points.length-3;e.points[2]=1,r>0&&Jo(e.points,0,o,r),e.points[o+2]=1,Kl(e),e.size=Math.abs(s),e.start=0,e.end=e.size}function tu(t,e,r,i){for(let n=0;n1?1:r}function D2(t){return{type:\"FeatureCollection\",features:t.map(e=>Ca(e))}}function Ca(t){let e={type:\"Feature\",geometry:_2(t),properties:t.tags};return t.id!=null&&(e.id=t.id),e}function _2(t){let{type:e,geometry:r}=t;switch(e){case\"Point\":return{type:e,coordinates:Ud(r[0],r[1])};case\"MultiPoint\":return{type:e,coordinates:ea(r)};case\"LineString\":return{type:e,coordinates:ea(r.points)};case\"MultiLineString\":case\"Polygon\":return{type:e,coordinates:r.map(i=>ea(i.points))};case\"MultiPolygon\":return{type:e,coordinates:r.map(i=>i.map(n=>ea(n.points)))}}}function ea(t){let e=[];for(let r=0;r=r&&s=i)return null;let l=[];for(let u of t){let h=n===0?u.minX:u.minY,c=n===0?u.maxX:u.maxY;if(h>=r&&c=i))switch(u.type){case\"Point\":case\"MultiPoint\":A2(u,l,r,i,n);continue;case\"LineString\":S2(u,l,r,i,n,o);continue;case\"MultiLineString\":E2(u,l,r,i,n);continue;case\"Polygon\":F2(u,l,r,i,n);continue;case\"MultiPolygon\":T2(u,l,r,i,n);continue}}return l.length?l:null}function A2(t,e,r,i,n){let a=[];if(k2(t.geometry,a,r,i,n),!a.length)return;let s=a.length===3?\"Point\":\"MultiPoint\";e.push(Ct(t.id,s,a,t.tags))}function S2(t,e,r,i,n,a){let s=[];if(Gd(t.geometry,s,r,i,n,!1,a.lineMetrics),s.length){if(a.lineMetrics){for(let o of s)e.push(Ct(t.id,\"LineString\",o,t.tags));return}if(s.length>1){e.push(Ct(t.id,\"MultiLineString\",s,t.tags));return}e.push(Ct(t.id,\"LineString\",s[0],t.tags))}}function E2(t,e,r,i,n){let a=[];if(eu(t.geometry,a,r,i,n,!1),a.length){if(a.length===1){e.push(Ct(t.id,\"LineString\",a[0],t.tags));return}e.push(Ct(t.id,\"MultiLineString\",a,t.tags))}}function F2(t,e,r,i,n){let a=[];eu(t.geometry,a,r,i,n,!0),a.length&&e.push(Ct(t.id,\"Polygon\",a,t.tags))}function T2(t,e,r,i,n){let a=[];for(let s of t.geometry){let o=[];eu(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&e.push(Ct(t.id,\"MultiPolygon\",a,t.tags))}function k2(t,e,r,i,n){for(let a=0;a=r&&s<=i&&Kr(e,t[a],t[a+1],t[a+2])}}function Gd(t,e,r,i,n,a,s){let o=vc(t),l=n===0?I2:C2,u=t.start,h,c;for(let g=0;gr&&(c=l(o,x,v,w,_,r),s&&(o.start=u+h*c)):A>i?S=r&&(c=l(o,x,v,w,_,r),T=!0),S>i&&A<=i&&(c=l(o,x,v,w,_,i),T=!0),!a&&T&&(s&&(o.end=u+h*c),e.push(o),o=vc(t)),s&&(u+=h)}let p=t.points.length-3,f=t.points[p],d=t.points[p+1],y=t.points[p+2],m=n===0?f:d;m>=r&&m<=i&&Kr(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&Kr(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Kl(o),e.push(o))}function vc(t){return{points:[],size:t.size,start:t.start,end:t.end}}function eu(t,e,r,i,n,a){for(let s of t)Gd(s,e,r,i,n,a,!1)}function Kr(t,e,r,i){t.push(e,r,i)}function I2(t,e,r,i,n,a){let s=(a-e)/(i-e);return Kr(t.points,a,r+(n-r)*s,1),s}function C2(t,e,r,i,n,a){let s=(a-r)/(n-r);return Kr(t.points,e+(i-e)*s,a,1),s}function ru(t,e){let r=e.buffer/e.extent,i=t,n=Me(t,1,-1-r,r,0,-1,2,e),a=Me(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=Me(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=bc(n,1).concat(i)),a&&(i=i.concat(bc(a,-1)))),i}function bc(t,e){let r=[];for(let i of t)switch(i.type){case\"Point\":case\"MultiPoint\":{let n=M2(i.geometry,e);r.push(Ct(i.id,i.type,n,i.tags));continue}case\"LineString\":{let n=Xs(i.geometry,e);r.push(Ct(i.id,i.type,n,i.tags));continue}case\"MultiLineString\":case\"Polygon\":{let n=[];for(let a of i.geometry)n.push(Xs(a,e));r.push(Ct(i.id,i.type,n,i.tags));continue}case\"MultiPolygon\":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push(Xs(o,e));n.push(s)}r.push(Ct(i.id,i.type,n,i.tags));continue}}return r}function M2(t,e){let r=[];for(let i=0;io.id));t=t.filter(o=>!s.has(o.id))}if(i.add.size){let s=Jl({type:\"FeatureCollection\",features:Array.from(i.add.values())},r);s=ru(s,r),n=n.concat(s),t=t.concat(s)}}if(i.update.size){let a=new Map,s=[];for(let o of t)i.update.has(o.id)?a.set(o.id,[...a.get(o.id)||[],o]):s.push(o);for(let[o,l]of i.update){let u=a.get(o);if(!u||u.length===0)continue;let h=P2(u,l,r);n=n.concat(u,h),s=s.concat(h)}t=s}return{affected:n,source:t}}function P2(t,e,r){var a,s;let i=!!e.newGeometry,n=e.removeAllProperties||((a=e.removeProperties)==null?void 0:a.length)>0||((s=e.addOrUpdateProperties)==null?void 0:s.length)>0;if(i){let o=t[0],l=Jl({type:\"FeatureCollection\",features:[{type:\"Feature\",id:o.id,geometry:e.newGeometry,properties:n?wc(o.tags,e):o.tags}]},r);return l=ru(l,r),l}if(n){let o=[];for(let l of t){let u=Xe({},l);u.tags=wc(u.tags,e),o.push(u)}return o}return t}function wc(t,e){if(e.removeAllProperties)return{};let r=Xe({},t||{});if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function z2(t,e){var r,i;return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map((r=t.add)==null?void 0:r.map(n=>[e.promoteId?n.properties[e.promoteId]:n.id,n])),update:new Map((i=t.update)==null?void 0:i.map(n=>[n.id,n]))}:{remove:new Set,add:new Map,update:new Map}}var Dc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],yt=new Uint32Array(96),L2=class Xd{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error(\"Data must be an instance of ArrayBuffer or SharedArrayBuffer.\");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error(\"Data does not appear to be in a KDBush format.\");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=Dc[i&15];if(!a)throw Error(\"Unrecognized array type.\");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Xd(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=Dc.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let h=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(h,8,e),this.coords=new i(h,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=r,new Uint32Array(h,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Qo(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;yt[0]=0,yt[1]=a.length-1,yt[2]=0;let l=3,u=[];for(;l>0;){let h=yt[--l],c=yt[--l],p=yt[--l];if(c-p<=o){for(let m=p;m<=c;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+c>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(h===0?e<=d:r<=y)&&(yt[l++]=p,yt[l++]=f-1,yt[l++]=1-h),(h===0?i>=d:n>=y)&&(yt[l++]=f+1,yt[l++]=c,yt[l++]=1-h)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;yt[0]=0,yt[1]=a.length-1,yt[2]=0;let l=3,u=0,h=i*i;for(;l>0;){let c=yt[--l],p=yt[--l],f=yt[--l];if(p-f<=o){for(let g=f;g<=p;g++)_c(s[2*g],s[2*g+1],e,r)<=h&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];_c(y,m,e,r)<=h&&(n[u++]=a[d]),(c===0?e-i<=y:r-i<=m)&&(yt[l++]=f,yt[l++]=d-1,yt[l++]=1-c),(c===0?e+i>=y:r+i>=m)&&(yt[l++]=d+1,yt[l++]=p,yt[l++]=1-c)}return u}};function Qo(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Yd(t,e,s,i,n,a),Qo(t,e,r,i,s-1,1-a),Qo(t,e,r,s+1,n,1-a)}function Yd(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,h=r-i+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);Yd(t,e,r,Math.max(i,Math.floor(r-h*p/u+f)),Math.min(n,Math.floor(r+(u-h)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(Li(t,e,i,r),e[2*n+a]>s&&Li(t,e,i,n);os;)l--}e[2*i+a]===s?Li(t,e,i,l):(l++,Li(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Li(t,e,r,i){Ys(t,r,i),Ys(e,2*r,2*i),Ys(e,2*r+1,2*i+1)}function Ys(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function _c(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var tl={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},V2=class{constructor(t){this.options=Object.assign(Object.create(tl),t),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,[a,s]=[Zr(i),Hr(n)],o={id:r.id,type:\"Point\",geometry:[a,s],tags:r.properties};e.push(o)}this.createIndex(e)}initialize(t){let e=[];for(let r of t)r.type===\"Point\"&&e.push(r);this.createIndex(e)}updateIndex(t,e,r){this.options=Object.assign(Object.create(tl),r.clusterOptions),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;e&&console.time(\"total time\");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=[];for(let o=0;o=r;o--){let l=Date.now();s=this.trees[o]=this.createTree(this.cluster(s,o)),e&&console.log(\"z%d: %d clusters in %dms\",o,s.numItems,Date.now()-l)}e&&console.timeEnd(\"total time\")}getClusters(t,e){return this.getClustersInternal(t,e).map(r=>Ca(r))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let h=this.getClustersInternal([r,i,180,a],e),c=this.getClustersInternal([-180,i,n,a],e);return h.concat(c)}let s=this.trees[this.limitZoom(e)],o=s.range(Zr(r),Hr(a),Zr(n),Hr(i)),l=s.flatData,u=[];for(let h of o){let c=this.stride*h;u.push(l[c+5]>1?O2(l,c,this.clusterProps):this.points[l[c+3]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error(\"No cluster with the specified id: \"+t),n=this.trees[r];if(!n)throw i;let a=n.flatData;if(e*this.stride>=a.length)throw i;let s=this.options.radius/(this.options.extent*2**(r-1)),o=a[e*this.stride],l=a[e*this.stride+1],u=n.within(o,l,s),h=[];for(let c of u){let p=c*this.stride;a[p+4]===t&&h.push(a[p+5]>1?R2(a,p,this.clusterProps):Ca(this.points[a[p+3]]))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t,{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,h={transformed:!0,features:[],source:null,x:e,y:r,z:t};return this.addTileFeatures(i.range((e-o)/n,l,(e+1+o)/n,u),i.flatData,e,r,n,h),e===0&&this.addTileFeatures(i.range(1-o/n,l,1,u),i.flatData,n,r,n,h),e===n-1&&this.addTileFeatures(i.range(0,l,o/n,u),i.flatData,-1,r,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o!=null&&o.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n1,u,h,c;if(l)u=iu(e,o,this.clusterProps),h=e[o],c=e[o+1];else{let d=this.points[e[o+3]];u=d.tags,[h,c]=d.geometry}let p={type:1,geometry:[[Math.round(this.options.extent*(h*n-r)),Math.round(this.options.extent*(c*n-i))]],tags:u},f;f=l||this.options.generateId?e[o+3]:this.points[e[o+3]].id,f!==void 0&&(p.id=f),a.features.push(p)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*2**e),o=t.flatData,l=[],u=this.stride;for(let h=0;he&&(y+=o[g+5])}if(y>d&&y>=a){let m=c*d,g=p*d,x,v=-1,b=((h/u|0)<<5)+(e+1)+this.points.length;for(let w of f){let _=w*u;if(o[_+2]<=e)continue;o[_+2]=e;let A=o[_+5];m+=o[_]*A,g+=o[_+1]*A,o[_+4]=b,n&&(x||(x=this.map(o,h,!0),v=this.clusterProps.length,this.clusterProps.push(x)),n(x,this.map(o,_)))}o[h+4]=b,l.push(m/y,g/y,1/0,b,-1,y),n&&l.push(v)}else{for(let m=0;m1)for(let m of f){let g=m*u;if(!(o[g+2]<=e)){o[g+2]=e;for(let x=0;x>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+5]>1){let a=this.clusterProps[t[e+6]];return r?Object.assign({},a):a}let i=this.points[t[e+3]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function O2(t,e,r){return{id:t[e+3],type:\"Point\",tags:iu(t,e,r),geometry:[t[e],t[e+1]]}}function R2(t,e,r){return{type:\"Feature\",id:t[e+3],properties:iu(t,e,r),geometry:{type:\"Point\",coordinates:[qd(t[e]),jd(t[e+1])]}}}function iu(t,e,r){let i=t[e+5],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+6],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+3],point_count:i,point_count_abbreviated:n})}var Wd=\"geojsonvt_clip_start\",Zd=\"geojsonvt_clip_end\";function Ac(t,e,r,i,n){let a=e===n.maxZoom?0:n.tolerance/((1<0&&e.size<(n?s:i)){r.numPoints+=e.points.length/3;return}let o=[];for(let l=0;ls)&&(r.numSimplified++,o.push(e.points[l],e.points[l+1])),r.numPoints++;n&&G2(o,a),t.push(o)}function G2(t,e){let r=0;for(let i=0,n=t.length,a=n-2;i0===e)for(let i=0,n=t.length;i1&&(console.log(\"invalidating tiles\"),console.time(\"invalidating\")),this.invalidateTiles(e),r.debug>1&&console.timeEnd(\"invalidating\");let[i,n,a]=[0,0,0],s=Ac(t,i,n,a,r);s.source=t;let o=ra(i,n,a);if(this.tiles[o]=s,this.tileCoords.push({z:i,x:n,y:a,id:o}),r.debug){let l=`z${i}`;this.stats[l]=(this.stats[l]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{extent:i,debug:n}=this.options,a=1<1&&console.log(\"drilling down to z%d-%d-%d\",t,e,r);let o=t,l=e,u=r,h;for(;!h&&o>0;)o--,l>>=1,u>>=1,h=this.tiles[ra(o,l,u)];return!(h!=null&&h.source)||(n>1&&(console.log(\"found parent tile z%d-%d-%d\",o,l,u),console.time(\"drilling down\")),this.splitTile(h.source,o,l,u,t,e,r),n>1&&console.timeEnd(\"drilling down\"),!this.tiles[s])?null:Sc(this.tiles[s],i)}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let h=1<1&&console.time(\"creation\"),p=this.tiles[c]=Ac(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:c}),u)){u>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd(\"creation\"));let A=`z${e}`;this.stats[A]=(this.stats[A]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let A=n-e;if(r!==a>>A||i!==s>>A)continue}}if(p.source=null,!t.length)continue;u>1&&console.time(\"clipping\");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,w=Me(t,h,r-f,r+y,0,p.minX,p.maxX,l),_=Me(t,h,r+d,r+m,0,p.minX,p.maxX,l);w&&(g=Me(w,h,i-f,i+y,1,p.minY,p.maxY,l),x=Me(w,h,i+d,i+m,1,p.minY,p.maxY,l)),_&&(v=Me(_,h,i-f,i+y,1,p.minY,p.maxY,l),b=Me(_,h,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd(\"clipping\"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(v||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let h=this.tiles[u],c=1<=f||s=y)continue;let m=!1;for(let g of t)if(g.maxX>=p&&g.minX=d&&g.minY1&&console.log(\"invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",h.z,h.x,h.y,h.numFeatures,h.numPoints,h.numSimplified);let g=`z${h.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function ra(t,e,r){return((1<24)throw Error(\"maxZoom should be in the 0-24 range\");if(e.promoteId&&e.generateId)throw Error(\"promoteId and generateId cannot be used together.\");let i=Jl(t,e);r&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",e.indexMaxZoom,e.indexMaxPoints),console.time(\"generate tiles\")),i=ru(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new V2(e.clusterOptions):new W2(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error(\"to update tile geojson `updateable` option must be set to true\");let{affected:i,source:n}=B2(this.source,t,r);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(Ca(n))||(e.push(n),i.add(n.id)));return t=t.filter(n=>!i.has(n.id)),{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error(\"to retrieve data the `updateable` option must be set to true\");return D2(this.source)}updateClusterOptions(t,e){let r=this.options.cluster;if(this.options.cluster=t,this.options.clusterOptions=e,r==t){this.tileIndex.updateIndex(this.source,[],this.options);return}this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},el=Et([{name:\"a_pos_normal\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"}],4),H2=el.members;el.size,el.alignment;var rl=Et([{name:\"a_uv_x\",components:1,type:\"Float32\"},{name:\"a_split_index\",components:1,type:\"Float32\"}]),K2=rl.members;rl.size,rl.alignment;var J2=Math.cos(75/2*(Math.PI/180)),Jd=1/2,Ec=2**14/Jd,Qd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new vg,this.layoutVertexArray2=new bg,this.indexArray=new En,this.programConfigurations=new Dr(t.layers,t.zoom),this.segments=new ie,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Fa(\"line\",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get(\"line-sort-key\"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Fr(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(Fa(\"line\",this.layers,e)?Wl(\"line\",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,h,r,{},{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,K2)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,H2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,\"geojsonvt_clip_start\")&&Object.hasOwn(t.properties,\"geojsonvt_clip_end\"))return{start:+t.properties[Wd],end:+t.properties[Zd]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get(\"line-join\").evaluate(t,{}),u=o.get(\"line-cap\").evaluate(t,{}),h=o.get(\"line-miter-limit\").evaluate(t,{}),c=o.get(\"line-round-limit\").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e)this.addLine(p,t,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=yr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v=2&&t[h-1].equals(t[h-2]);)h--;let c=0;for(;c0;if(T&&v>c){let V=d.dist(y);if(V>2*p){let F=d.sub(d.sub(y)._mult(p/V)._round());this.updateDistance(y,F),this.addCurrentVertex(F,g,0,0,f),y=F}}let O=y&&m,B=O?r:u?\"butt\":i;if(O&&B===\"round\"&&(An&&(B=\"bevel\"),B===\"bevel\"&&(A>2&&(B=\"flipbevel\"),A100)b=x.mult(-1);else{let V=A*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(V*(L?-1:1))}this.addCurrentVertex(d,b,0,0,f),this.addCurrentVertex(d,b.mult(-1),0,0,f)}else if(B===\"bevel\"||B===\"fakeround\"){let V=-Math.sqrt(A*A-1),F=L?V:0,$=L?0:V;if(y&&this.addCurrentVertex(d,g,F,$,f),B===\"fakeround\"){let G=Math.round(S*180/Math.PI/20);for(let P=1;P2*p){let F=d.add(m.sub(d)._mult(p/V)._round());this.updateDistance(d,F),this.addCurrentVertex(F,x,0,0,f),d=F}}}}addCurrentVertex(t,e,r,i,n,a=!1){let s=e.x+e.y*r,o=e.y-e.x*r,l=-e.x+e.y*i,u=-e.y-e.x*i;this.addHalfVertex(t,s,o,a,!1,r,n),this.addHalfVertex(t,l,u,a,!0,-i,n),this.distance>Ec/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a))}addHalfVertex({x:t,y:e},r,i,n,a,s,o){let l=(this.lineClips?this.scaledDistance*(Ec-1):this.scaledDistance)*Jd;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!n,(e<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*i)+128,(s===0?0:s<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let r=e.paint.get(\"line-dasharray\");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get(\"line-dasharray\");if(!a||a.value.kind===\"constant\")continue;let s=n.layout.get(\"line-cap\").evaluate(e,{})===\"round\",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},h=`${o.dasharray.join(\",\")},${o.round}`,c=`${l.dasharray.join(\",\")},${l.round}`,p=`${u.dasharray.join(\",\")},${u.round}`;i.dashDependencies[h]=o,i.dashDependencies[c]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:h,mid:c,max:p}}}};C(\"LineBucket\",Qd,{omit:[\"layers\",\"patternFeatures\"]});var Fc,Q2=()=>Fc||(Fc=new Yt({\"line-cap\":new U(D.layout_line[\"line-cap\"],\"line-cap\"),\"line-join\":new U(D.layout_line[\"line-join\"],\"line-join\"),\"line-miter-limit\":new U(D.layout_line[\"line-miter-limit\"],\"line-miter-limit\"),\"line-round-limit\":new U(D.layout_line[\"line-round-limit\"],\"line-round-limit\"),\"line-sort-key\":new U(D.layout_line[\"line-sort-key\"],\"line-sort-key\")})),Tc,tv=()=>Tc||(Tc=new Yt({\"line-opacity\":new U(D.paint_line[\"line-opacity\"],\"line-opacity\"),\"line-layer-opacity\":new R(D.paint_line[\"line-layer-opacity\"],\"line-layer-opacity\"),\"line-color\":new U(D.paint_line[\"line-color\"],\"line-color\"),\"line-translate\":new R(D.paint_line[\"line-translate\"],\"line-translate\"),\"line-translate-anchor\":new R(D.paint_line[\"line-translate-anchor\"],\"line-translate-anchor\"),\"line-width\":new U(D.paint_line[\"line-width\"],\"line-width\"),\"line-gap-width\":new U(D.paint_line[\"line-gap-width\"],\"line-gap-width\"),\"line-offset\":new U(D.paint_line[\"line-offset\"],\"line-offset\"),\"line-blur\":new U(D.paint_line[\"line-blur\"],\"line-blur\"),\"line-dasharray\":new cn(D.paint_line[\"line-dasharray\"],\"line-dasharray\"),\"line-pattern\":new cn(D.paint_line[\"line-pattern\"],\"line-pattern\"),\"line-gradient\":new Za(D.paint_line[\"line-gradient\"],\"line-gradient\")})),kc={get paint(){return tv()},get layout(){return Q2()}},ev=class extends U{possiblyEvaluate(t,e){return e=new st(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=Xt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,i)}},ia;var rv=class extends ye{constructor(t,e){super(t,kc,e),this.gradientVersion=0,ia||(ia=new ev(kc.paint.properties[\"line-width\"].specification,\"line-floorwidth\"),ia.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t===\"line-gradient\"){let e=this.gradientExpression();this.stepInterpolant=Im(e)?e._styleExpression.expression instanceof Dl:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values[\"line-gradient\"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values[\"line-floorwidth\"]=ia.possiblyEvaluate(this._transitioningPaint._values[\"line-width\"].value,t)}createBucket(t){return new Qd(t)}queryRadius(t){let e=t,r=Ic(Wr(\"line-width\",this,e),Wr(\"line-gap-width\",this,e)),i=Wr(\"line-offset\",this,e);return r/2+Math.abs(i)+Ka(this.paint.get(\"line-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=Ja(t,this.paint.get(\"line-translate\"),this.paint.get(\"line-translate-anchor\"),-n.bearingInRadians,a),o=a/2*Ic(this.paint.get(\"line-width\").evaluate(e,r),this.paint.get(\"line-gap-width\").evaluate(e,r)),l=this.paint.get(\"line-offset\").evaluate(e,r);return l&&(i=Ug(i,l*a)),Lg(s,i,o)}isTileClipped(){return!0}};function Ic(t,e){return e>0?e+2*t:t}var iv=Et([{name:\"a_pos_offset\",components:4,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint16\"},{name:\"a_pixeloffset\",components:4,type:\"Int16\"},{name:\"a_height_offset\",components:1,type:\"Float32\"}],4),nv=Et([{name:\"a_projected_pos\",components:3,type:\"Float32\"}],4);Et([{name:\"a_fade_opacity\",components:1,type:\"Uint32\"}],4);var av=Et([{name:\"a_placed\",components:2,type:\"Uint8\"},{name:\"a_shift\",components:2,type:\"Float32\"},{name:\"a_box_real\",components:2,type:\"Int16\"}]);Et([{type:\"Int16\",name:\"anchorPointX\"},{type:\"Int16\",name:\"anchorPointY\"},{type:\"Int16\",name:\"x1\"},{type:\"Int16\",name:\"y1\"},{type:\"Int16\",name:\"x2\"},{type:\"Int16\",name:\"y2\"},{type:\"Uint32\",name:\"featureIndex\"},{type:\"Uint16\",name:\"sourceLayerIndex\"},{type:\"Uint16\",name:\"bucketIndex\"}]);var Cc=Et([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_anchor_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"}],4),S5=Et([{name:\"a_pos\",components:2,type:\"Float32\"},{name:\"a_radius\",components:1,type:\"Float32\"},{name:\"a_flags\",components:2,type:\"Int16\"}],4);Et([{name:\"triangle\",components:3,type:\"Uint16\"}]),Et([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Uint16\",name:\"glyphStartIndex\"},{type:\"Uint16\",name:\"numGlyphs\"},{type:\"Uint32\",name:\"vertexStartIndex\"},{type:\"Uint32\",name:\"lineStartIndex\"},{type:\"Uint32\",name:\"lineLength\"},{type:\"Uint16\",name:\"segment\"},{type:\"Uint16\",name:\"lowerSize\"},{type:\"Uint16\",name:\"upperSize\"},{type:\"Float32\",name:\"lineOffsetX\"},{type:\"Float32\",name:\"lineOffsetY\"},{type:\"Uint8\",name:\"writingMode\"},{type:\"Uint8\",name:\"placedOrientation\"},{type:\"Uint8\",name:\"hidden\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Int16\",name:\"associatedIconIndex\"},{type:\"Float32\",name:\"heightOffset\"}]),Et([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Int16\",name:\"rightJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"centerJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"leftJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedTextSymbolIndex\"},{type:\"Int16\",name:\"placedIconSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedIconSymbolIndex\"},{type:\"Uint16\",name:\"key\"},{type:\"Uint16\",name:\"textBoxStartIndex\"},{type:\"Uint16\",name:\"textBoxEndIndex\"},{type:\"Uint16\",name:\"verticalTextBoxStartIndex\"},{type:\"Uint16\",name:\"verticalTextBoxEndIndex\"},{type:\"Uint16\",name:\"iconBoxStartIndex\"},{type:\"Uint16\",name:\"iconBoxEndIndex\"},{type:\"Uint16\",name:\"verticalIconBoxStartIndex\"},{type:\"Uint16\",name:\"verticalIconBoxEndIndex\"},{type:\"Uint16\",name:\"featureIndex\"},{type:\"Uint16\",name:\"numHorizontalGlyphVertices\"},{type:\"Uint16\",name:\"numVerticalGlyphVertices\"},{type:\"Uint16\",name:\"numIconVertices\"},{type:\"Uint16\",name:\"numVerticalIconVertices\"},{type:\"Uint16\",name:\"useRuntimeCollisionCircles\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Float32\",name:\"textBoxScale\"},{type:\"Float32\",name:\"collisionCircleDiameter\"},{type:\"Uint16\",name:\"textAnchorOffsetStartIndex\"},{type:\"Uint16\",name:\"textAnchorOffsetEndIndex\"},{type:\"Float32\",name:\"heightOffset\"}]),Et([{type:\"Float32\",name:\"offsetX\"}]),Et([{type:\"Int16\",name:\"x\"},{type:\"Int16\",name:\"y\"},{type:\"Int16\",name:\"tileUnitDistanceFromAnchor\"}]),Et([{type:\"Uint16\",name:\"textAnchor\"},{type:\"Float32\",components:2,name:\"textOffset\"}]);var Ar=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=\"unavailable\",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(Ar.isParsed())throw Error(\"RTL text plugin already registered.\");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,e){return et(this,null,function*(){if(this.isParsed())return this.getState();if(t.pluginStatus!==\"loading\")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(yield e(r),yield Promise.race([i,n]),this.isParsed()){let a={pluginStatus:\"loaded\",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:\"error\",pluginURL:\"\"}),Error(`RTL Text Plugin failed to import scripts from ${r}`)})}};function sv(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function ov(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function lv(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function ts(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function uv(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function hv(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function Mc(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function cv(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||new RegExp(\"^\\\\p{gc=Mc}\",\"u\").test(e)}var pv={C:\"18g,1;g2,3;4nb,1\",D:\"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f\",R:\"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1\",T:\"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1\"},fv={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},dv={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},Bc=1604,yv=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function mv(t,e,r){let i=0;for(let n of t.split(\";\")){let[a,s]=n.split(\",\").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l{let r=e.codePointAt(0);return{codePoint:r,type:gv(r),form:null}})}function Dv(t){let e=t.filter(r=>r.type!==\"T\");for(let r=0;r0&&xv(e[r-1].type),a=r+1String.fromCodePoint(Sv(r))).join(\"\")}function Fv(t,e,r){var n;let i=e.layout.get(\"text-transform\").evaluate(r,{});return i===\"uppercase\"?t=t.toLocaleUpperCase():i===\"lowercase\"&&(t=t.toLocaleLowerCase()),((n=Ar.applyArabicShaping)!=null?n:Ev)(t)}function Tv(t,e,r){for(let i of t.sections)i.text=Fv(i.text,e,r);return t}function Ws(t,e,r){let i=r?e.last.points:e.first.points,n=r?i[i.length-1]:i[0];return`${t}:${n.x}:${n.y}`}function kv(t){let e=t.first.points,r=e.length;for(let a=t.first.next;a;a=a.next)r+=a.points.length-1;let i=Array(r);for(let a=0;a=0&&cv(e[i],r)?e[i]+=r:e.push(r)}return e}function Cv(t){let e=new Set;if(ey){Oi!=null||(Oi=new Intl.Segmenter(void 0,{granularity:\"word\"}));for(let{index:i}of Oi.segment(t))e.add(i);return e}let r=0;for(let i of t.split(new RegExp(\"\\\\b|(?=\\\\p{Ideo})\",\"u\")))e.add(r),r+=i.length;return e}function ry(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function au(t){return/\\s/u.test(String.fromCodePoint(t))}function nl(t){for(let e of t)if(ts(e.codePointAt(0)))return!0;return!1}function Mv(t){for(let e of t)if(!Bv(e.codePointAt(0)))return!1;return!0}function Bv(t){return!sv(t)}function Lc(t){return!(ts(t)||uv(t))}function iy(t){return new RegExp(\"\\\\p{sc=Arab}\",\"u\").test(String.fromCodePoint(t))}function ny(t){return ov(t)}function ay(t){for(let e of t)if(ny(e.codePointAt(0)))return!0;return!1}var Gr={\"!\":\"\\uFE15\",\"#\":\"\\uFF03\",$:\"\\uFF04\",\"%\":\"\\uFF05\",\"&\":\"\\uFF06\",\"(\":\"\\uFE35\",\")\":\"\\uFE36\",\"*\":\"\\uFF0A\",\"+\":\"\\uFF0B\",\",\":\"\\uFE10\",\"-\":\"\\uFE32\",\".\":\"\\u30FB\",\"/\":\"\\uFF0F\",\":\":\"\\uFE13\",\";\":\"\\uFE14\",\"<\":\"\\uFE3F\",\"=\":\"\\uFF1D\",\">\":\"\\uFE40\",\"?\":\"\\uFE16\",\"@\":\"\\uFF20\",\"[\":\"\\uFE47\",\"\\\\\":\"\\uFF3C\",\"]\":\"\\uFE48\",\"^\":\"\\uFF3E\",_:\"\\uFE33\",\"`\":\"\\uFF40\",\"{\":\"\\uFE37\",\"|\":\"\\u2015\",\"}\":\"\\uFE38\",\"~\":\"\\uFF5E\",\"\\xA2\":\"\\uFFE0\",\"\\xA3\":\"\\uFFE1\",\"\\xA5\":\"\\uFFE5\",\"\\xA6\":\"\\uFFE4\",\"\\xAC\":\"\\uFFE2\",\"\\xAF\":\"\\uFFE3\",\"\\u2013\":\"\\uFE32\",\"\\u2014\":\"\\uFE31\",\"\\u2018\":\"\\uFE43\",\"\\u2019\":\"\\uFE44\",\"\\u201C\":\"\\uFE41\",\"\\u201D\":\"\\uFE42\",\"\\u2026\":\"\\uFE19\",\"\\u22EF\":\"\\uFE19\",\"\\u2027\":\"\\u30FB\",\"\\u20A9\":\"\\uFFE6\",\"\\u3001\":\"\\uFE11\",\"\\u3002\":\"\\uFE12\",\"\\u3008\":\"\\uFE3F\",\"\\u3009\":\"\\uFE40\",\"\\u300A\":\"\\uFE3D\",\"\\u300B\":\"\\uFE3E\",\"\\u300C\":\"\\uFE41\",\"\\u300D\":\"\\uFE42\",\"\\u300E\":\"\\uFE43\",\"\\u300F\":\"\\uFE44\",\"\\u3010\":\"\\uFE3B\",\"\\u3011\":\"\\uFE3C\",\"\\u3014\":\"\\uFE39\",\"\\u3015\":\"\\uFE3A\",\"\\u3016\":\"\\uFE17\",\"\\u3017\":\"\\uFE18\",\"\\uFF01\":\"\\uFE15\",\"\\uFF08\":\"\\uFE35\",\"\\uFF09\":\"\\uFE36\",\"\\uFF0C\":\"\\uFE10\",\"\\uFF0D\":\"\\uFE32\",\"\\uFF0E\":\"\\u30FB\",\"\\uFF1A\":\"\\uFE13\",\"\\uFF1B\":\"\\uFE14\",\"\\uFF1C\":\"\\uFE3F\",\"\\uFF1E\":\"\\uFE40\",\"\\uFF1F\":\"\\uFE16\",\"\\uFF3B\":\"\\uFE47\",\"\\uFF3D\":\"\\uFE48\",\"\\uFF3F\":\"\\uFE33\",\"\\uFF5B\":\"\\uFE37\",\"\\uFF5C\":\"\\u2015\",\"\\uFF5D\":\"\\uFE38\",\"\\uFF5F\":\"\\uFE35\",\"\\uFF60\":\"\\uFE36\",\"\\uFF61\":\"\\uFE12\",\"\\uFF62\":\"\\uFE41\",\"\\uFF63\":\"\\uFE42\"};function Pv(t){let e=\"\",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!Lc(s.value.codePointAt(0))||Gr[s.value])&&(r.premature||!Lc(r.value.codePointAt(0))||Gr[r.value])&&Gr[n.value]?e+=Gr[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var zv={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Lv={40:!0};function Vc(t,e,r,i,n,a){var s;if(\"fontStack\"in e){let o=(s=r[e.fontStack])==null?void 0:s.default,l=o==null?void 0:o[t];if(l)return l.metrics.advance*e.scale+n;let u=0;for(let h of t){let c=o==null?void 0:o[h];c&&(u+=c.metrics.advance*e.scale+n)}return u}{let o=i[e.imageName];return o?o.displaySize[0]*e.scale*24/a+n:0}}function Oc(t,e,r,i){let n=(t-e)**2;return i?tr&&Rc(e[i-1]);)i--;this.text=e.slice(r,i).join(\"\"),this.sectionIndex=this.sectionIndex.slice(r,i),this._graphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(\"\"),n=this.sectionIndex.slice(e,r);return new al(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join(\"\").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n0?i[i.length-1]:\"\",a=il(n+e);this.text+=e,this._graphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=[],o=this.determineAverageLineWidth(e,r,i,n,a),l=this.hasZeroWidthSpaces(),u=this.graphemes(),h=null,c=0,p=0;for(let f=0;f0){let y=u[f-1].codePointAt(0),m=d.codePointAt(0),g=lv(y),x=Mc(y)&&Mc(m);(zv[y]||g||\"imageName\"in this.getSection(f-1)||u[f+1]!==void 0&&Lv[m]||x&&(h!=null?h:h=Cv(this.text)).has(p))&&s.push($c(f,c,o,s,Vv(y,m,g&&l),!1))}au(d.codePointAt(0))||(c+=Vc(d,this.getSection(f),i,n,e,a)),p+=d.length}return sy($c(this.length(),c,o,s,0,!0))}determineAverageLineWidth(e,r,i,n,a){let s=0,o=0;for(let u of this.graphemes()){let h=this.getSection(o);s+=Vc(u,h,i,n,e,a),o++}let l=Math.max(1,Math.ceil(s/r));return s/l}};function Ov(){return(function(t){var e={R:\"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73\",EN:\"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9\",ES:\"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2\",ET:\"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj\",AN:\"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u\",CS:\"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b\",B:\"a,3,f+2,2v,690\",S:\"9,2,k\",WS:\"c,k,4f4,1vk+a,u,1j,335\",ON:\"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i\",BN:\"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1\",NSM:\"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n\",AL:\"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d\",LRO:\"6ct\",RLO:\"6cu\",LRE:\"6cq\",RLE:\"6cr\",PDF:\"6cs\",LRI:\"6ee\",RLI:\"6ef\",FSI:\"6eg\",PDI:\"6eh\"},r={},i={};r.L=1,i[1]=\"L\",Object.keys(e).forEach(function(N,at){r[N]=1<1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1\",canonical:\"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye\"};function d(N,at){var Y=0,k=new Map,ot=at&&new Map,X;return N.split(\",\").forEach(function K(j){if(j.indexOf(\"+\")!==-1)for(var Nt=+j;Nt--;)K(X);else{X=j;var bt=j.split(\">\"),nt=bt[0],kt=bt[1];nt=String.fromCodePoint(Y+=parseInt(nt,36)),kt=String.fromCodePoint(Y+=parseInt(kt,36)),k.set(nt,kt),at&&ot.set(kt,nt)}}),{map:k,reverseMap:ot}}var y,m,g;function x(){if(!y){var N=d(f.pairs,!0),at=N.map,Y=N.reverseMap;y=at,m=Y,g=d(f.canonical,!1).map}}function v(N){return x(),y.get(N)||null}function b(N){return x(),m.get(N)||null}function w(N){return x(),g.get(N)||null}var _=r.L,A=r.R,S=r.EN,T=r.ES,L=r.ET,O=r.AN,B=r.CS,V=r.B,F=r.S,$=r.ON,G=r.BN,P=r.NSM,z=r.AL,it=r.LRO,dt=r.RLO,ct=r.LRE,pt=r.RLE,Kt=r.PDF,jt=r.LRI,Jt=r.RLI,Oe=r.FSI,Gt=r.PDI;function Re(N,at){for(var Y=125,k=new Uint32Array(N.length),ot=0;ot0)Ie--;else if(is>0){for(qe=0;!lt[lt.length-1]._isolate;)lt.pop();var ns=lt[lt.length-1]._isolInitIndex;ns!=null&&(Nt.set(ns,zt),Nt.set(zt,ns)),lt.pop(),is--}wt=lt[lt.length-1],j[zt]=wt._level,wt._override&&K(zt,wt._override)}else Lt&Kt?(Ie===0&&(qe>0?qe--:!wt._isolate&<.length>1&&(lt.pop(),wt=lt[lt.length-1])),j[zt]=wt._level):Lt&V&&(j[zt]=nt.level);else j[zt]=wt._level,wt._override&&Lt!==G&&K(zt,wt._override)}for(var Cr=[],me=null,ur=nt.start;ur<=nt.end;ur++){var as=k[ur];if(!(as&o)){var Vu=j[ur],Ou=as&n,m1=as===Gt;me&&Vu===me._level?(me._end=ur,me._endsWithIsolInit=Ou):Cr.push(me={_start:ur,_end:ur,_level:Vu,_startsWithPDI:m1,_endsWithIsolInit:Ou})}}for(var ss=[],In=0;In=0;Bn--)if(!(k[Bn]&o)){Nu=j[Bn];break}var hs=Mr[Mr.length-1],x1=j[hs],Uu=nt.level;if(!(k[hs]&n)){for(var Pn=hs+1;Pn<=nt.end;Pn++)if(!(k[Pn]&o)){Uu=j[Pn];break}}ss.push({_seqIndices:Mr,_sosType:Math.max(Nu,g1)%2?A:_,_eosType:Math.max(Uu,x1)%2?A:_})}}for(var cs=0;cs=0;Ln--)if(!(k[q[Ln]]&o)){fs=k[q[Ln]];break}K(qu,fs&(n|Gt)?$:fs)}}if(X.get(S))for(var Vn=0;Vn=-1;On--){var Gu=On===-1?yi:k[q[On]];if(Gu&a){Gu===z&&K(ju,O);break}}}if(X.get(z))for(var ds=0;ds=0&&(Pr=k[q[gs]],Pr&o);gs--);for(var xs=mi+1;xs=0&&k[q[Rn]]&(L|o);Rn--)K(q[Rn],S);for(ge++;ge=0&&k[q[$n]]&o;$n--)K(q[$n],$);for(var Nn=gi+1;Nn=0;bi--){var ws=zr[bi].char;if(ws===Ku||ws===b(w(vi))||v(w(ws))===vi){Un.push([zr[bi].seqIndex,Lr]),zr.length=bi;break}}}Un.sort(function(Wt,he){return Wt[0]-he[0]});for(var Ds=0;Ds=0;Ss--){var rh=q[Ss];if(k[rh]&Hu){var ih=k[rh]&xi?A:_;xe=ih===Br?Br:ih;break}}}if(xe){if(k[q[qn]]=k[q[_s]]=xe,xe!==Br){for(var wi=qn+1;wi=0;_i--)if(k[q[_i]]&o)nh=_i;else{Fs=k[q[_i]]&xi?A:_;break}for(var ah=v1,Ai=je+1;Ai=0&&c(N[Gn])&l;Gn--)j[Gn]=nt.level}}return{levels:j,paragraphs:bt};function sh(Wt,he){for(var Zt=Wt;Zt1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1\",sr;function fi(){if(!sr){var N=d($e,!0),at=N.map;N.reverseMap.forEach(function(Y,k){at.set(k,Y)}),sr=at}}function Te(N){return fi(),sr.get(N)||null}function $t(N,at,Y,k){var ot=N.length;Y=Math.max(0,Y==null?0:+Y),k=Math.min(ot-1,k==null?ot-1:+k);for(var X=new Map,K=Y;K<=k;K++)if(at[K]&1){var j=Te(N[K]);j!==null&&X.set(K,j)}return X}function ke(N,at,Y,k){var ot=N.length;Y=Math.max(0,Y==null?0:+Y),k=Math.min(ot-1,k==null?ot-1:+k);var X=[];return at.paragraphs.forEach(function(K){var j=Math.max(Y,K.start),Nt=Math.min(k,K.end);if(j=j&&c(N[nt])&l;nt--)bt[nt]=K.level;for(var kt=K.level,di=1/0,lr=0;lrkt&&(kt=Ne),Ne=di;Ue--)for(var lt=0;lt=Ue){for(var wt=lt;lt+1=Ue;)lt++;lt>wt&&X.push([wt+j,lt+j])}}}),X}function or(N,at,Y,k){var ot=Ir(N,at,Y,k),X=[].concat(N);return ot.forEach(function(K,j){X[j]=(at.levels[K]&1?Te(N[K]):null)||N[K]}),X.join(\"\")}function Ir(N,at,Y,k){for(var ot=ke(N,at,Y,k),X=[],K=0;K=0;i--){let n=ou.getBidiCharTypeName(t[i].text[0]);Nv.has(n)?(t[i].level=e,r=!0):r&&$v.has(n)?t[i].level=e:r=!1}}function jv(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)=i;a--)for(let s=0;s=a;)o++;for(let l=s,u=o;le>=n.start&&e<=n.end))==null?void 0:r.level)!=null?i:0}function Yv(t,e,r,i,n){let a=Uv(t,e,i,n);qv(a,r);let s=\"\",o=[];for(let l of jv(a,r)){if(Rv.test(l.text))continue;let u=Gv(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function Wv(t,e){let r=e.filter(a=>a>0&&aa-s),n=[];for(let a=0;a+1n.start))).map(([n,a])=>Yv(t,r,Xv(i,n),n,a))}function Zv(t,e){return oy(t,e).map(r=>r.text)}function Hv(t,e,r){return oy(t,r).map(i=>[i.text,i.sourceIndices.map(n=>{var a;return(a=e[n])!=null?a:0})])}var sl=4294967296,Nc=1/sl,Uc=typeof TextDecoder>\"u\"?null:new TextDecoder(\"utf-8\"),lu=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*sl;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*sl;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,Jv(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Uc?Uc.decode(this.buf.subarray(e,t)):pb(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd();for(;this.pos=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},Kv=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e=0&&t<128){this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t;return}if(t>268435455||t<0){tb(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=fb(this.buf,t,this.pos);let r=this.pos-e;r>=128&&qc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&qc(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,ib,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,nb,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,ob,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,ab,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,sb,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,lb,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,ub,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,hb,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,cb,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function Jv(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return Qv(t,n,e);throw Error(\"Expected varint not more than 10 bytes\")}function Qv(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function tb(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error(\"Given varint doesn't fit into 10 bytes\");e.realloc(10),eb(r,i,e),rb(i,e)}function eb(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function rb(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function qc(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function ib(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;sa){e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;continue}for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}e.pos=n}function nb(t,e){for(let r=0;r239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function fb(t,e,r){for(let i=0,n,a;i55295&&n<57344)if(a){if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}else a&&(a=(t[r++]=239,t[r++]=191,t[r++]=189,null));n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=n&63|128)}return r}function db(t){return typeof(t==null?void 0:t.renderWithWebGL)==\"function\"}function uu(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o=r;a--)e.push(a);r=i+1}else{for(let a=r;at.toCodeUnitIndex(a)),i=Ar.isParsed()?Ar:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>Gc(a,t.sections,[...a].map(()=>0))):Zv(t.toString(),r).map(a=>ol([...a],t.sections,[...a].map(()=>0)));let n=xb(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>Gc(a,t.sections,s)):Hv(t.text,n,r).map(([a,s])=>{let o=[...a];return ol(o,t.sections,hy(o).map(l=>{var u;return(u=s[l])!=null?u:0}))})}function ol(t,e,r){var a;let i=new su(t.join(\"\"),e,[]),n=0;for(let s of i.graphemes())i.sectionIndex.push((a=r[n])!=null?a:0),n+=[...s].length;return i}function hy(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function Gc(t,e,r){let i=[...t],n=hy(i),a=gb(i);return ol(a.map(s=>i[s]),e,a.map(s=>{var o;return(o=r[n[s]])!=null?o:0}))}function na(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=su.fromFeature(t,n);c===2&&y.verticalizePunctuation();let m=y.determineLineBreaks(u,a,e,i,f),g=ay(y.text)?vb(y,m):mb(y,m),x=[],v={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return Tb(v,e,r,i,g,s,o,l,c,u,p,d),!yb(x)&&v}function cy(t){let e=.5,r=.5;switch(t){case\"right\":case\"top-right\":case\"bottom-right\":e=1;break;case\"left\":case\"top-left\":case\"bottom-left\":e=0}switch(t){case\"bottom\":case\"bottom-right\":case\"bottom-left\":r=1;break;case\"top\":case\"top-right\":case\"top-left\":r=0}return{horizontalAlign:e,verticalAlign:r}}function bb(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function py(t){switch(t){case\"top\":return 0;case\"center\":return .5;default:return 1}}function wb(t,e,r,i){var a,s;if(t!=null&&t.rect)return t;let n=(s=(a=e[r.fontStack])==null?void 0:a.default)==null?void 0:s[i];return n?{rect:null,metrics:n.metrics}:null}function Db(t,e,r){return!(t===1||!e&&!ts(r)||e&&(au(r)||iy(r)))}function ma(t){return new RegExp(\"\\\\p{Nd}\",\"u\").test(String.fromCodePoint(t))}function fy(t){return new RegExp(\"\\\\p{Lu}\",\"u\").test(String.fromCodePoint(t))}function _b(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function Ab(t){let e=t.some(ma)&&t.every(i=>ma(i)||_b(i)),r=t.length<=3&&t.every(i=>fy(i)||ma(i));return e||r}function Sb(t){return(ma(t)||fy(t))&&!iy(t)}function Eb(t,e){let r=!1;for(let i=0;ia.codePointAt(0)),i=r.map(ts),n=a=>!i[a]&&!au(r[a])&&!(\"imageName\"in t.getSection(a));for(let a=0;au){let p=Math.ceil(i/u);r*=p/n,n=p}return{x1:e,y1:r,x2:e+i,y2:r+n}}function Xc(t,e,r,i,n,a){let s=t.image,o;if(s.content){let m=s.content,g=s.pixelRatio||1;o=[m[0]/g,m[1]/g,s.displaySize[0]-m[2]/g,s.displaySize[1]-m[3]/g]}let l=e.left*a,u=e.right*a,h,c,p,f;r===\"width\"||r===\"both\"?(f=n[0]+l-i[3],c=n[0]+u+i[1]):(f=n[0]+(l+u-s.displaySize[0])/2,c=f+s.displaySize[0]);let d=e.top*a,y=e.bottom*a;return r===\"height\"||r===\"both\"?(h=n[1]+d-i[0],p=n[1]+y+i[2]):(h=n[1]+(d+y-s.displaySize[1])/2,p=h+s.displaySize[1]),{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}var Yc=32640;function Wc(t,e){let{expression:r}=e;if(r.kind===\"constant\")return{kind:\"constant\",layoutSize:r.evaluate(new st(t+1))};if(r.kind===\"source\")return{kind:\"source\"};if(r.kind===\"composite\"){let{minZoom:i,maxZoom:n}=Pb(r.zoomStops,t);return{kind:\"composite\",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=zb(r),n=r.evaluate(new st(t+1));return{kind:\"camera\",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function Pb(t,e){let r=0;for(;rt.evaluate(new st(e===-1/0?t.zoomStops[1]-1:e)))}var Jr=class yy extends M{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new yy(this.x,this.y,this.angle,this.segment)}};C(\"Anchor\",Jr);function my(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;oi;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=c.dist(p)}return!0}function gy(t){let e=0;for(let r=0;ru){let d=(u-l)/f,y=new Jr(br.number(c.x,p.x,d),br.number(c.y,p.y,d),p.angleTo(c),h);return y._round(),!s||my(t,y,o,s,e)?y:void 0}l+=f}}function Vb(t,e,r,i,n,a,s,o,l){let u=xy(i,a,s),h=vy(i,n),c=h*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-c=0&&b=0&&w=0&&p+u<=h){let _=new Jr(b,w,x,d);_._round(),(!i||my(t,_,a,i,n))&&f.push(_)}}c+=g}return!o&&!f.length&&!s&&(f=by(t,c/2,r,i,n,a,s,!0,l)),f}function Ob(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l=i&&h.x>=i)&&(u.x>=i?u=new M(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round():h.x>=i&&(h=new M(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round()),!(u.y>=n&&h.y>=n)&&(u.y>=n?u=new M(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y>=n&&(h=new M(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),(!o||!u.equals(o[o.length-1]))&&(o=[u],a.push(o)),o.push(h)))))}}return a}function wy(t,e,r,i,n,a){let s=Zc(t,e,r,n,0);return s=Zc(s,e,i,a,1),s}function Zc(t,e,r,i,n){switch(e){case 1:return Rb(t,r,i,n);case 2:return Hc(t,r,i,n,!1);case 3:return Hc(t,r,i,n,!0)}return[]}function Rb(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function $b(t,e,r,i,n){let a=i===0?Nb:Ub,s=[],o=[];for(let h=0;he&&s.push(a(c,p,e)):f>r?d=e&&(s.push(a(c,p,e)),y=!0),d>r&&f<=r&&(s.push(a(c,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new M(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function Hc(t,e,r,i,n){let a=[];for(let s of t){let o=$b(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function Nb(t,e,r){let i=(r-t.x)/(e.x-t.x);return new M(r,t.y+(e.y-t.y)*i)}function Ub(t,e,r){let i=(r-t.y)/(e.y-t.y);return new M(t.x+(e.x-t.x)*i,r)}function Kc(t,e,r,i){let n=[],a=t.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(F,$)=>F+$[1]-$[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,v=0,b=d,w=0,_=y,A=0,S=m;if(a.content&&i){let F=a.content,$=F[2]-F[0],G=F[3]-F[1];(a.textFitWidth||a.textFitHeight)&&(u=dy(t)),g=aa(h,0,F[0]),v=aa(c,0,F[1]),x=aa(h,F[0],F[2]),b=aa(c,F[1],F[3]),w=F[0]-g,A=F[1]-v,_=$-x,S=G-b}let T=u.x1,L=u.y1,O=u.x2-T,B=u.y2-L,V=(F,$,G,P)=>{let z=sa(F.stretch-g,x,O,T),it=oa(F.fixed-w,_,F.stretch,f),dt=sa($.stretch-v,b,B,L),ct=oa($.fixed-A,S,$.stretch,d),pt=sa(G.stretch-g,x,O,T),Kt=oa(G.fixed-w,_,G.stretch,f),jt=sa(P.stretch-v,b,B,L),Jt=oa(P.fixed-A,S,P.stretch,d),Oe=new M(z,dt),Gt=new M(pt,dt),Re=new M(pt,jt),$e=new M(z,jt),sr=new M(it/s,ct/s),fi=new M(Kt/s,Jt/s),Te=e*Math.PI/180;if(Te){let N=Math.sin(Te),at=Math.cos(Te),Y=[at,-N,N,at];Oe._matMult(Y),Gt._matMult(Y),$e._matMult(Y),Re._matMult(Y)}let $t=F.stretch+F.fixed,ke=G.stretch+G.fixed,or=$.stretch+$.fixed,Ir=P.stretch+P.fixed;return{tl:Oe,tr:Gt,bl:$e,br:Re,tex:{x:a.paddedRect.x+1+$t,y:a.paddedRect.y+1+or,w:ke-$t,h:Ir-or},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:sr,pixelOffsetBR:fi,minFontScaleX:_/s/O,minFontScaleY:S/s/B,isSDF:r}};if(!i||!a.stretchX&&!a.stretchY)n.push(V({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));else{let F=Jc(h,y,f),$=Jc(c,m,d);for(let G=0;G0&&(d=Math.max(10,d),this.circleDiameter=d)}else{let c=(h=a.image)!=null&&h.content&&(a.image.textFitWidth||a.image.textFitHeight)?dy(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-o[0],c.y2=c.y2*s+o[2],c.x1=c.x1*s-o[3],c.x2=c.x2*s+o[1];let p=a.collisionPadding;if(p&&(c.x1-=p[0]*s,c.y1-=p[1]*s,c.x2+=p[2]*s,c.y2+=p[3]*s),u){let f=new M(c.x1,c.y1),d=new M(c.x2,c.y1),y=new M(c.x1,c.y2),m=new M(c.x2,c.y2),g=u*Math.PI/180;f._rotate(g),d._rotate(g),y._rotate(g),m._rotate(g),c.x1=Math.min(f.x,d.x,y.x,m.x),c.x2=Math.max(f.x,d.x,y.x,m.x),c.y1=Math.min(f.y,d.y,y.y,m.y),c.y2=Math.max(f.y,d.y,y.y,m.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,i,n)}this.boxEndIndex=t.length}},jb=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}};function Gb(t,e=1){let r=Ia.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new jb([],Xb),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new M(s,o);for(let p=s;pc.d||!c.d)&&(c=p),!(p.max-c.d<=e)&&(n=p.h/2,a.push(new qr(p.p.x-n,p.p.y-n,n,t)),a.push(new qr(p.p.x+n,p.p.y-n,n,t)),a.push(new qr(p.p.x-n,p.p.y+n,n,t)),a.push(new qr(p.p.x+n,p.p.y+n,n,t)))}return h.d>0&&c.d-h.d<=e?h.p:c.p}function Xb(t,e){return e.max-t.max}var qr=class{constructor(t,e,r,i){this.p=new M(t,e),this.h=r,this.d=Yb(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function Yb(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;at.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,wd(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function Wb(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;ap*24);h.startsWith(\"top\")?c[1]-=7:h.startsWith(\"bottom\")&&(c[1]+=7),l[u+1]=c}return new Ae(l)}let a=i.get(\"text-variable-anchor\");if(a){let o;o=t._unevaluatedLayout.getValue(\"text-radial-offset\")===void 0?i.get(\"text-offset\").evaluate(e,{},r).map(u=>u*24):[i.get(\"text-radial-offset\").evaluate(e,{},r)*24,cu];let l=[];for(let u of a)l.push(u,Dy(u,o));return new Ae(l)}return null}function Hb(t){var h,c;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=gt/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n[\"icon-size\"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),layoutTextSize:n[\"text-size\"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),textMaxSize:n[\"text-size\"].possiblyEvaluate(new st(18))};if(t.bucket.textSizeData.kind===\"composite\"){let{minZoom:p,maxZoom:f}=t.bucket.textSizeData;a.compositeTextSizes=[n[\"text-size\"].possiblyEvaluate(new st(p),t.canonical),n[\"text-size\"].possiblyEvaluate(new st(f),t.canonical)]}if(t.bucket.iconSizeData.kind===\"composite\"){let{minZoom:p,maxZoom:f}=t.bucket.iconSizeData;a.compositeIconSizes=[n[\"icon-size\"].possiblyEvaluate(new st(p),t.canonical),n[\"icon-size\"].possiblyEvaluate(new st(f),t.canonical)]}let s=i.get(\"text-line-height\")*24,o=i.get(\"text-rotation-alignment\")!==\"viewport\"&&i.get(\"symbol-placement\")!==\"point\",l=i.get(\"text-keep-upright\"),u=i.get(\"text-size\");for(let p of t.bucket.features){let f=i.get(\"text-font\").evaluate(p,{},t.canonical).join(\",\"),d=u.evaluate(p,{},t.canonical),y=a.layoutTextSize.evaluate(p,{},t.canonical),m=a.layoutIconSize.evaluate(p,{},t.canonical),g={horizontal:{},vertical:void 0},x=p.text,v=[0,0];if(x){let A=x.toString(),S=i.get(\"text-letter-spacing\").evaluate(p,{},t.canonical)*24,T=Mv(A)?S:0,L=i.get(\"text-anchor\").evaluate(p,{},t.canonical),O=_y(r,p,t.canonical);if(!O){let $=i.get(\"text-radial-offset\").evaluate(p,{},t.canonical);v=$?Dy(L,[$*24,cu]):i.get(\"text-offset\").evaluate(p,{},t.canonical).map(G=>G*24)}let B=o?\"center\":i.get(\"text-justify\").evaluate(p,{},t.canonical),V=i.get(\"symbol-placement\")===\"point\"?i.get(\"text-max-width\").evaluate(p,{},t.canonical)*24:1/0,F=()=>{t.bucket.allowVerticalPlacement&&nl(A)&&(g.vertical=na(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,V,s,L,\"left\",T,v,2,!0,y,d))};if(!o&&O){let $=new Set;if(B===\"auto\")for(let P=0;P{z.x<0||z.x>=8192||z.y<0||z.y>=8192||Qb(t,z,P,r,i,n,F,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,[_,_,_,_],T,l,b,A,L,y,e,a,u,h,s,p)};if(O===\"line\")for(let P of Ob(e.geometry,0,0,gt,gt)){let z=yr(P,$),it=Vb(z,w,S,r.vertical||m,i,24,v,t.overscaling,gt);for(let dt of it){let ct=m;(!ct||!tw(t,ct.text,B,dt))&&G(z,dt)}}else if(O===\"line-center\"){for(let P of e.geometry)if(P.length>1){let z=yr(P,$),it=Lb(z,S,r.vertical||m,i,24,v);it&&G(z,it)}}else if(e.type===\"Polygon\")for(let P of Na(e.geometry,0)){let z=Gb(P,16);G(yr(P[0],$,!0),new Jr(z.x,z.y,0))}else if(e.type===\"LineString\")for(let P of e.geometry){let z=yr(P,$);G(z,new Jr(z[0].x,z[0].y,0))}else if(e.type===\"Point\")for(let P of e.geometry)for(let z of P)G([z],new Jr(z.x,z.y,0))}function Jb(t,e){let r=t.length,i=e==null?void 0:e.values;if((i==null?void 0:i.length)>0)for(let n=0;n32640&&Mt(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)):g.kind===\"composite\"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Mt(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)),t.addSymbols(t.text,m,x,o,a,s,h,e,u.lineStartIndex,u.lineLength,f,y,l);for(let v of c)p[v]=t.text.placedSymbolArray.length-1;return m.length*4}function Ay(t){for(let e in t)return t[e];return null}function Qb(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,_,A,S,T){let L=t.addToLineVertexArray(e,r),O=o.layout.get(\"symbol-height-offset\").evaluate(b,{},A);O>t.maxHeightOffset&&(t.maxHeightOffset=O);let B,V,F,$,G=0,P=0,z=0,it=0,dt=-1,ct=-1,pt={},Kt=(0,Ea.default)(\"\");if(t.allowVerticalPlacement&&i.vertical){let Y=o.layout.get(\"text-rotate\").evaluate(b,{},A)+90,k=i.vertical;F=new la(l,e,u,h,c,k,p,f,d,Y),s&&($=new la(l,e,u,h,c,s,m,g,d,Y))}if(n){let Y=o.layout.get(\"icon-rotate\").evaluate(b,{}),k=o.layout.get(\"icon-text-fit\")!==\"none\",ot=Kc(n,Y,_,k),X=s?Kc(s,Y,_,k):void 0;V=new la(l,e,u,h,c,n,m,g,!1,Y),G=ot.length*4;let K=t.iconSizeData,j=null;K.kind===\"source\"?(j=[128*o.layout.get(\"icon-size\").evaluate(b,{})],j[0]>32640&&Mt(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)):K.kind===\"composite\"&&(j=[128*w.compositeIconSizes[0].evaluate(b,{},A),128*w.compositeIconSizes[1].evaluate(b,{},A)],(j[0]>32640||j[1]>32640)&&Mt(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)),t.addSymbols(t.icon,ot,j,v,x,b,0,e,L.lineStartIndex,L.lineLength,-1,A,O),dt=t.icon.placedSymbolArray.length-1,X&&(P=X.length*4,t.addSymbols(t.icon,X,j,v,x,b,2,e,L.lineStartIndex,L.lineLength,-1,A,O),ct=t.icon.placedSymbolArray.length-1)}let jt=Object.keys(i.horizontal);for(let Y of jt){let k=i.horizontal[Y];B||(B=(Kt=(0,Ea.default)(k.text),new la(l,e,u,h,c,k,p,f,d,o.layout.get(\"text-rotate\").evaluate(b,{},A))));let ot=k.positionedLines.length===1;if(z+=tp(t,e,k,a,o,d,b,y,O,L,i.vertical?1:3,ot?jt:[Y],pt,dt,w,A),ot)break}i.vertical&&(it+=tp(t,e,i.vertical,a,o,d,b,y,O,L,2,[\"vertical\"],pt,ct,w,A));let Jt=B?B.boxStartIndex:t.collisionBoxArray.length,Oe=B?B.boxEndIndex:t.collisionBoxArray.length,Gt=F?F.boxStartIndex:t.collisionBoxArray.length,Re=F?F.boxEndIndex:t.collisionBoxArray.length,$e=V?V.boxStartIndex:t.collisionBoxArray.length,sr=V?V.boxEndIndex:t.collisionBoxArray.length,fi=$?$.boxStartIndex:t.collisionBoxArray.length,Te=$?$.boxEndIndex:t.collisionBoxArray.length,$t=-1,ke=(Y,k)=>Y!=null&&Y.circleDiameter?Math.max(Y.circleDiameter,k):k;$t=ke(B,$t),$t=ke(F,$t),$t=ke(V,$t),$t=ke($,$t);let or=+($t>-1);or&&($t*=S/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Mt(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let Ir=_y(o,b,A),[N,at]=Jb(t.textAnchorOffsets,Ir);T&&(Kt=ew(Kt,b)),t.symbolInstances.emplaceBack(e.x,e.y,pt.right>=0?pt.right:-1,pt.center>=0?pt.center:-1,pt.left>=0?pt.left:-1,pt.vertical||-1,dt,ct,Kt,Jt,Oe,Gt,Re,$e,sr,fi,Te,u,z,it,G,P,or,0,p,$t,N,at,O)}function tw(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Wc(this.zoom,e[\"text-size\"]),this.iconSizeData=Wc(this.zoom,e[\"icon-size\"]);let r=this.layers[0].layout,i=r.get(\"symbol-sort-key\"),n=r.get(\"symbol-z-order\");this.canOverlap=ep(r,\"text-overlap\",\"text-allow-overlap\")!==\"never\"||ep(r,\"icon-overlap\",\"icon-allow-overlap\")!==\"never\"||r.get(\"text-ignore-placement\")||r.get(\"icon-ignore-placement\"),this.sortFeaturesByKey=n!==\"viewport-y\"&&!i.isConstant();let a=n===\"viewport-y\"||n===\"auto\"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get(\"symbol-placement\")===\"point\"&&(this.writingModes=r.get(\"text-writing-mode\").map(s=>uy[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new ll(new Dr(this.layers,this.zoom,t=>t.startsWith(\"text\"))),this.icon=new ll(new Dr(this.layers,this.zoom,t=>t.startsWith(\"icon\"))),this.glyphOffsetArray=new ud,this.lineVertexArray=new hd,this.symbolInstances=new ld,this.textAnchorOffsets=new pd}calculateGlyphDependencies(t,e,r,i,n){var l;let a=(i||this.allowVerticalPlacement)&&n,s=su.fromFeature(t,r),o=s.graphemes();for(let u=0;u0)&&(a.value.kind!==\"constant\"||a.value.value.length>0),u=o.value.kind!==\"constant\"||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get(\"symbol-sort-key\");if(this.features=[],!l&&!u)return;let c=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new st(this.zoom);for(let{feature:m,id:g,index:x,sourceLayerIndex:v}of t){let b=i._featureFilter.needGeometry,w=hi(m,b);if(!i._featureFilter.filter(d,w,r))continue;b||(w.geometry=Fr(m));let _;if(l){let L=i.getValueAndResolveTokens(\"text-field\",w,r,f),O=Le.factory(L);this.hasRTLText||(this.hasRTLText=nw(O)),_=Tv(O,i,w)}let A;if(u){let L=i.getValueAndResolveTokens(\"icon-image\",w,r,f);A=L instanceof Se?L:Se.fromString(L)}if(!_&&!A)continue;let S=this.sortFeaturesByKey?h.evaluate(w,{},r):void 0,T={id:g,text:_,icon:A,index:x,sourceLayerIndex:v,geometry:w.geometry,properties:m.properties,type:Fn.types[m.type],sortKey:S};if(this.features.push(T),A&&(c[A.name]=!0),_){let L=a.evaluate(w,{},r).join(\",\"),O=n.get(\"text-rotation-alignment\")!==\"viewport\"&&n.get(\"symbol-placement\")!==\"point\";this.allowVerticalPlacement=(y=this.writingModes)==null?void 0:y.includes(2);let B=nl(_.toString());this.calculateGlyphDependencies(_,p,L,O,B);for(let V of _.sections)V.image&&(c[V.image.name]=!0)}}n.get(\"symbol-placement\")===\"line\"&&(this.features=Iv(this.features)),this.sortFeaturesByKey&&this.features.sort((m,g)=>m.sortKey-g.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){Hb({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity,hasPromoteId:t.featureIndex.promoteId!=null})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;s0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;ni[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];(r==null?void 0:r.sortKey)===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};C(\"SymbolBucket\",Sy,{omit:[\"layers\",\"collisionBoxArray\",\"features\",\"compareText\"]});function aw(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):\"\")}var rp,sw=()=>rp||(rp=new Yt({\"symbol-placement\":new R(D.layout_symbol[\"symbol-placement\"],\"symbol-placement\"),\"symbol-spacing\":new R(D.layout_symbol[\"symbol-spacing\"],\"symbol-spacing\"),\"symbol-avoid-edges\":new R(D.layout_symbol[\"symbol-avoid-edges\"],\"symbol-avoid-edges\"),\"symbol-sort-key\":new U(D.layout_symbol[\"symbol-sort-key\"],\"symbol-sort-key\"),\"symbol-z-order\":new R(D.layout_symbol[\"symbol-z-order\"],\"symbol-z-order\"),\"icon-allow-overlap\":new R(D.layout_symbol[\"icon-allow-overlap\"],\"icon-allow-overlap\"),\"icon-overlap\":new R(D.layout_symbol[\"icon-overlap\"],\"icon-overlap\"),\"icon-ignore-placement\":new R(D.layout_symbol[\"icon-ignore-placement\"],\"icon-ignore-placement\"),\"icon-optional\":new R(D.layout_symbol[\"icon-optional\"],\"icon-optional\"),\"icon-rotation-alignment\":new U(D.layout_symbol[\"icon-rotation-alignment\"],\"icon-rotation-alignment\"),\"icon-size\":new U(D.layout_symbol[\"icon-size\"],\"icon-size\"),\"icon-text-fit\":new R(D.layout_symbol[\"icon-text-fit\"],\"icon-text-fit\"),\"icon-text-fit-padding\":new R(D.layout_symbol[\"icon-text-fit-padding\"],\"icon-text-fit-padding\"),\"icon-image\":new U(D.layout_symbol[\"icon-image\"],\"icon-image\"),\"icon-rotate\":new U(D.layout_symbol[\"icon-rotate\"],\"icon-rotate\"),\"icon-padding\":new U(D.layout_symbol[\"icon-padding\"],\"icon-padding\"),\"icon-keep-upright\":new R(D.layout_symbol[\"icon-keep-upright\"],\"icon-keep-upright\"),\"icon-offset\":new U(D.layout_symbol[\"icon-offset\"],\"icon-offset\"),\"icon-anchor\":new U(D.layout_symbol[\"icon-anchor\"],\"icon-anchor\"),\"icon-pitch-alignment\":new R(D.layout_symbol[\"icon-pitch-alignment\"],\"icon-pitch-alignment\"),\"text-pitch-alignment\":new R(D.layout_symbol[\"text-pitch-alignment\"],\"text-pitch-alignment\"),\"text-rotation-alignment\":new R(D.layout_symbol[\"text-rotation-alignment\"],\"text-rotation-alignment\"),\"text-field\":new U(D.layout_symbol[\"text-field\"],\"text-field\"),\"text-font\":new U(D.layout_symbol[\"text-font\"],\"text-font\"),\"text-size\":new U(D.layout_symbol[\"text-size\"],\"text-size\"),\"text-max-width\":new U(D.layout_symbol[\"text-max-width\"],\"text-max-width\"),\"text-line-height\":new R(D.layout_symbol[\"text-line-height\"],\"text-line-height\"),\"text-letter-spacing\":new U(D.layout_symbol[\"text-letter-spacing\"],\"text-letter-spacing\"),\"text-justify\":new U(D.layout_symbol[\"text-justify\"],\"text-justify\"),\"text-radial-offset\":new U(D.layout_symbol[\"text-radial-offset\"],\"text-radial-offset\"),\"text-variable-anchor\":new R(D.layout_symbol[\"text-variable-anchor\"],\"text-variable-anchor\"),\"text-variable-anchor-offset\":new U(D.layout_symbol[\"text-variable-anchor-offset\"],\"text-variable-anchor-offset\"),\"text-anchor\":new U(D.layout_symbol[\"text-anchor\"],\"text-anchor\"),\"text-max-angle\":new R(D.layout_symbol[\"text-max-angle\"],\"text-max-angle\"),\"text-writing-mode\":new R(D.layout_symbol[\"text-writing-mode\"],\"text-writing-mode\"),\"text-rotate\":new U(D.layout_symbol[\"text-rotate\"],\"text-rotate\"),\"text-padding\":new R(D.layout_symbol[\"text-padding\"],\"text-padding\"),\"text-keep-upright\":new R(D.layout_symbol[\"text-keep-upright\"],\"text-keep-upright\"),\"text-transform\":new U(D.layout_symbol[\"text-transform\"],\"text-transform\"),\"text-offset\":new U(D.layout_symbol[\"text-offset\"],\"text-offset\"),\"text-allow-overlap\":new R(D.layout_symbol[\"text-allow-overlap\"],\"text-allow-overlap\"),\"text-overlap\":new R(D.layout_symbol[\"text-overlap\"],\"text-overlap\"),\"text-ignore-placement\":new R(D.layout_symbol[\"text-ignore-placement\"],\"text-ignore-placement\"),\"text-optional\":new R(D.layout_symbol[\"text-optional\"],\"text-optional\"),\"symbol-height-offset\":new U(D.layout_symbol[\"symbol-height-offset\"],\"symbol-height-offset\"),\"symbol-height-anchor\":new R(D.layout_symbol[\"symbol-height-anchor\"],\"symbol-height-anchor\")})),ip,ow=()=>ip||(ip=new Yt({\"icon-opacity\":new U(D.paint_symbol[\"icon-opacity\"],\"icon-opacity\"),\"icon-color\":new U(D.paint_symbol[\"icon-color\"],\"icon-color\"),\"icon-halo-color\":new U(D.paint_symbol[\"icon-halo-color\"],\"icon-halo-color\"),\"icon-halo-width\":new U(D.paint_symbol[\"icon-halo-width\"],\"icon-halo-width\"),\"icon-halo-blur\":new U(D.paint_symbol[\"icon-halo-blur\"],\"icon-halo-blur\"),\"icon-translate\":new R(D.paint_symbol[\"icon-translate\"],\"icon-translate\"),\"icon-translate-anchor\":new R(D.paint_symbol[\"icon-translate-anchor\"],\"icon-translate-anchor\"),\"text-opacity\":new U(D.paint_symbol[\"text-opacity\"],\"text-opacity\"),\"text-color\":new U(D.paint_symbol[\"text-color\"],\"text-color\",{runtimeType:pe,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),\"text-halo-color\":new U(D.paint_symbol[\"text-halo-color\"],\"text-halo-color\"),\"text-halo-width\":new U(D.paint_symbol[\"text-halo-width\"],\"text-halo-width\"),\"text-halo-blur\":new U(D.paint_symbol[\"text-halo-blur\"],\"text-halo-blur\"),\"text-translate\":new R(D.paint_symbol[\"text-translate\"],\"text-translate\"),\"text-translate-anchor\":new R(D.paint_symbol[\"text-translate-anchor\"],\"text-translate-anchor\")})),Zs={get paint(){return ow()},get layout(){return sw()}},Ey=class{constructor(t){if(t.property.overrides===void 0)throw Error(\"overrides must be provided to instantiate FormatSectionOverride class\");this.type=t.property.overrides?t.property.overrides.runtimeType:vn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e!=null&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};C(\"FormatSectionOverride\",Ey,{omit:[\"defaultValue\"]});var lw=class hl extends ye{constructor(e,r){super(e,Zs,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get(\"icon-rotation-alignment\");if((i.value.kind!==\"constant\"||i.value.value===\"auto\")&&(this.layout._values[\"icon-rotation-alignment\"]=new le(i.property,{kind:\"constant\",value:this.layout.get(\"symbol-placement\")===\"point\"?\"viewport\":\"map\"},i.parameters)),this.layout.get(\"text-rotation-alignment\")===\"auto\"&&(this.layout.get(\"symbol-placement\")===\"point\"?this.layout._values[\"text-rotation-alignment\"]=\"viewport\":this.layout._values[\"text-rotation-alignment\"]=\"map\"),this.layout.get(\"text-pitch-alignment\")===\"auto\"&&(this.layout._values[\"text-pitch-alignment\"]=this.layout.get(\"text-rotation-alignment\")===\"map\"?\"map\":\"viewport\"),this.layout.get(\"icon-pitch-alignment\")===\"auto\"&&(this.layout._values[\"icon-pitch-alignment\"]=this.layout.get(\"icon-rotation-alignment\").constantOr(\"viewport\")),this.layout.get(\"symbol-placement\")===\"point\"){let n=this.layout.get(\"text-writing-mode\");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values[\"text-writing-mode\"]=a}else this.layout._values[\"text-writing-mode\"]=[\"horizontal\"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!Xa(s.value)&&a?aw(r.properties,a):a}createBucket(e){return new Sy(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error(\"Should take a different path in FeatureIndex\")}_setPaintOverrides(){for(let e of Zs.paint.overridableProperties){if(!hl.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Bl(new Ey(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind===\"constant\"||r.value.kind===\"source\"?new ln(\"source\",i):new _a(\"composite\",i,r.value.zoomStops),this.paint._values[e]=new le(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:hl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get(\"text-field\"),n=Zs.paint.properties[r],a=!1,s=o=>{var l;for(let u of o)if((l=n.overrides)!=null&&l.hasOverride(u)){a=!0;return}};if(i.value.kind===\"constant\"&&i.value.value instanceof Le)s(i.value.value.sections);else if(i.value.kind===\"source\"||i.value.kind===\"composite\"){let o=u=>{if(!a)if(u instanceof ri&&St(u.value)===bn){let h=u.value;s(h.sections)}else u instanceof Yp?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function uw(t,e,r,i=1){var a;let n=(a=t.get(\"icon-padding\").evaluate(e,{},r))==null?void 0:a.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var np,hw=()=>np||(np=new Yt({\"background-color\":new R(D.paint_background[\"background-color\"],\"background-color\"),\"background-pattern\":new id(D.paint_background[\"background-pattern\"],\"background-pattern\"),\"background-opacity\":new R(D.paint_background[\"background-opacity\"],\"background-opacity\")})),cw={get paint(){return hw()}};var pw=class extends ye{constructor(t,e){super(t,cw,e)}};var fw=class extends ye{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode===\"3d\"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error(\"Custom layers cannot be serialized\")}};function Fy(t,e){if(t.type===\"custom\")return new fw(t,e);switch(t.type){case\"background\":return new pw(t,e);case\"circle\":return new Kg(t,e);case\"color-relief\":return new lx(t,e);case\"fill\":return new $x(t,e);case\"fill-extrusion\":return new u2(t,e);case\"heatmap\":return new rx(t,e);case\"hillshade\":return new ax(t,e);case\"line\":return new rv(t,e);case\"raster\":return new pg(t,e);case\"symbol\":return new lw(t,e)}}var dw=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var t;this._triggered||(this._triggered=!0,(t=this._channel)==null||t.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},yw={once:!0},Ty=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new dw(()=>this.process()),this.subscription=dh(this.target,\"message\",r=>this.receive(r),!1),this.globalScope=vr(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?dh(e.signal,\"abort\",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:\"\",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new gl(e.signal.reason))},yw):null;this.resolveRejects[n]={resolve:l=>{a==null||a.unsubscribe(),r(l)},reject:l=>{a==null||a.unsubscribe(),i(l)}};let s=[],o=Si(Xe({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:Hi(t.data,s)});this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=[\"file://\",\"resource://android\",\"null\"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===\"\"){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort();return}if(vr(self)||e.mustQueue){this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,e){return et(this,null,function*(){if(e.type===\"\"){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(tn(Ki(e.error))):n.resolve(Ki(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=Ki(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=yield this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,tn(n))}})}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:\"\",sourceMapId:this.mapId,origin:location.origin,error:e?Hi(e):null,data:Hi(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function mw(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var ky=class{constructor(t,e,r){if(!mw(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=Qi(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){let i=xw(this.x,this.y,this.z),n=vw(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r===\"tms\"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?\"@2x\":\"\").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,i)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new M((t.x*e-this.x)*gt,(t.y*e-this.y)*gt)}toString(){return`${this.z}/${this.x}/${this.y}`}},gw=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Qi(t,e.z,e.z,e.x,e.y)}},pu=class se{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new ky(i,+n,+a),this.key=Qi(r,e,i,n,a)}clone(){return new se(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new se(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new se(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?Qi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Qi(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new se(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new se(r,this.wrap,r,i,n),new se(r,this.wrap,r,i+1,n),new se(r,this.wrap,r,i,n+1),new se(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrape.wrap?!1:this.overscaledZe.overscaledZ?!1:this.canonical.xe.canonical.x?!1:this.canonical.y=0&&e=0&&r=u)return null;let c=this.canonical.x+n,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new se(this.overscaledZ,p,l,c,h),x:s,y:o}}};function Qi(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<0;n--){let a=1<Dw(n,a,r),t.layers[i])}function Dw(t,e,r=\"\"){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||\"\"),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s>31}function Sw(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(Ks(1,o));let l=i===3?s.length-1:s.length;for(let u=0;u=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},Fw=class{constructor(t,e,r,i,n){this.type=\"Feature\",this._vectorTileFeature=t,this._x=r,this._y=i,this._z=e;for(let a in t.properties)typeof t.properties[a]==\"string\"&&t.properties[a].startsWith(\"__$json__:\")&&(t.properties[a]=JSON.parse(t.properties[a].slice(10)));this.properties=t.properties,this.id=n}projectPoint(t,e,r,i){return[(t.x+e)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+r)*2/i)*Math.PI))-90]}projectLine(t,e,r,i){return t.map(n=>this.projectPoint(n,e,r,i))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,e=t.extent*2**this._z,r=t.extent*this._x,i=t.extent*this._y,n=t.loadGeometry();switch(t.type){case 1:{let a=[];for(let o of n)a.push(o[0]);let s=this.projectLine(a,r,i,e);this._geometry=a.length===1?{type:\"Point\",coordinates:s[0]}:{type:\"MultiPoint\",coordinates:s};break}case 2:{let a=n.map(s=>this.projectLine(s,r,i,e));this._geometry=a.length===1?{type:\"LineString\",coordinates:a[0]}:{type:\"MultiLineString\",coordinates:a};break}case 3:{let a=Ld(n),s=[];for(let o of a)s.push(o.map(l=>this.projectLine(l,r,i,e)));this._geometry=s.length===1?{type:\"Polygon\",coordinates:s[0]}:{type:\"MultiPolygon\",coordinates:s};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)e!==\"_geometry\"&&e!==\"_vectorTileFeature\"&&e!==\"_x\"&&e!==\"_y\"&&e!==\"_z\"&&(t[e]=this[e]);return t}},Tr=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r==\"number\"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){var e;return((e=this.nullabilityBuffer)==null?void 0:e.get(t))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},es=class extends Tr{},yu=class extends es{getValueFromBuffer(t){return this.dataBuffer[t]}},mu=class extends es{getValueFromBuffer(t){return this.dataBuffer[t]}},Cy=class extends Tr{constructor(t,e,r,i){super(t,e,i),this.delta=r}},gu=class extends Cy{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},xu=class extends Tr{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},Tw=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error(\"Missing layer name\")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var t;return(t=this._propertyVectors)!=null?t:[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r>>32-t;var pl=vu,bu=65536;function wu(t,e){return t-t%e}function kw(t){return wu(t+31,32)}function Py(t){if(!Number.isFinite(t)||t<=0)return bu;let e=wu(Math.floor(t),256);return e===0?256:e}function Iw(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function Cw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function Mw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function Bw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function Pw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function zw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(h&3)<<4)&63,r[n++]=h>>>2&63,r[n++]=h>>>8&63,r[n++]=h>>>14&63,r[n++]=h>>>20&63,r[n]=h>>>26&63}function Lw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(h&1)<<6)&127,r[n++]=h>>>1&127,r[n++]=h>>>8&127,r[n++]=h>>>15&127,r[n++]=h>>>22&127,r[n++]=(h>>>29|(c&15)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n]=c>>>25&127}function Vw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function Ow(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(h&3)<<7)&511,r[n++]=h>>>2&511,r[n++]=h>>>11&511,r[n++]=h>>>20&511,r[n++]=(h>>>29|(c&63)<<3)&511,r[n++]=c>>>6&511,r[n++]=c>>>15&511,r[n++]=(c>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function Rw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=h>>>0&1023,r[n++]=h>>>10&1023,r[n++]=h>>>20&1023,r[n++]=(h>>>30|(c&255)<<2)&1023,r[n++]=c>>>8&1023,r[n++]=c>>>18&1023,r[n++]=(c>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function $w(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(h&31)<<6)&2047,r[n++]=h>>>5&2047,r[n++]=h>>>16&2047,r[n++]=(h>>>27|(c&63)<<5)&2047,r[n++]=c>>>6&2047,r[n++]=c>>>17&2047,r[n++]=(c>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Nw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(h&255)<<4)&4095,r[n++]=h>>>8&4095,r[n++]=h>>>20&4095,r[n++]=c>>>0&4095,r[n++]=c>>>12&4095,r[n++]=(c>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function Uw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,v=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function qw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function jw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Gw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function Xw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=h>>>0&15,r[n++]=h>>>4&15,r[n++]=h>>>8&15,r[n++]=h>>>12&15,r[n++]=h>>>16&15,r[n++]=h>>>20&15,r[n++]=h>>>24&15,r[n++]=h>>>28&15}}function Yw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(h&15)<<1)&31,r[n++]=h>>>4&31,r[n++]=h>>>9&31,r[n++]=h>>>14&31,r[n++]=h>>>19&31,r[n++]=h>>>24&31,r[n++]=(h>>>29|(c&3)<<3)&31,r[n++]=c>>>2&31,r[n++]=c>>>7&31,r[n++]=c>>>12&31,r[n++]=c>>>17&31,r[n++]=c>>>22&31,r[n++]=c>>>27&31}}function Ww(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=h>>>0&63,r[n++]=h>>>6&63,r[n++]=h>>>12&63,r[n++]=h>>>18&63,r[n++]=h>>>24&63,r[n++]=(h>>>30|(c&15)<<2)&63,r[n++]=c>>>4&63,r[n++]=c>>>10&63,r[n++]=c>>>16&63,r[n++]=c>>>22&63,r[n++]=(c>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function Zw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(h&3)<<5)&127,r[n++]=h>>>2&127,r[n++]=h>>>9&127,r[n++]=h>>>16&127,r[n++]=h>>>23&127,r[n++]=(h>>>30|(c&31)<<2)&127,r[n++]=c>>>5&127,r[n++]=c>>>12&127,r[n++]=c>>>19&127,r[n++]=(c>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function Hw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function Kw(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function Jw(t,e,r,i,n){let a=pl[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+n<=32){let p=l>>>o&a;r[u+c]=p|0,o+=n,o===32&&(o=0,s++,c!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<>>0)}}var fl=Py(bu),Qw=3*fl/256+fl|0;function zy(){let t=new Uint8Array(Qw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function t3(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:zy()}}function e3(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function r3(t,e,r,i){i.byteContainer.length>>2;if(n.byteOffset&3)for(let o=0;o>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u>>(u<<3)&255}return n}function i3(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=kw(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length>>5)|0,r.exceptionSizes[a]=s}return e}function n3(t,e,r,i,n){switch(n){case 1:qw(t,e,r,i);break;case 2:jw(t,e,r,i);break;case 3:Gw(t,e,r,i);break;case 4:Xw(t,e,r,i);break;case 5:Yw(t,e,r,i);break;case 6:Ww(t,e,r,i);break;case 7:Zw(t,e,r,i);break;case 8:Hw(t,e,r,i);break;case 16:Kw(t,e,r,i);break;default:Jw(t,e,r,i,n)}return e+(n<<3)|0}function a3(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function s3(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function o3(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=s3(n,a,s,r,i,l);if(s=c,h===1){let m=1<y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m0&&(c=o3(n,m,d,y,o,l,c,u,p))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function u3(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,h=t[u]>>>0,c=h+3>>>2,p=u+1,f=p+c;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=r3(t,p,h,a),y=h,m=i3(t,f,a);return a.dataPointers.fill(0),l3(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function h3(t,e,r,i,n,a){let s=i+wu(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(fl,s-o);l=u3(t,e,l,o,u,a),o=o+u|0}return l}function c3(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,h=n,c=n+a,p=0,f=0;for(;o>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${h-u}/${a}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function p3(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r!=null?r:zy();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=h3(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return c3(t,i,o,a,n,l),a}function f3(t,e,r,i,n){switch(n){case 2:Cw(t,e,r,i);return;case 3:Mw(t,e,r,i);return;case 4:Bw(t,e,r,i);return;case 5:Pw(t,e,r,i);return;case 6:zw(t,e,r,i);return;case 7:Lw(t,e,r,i);return;case 8:Vw(t,e,r,i);return;case 9:Ow(t,e,r,i);return;case 10:Rw(t,e,r,i);return;case 11:$w(t,e,r,i);return;case 12:Nw(t,e,r,i);return;case 16:Uw(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=pl[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let h=l>>>o&a;r[i+u]=h|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=t[s]>>>0;let p=pl[n-h]>>>0,f=(c|(l&p)<t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length0){let o=t.byteOffset+e;if(o&3)for(let l=0;l=64)throw Error(\"Varint too long\")}return e.set(n),r}function m3(t,e,r){let i=new Float64Array(r);for(let n=0;n>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error(\"Expected varint not more than 10 bytes\")}function v3(t,e,r,i){return b3(t,e,r,i,t3(r>>>2))}function b3(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=e3(n,s);d3(t,a,r,o);let l=p3(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function tt(t){return t>>>1^-(t&1)}function Ot(t){return t>>BigInt(1)^-(t&BigInt(1))}function He(t){return t%2==1?(t+1)/-2:t/2}function w3(t){let e=new Int32Array(t.length);for(let r=0;r=4)for(;i=4)for(;i=4)for(;r=4)for(let i=t[0];r=4)for(;i=4)for(;l>>0;for(let r=1;r>>0;return e}function hp(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ot(t[0]));for(let r=1;r>>0,e[1]=tt(t[1])>>>0;for(let r=2;r>>0,e[r+1]=e[r-1]+tt(t[r+1])>>>0;return e}function L3(t,e,r,i){let n=Vy(t,e,r,i);return new Uint32Array(n)}function V3(t){return t[1]}function O3(t){return tt(t[1])}function R3(t){if(t.length===2){let e=tt(t[1]);return[e,e]}return[tt(t[2]),tt(t[3])]}function $3(t){return t[1]}function N3(t){return Ot(t[1])}function U3(t){if(t.length===2){let e=Ot(t[1]);return[e,e]}return[Ot(t[2]),Ot(t[3])]}var At;(function(t){t.PRESENT=\"PRESENT\",t.DATA=\"DATA\",t.OFFSET=\"OFFSET\",t.LENGTH=\"LENGTH\"})(At||(At={}));var qt;(function(t){t.NONE=\"NONE\",t.SINGLE=\"SINGLE\",t.SHARED=\"SHARED\",t.VERTEX=\"VERTEX\",t.MORTON=\"MORTON\",t.FSST=\"FSST\"})(qt||(qt={}));var be;(function(t){t.VERTEX=\"VERTEX\",t.INDEX=\"INDEX\",t.STRING=\"STRING\",t.KEY=\"KEY\"})(be||(be={}));var Ft;(function(t){t.VAR_BINARY=\"VAR_BINARY\",t.GEOMETRIES=\"GEOMETRIES\",t.PARTS=\"PARTS\",t.RINGS=\"RINGS\",t.TRIANGLES=\"TRIANGLES\",t.SYMBOL=\"SYMBOL\",t.DICTIONARY=\"DICTIONARY\"})(Ft||(Ft={}));var q3=[At.PRESENT,At.DATA,At.OFFSET,At.LENGTH],cp=[Z.NONE,Z.DELTA,Z.COMPONENTWISE_DELTA,Z.RLE,Z.MORTON],j3=[re.NONE,re.FAST_PFOR,re.VARINT],G3=[qt.NONE,qt.SINGLE,qt.SHARED,qt.VERTEX,qt.MORTON,qt.FSST],X3=[be.VERTEX,be.INDEX,be.STRING,be.KEY],Y3=[Ft.VAR_BINARY,Ft.GEOMETRIES,Ft.PARTS,Ft.RINGS,Ft.TRIANGLES,Ft.SYMBOL,Ft.DICTIONARY];function ht(t,e){let r=H3(t,e);return r.logicalLevelTechnique1===Z.MORTON?W3(r,t,e):(Z.RLE===r.logicalLevelTechnique1||Z.RLE===r.logicalLevelTechnique2)&&re.NONE!==r.physicalLevelTechnique?Z3(r,t,e):r}function W3(t,e,r){let i=Rt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function Z3(t,e,r){let i=Rt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function H3(t,e){let r=t[e.get()],i=q3[r>>4],n={};switch(i){case At.DATA:n={dictionaryType:G3[r&15]};break;case At.OFFSET:n={offsetType:X3[r&15]};break;case At.LENGTH:n={lengthType:Y3[r&15]}}e.increment();let a=t[e.get()],s=cp[a>>5],o=cp[a>>2&7],l=j3[a&3];e.increment();let u=Rt(t,e,2),h=u[0],c=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var ut;(function(t){t[t.FLAT=0]=\"FLAT\",t[t.CONST=1]=\"CONST\",t[t.SEQUENCE=2]=\"SEQUENCE\",t[t.DICTIONARY=3]=\"DICTIONARY\",t[t.FSST_DICTIONARY=4]=\"FSST_DICTIONARY\"})(ut||(ut={}));var de=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<>r&1}size(){return this._size}getBuffer(){return this.values}};function kr(t,e,r){if(!e)return t;let i=e.size(),n=t.constructor,a=new n(i),s=0;for(let o=0;o=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],h=Math.min(a+l,e);n.fill(u,a,h),a=h}else{let l=256-o;for(let u=0;u=12?e6.decode(t.subarray(e,r)):r6(t,e,r)}function r6(t,e,r){let i=\"\",n=e;for(;n239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function Ma(t,e,r,i,n){return o6(pi(t,e,r),r,i,n)}function Vt(t,e,r,i,n){return l6(pi(t,e,r),r,i,n)}function Ke(t,e,r){return h6(pi(t,e,r),r)}function pi(t,e,r){let i=r.physicalLevelTechnique;switch(i){case re.FAST_PFOR:return v3(t,r.numValues,r.byteLength,e);case re.VARINT:return Rt(t,e,r.numValues);case re.NONE:return Q3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Tn(t,e,r){let i=r.physicalLevelTechnique;switch(i){case re.VARINT:return Du(t,e,r.numValues);case re.NONE:return t6(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function i6(t,e,r){let i=pi(t,e,r);return i.length===1?tt(i[0]):O3(i)}function Su(t,e,r){let i=pi(t,e,r);return i.length===1?r.logicalLevelTechnique1===Z.DELTA?tt(i[0]):i[0]:V3(i)}function Ny(t,e,r){return R3(pi(t,e,r))}function Uy(t,e,r){return U3(Du(t,e,r.numValues))}function qy(t,e,r,i){return Gy(Tn(t,e,r),r,i)}function Eu(t,e,r,i){return Xy(Tn(t,e,r),r,i)}function n6(t,e,r,i){let n=a6(t,e,r,!1);return i?kr(n,i,0):n}function a6(t,e,r,i){if(r.physicalLevelTechnique===re.VARINT)return u6(m3(t,e,r.numValues),r,i);let n=Tn(t,e,r),a=i?Gy(n,r):Xy(n,r);return Float64Array.from(a,Number)}function s6(t,e,r){let i=Tn(t,e,r);return i.length===1?Ot(i[0]):N3(i)}function jy(t,e,r){let i=Tn(t,e,r);return i.length===1?r.logicalLevelTechnique1===Z.DELTA?Ot(i[0]):i[0]:$3(i)}function o6(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case Z.DELTA:if(e.logicalLevelTechnique2===Z.RLE){let a=e;if(!i)return B3(t,a.runs,a.numRleValues);t=dl(t,a.runs,a.numRleValues),n=op(t)}else n=op(t);break;case Z.RLE:n=S3(t,e.runs,e.numRleValues);break;case Z.MORTON:_u(t),n=new Int32Array(t);break;case Z.COMPONENTWISE_DELTA:if(r&&!i)return Vy(t,r.scale,r.min,r.max);n=k3(t);break;case Z.NONE:n=w3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?kr(n,i,0):n}function l6(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case Z.DELTA:if(e.logicalLevelTechnique2===Z.RLE){let a=e;n=up(dl(t,a.runs,a.numRleValues))}else n=up(t);break;case Z.RLE:n=dl(t,e.runs,e.numRleValues);break;case Z.MORTON:_u(t),n=t;break;case Z.COMPONENTWISE_DELTA:n=r&&!i?L3(t,r.scale,r.min,r.max):z3(t);break;case Z.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?kr(n,i,0):n}function Gy(t,e,r){let i;switch(e.logicalLevelTechnique1){case Z.DELTA:if(e.logicalLevelTechnique2===Z.RLE){let n=e;if(!r)return P3(t,n.runs,n.numRleValues);t=yl(t,n.runs,n.numRleValues),i=lp(t)}else i=lp(t);break;case Z.RLE:i=E3(t,e.runs,e.numRleValues);break;case Z.NONE:i=D3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?kr(i,r,BigInt(0)):i}function Xy(t,e,r){let i;switch(e.logicalLevelTechnique1){case Z.DELTA:if(e.logicalLevelTechnique2===Z.RLE){let n=e;i=hp(yl(t,n.runs,n.numRleValues))}else i=hp(t);break;case Z.RLE:i=yl(t,e.runs,e.numRleValues);break;case Z.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?kr(i,r,BigInt(0)):i}function u6(t,e,r){switch(e.logicalLevelTechnique1){case Z.DELTA:if(e.logicalLevelTechnique2===Z.RLE){let i=e;t=Ly(t,i.runs,i.numRleValues)}return A3(t),t;case Z.RLE:return p6(t,e,r);case Z.NONE:return r&&_3(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function h6(t,e){if(e.logicalLevelTechnique1===Z.DELTA&&e.logicalLevelTechnique2===Z.NONE)return I3(t);if(e.logicalLevelTechnique1===Z.RLE&&e.logicalLevelTechnique2===Z.NONE){let r=e;return M3(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===Z.NONE&&e.logicalLevelTechnique2===Z.NONE){T3(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===Z.DELTA&&e.logicalLevelTechnique2===Z.RLE){let r=e,i=C3(t,r.runs,r.numRleValues);return _u(i),new Uint32Array(i)}throw Error(\"Only delta encoding is supported for transforming length to offset streams yet.\")}function rs(t,e,r,i,n=\"int32\"){let a=t.logicalLevelTechnique1;if(a===Z.RLE)return t.runs===1?ut.CONST:ut.FLAT;if(a!==Z.DELTA||t.logicalLevelTechnique2!==Z.RLE)return t.numValues===1?ut.CONST:ut.FLAT;let s=e instanceof de?e.size():e,o=t;if(o.numRleValues!==s)return ut.FLAT;if(o.runs===1)return ut.SEQUENCE;if(o.runs!==2)return t.numValues===1?ut.CONST:ut.FLAT;let l=i.get();if(t.physicalLevelTechnique===re.VARINT)return c6(r,i,n)?ut.SEQUENCE:t.numValues===1?ut.CONST:ut.FLAT;let u=i.get(),h=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),h[2]===2&&h[3]===2?ut.SEQUENCE:t.numValues===1?ut.CONST:ut.FLAT}function c6(t,e,r){let i=new By(e.get());if(r===\"int64\"){let a=Du(t,i,4);return a[2]===BigInt(2)&&a[3]===BigInt(2)}let n=Rt(t,i,4);return n[2]===2&&n[3]===2}function p6(t,e,r){return r?F3(t,e.runs,e.numRleValues):Ly(t,e.runs,e.numRleValues)}var Yy=class extends es{getValueFromBuffer(t){return this.dataBuffer[t]}},Wy=class extends Cy{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function Fu(t,e,r){return{x:pp(t,e)-r,y:pp(t>>1,e)-r}}function pp(t,e){let r=0;for(let i=0;i>i;return r}var Pt;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\",t[t.MULTIPOINT=3]=\"MULTIPOINT\",t[t.MULTILINESTRING=4]=\"MULTILINESTRING\",t[t.MULTIPOLYGON=5]=\"MULTIPOLYGON\"})(Pt||(Pt={}));var fp;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\"})(fp||(fp={}));var nr;(function(t){t[t.MORTON=0]=\"MORTON\",t[t.VEC_2=1]=\"VEC_2\",t[t.VEC_3=2]=\"VEC_3\"})(nr||(nr={}));function f6(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g[w]),r+=v,i+=v}break;case Pt.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=c[r]-c[r-1],r++;let b;d?(b=Or(m,s,v,!1),s+=v*2):(b=pr(t.vertexBufferType,m,f,o,v,!1,l),o+=v),e[a++]=[b],h&&n++}break;case Pt.POLYGON:{let v=c[r]-c[r-1];r++;let b=Array(v-1),w,_=p[i]-p[i-1];if(i++,d){w=Or(m,s,_,!0),s+=_*2;for(let A=0;Ar?e[a++]:1);return i}function mp(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l0;)n[a++]=t[u++]}}return n}var e1=class extends Tu{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s!=null?s:e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){var n,a,s;(s=this.decodedDictionary)!=null||(this.decodedDictionary=(n=this.sharedDictionaryCache)==null?void 0:n.decodedDictionary,(a=this.decodedDictionary)!=null||(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return Au(this.decodedDictionary,r,i)}decodeDictionary(){var t;return(t=this.symbolLengthBuffer)!=null||(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),F6(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=ht(t,e);m=new de(ci(t,x.numValues,x.byteLength,e),x.numValues)}let g=Vt(t,e,ht(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column \"${y}\"`);h[p++]=new e1(y,g,n,a,s,o,m,c)}else h[p++]=new Qr(y,g,n,a,m)}return h}var xp=class extends Tr{constructor(t,e,r){super(t,new Uint8Array,r!=null?r:e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},we;(function(t){t[t.STRING=1]=\"STRING\",t[t.INT32=2]=\"INT32\",t[t.UINT32=4]=\"UINT32\",t[t.INT64=8]=\"INT64\",t[t.UINT64=16]=\"UINT64\",t[t.FLOAT=32]=\"FLOAT\",t[t.DOUBLE=64]=\"DOUBLE\",t[t.PRESENCE=128]=\"PRESENCE\"})(we||(we={}));var tr;(function(t){t[t.FALSE=0]=\"FALSE\",t[t.TRUE=1]=\"TRUE\",t[t.START_MAP=2]=\"START_MAP\",t[t.START_LIST=3]=\"START_LIST\",t[t.COUNT=4]=\"COUNT\"})(tr||(tr={}));function M6(t,e,r,i){let n=B6(r);if(i===0)return n.map(h=>new xp(h,[]));let a=P6(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let h=0;h{var i;return t.name+((i=r.name)!=null?i:\"\")})}function P6(t,e,r){let i=t[e.get()];e.add(1);let n=Vt(t,e,ht(t,e)),a=r-1,s=[];i&we.STRING&&(a-=z6(t,e,s)),a-=L6(t,e,i,s),a-=V6(t,e,i,s);let o,l=0;if(i&we.PRESENCE){let h=O6(t,e);o=h.value,l=h.count,a--}let u=new Uint32Array;if(a>0&&(u=Vt(t,e,ht(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function z6(t,e,r){let i=t[e.get()];e.add(1);let n=r1(\"\",t,e,i);if(n)for(let a=0;aa.length)throw Error(\"Merged map counts underflow while decoding child streams\");let f=Array(r),d=i,y=n;for(let x=0;xs.length)throw Error(\"Map value stream underflow while decoding feature payload\");let b=$6(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x=r)throw Error(\"Unexpected end of map value stream\");let n=t[e];if(n===tr.FALSE)return{value:!1,nextIndex:e+1};if(n===tr.TRUE)return{value:!0,nextIndex:e+1};if(n===tr.START_MAP){let a=vp(t,e,r);return{value:i1(t,e+2,a,i).value,nextIndex:a}}if(n===tr.START_LIST){let a=vp(t,e,r),s=[],o=e+2;for(;o=r)throw Error(\"Missing length for nested map/list payload\");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error(\"Nested payload exceeds containing payload bounds\");return n}function n1(t,e){let r=t-tr.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function Xr(t,e){for(let r of e)t.push(r)}function N6(t,e,r,i,n,a){var s;return r.type===\"scalarType\"?a&&!a.has(r.name)?(Oy(i,t,e),null):U6(i,t,e,n,r.scalarType,r):((s=r.complexType)==null?void 0:s.physicalType)===rr.MAP?M6(t,e,r,i):i===0?null:C6(t,e,r,a)}function U6(t,e,r,i,n,a){var l;let s;if(t===0)return null;if(a.nullable){let u=ht(e,r),h=u.numValues,c=r.get(),p=ci(e,h,u.byteLength,r);r.set(c+u.byteLength),s=new de(p,u.numValues)}let o=s!=null?s:i;switch(n.physicalType){case rt.UINT_32:case rt.INT_32:return Y6(e,r,a,n,o);case rt.STRING:{let u=a.nullable?t-1:t;return(l=r1(a.name,e,r,u,s))!=null?l:null}case rt.BOOLEAN:return q6(e,r,a,i,o);case rt.UINT_64:case rt.INT_64:return X6(e,r,a,o,n);case rt.FLOAT:return j6(e,r,a,o);case rt.DOUBLE:return G6(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function q6(t,e,r,i,n){let a=ht(t,e),s=a.numValues,o=e.get(),l=kn(n)?n:void 0,u=ci(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let h=new de(u,s);return new A6(r.name,h,n)}function j6(t,e,r,i){let n=ht(t,e),a=kn(i)?i:void 0,s=Ry(t,e,n.numValues,a);return new S6(r.name,s,i)}function G6(t,e,r,i){let n=ht(t,e),a=kn(i)?i:void 0,s=$y(t,e,n.numValues,a);return new mu(r.name,s,i)}function X6(t,e,r,i,n){let a=ht(t,e),s=rs(a,i,t,e,\"int64\"),o=n.physicalType===rt.INT_64;if(s===ut.FLAT){let u=kn(i)?i:void 0,h=o?qy(t,e,a,u):Eu(t,e,a,u);return new Yy(r.name,h,i)}if(s===ut.SEQUENCE){let u=Uy(t,e,a);return new Wy(r.name,u[0],u[1],a.numRleValues,o)}let l=o?s6(t,e,a):jy(t,e,a);return new t1(r.name,l,i,o)}function Y6(t,e,r,i,n){let a=ht(t,e),s=rs(a,n,t,e),o=i.physicalType===rt.INT_32;if(s===ut.FLAT){let u=kn(n)?n:void 0,h=o?Ma(t,e,a,void 0,u):Vt(t,e,a,void 0,u);return new yu(r.name,h,n)}if(s===ut.SEQUENCE){let u=Ny(t,e,a);return new gu(r.name,u[0],u[1],a.numRleValues,o)}let l=o?i6(t,e,a):Su(t,e,a);return new xu(r.name,l,n,o)}function kn(t){return t instanceof de}var It={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function a1(t){switch(t){case It.ID:case It.ID|It.ID_NULLABLE:case It.ID|It.ID_LONG:case It.ID|It.ID_LONG|It.ID_NULLABLE:return{nullable:(t&It.ID_NULLABLE)!==0,columnScope:Xi.FEATURE,type:\"scalarType\",scalarType:{longID:(t&It.ID_LONG)!==0,type:\"logicalType\",logicalType:My.ID}};case It.GEOMETRY:return{nullable:!1,columnScope:Xi.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:rr.GEOMETRY,children:[]}};case It.STRUCT:return{nullable:!1,columnScope:Xi.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:rr.STRUCT,children:[]}};case It.MAP:return{nullable:!0,columnScope:Xi.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:rr.MAP,children:[]}};default:return J6(t)}}function W6(t){return t>=It.SCALAR_BASE}function s1(t){return t===It.STRUCT||t===It.MAP}function Z6(t){if(t.type===\"scalarType\"){let e=t.scalarType;if(e.type===\"physicalType\")switch(e.physicalType){case rt.BOOLEAN:case rt.INT_8:case rt.UINT_8:case rt.INT_32:case rt.UINT_32:case rt.INT_64:case rt.UINT_64:case rt.FLOAT:case rt.DOUBLE:return!1;case rt.STRING:return!0;default:return!1}if(e.type===\"logicalType\")return!1}else if(t.type===\"complexType\"){let e=t.complexType;if(e.type===\"physicalType\")switch(e.physicalType){case rr.GEOMETRY:case rr.STRUCT:case rr.MAP:return!0;default:return!1}}return console.warn(\"Unexpected column type in hasStreamCount\",t),!1}function H6(t){var e;return t.type===\"scalarType\"&&((e=t.scalarType)==null?void 0:e.type)===\"logicalType\"&&t.scalarType.logicalType===My.ID}function K6(t){var e;return t.type===\"complexType\"&&((e=t.complexType)==null?void 0:e.type)===\"physicalType\"&&t.complexType.physicalType===rr.GEOMETRY}function J6(t){let e;switch(t){case 10:case 11:e=rt.BOOLEAN;break;case 12:case 13:e=rt.INT_8;break;case 14:case 15:e=rt.UINT_8;break;case 16:case 17:e=rt.INT_32;break;case 18:case 19:e=rt.UINT_32;break;case 20:case 21:e=rt.INT_64;break;case 22:case 23:e=rt.UINT_64;break;case 24:case 25:e=rt.FLOAT;break;case 26:case 27:e=rt.DOUBLE;break;case 28:case 29:e=rt.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:Xi.FEATURE,type:\"scalarType\",scalarType:{longID:!1,type:\"physicalType\",physicalType:e}}}var Q6=new TextDecoder,bp=\"0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)\";function Iu(t,e){let r=Rt(t,e,1)[0];if(r===0)return\"\";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),Q6.decode(a)}function t5(t){let e=t.name,r=t.nullable;return t.type===\"scalarType\"?{type:\"scalarField\",scalarField:t.scalarType,name:e,nullable:r}:{type:\"complexField\",complexField:t.complexType,name:e,nullable:r}}function o1(t,e){let r=Rt(t,e,1)[0]>>>0,i=r>=It.SCALAR_BASE?a1(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n=Si(Xe({},i),{name:Iu(t,e)});if(n.type===\"complexType\"&&s1(r)){let a=n.complexType,s=Rt(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o>>0,i=a1(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${bp}`);let n;if(W6(r))n=Iu(t,e);else if(r>>0,o=a.complexType;o.children=Array(s);for(let l=0;l>>0,a=Rt(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=Rt(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=r5(t,i),h=l.featureTables[0],c=null,p=null,f=[],d=0;for(let m of h.columns){let g=m.name;if(H6(m)){let x=null;if(m.nullable){let b=ht(t,i),w=i.get(),_=ci(t,b.numValues,b.byteLength,i);i.set(w+b.byteLength),x=new de(_,b.numValues)}let v=ht(t,i);d=x?x.size():v.decompressedCount,c=n5(t,m,i,g,v,x!=null?x:d,r)}else if(K6(m)){let x=Rt(t,i,1)[0];if(d===0){let v=i.get();d=ht(t,i).decompressedCount,i.set(v)}e&&(e.scale=e.extent/u),p=w6(t,x,i,d,e)}else{let x=Z6(m)?Rt(t,i,1)[0]:1;if(x===0)continue;let v=N6(t,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new Tw(h.name,p,c,f,u);n.push(y),i.set(s)}return n}function n5(t,e,r,i,n,a,s=!1){var h;let o=(h=e.scalarType)!=null&&h.longID?rt.UINT_64:rt.UINT_32,l=typeof a==\"number\"?void 0:a,u=rs(n,a,t,r,o===rt.UINT_64?\"int64\":\"int32\");if(o===rt.UINT_32)switch(u){case ut.FLAT:return new yu(i,Vt(t,r,n,void 0,l),a);case ut.SEQUENCE:{let c=Ny(t,r,n);return new gu(i,c[0],c[1],n.numRleValues,!1)}case ut.CONST:return new xu(i,Su(t,r,n),a,!1)}switch(u){case ut.FLAT:return s?new mu(i,n6(t,r,n,l),a):new Yy(i,Eu(t,r,n,l),a);case ut.SEQUENCE:{let c=Uy(t,r,n);return new Wy(i,c[0],c[1],n.numRleValues,!1)}case ut.CONST:return new t1(i,jy(t,r,n),a,!1)}throw Error(\"Vector type not supported for id column.\")}var Qs=Py(bu);Qs/32*4,3*Qs/256+Qs|0;var a5=class{constructor(t,e){var r;switch(this._featureData=t,this.properties=this._featureData.properties||{},(r=this._featureData.geometry)==null?void 0:r.type){case Pt.POINT:case Pt.MULTIPOINT:this.type=1;break;case Pt.LINESTRING:case Pt.MULTILINESTRING:this.type=2;break;case Pt.POLYGON:case Pt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new M(i.x,i.y));t.push(r)}return t}},s5=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new a5(this.features[t],this.extent)}},Cu=class{constructor(t){this.layers={};let e=i5(new Uint8Array(t));this.layers=e.reduce((r,i)=>Si(Xe({},r),{[i.name]:new s5(i)}),{})}},Mu=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new fo(gt,16,0),this.grid3D=new fo(gt,16,0),this.featureIndexArray=new dd,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding===\"mlt\"?this.vtLayers=new Cu(this.rawTileData).layers:this.vtLayers=new Zl(new lu(this.rawTileData)).layers,this.sourceLayerCoder=new du(this.vtLayers?Object.keys(this.vtLayers).sort():[cl])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=gt/t.tileSize/t.scale,s=ai(n.filter,\"queryRenderedFeatures filter\",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Ia.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=Ia.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(y,m,g,x)=>Rg(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)h.push(y);h.sort(l5);let f={},d;for(let y of h){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,i,(x,v,b)=>(g||(g=Fr(x)),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,transform:t.transform,pixelsToTileUnits:a,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,h){let c=this.bucketLayerIDs[e];if(a&&!c.some(y=>a.has(y)))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(i);if(n.needGeometry){let y=hi(f,!0);if(!n.filter(new st(this.tileID.overscaledZ),y,this.tileID.canonical))return}else if(!n.filter(new st(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let y of c){if(a&&!a.has(y))continue;let m=o[y];if(!m)continue;let g={};d&&u&&(g=u.getState(m.sourceLayer||\"_geojsonTileLayer\",d));let x=Xt({},l[y]);x.paint=wp(x.paint,m.paint,f,g,s),x.layout=wp(x.layout,m.layout,f,g,s);let v=!h||h(f,m,g);if(!v)continue;let b=new Fw(f,this.z,this.x,this.y,d);b.layer=x;let w=t[y];w===void 0&&(w=t[y]=[]),w.push({featureIndex:i,feature:b,intersectionZ:v})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=ai(n.filterSpec,\"queryRenderedFeatures symbol filter\",n.globalState);for(let h of t)this.loadMatchingFeature(l,r,i,h,u,a,s,o,e);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){var i;let r=t.id;if(this.promoteId){let n=typeof this.promoteId==\"string\"?this.promoteId:this.promoteId[e];r=t.properties[n],typeof r==\"boolean\"&&(r=Number(r)),r===void 0&&((i=t.properties)!=null&&i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};C(\"FeatureIndex\",Mu,{omit:[\"rawTileData\",\"sourceLayerCoder\"]});function o5(t){return typeof t==\"object\"&&!!t&&\"evaluate\"in t}function wp(t,e,r,i,n){return xn(t,(a,s)=>{let o=e instanceof Wa?e.get(s):null;return o5(o)?o.evaluate(r,i,void 0,n):o})}function l5(t,e){return e-t}var l1=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}};function Bu(t){let e=typeof t;if(e===\"number\"||e===\"boolean\"||e===\"string\"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n=\"[\";for(let a of t)n+=`${Bu(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i=\"{\";for(let n=0;nthis._layers[c.id]),s=a[0];if(s.isHidden())continue;let o=s.source||\"\",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]={});let u=s.sourceLayer||\"_geojsonTileLayer\",h=l[u];h||(h=l[u]=[]),h.push(a)}}},c1=class{constructor(t){let e={},r=[];for(let s in t){let o=e[s]={};for(let l in t[s]){let u=t[s][l];o[l]={};for(let h in u){let c=u[h];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let p={x:0,y:0,w:c.bitmap.width+2,h:c.bitmap.height+2};r.push(p),o[l][h]={rect:p,metrics:c.metrics}}}}let{w:i,h:n}=uu(r),a=new Qa({width:i||1,height:n||1});for(let s in t)for(let o in t[s]){let l=t[s][o];for(let u in l){let h=l[u];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let c=e[s][o][u].rect;Qa.copy(h.bitmap,a,{x:0,y:0},{x:c.x+1,y:c.y+1},h.bitmap)}}this.image=a,this.positions=e}};C(\"GlyphAtlas\",c1);var p1=class{constructor(t){this.tileID=new pu(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,e,r,i,n){return et(this,null,function*(){this.data=t,this.collisionBoxArray=new Rl;let a=new du(Object.keys(t.layers).sort()),s=new Mu(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let S in u){let T=t.layers[S];if(!T)continue;T.version===1&&Mt(`Vector tile source \"${this.source}\" layer \"${S}\" does not use vector tile spec v2 and therefore may have some rendering errors.`);let L=a.encode(S),O=[];for(let B=0;BF.id)))}}let h=xn(l.glyphDependencies,S=>xn(S,T=>Object.keys(T)));for(let S of this.inFlightDependencies)S==null||S.abort();this.inFlightDependencies=[];let c=Promise.resolve({});if(Object.keys(h).length){let S=new AbortController;this.inFlightDependencies.push(S),c=i.sendAsync({type:\"GG\",data:{stacks:h,source:this.source,tileID:this.tileID,type:\"glyphs\"}},S)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let S=new AbortController;this.inFlightDependencies.push(S),f=i.sendAsync({type:\"GI\",data:{icons:p,source:this.source,tileID:this.tileID,type:\"icons\"}},S)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let S=new AbortController;this.inFlightDependencies.push(S),y=i.sendAsync({type:\"GI\",data:{icons:d,source:this.source,tileID:this.tileID,type:\"patterns\"}},S)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let S=new AbortController;this.inFlightDependencies.push(S),g=i.sendAsync({type:\"GDA\",data:{dashes:m}},S)}let[x,v,b,w]=yield Promise.all([c,f,y,g]),_=new c1(x),A=new hu(v,b);for(let S in o){let T=o[S];T.hasDependencies&&(u1(T.layers,this.zoom,r),T.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:_.positions,iconMap:v,iconPositions:A.iconPositions,patternMap:b,patternPositions:A.patternPositions,dashPositions:w,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(S=>!S.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_.image,imageAtlas:A,dashPositions:w,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?_.positions:null}})}};function u1(t,e,r){let i=new st(e);for(let n of t)n.recalculate(i,r)}var f1=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e!=null&&e.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},d1=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},p5=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new M(e.x,e.y)))}},f5=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},d5=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function y5(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l0&&l.addLayer(d)}let h={vectorTile:l,rawData:fu(l).buffer};return this.overzoomedTileResultCache.set(s,h),h}reloadTile(t){return et(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error(\"Should not be trying to reload a tile that was never loaded or has been removed\");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}abortTile(t){return et(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return et(this,null,function*(){this.tileState.removeLoaded(t.uid)})}},g5=class{constructor(){this.loaded={}}loadTile(t){return et(this,null,function*(){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,h=Ba(i)?new Ht({width:l,height:u},yield Ep(i,-2,-2,l,u)):i,c=new Yl(e,h,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=c,c})}removeTile(t){let e=this.loaded,r=t.uid;e!=null&&e[r]&&delete e[r]}},x5=class{constructor(t,e,r,i=v5){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new f1,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error(\"Unable to parse the data into a cluster or geojson\");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new Iy(n.features,{version:2,extent:gt});return{vectorTile:a,rawData:fu(a,Sp).buffer}}loadTile(t){return et(this,null,function*(){let{uid:e}=t,r=new p1(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),yield this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}})}_parseWorkerTile(t,e){return et(this,null,function*(){let r=this.tileState.getParsing(t.uid),i=yield t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=Xt({rawTileData:n.slice(0),encoding:\"mvt\"},i),this.tileState.removeParsing(t.uid)}return i})}abortTile(t){return et(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return et(this,null,function*(){this.tileState.removeLoaded(t.uid)})}loadData(t){return et(this,null,function*(){var r;(r=this._pendingRequest)==null||r.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let i={};return t.request&&(i.data=t.data),this._finishRequestTiming(e,t,i),i}catch(i){if(delete this._pendingRequest,!xl(i))throw i;return{abandoned:!0}}})}_startRequestTiming(t){var e;if((e=t.request)!=null&&e.collectResourceTiming)return new d1(t.request.url)}_finishRequestTiming(t,e,r){let i=t==null?void 0:t.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}reloadTile(t){return et(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return yield this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}loadAndProcessGeoJSON(t,e){return et(this,null,function*(){var r;if(t.request&&(t.data=(yield Ip(t.request,e)).data),t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source),this._geoJSONIndex=this._createGeoJSONIndex(t.data,t);return}if(t.dataDiff){(r=this._geoJSONIndex)!=null||(this._geoJSONIndex=this._createGeoJSONIndex({type:\"FeatureCollection\",features:[]},t)),this._geoJSONIndex.updateData(t.dataDiff,this._getFilterPredicate(t.filter,t.source));return}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,y1(t)),this._geoJSONIndex==null)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)})}_filterGeoJSON(t,e,r){if(t.type!==\"FeatureCollection\")return t;let i=this._getFilterPredicate(e,r);return i?{type:\"FeatureCollection\",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!=\"boolean\"&&!(t!=null&&t.length))return;let r=ar(t,`sources.${e}.filter`,{type:\"boolean\",\"property-type\":\"data-driven\",overridable:!1,transition:!1});if(r.result===\"error\")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(\", \"));return i=>r.value.evaluate({zoom:0},i)}removeSource(t){return et(this,null,function*(){var e;(e=this._pendingRequest)==null||e.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getClusterChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset)}};function v5(t,e){let r=Xt(e.geojsonVtOptions||{},{updateable:!0,clusterOptions:y1(e)});return new Kd(t,r)}function y1({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,h]=e[l],c=ar(h,`sources.${r}.clusterProperties.${l}[1]`),p=ar(typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=c.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let h of o)u[h]=i[h].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let h of o)a.accumulated=l[h],l[h]=n[h].evaluate(a,s)},t.clusterOptions}function h1(t){return et(this,null,function*(){if(t.endsWith(\".mjs\")){yield import(t);return}let e=yield fetch(t,{credentials:\"same-origin\"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=yield e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:\"text/javascript\"}));try{yield import(i)}finally{URL.revokeObjectURL(i)}return}globalThis.eval(r)})}var b5=class{constructor(t){this.self=t,this.actor=new Ty(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name \"${e}\" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=Fp,this.self.removeProtocol=Tp,this.self.registerRTLTextPlugin=e=>{Ar.setMethods(e)},this.self.makeRequest=Pa,this.actor.registerMessageHandler(\"LDT\",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RDT\",(e,r)=>et(this,null,function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})),this.actor.registerMessageHandler(\"GCEZ\",(e,r)=>et(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})),this.actor.registerMessageHandler(\"GCC\",(e,r)=>et(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})),this.actor.registerMessageHandler(\"GCL\",(e,r)=>et(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})),this.actor.registerMessageHandler(\"LD\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler(\"LT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler(\"AT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler(\"RMT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler(\"RS\",(e,r)=>et(this,null,function*(){var n,a;if(!((a=(n=this.workerSources[e])==null?void 0:n[r.type])!=null&&a[r.source]))return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)})),this.actor.registerMessageHandler(\"RM\",e=>et(this,null,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)})),this.actor.registerMessageHandler(\"SR\",(e,r)=>et(this,null,function*(){this.referrer=r})),this.actor.registerMessageHandler(\"SRPS\",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler(\"IS\",(e,r)=>et(this,null,function*(){yield h1(r)})),this.actor.registerMessageHandler(\"SI\",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler(\"UL\",(e,r)=>et(this,null,function*(){this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))})),this.actor.registerMessageHandler(\"UGS\",(e,r)=>et(this,null,function*(){let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]})),this.actor.registerMessageHandler(\"SL\",(e,r)=>et(this,null,function*(){this._getLayerIndex(e).replace(r,this._getGlobalState(e))}))}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}_setImages(t,e){return et(this,null,function*(){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}})}_syncRTLPluginState(t,e){return et(this,null,function*(){return yield Ar.syncState(e,h1)})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new c5),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case\"vector\":this.workerSources[t][e][r]=new m5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case\"geojson\":this.workerSources[t][e][r]=new x5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new g5),this.demWorkerSources[t][e]}};vr(self)&&(self.worker=new b5(self));export{b5 as default};\n/*! Bundled license information:\n\nmaplibre-gl/dist/maplibre-gl-shared.mjs:\nmaplibre-gl/dist/maplibre-gl-worker.mjs:\n (**\n * MapLibre GL JS\n * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.11.2/LICENSE.txt\n *)\n*/\n"; +module.exports = "var um=Object.defineProperty,cm=Object.defineProperties;var hm=Object.getOwnPropertyDescriptors;var Hc=Object.getOwnPropertySymbols;var pm=Object.prototype.hasOwnProperty,fm=Object.prototype.propertyIsEnumerable;var Kc=(t,e,r)=>e in t?um(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y=(t,e)=>{for(var r in e||(e={}))pm.call(e,r)&&Kc(t,r,e[r]);if(Hc)for(var r of Hc(e))fm.call(e,r)&&Kc(t,r,e[r]);return t},lt=(t,e)=>cm(t,hm(e));var rt=(t,e,r)=>new Promise((i,n)=>{var a=l=>{try{o(r.next(l))}catch(u){n(u)}},s=l=>{try{o(r.throw(l))}catch(u){n(u)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(a,s);o((r=r.apply(t,e)).next())});var dm=Object.create,Lf=Object.defineProperty,ym=Object.getOwnPropertyDescriptor,mm=Object.getOwnPropertyNames,gm=Object.getPrototypeOf,Of=Object.prototype.hasOwnProperty,lu=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e,e.exports),t=null),e.exports),xm=(t,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(var n=mm(e),a=0,s=n.length,o;ae[l]).bind(null,o),enumerable:!(i=ym(e,o))||i.enumerable});return t},vm=(t,e,r)=>(r=t==null?{}:dm(gm(t)),xm(e||!t||!t.__esModule||!Of.call(t,\"default\")?Lf(r,\"default\",{value:t,enumerable:!0}):r,t));function F(t,e){this.x=t,this.y=e}F.prototype={clone(){return new F(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:F},F.convert=function(t){if(t instanceof F)return t;if(Array.isArray(t))return new F(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new F(+t.x,+t.y);throw Error(\"Expected [x, y] or {x, y} point format\")};function bm(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-c;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var Yi;function wm(){return Yi!=null||(Yi=typeof OffscreenCanvas<\"u\"&&!!new OffscreenCanvas(1,1).getContext(\"2d\")&&typeof createImageBitmap==\"function\"),Yi}var da;function _m(){if(da==null&&(da=!1,wm())){let t=new OffscreenCanvas(5,5).getContext(\"2d\",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){da=!0;break}}}return da||!1}var bn=typeof Float32Array<\"u\"?Float32Array:Array;function Dm(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function uu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Mo(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],m=e[13],g=e[14],x=e[15],v=r[0],b=r[1],w=r[2],D=r[3];return t[0]=v*i+b*o+w*h+D*y,t[1]=v*n+b*l+w*p+D*m,t[2]=v*a+b*u+w*f+D*g,t[3]=v*s+b*c+w*d+D*x,v=r[4],b=r[5],w=r[6],D=r[7],t[4]=v*i+b*o+w*h+D*y,t[5]=v*n+b*l+w*p+D*m,t[6]=v*a+b*u+w*f+D*g,t[7]=v*s+b*c+w*d+D*x,v=r[8],b=r[9],w=r[10],D=r[11],t[8]=v*i+b*o+w*h+D*y,t[9]=v*n+b*l+w*p+D*m,t[10]=v*a+b*u+w*f+D*g,t[11]=v*s+b*c+w*d+D*x,v=r[12],b=r[13],w=r[14],D=r[15],t[12]=v*i+b*o+w*h+D*y,t[13]=v*n+b*l+w*p+D*m,t[14]=v*a+b*u+w*f+D*g,t[15]=v*s+b*c+w*d+D*x,t}function Vf(t,e,r){var i=r[0],n=r[1],a=r[2],s,o,l,u,c,h,p,f,d,y,m,g;return e===t?(t[12]=e[0]*i+e[4]*n+e[8]*a+e[12],t[13]=e[1]*i+e[5]*n+e[9]*a+e[13],t[14]=e[2]*i+e[6]*n+e[10]*a+e[14],t[15]=e[3]*i+e[7]*n+e[11]*a+e[15]):(s=e[0],o=e[1],l=e[2],u=e[3],c=e[4],h=e[5],p=e[6],f=e[7],d=e[8],y=e[9],m=e[10],g=e[11],t[0]=s,t[1]=o,t[2]=l,t[3]=u,t[4]=c,t[5]=h,t[6]=p,t[7]=f,t[8]=d,t[9]=y,t[10]=m,t[11]=g,t[12]=s*i+c*n+d*a+e[12],t[13]=o*i+h*n+y*a+e[13],t[14]=l*i+p*n+m*a+e[14],t[15]=u*i+f*n+g*a+e[15]),t}function Rf(t,e,r){var i=r[0],n=r[1],a=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Sm(){var t=new bn(3);return bn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Am(t){var e=new bn(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function os(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function Pa(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function $f(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function br(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function Nf(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t}function Le(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function wr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function cu(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}function Em(t,e,r,i){var n=e[0],a=e[1],s=e[2];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t[2]=s+i*(r[2]-s),t}var tr=$f,Po=os;(function(){var t=Sm();return function(e,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;or?n-360:n+360;return Math.abs(n)=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function zm(t,e,r,i){return bm(t,e,r,i)}zm(.25,.1,.25,1);function Kt(t,e,r){return Math.min(r,Math.max(e,t))}function Pr(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function Lm(t){return Math.log(t)/Math.LN2%1==0}function Om(t){return 2**t}function Vm(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function Lo(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r[e,gr(r)])):t}var th={};function Ot(t){th[t]||(typeof console<\"u\"&&console.warn(t),th[t]=!0)}function xr(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function vi(t){return typeof WorkerGlobalScope<\"u\"&&t!==void 0&&t instanceof WorkerGlobalScope}function pu(t){return typeof ImageBitmap<\"u\"&&t instanceof ImageBitmap}function Rm(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),c=Math.min(t.width,e+i),h=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:c-l,height:h-u},layout:[{offset:s,stride:o}]}}function $m(t,e,r,i,n){return rt(this,null,function*(){if(typeof VideoFrame>\"u\")throw Error(\"VideoFrame not supported\");let a=new VideoFrame(t,{timestamp:0});try{let s=a==null?void 0:a.format;if(!s||!(s.startsWith(\"BGR\")||s.startsWith(\"RGB\")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith(\"BGR\"),l=new Uint8ClampedArray(i*n*4);if(yield a.copyTo(l,Rm(t,e,r,i,n)),o)for(let u=0;u{t.removeEventListener(e,r,i)}}}function bi(t){return t*Math.PI/180}function rh(t,e,r){var i;(i=r[t])!=null&&i.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function io(t,e,r){if(r!=null&&r[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}function jf(t,e){if(e)for(let[r,i]of Object.entries(e))Object.defineProperty(t,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}var Uf=class{constructor(t,e={}){jf(this,e),this.type=t}},ja=class extends Uf{constructor(t,e={}){super(\"error\",Y({error:t},e))}},Um=class{on(t,e){return this._listeners||(this._listeners={}),rh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return io(t,e,this._listeners),io(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),rh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){var n,a,s,o,l,u;let r=typeof t==\"string\"?new Uf(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let c=(s=(a=(n=this._listeners)==null?void 0:n[i])==null?void 0:a.slice())!=null?s:[];for(let f of c)f.call(this,r);let h=(u=(l=(o=this._oneTimeListeners)==null?void 0:o[i])==null?void 0:l.slice())!=null?u:[];for(let f of h)io(i,f,this._oneTimeListeners),f.call(this,r);let p=this._eventedParent;p&&(jf(r,typeof this._eventedParentData==\"function\"?this._eventedParentData():this._eventedParentData),p.fire(r))}else r instanceof ja&&console.error(r.error);return this}listens(t){var e,r,i,n,a;return!!((r=(e=this._listeners)==null?void 0:e[t])!=null&&r.length||(n=(i=this._oneTimeListeners)==null?void 0:i[t])!=null&&n.length||(a=this._eventedParent)!=null&&a.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},ih=\"AbortError\",fu=class extends Error{constructor(t=ih){super(t instanceof Error?t.message:t),this.name=ih,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function qf(t){return t instanceof Error&&t.name===\"AbortError\"}function qm(t){if(t.aborted)throw new fu(t.reason)}var Oo=class Gf{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u=h[f+0]&&n>=h[f+1])?(o[p]=!0,s.push(c[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=h;f++)for(let d=c;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;s\":{},\">=\":{},\"<\":{},\"<=\":{},in:{},\"!in\":{},all:{},any:{},none:{},has:{},\"!has\":{}}},geometry_type:{type:\"enum\",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:\"expression\"},stops:{type:\"array\",value:\"function_stop\"},base:{type:\"number\",default:1,minimum:0},property:{type:\"string\",default:\"$zoom\"},type:{type:\"enum\",values:{identity:{},exponential:{},interval:{},categorical:{}},default:\"exponential\"},colorSpace:{type:\"enum\",values:{rgb:{},lab:{},hcl:{},oklch:{},oklab:{}},default:\"rgb\"},default:{type:\"*\",required:!1}},function_stop:{type:\"array\",minimum:0,maximum:24,value:[\"number\",\"color\"],length:2},expression:{type:\"array\",value:\"expression_name\",minimum:1},light:{anchor:{type:\"enum\",default:\"viewport\",values:{map:{},viewport:{}},\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]}},position:{type:\"array\",default:[1.15,210,30],length:3,value:\"number\",\"property-type\":\"data-constant\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]}},color:{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},intensity:{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},sky:{\"sky-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#88C6FC\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-ground-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-fog-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"sky-horizon-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"atmosphere-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},terrain:{source:{type:\"string\",required:!0},exaggeration:{type:\"number\",minimum:0,default:1}},projection:{type:{type:\"projectionDefinition\",default:\"mercator\",\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]}}},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_heatmap\",\"paint_fill-extrusion\",\"paint_symbol\",\"paint_raster\",\"paint_hillshade\",\"paint_color-relief\",\"paint_background\"],paint_fill:{\"fill-antialias\":{type:\"boolean\",default:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-layer-blend\":{type:\"enum\",values:{normal:{},multiply:{},color:{},luminosity:{},\"plus-lighter\":{},screen:{},overlay:{},difference:{},exclusion:{},\"soft-light\":{},\"hard-light\":{},darken:{},lighten:{},\"color-dodge\":{},\"color-burn\":{},hue:{},saturation:{}},default:\"normal\",\"property-type\":\"constant\",transition:!1},\"fill-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-outline-color\":{type:\"color\",transition:!0,requires:[{\"!\":\"fill-pattern\"},{\"fill-antialias\":!0}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"fill-rounded-corner-distance\":{type:\"number\",default:0,minimum:0,units:\"meters\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},\"paint_fill-extrusion\":{\"fill-extrusion-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"fill-extrusion-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\",\"elevation\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-extrusion-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"fill-extrusion-height\":{type:\"number\",default:0,units:\"meters\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-base\":{type:\"number\",default:0,units:\"meters\",transition:!0,requires:[\"fill-extrusion-height\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-vertical-gradient\":{type:\"boolean\",default:!0,transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_line:{\"line-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"line-layer-blend\":{type:\"enum\",values:{normal:{},multiply:{},color:{},luminosity:{},\"plus-lighter\":{},screen:{},overlay:{},difference:{},exclusion:{},\"soft-light\":{},\"hard-light\":{},darken:{},lighten:{},\"color-dodge\":{},\"color-burn\":{},hue:{},saturation:{}},default:\"normal\",\"property-type\":\"constant\",transition:!1},\"line-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"line-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-width\":{type:\"number\",default:1,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-gap-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-offset\":{type:\"number\",default:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-dasharray\":{type:\"array\",value:\"number\",minimum:0,transition:!0,units:\"line widths\",requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-gradient\":{type:\"color\",transition:!1,requires:[{\"!\":\"line-dasharray\"},{\"!\":\"line-pattern\"},{source:\"geojson\",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[\"line-progress\"]},\"property-type\":\"color-ramp\"}},paint_circle:{\"circle-radius\":{type:\"number\",default:5,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-blur\":{type:\"number\",default:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"circle-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-scale\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-stroke-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"}},paint_heatmap:{\"heatmap-radius\":{type:\"number\",default:30,minimum:1,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-weight\":{type:\"number\",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-intensity\":{type:\"number\",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"heatmap-color\":{type:\"color\",default:[\"interpolate\",[\"linear\"],[\"heatmap-density\"],0,\"rgba(0, 0, 255, 0)\",.1,\"royalblue\",.3,\"cyan\",.5,\"lime\",.7,\"yellow\",1,\"red\"],transition:!1,expression:{interpolated:!0,parameters:[\"heatmap-density\"]},\"property-type\":\"color-ramp\"},\"heatmap-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_symbol:{\"icon-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"icon-image\",\"icon-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-color\":{type:\"color\",default:\"#000000\",transition:!0,overridable:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"text-field\",\"text-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_raster:{\"raster-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-layer-blend\":{type:\"enum\",values:{normal:{},multiply:{},color:{},luminosity:{},\"plus-lighter\":{},screen:{},overlay:{},difference:{},exclusion:{},\"soft-light\":{},\"hard-light\":{},darken:{},lighten:{},\"color-dodge\":{},\"color-burn\":{},hue:{},saturation:{}},default:\"normal\",\"property-type\":\"constant\",transition:!1},\"raster-hue-rotate\":{type:\"number\",default:0,period:360,transition:!0,units:\"degrees\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-min\":{type:\"number\",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-max\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-saturation\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-contrast\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-resampling\":{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-fade-duration\":{type:\"number\",default:300,minimum:0,transition:!1,units:\"milliseconds\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_hillshade:{\"hillshade-illumination-direction\":{type:\"numberArray\",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-altitude\":{type:\"numberArray\",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-exaggeration\":{type:\"number\",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-shadow-color\":{type:\"colorArray\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-highlight-color\":{type:\"colorArray\",default:\"#FFFFFF\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-accent-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-method\":{type:\"enum\",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:\"standard\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},\"paint_color-relief\":{\"color-relief-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"color-relief-color\":{type:\"color\",transition:!1,expression:{interpolated:!0,parameters:[\"elevation\"]},\"property-type\":\"color-ramp\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_background:{\"background-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"background-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"background-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"cross-faded\"},\"background-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},transition:{duration:{type:\"number\",default:300,minimum:0,units:\"milliseconds\"},delay:{type:\"number\",default:0,minimum:0,units:\"milliseconds\"}},\"property-type\":{\"data-driven\":{type:\"property-type\"},\"cross-faded\":{type:\"property-type\"},\"cross-faded-data-driven\":{type:\"property-type\"},\"color-ramp\":{type:\"property-type\"},\"data-constant\":{type:\"property-type\"},constant:{type:\"property-type\"}},promoteId:{\"*\":{type:\"string\"}},interpolation:{type:\"array\",value:\"interpolation_name\",minimum:1},interpolation_name:{type:\"enum\",values:{linear:{syntax:{overloads:[{parameters:[],\"output-type\":\"interpolation\"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[\"base\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"base\",type:\"number literal\"}]}},\"cubic-bezier\":{syntax:{overloads:[{parameters:[\"x1\",\"y1\",\"x2\",\"y2\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"x1\",type:\"number literal\"},{name:\"y1\",type:\"number literal\"},{name:\"x2\",type:\"number literal\"},{name:\"y2\",type:\"number literal\"}]}}}}},S=Xf,Gm=[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"],T=class{constructor(t,e,r,i,n=\"error\"){this.message=(t?`${t}: `:\"\")+r,i&&(this.identifier=i),this.severity=n,typeof(e==null?void 0:e.__line__)==\"number\"&&e.__line__&&(this.line=e.__line__)}},Te=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},Xm=class Yf{constructor(e,r=[]){this.parent=e,this.bindings=new Map(r)}concat(e){return new Yf(this,e)}get(e){if(this.bindings.has(e))return this.bindings.get(e);if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings.has(e)?!0:this.parent?this.parent.has(e):!1}},$n={kind:\"null\"},M={kind:\"number\"},Z={kind:\"string\"},tt={kind:\"boolean\"},Fe={kind:\"color\"},ls={kind:\"projectionDefinition\"},Lr={kind:\"object\"},J={kind:\"value\"},Ym={kind:\"error\"},us={kind:\"collator\"},Nn={kind:\"formatted\"},cs={kind:\"padding\"},wn={kind:\"colorArray\"},hs={kind:\"numberArray\"},jn={kind:\"resolvedImage\"},ps={kind:\"variableAnchorOffsetCollection\"};function Zt(t,e){return{kind:\"array\",itemType:t,N:e}}function _t(t){if(t.kind===\"array\"){let e=_t(t.itemType);return typeof t.N==\"number\"?`array<${e}, ${t.N}>`:t.itemType.kind===\"value\"?\"array\":`array<${e}>`}return t.kind}var Wm=[$n,M,Z,tt,Fe,ls,Nn,Lr,Zt(J),cs,hs,wn,jn,ps];function _n(t,e){if(e.kind===\"error\")return null;if(t.kind===\"array\"){if(e.kind===\"array\"&&(e.N===0&&e.itemType.kind===\"value\"||!_n(t.itemType,e.itemType))&&(typeof t.N!=\"number\"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind===\"value\"){for(let r of Wm)if(!_n(r,e))return null}}return`Expected ${_t(t)} but found ${_t(e)} instead.`}function du(t,e){return e.some(r=>r.kind===t.kind)}function Or(t,e){return e.some(r=>r===\"null\"?t===null:r===\"array\"?Array.isArray(t):r===\"object\"?t&&!Array.isArray(t)&&typeof t==\"object\":r===typeof t)}function hr(t,e){return t.kind===\"array\"&&e.kind===\"array\"?t.itemType.kind===e.itemType.kind&&typeof t.N==\"number\":t.kind===e.kind}var Wf=.96422,Zf=.82521,Hf=4/29,Vo=6/29,Kf=3*Vo*Vo,Jf=Math.PI/180,yu=180/Math.PI;function mu(t){return t%=360,t<0&&(t+=360),t}function Qf([t,e,r,i]){t=Re(t),e=Re(e),r=Re(r);let n,a,s=no((.2225045*t+.7168786*e+.0606169*r)/1);return t===e&&e===r?n=a=s:(n=no((.4360747*t+.3850649*e+.1430804*r)/Wf),a=no((.0139322*t+.0971045*e+.7141733*r)/Zf)),[116*s-16,500*(n-s),200*(s-a),i]}function Re(t){let e=Math.abs(t);return e<=.04045?t/12.92:Math.sign(t)*((e+.055)/1.055)**2.4}function no(t){return t>.008856451679035631?t**(1/3):t/Kf+Hf}function td([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*so(n),a=Wf*so(a),s=Zf*so(s),[ao(3.1338561*a-1.6168667*n-.4906146*s),ao(-.9787684*a+1.9161415*n+.033454*s),ao(.0719453*a-.2289914*n+1.4052427*s),i]}function ao(t){let e=Math.abs(t);return e<=.00304?12.92*t:Math.sign(t)*(1.055*e**(1/2.4)-.055)}function so(t){return t>Vo?t*t*t:Kf*(t-Hf)}function Zm(t){let[e,r,i,n]=Qf(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?mu(Math.atan2(i,r)*yu):NaN,a,e,n]}function Hm([t,e,r,i]){return t=isNaN(t)?0:t*Jf,td([r,Math.cos(t)*e,Math.sin(t)*e,i])}function Km([t,e,r,i]){t=mu(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var ed=[[506752/1228815,87881/245763,12673/70218],[87098/409605,175762/245763,12673/175545],[7918/409605,87881/737289,1001167/1053270]],rd=[[12831/3959,-329/214,-1974/3959],[-851781/878810,1648619/878810,36519/878810],[705/12673,-2585/12673,705/667]],Jm=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Qm=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],tg=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],eg=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]];function $e(t,[e,r,i]){return[t[0][0]*e+t[0][1]*r+t[0][2]*i,t[1][0]*e+t[1][1]*r+t[1][2]*i,t[2][0]*e+t[2][1]*r+t[2][2]*i]}function fn(t){let e=Math.abs(t);return e>.0031308?Math.sign(t)*(1.055*e**(1/2.4)-.055):12.92*t}function id([t,e,r]){let[i,n,a]=$e(Jm,$e(ed,[Re(t),Re(e),Re(r)]));return $e(Qm,[Math.cbrt(i),Math.cbrt(n),Math.cbrt(a)])}function rg(t){let[e,r,i]=$e(tg,t),[n,a,s]=$e(rd,$e(eg,[e*e*e,r*r*r,i*i*i]));return[fn(n),fn(a),fn(s)]}function ig([t,e,r,i]){let[n,a,s]=id([t,e,r]);return[n,a,s,i]}function ng([t,e,r,i]){let[n,a,s]=id([t,e,r]),o=Math.sqrt(a*a+s*s);return o<=4e-6?[n,0,NaN,i]:[n,o,mu(Math.atan2(s,a)*yu),i]}function gu([t,e,r,i]){let n=isNaN(r)?0:r*Jf,a=Math.min(e,1e6),[s,o,l]=rg([t,a*Math.cos(n),a*Math.sin(n)]);return[s,o,l,i]}function nd([t,e,r,i]){return gu([t,Math.hypot(e,r),Math.atan2(r,e)*yu,i])}var ag=[[608311/1250200,189793/714400,198249/1000160],[35783/156275,247089/357200,198249/2500400],[0,32229/714400,5220557/5000800]],sg=[[446124/178915,-333277/357830,-72051/178915],[-14852/17905,63121/35810,423/17905],[11844/330415,-50337/660830,316169/330415]];function og([t,e,r,i]){let[n,a,s]=[t,e,r].map(c=>Re(Math.min(Math.max(c,-1e6),1e6))),[o,l,u]=$e(rd,$e(ag,[n,a,s])).map(fn);return[o,l,u,i]}function lg([t,e,r,i]){let[n,a,s]=$e(sg,$e(ed,[Re(t),Re(e),Re(r)])).map(o=>Math.min(Math.max(fn(o),0),1));return[n,a,s,i]}var ug=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function Nt(t,e){return ug(t,e)?t[e]:void 0}function cg(t){if(t=t.toLowerCase().trim(),t===\"transparent\")return[0,0,0,0];let e=Nt(dg,t);if(e){let[s,o,l]=e;return[s/255,o/255,l/255,1]}if(t.startsWith(\"#\")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let s=t.length<6?1:2,o=1;return[ya(t.slice(o,o+=s)),ya(t.slice(o,o+=s)),ya(t.slice(o,o+=s)),ya(t.slice(o,o+s)||\"ff\")]}if(t.startsWith(\"rgb\")){let s=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(s){let[o,l,u,c,h,p,f,d,y,m,g,x]=s,v=[c||\" \",f||\" \",m].join(\"\");if(v===\" \"||v===\" /\"||v===\",,\"||v===\",,,\"){let b=[u,p,y].join(\"\"),w=b===\"%%%\"?100:b===\"\"?255:0;if(w){let D=[De(+l/w,0,1),De(+h/w,0,1),De(+d/w,0,1),g?ah(+g,x):1];if(sh(D))return D}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[s,o,l,u,c,h,p,f,d]=r,y=[l||\" \",c||\" \",p].join(\"\");if(y===\" \"||y===\" /\"||y===\",,\"||y===\",,,\"){let m=[+o,De(+u,0,100),De(+h,0,100),f?ah(+f,d):1];if(sh(m))return Km(m)}}let i=t.match(hg);if(i){let[,s,o,l,u]=i,c=[fe(s,1),fe(o,.4),fe(l,1),u===void 0?1:fe(u,1)];if(c.every(Number.isFinite))return gu([De(c[0],0,1),Math.max(c[1],0),c[2]%360,De(c[3],0,1)])}let n=t.match(pg);if(n){let[,s,o,l,u]=n,c=[fe(s,1),fe(o,.4),fe(l,.4),u===void 0?1:fe(u,1)];if(c.every(Number.isFinite))return nd([De(c[0],0,1),c[1],c[2],De(c[3],0,1)])}let a=t.match(fg);if(a){let[,s,o,l,u]=a,c=[fe(s,1),fe(o,1),fe(l,1),u===void 0?1:fe(u,1)];if(c.every(Number.isFinite))return og([c[0],c[1],c[2],De(c[3],0,1)])}}var xe=\"[+-]?(?:\\\\d+(?:\\\\.\\\\d+)?|\\\\.\\\\d+)(?:e[+-]?\\\\d+)?\",hg=RegExp(`^oklch\\\\(\\\\s*(none|${xe}%?)\\\\s+(none|${xe}%?)\\\\s+(none|${xe}(?:deg|grad|rad|turn)?)\\\\s*(?:\\\\/\\\\s*(none|${xe}%?)\\\\s*)?\\\\)$`),pg=RegExp(`^oklab\\\\(\\\\s*(none|${xe}%?)\\\\s+(none|${xe}%?)\\\\s+(none|${xe}%?)\\\\s*(?:\\\\/\\\\s*(none|${xe}%?)\\\\s*)?\\\\)$`),fg=RegExp(`^color\\\\(\\\\s*display-p3\\\\s+(none|${xe}%?)\\\\s+(none|${xe}%?)\\\\s+(none|${xe}%?)\\\\s*(?:\\\\/\\\\s*(none|${xe}%?)\\\\s*)?\\\\)$`),nh={deg:1,grad:.9,rad:180/Math.PI,turn:360};function fe(t,e){if(t===\"none\")return 0;let[,r,i]=t.match(/^(.+?)(%|[a-z]+)?$/);return i===\"%\"?r/100*e:i?+r%(360/nh[i])*nh[i]:+r}function ya(t){return parseInt(t.padEnd(2,t),16)/255}function ah(t,e){return De(e?t/100:t,0,1)}function De(t,e,r){return Math.min(Math.max(e,t),r)}function sh(t){return!t.some(Number.isNaN)}var dg={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Wt(t,e,r){return t+r*(e-t)}function wi(t,e,r){return t.map((i,n)=>Wt(i,e[n],r))}function yg(t){return t===\"rgb\"||t===\"hcl\"||t===\"lab\"||t===\"oklch\"||t===\"oklab\"}var Bt,xt=(Bt=class{constructor(e,r,i,n=1,a=!0){!a&&(Math.min(e,r,i)<0||Math.max(e,r,i)>1)&&(this.overwriteGetter(\"unclippedRgb\",[e,r,i,n]),e=Math.min(Math.max(e,0),1),r=Math.min(Math.max(r,0),1),i=Math.min(Math.max(i,0),1)),this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter(\"rgb\",[e,r,i,n]))}static parse(e){if(e instanceof Bt)return e;if(typeof e!=\"string\")return;let r=cg(e);if(r)return new Bt(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter(\"rgb\",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter(\"hcl\",Zm(this.unclippedRgb))}get lab(){return this.overwriteGetter(\"lab\",Qf(this.unclippedRgb))}get oklch(){return this.overwriteGetter(\"oklch\",ng(this.unclippedRgb))}get oklab(){return this.overwriteGetter(\"oklab\",ig(this.unclippedRgb))}get displayP3(){return this.overwriteGetter(\"displayP3\",lg(this.unclippedRgb))}get unclippedRgb(){return this.rgb}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(\",\")},${n})`}static interpolate(e,r,i,n=\"rgb\"){switch(n){case\"rgb\":{let[a,s,o,l]=wi(e.unclippedRgb,r.unclippedRgb,i);return new Bt(a,s,o,l,!1)}case\"hcl\":{let[a,s,o,l]=e.hcl,[u,c,h,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=c)):(f=a,(h===1||h===0)&&(d=s));let[y,m,g,x]=Hm([f,d!=null?d:Wt(s,c,i),Wt(o,h,i),Wt(l,p,i)]);return new Bt(y,m,g,x,!1)}case\"lab\":{let[a,s,o,l]=td(wi(e.lab,r.lab,i));return new Bt(a,s,o,l,!1)}case\"oklch\":{let[a,s,o,l]=e.oklch,[u,c,h,p]=r.oklch,f=isNaN(o)?h:o,d=isNaN(h)?o:h;d-f>180?f+=360:d-f<-180&&(d+=360);let y=Wt(l,p,i),m=y===0?1:y,[g,x,v]=gu([Wt(a*l,u*p,i)/m,Wt(s*l,c*p,i)/m,Wt(f,d,i),y]);return new Bt(g,x,v,y,!1)}case\"oklab\":{let[a,s,o,l]=e.oklab,[u,c,h,p]=r.oklab,f=Wt(l,p,i),d=f===0?1:f,[y,m,g]=nd([Wt(a*l,u*p,i)/d,Wt(s*l,c*p,i)/d,Wt(o*l,h*p,i)/d,f]);return new Bt(y,m,g,f,!1)}}}},Bt.black=new Bt(0,0,0,1),Bt.white=new Bt(1,1,1,1),Bt.transparent=new Bt(0,0,0,0),Bt.red=new Bt(1,0,0,1),Bt),xu=class{constructor(t,e,r){this.sensitivity=t?e?\"variant\":\"case\":e?\"accent\":\"base\",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:\"search\"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},mg=[\"bottom\",\"center\",\"top\"],Ro=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},er=class Ba{constructor(e){this.sections=e}static fromString(e){return new Ba([new Ro(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ba?e:Ba.fromString(e)}toString(){return this.sections.length===0?\"\":this.sections.map(e=>e.text).join(\"\")}},Ge=class an{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof an)return e;if(typeof e==\"number\")return new an([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!=\"number\")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new an(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new an(wi(e.values,r.values,i))}},Xe=class sn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof sn)return e;if(typeof e==\"number\")return new sn([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!=\"number\")return;return new sn(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new sn(wi(e.values,r.values,i))}},ie=class on{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof on)return e;if(typeof e==\"string\"){let i=xt.parse(e);return i?new on([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!=\"string\")return;let n=xt.parse(i);if(!n)return;r.push(n)}return new on(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n=\"rgb\"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s=0&&t<=255&&typeof e==\"number\"&&e>=0&&e<=255&&typeof r==\"number\"&&r>=0&&r<=255?i===void 0||typeof i==\"number\"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(\", \")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i==\"number\"?[t,e,r,i]:[t,e,r]).join(\", \")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function _i(t){if(t===null||typeof t==\"string\"||typeof t==\"boolean\"||typeof t==\"number\"||t instanceof Gr||t instanceof xt||t instanceof xu||t instanceof er||t instanceof Ge||t instanceof Xe||t instanceof ie||t instanceof Ue||t instanceof qe)return!0;if(Array.isArray(t)){for(let e of t)if(!_i(e))return!1;return!0}if(typeof t==\"object\"){for(let e in t)if(!_i(t[e]))return!1;return!0}return!1}function Ct(t){if(t===null)return $n;if(typeof t==\"string\")return Z;if(typeof t==\"boolean\")return tt;if(typeof t==\"number\")return M;if(t instanceof xt)return Fe;if(t instanceof Gr)return ls;if(t instanceof xu)return us;if(t instanceof er)return Nn;if(t instanceof Ge)return cs;if(t instanceof Xe)return hs;if(t instanceof ie)return wn;if(t instanceof Ue)return ps;if(t instanceof qe)return jn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=Ct(i);if(!r)r=n;else{if(r===n)continue;r=J;break}}return Zt(r||J,e)}return Lr}function dn(t){let e=typeof t;return t===null?\"\":e===\"string\"||e===\"number\"||e===\"boolean\"?String(t):t instanceof xt||t instanceof Gr||t instanceof er||t instanceof Ge||t instanceof Xe||t instanceof ie||t instanceof Ue||t instanceof qe?t.toString():JSON.stringify(t)}var Di=class od{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!_i(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=Ct(i),a=r.expectedType;return n.kind===\"array\"&&n.N===0&&a&&a.kind===\"array\"&&(typeof a.N!=\"number\"||a.N===0)&&(n=a),new od(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},ma={string:Z,number:M,boolean:tt,object:Lr},He=class ld{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=1,n,a=e[0];if(a===\"array\"){let o;if(e.length>2){let u=e[1];if(typeof u!=\"string\"||!(u in ma)||u===\"object\")return r.error('The item type argument of \"array\" must be one of string, number, boolean',1);o=ma[u],i++}else o=J;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=\"number\"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to \"array\" must be a positive integer literal',2);l=e[2],i++}n=Zt(o,l)}else{if(!ma[a])throw Error(`Types doesn't contain name = ${a}`);n=ma[a]}let s=[];for(;ie.outputDefined())}},oh={\"to-boolean\":tt,\"to-color\":Fe,\"to-number\":M,\"to-string\":Z},ui=class ud{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[0];if(!oh[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i===\"to-boolean\"||i===\"to-string\")&&e.length!==2)return r.error(\"Expected one argument.\");let n=oh[i],a=[];for(let s=1;s4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:sd(r[0],r[1],r[2],r[3]),!i))return new xt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new bt(i||`Could not parse color from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"padding\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ge.parse(r);if(n)return n}throw new bt(`Could not parse padding from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"numberArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Xe.parse(r);if(n)return n}throw new bt(`Could not parse numberArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"colorArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=ie.parse(r);if(n)return n}throw new bt(`Could not parse colorArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"variableAnchorOffsetCollection\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ue.parse(r);if(n)return n}throw new bt(`Could not parse variableAnchorOffsetCollection from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"number\":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new bt(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case\"formatted\":return er.fromString(dn(this.args[0].evaluate(e)));case\"resolvedImage\":return qe.fromString(dn(this.args[0].evaluate(e)));case\"projectionDefinition\":{let r=this.args[0].evaluate(e);if(Gr.parse(r))return r;throw new bt(`Could not parse projectionDefinition from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}default:return dn(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},xg=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],cd=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&\"id\"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type==\"number\"?xg[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&\"geometry\"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=xt.parse(t),this._parseColorCache.set(t,e)),e}},hd=class pd{constructor(e,r,i=[],n,a=new Xm,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(\"\"),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r==null?this._parse(e,a):this.concat(r,i,n)._parse(e,a)}_parse(e,r){(e===null||typeof e==\"string\"||typeof e==\"boolean\"||typeof e==\"number\")&&(e=[\"literal\",e]);let i=this.key;function n(a,s,o){return o===\"assert\"?new He(s,[a],i):o===\"coerce\"?new ui(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');let a=e[0];if(typeof a!=\"string\")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use [\"literal\", [...]].`,0),null;let s=Nt(this.registry,a);if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind===\"string\"||l.kind===\"number\"||l.kind===\"boolean\"||l.kind===\"object\"||l.kind===\"array\")&&u.kind===\"value\")o=n(o,l,r.typeAnnotation||\"assert\");else if(l.kind===\"projectionDefinition\"&&[\"string\",\"array\",\"value\"].includes(u.kind)||[\"color\",\"formatted\",\"resolvedImage\"].includes(l.kind)&&[\"value\",\"string\"].includes(u.kind)||[\"padding\",\"numberArray\"].includes(l.kind)&&[\"value\",\"number\",\"array\"].includes(u.kind)||l.kind===\"colorArray\"&&[\"value\",\"string\",\"array\"].includes(u.kind)||l.kind===\"variableAnchorOffsetCollection\"&&[\"value\",\"array\"].includes(u.kind))o=n(o,l,r.typeAnnotation||\"coerce\");else if(this.checkSubtype(l,u))return null}if(!(o instanceof Di)&&o.type.kind!==\"resolvedImage\"&&this._isConstant(o)){let l=new cd;try{o=new Di(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression \"${a}\". If you wanted a literal array, use [\"literal\", [...]].`,0)}return e===void 0?this.error(\"'undefined' value invalid. Use null instead.\"):typeof e==\"object\"?this.error('Bare objects invalid. Use [\"literal\", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e==\"number\"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new pd(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join(\"\")}`;this.errors.push(new Te(i,e))}checkSubtype(e,r){let i=_n(e,r);return i&&this.error(i),i}},fd=class dd{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a=i.length)throw new bt(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new bt(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},bg=class xd{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=tt}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,J),n=r.parse(e[2],2,J);return!i||!n?null:du(i.type,[tt,Z,M,$n,J])?new xd(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${_t(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!Or(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new bt(`Expected first argument to be of type boolean, string, number or null, but found ${_t(Ct(r))} instead.`,this.key);if(!Or(i,[\"string\",\"array\"]))throw new bt(`Expected second argument to be of type array or string, but found ${_t(Ct(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},wg=class $o{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=M}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,J),n=r.parse(e[2],2,J);if(!i||!n)return null;if(!du(i.type,[tt,Z,M,$n,J]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${_t(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,M);return a?new $o(i,n,r.key,a):null}return new $o(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!Or(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new bt(`Expected first argument to be of type boolean, string, number or null, but found ${_t(Ct(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),Or(i,[\"string\"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(Or(i,[\"array\"]))return i.indexOf(r,n);throw new bt(`Expected second argument to be of type array or string, but found ${_t(Ct(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},_g=class vd{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error(\"Expected an even number of arguments.\");let i,n;r.expectedType&&r.expectedType.kind!==\"value\"&&(n=r.expectedType);let a={},s=[];for(let u=2;u2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d==\"number\"&&Math.floor(d)!==d)return p.error(\"Numeric branch labels must be integer values.\");if(!i)i=Ct(d);else if(p.checkSubtype(i,Ct(d)))return null;if(a[String(d)]!==void 0)return p.error(\"Branch labels must be unique.\");a[String(d)]=s.length}let f=r.parse(h,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,J);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!==\"value\"&&r.concat(1).checkSubtype(i,o.type)?null:new vd(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(Ct(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},Dg=class bd{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error(\"Expected an odd number of arguments.\");let i;r.expectedType&&r.expectedType.kind!==\"value\"&&(i=r.expectedType);let n=[];for(let s=1;sr.outputDefined())&&this.otherwise.outputDefined()}},Sg=class No{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,J),n=r.parse(e[2],2,M);if(!i||!n)return null;if(!du(i.type,[Zt(J),Z,J]))return r.error(`Expected first argument to be of type array or string, but found ${_t(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,M);return a?new No(i.type,i,n,r.key,a):null}return new No(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),Or(r,[\"string\"]))return[...r].slice(i,n).join(\"\");if(Or(r,[\"array\"]))return r.slice(i,n);throw new bt(`Expected first argument to be of type array or string, but found ${_t(Ct(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function fs(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||ee)a=s-1;else throw new bt(\"Input is not a number.\",r);return 0}var vu=class wd{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");let i=r.parse(e[1],1,M);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!==\"value\"&&(a=r.expectedType);for(let s=1;s=o)return r.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.',u);let h=r.parse(l,c,a);if(!h)return null;a||(a=h.type),n.push([o,h])}return new wd(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[fs(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Ag(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(c,h=1e-6){if(c<=0)return 0;if(c>=1)return 1;let p=c;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-c;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}function pi(t,e){if(!(t instanceof e))return!1;try{return e.prototype.valueOf.call(t),!0}catch(r){return!1}}function St(t){return pi(t,Number)||pi(t,String)||pi(t,Boolean)?t.valueOf():t}function $r(t){if(Array.isArray(t))return t.map($r);let e=St(t);return e instanceof Object?Object.fromEntries(Object.entries(e).map(([r,i])=>[r,$r(i)])):e}function Ae(t){let e=St(t);return typeof e==\"object\"&&e?JSON.stringify(e):String(e)}var ge=class jo{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name===\"exponential\")a=oo(r,e.base,i,n);else if(e.name===\"linear\")a=oo(r,1,i,n);else if(e.name===\"cubic-bezier\"){let s=e.controlPoints;a=Ag(s[0],s[1],s[2],s[3])(oo(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error(\"Expected an interpolation type expression.\",1);if(n[0]===\"linear\")n={name:\"linear\"};else if(n[0]===\"exponential\"){let u=n[1];if(typeof u!=\"number\")return r.error(\"Exponential interpolation requires a numeric base.\",1,1);n={name:\"exponential\",base:u}}else if(n[0]===\"cubic-bezier\"){let u=n.slice(1);if(u.length!==4||u.some(c=>typeof c!=\"number\"||c<0||c>1))return r.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\",1);n={name:\"cubic-bezier\",controlPoints:u}}else return r.error(`Unknown interpolation type ${Ae(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");if(a=r.parse(a,2,M),!a)return null;let o=[],l=null;(i===\"interpolate-hcl\"||i===\"interpolate-lab\"||i===\"interpolate-oklch\"||i===\"interpolate-oklab\")&&r.expectedType!=wn?l=Fe:r.expectedType&&r.expectedType.kind!==\"value\"&&(l=r.expectedType);for(let u=0;u=c)return r.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.',p);let d=r.parse(h,f,l);if(!d)return null;l||(l=d.type),o.push([c,d])}return!hr(l,M)&&!hr(l,ls)&&!hr(l,Fe)&&!hr(l,cs)&&!hr(l,hs)&&!hr(l,wn)&&!hr(l,ps)&&!hr(l,Zt(M))?r.error(`Type ${_t(l)} is not interpolatable.`):new jo(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=fs(r,n,this.key),o=r[s],l=r[s+1],u=jo.interpolationFactor(this.interpolation,n,o,l),c=i[s].evaluate(e),h=i[s+1].evaluate(e);switch(this.operator){case\"interpolate\":switch(this.type.kind){case\"number\":return Wt(c,h,u);case\"color\":return xt.interpolate(c,h,u);case\"padding\":return Ge.interpolate(c,h,u);case\"colorArray\":return ie.interpolate(c,h,u);case\"numberArray\":return Xe.interpolate(c,h,u);case\"variableAnchorOffsetCollection\":return Ue.interpolate(c,h,u,this.key);case\"array\":return wi(c,h,u);case\"projectionDefinition\":return Gr.interpolate(c,h,u)}case\"interpolate-hcl\":switch(this.type.kind){case\"color\":return xt.interpolate(c,h,u,\"hcl\");case\"colorArray\":return ie.interpolate(c,h,u,\"hcl\")}case\"interpolate-lab\":switch(this.type.kind){case\"color\":return xt.interpolate(c,h,u,\"lab\");case\"colorArray\":return ie.interpolate(c,h,u,\"lab\")}case\"interpolate-oklch\":switch(this.type.kind){case\"color\":return xt.interpolate(c,h,u,\"oklch\");case\"colorArray\":return ie.interpolate(c,h,u,\"oklch\")}case\"interpolate-oklab\":switch(this.type.kind){case\"color\":return xt.interpolate(c,h,u,\"oklab\");case\"colorArray\":return ie.interpolate(c,h,u,\"oklab\")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function oo(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var rr={color:xt.interpolate,number:Wt,padding:Ge.interpolate,numberArray:Xe.interpolate,colorArray:ie.interpolate,variableAnchorOffsetCollection:Ue.interpolate,array:wi},_d=class Uo{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=null,n=r.expectedType;n&&n.kind!==\"value\"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:\"omit\"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error(\"No output type\");return n&&a.some(s=>_n(n,s.type))?new Uo(J,a):new Uo(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof qe&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function lh(t,e){return t===\"==\"||t===\"!=\"?e.kind===\"boolean\"||e.kind===\"string\"||e.kind===\"number\"||e.kind===\"null\"||e.kind===\"value\":e.kind===\"string\"||e.kind===\"number\"||e.kind===\"value\"}function Eg(t,e,r){return e===r}function Tg(t,e,r){return e!==r}function Fg(t,e,r){return er}function Cg(t,e,r){return e<=r}function kg(t,e,r){return e>=r}function Dd(t,e,r,i){return i.compare(e,r)===0}function Mg(t,e,r,i){return!Dd(t,e,r,i)}function Pg(t,e,r,i){return i.compare(e,r)<0}function Bg(t,e,r,i){return i.compare(e,r)>0}function zg(t,e,r,i){return i.compare(e,r)<=0}function Lg(t,e,r,i){return i.compare(e,r)>=0}function Mi(t,e,r){let i=t!==\"==\"&&t!==\"!=\";return class Sd{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=tt,this.hasUntypedArgument=a.type.kind===\"value\"||s.type.kind===\"value\"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error(\"Expected two or three arguments.\");let o=a[0],l=s.parse(a[1],1,J);if(!l)return null;if(!lh(o,l.type))return s.concat(1).error(`\"${o}\" comparisons are not supported for type '${_t(l.type)}'.`);let u=s.parse(a[2],2,J);if(!u)return null;if(!lh(o,u.type))return s.concat(2).error(`\"${o}\" comparisons are not supported for type '${_t(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(`Cannot compare types '${_t(l.type)}' and '${_t(u.type)}'.`);i&&(l.type.kind===\"value\"&&u.type.kind!==\"value\"?l=new He(u.type,[l],s.key):l.type.kind!==\"value\"&&u.type.kind===\"value\"&&(u=new He(l.type,[u],s.key)));let c=null;if(a.length===4){if(l.type.kind!==\"string\"&&u.type.kind!==\"string\"&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(\"Cannot use collator to compare non-string types.\");if(c=s.parse(a[3],3,us),!c)return null}return new Sd(l,u,s.key,c)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=Ct(s),u=Ct(o);if(l.kind!==u.kind||l.kind!==\"string\"&&l.kind!==\"number\")throw new bt(`Expected arguments for \"${t}\" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=Ct(s),u=Ct(o);if(l.kind!==\"string\"||u.kind!==\"string\")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var Og=Mi(\"==\",Eg,Dd),Vg=Mi(\"!=\",Tg,Mg),Rg=Mi(\"<\",Fg,Pg),$g=Mi(\">\",Ig,Bg),Ng=Mi(\"<=\",Cg,zg),jg=Mi(\">=\",kg,Lg),Ad=class Ed{constructor(e,r,i){this.type=us,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error(\"Expected one argument.\");let i=e[1];if(typeof i!=\"object\"||!i||Array.isArray(i))return r.error(\"Collator options argument must be an object.\");let n=r.parse(i[\"case-sensitive\"]!==void 0&&i[\"case-sensitive\"],1,tt);if(!n)return null;let a=r.parse(i[\"diacritic-sensitive\"]!==void 0&&i[\"diacritic-sensitive\"],1,tt);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,Z),!s)?null:new Ed(n,a,s)}evaluate(e){return new xu(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},Ug=class Td{constructor(e,r,i,n,a,s){this.type=Z,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,M);if(!i)return null;let n=e[2];if(typeof n!=\"object\"||!n||Array.isArray(n))return r.error(\"NumberFormat options argument must be an object.\");let a=null;if(n.locale&&(a=r.parse(n.locale,1,Z),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,Z),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,Z),!o))return null;if(s&&o)return r.error(\"NumberFormat options `currency` and `unit` are mutually exclusive\");let l=null;if(n[\"min-fraction-digits\"]&&(l=r.parse(n[\"min-fraction-digits\"],1,M),!l))return null;let u=null;return n[\"max-fraction-digits\"]&&(u=r.parse(n[\"max-fraction-digits\"],1,M),!u)?null:new Td(i,a,s,o,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?\"currency\":this.unit?\"unit\":\"decimal\",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},Fd=class Id{constructor(e){this.type=Nn,this.sections=e}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[1];if(!Array.isArray(i)&&typeof i==\"object\")return r.error(\"First argument must be an image or text section.\");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o==\"object\"&&o&&!Array.isArray(o)){a=!1;let l=null;if(o[\"font-scale\"]&&(l=r.parse(o[\"font-scale\"],1,M),!l))return null;let u=null;if(o[\"text-font\"]&&(u=r.parse(o[\"text-font\"],1,Zt(Z)),!u))return null;let c=null;if(o[\"text-color\"]&&(c=r.parse(o[\"text-color\"],1,Fe),!c))return null;let h=null;if(o[\"vertical-align\"]){if(typeof o[\"vertical-align\"]==\"string\"&&!mg.includes(o[\"vertical-align\"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o[\"vertical-align\"]}' instead.`);if(h=r.parse(o[\"vertical-align\"],1,Z),!h)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=c,p.verticalAlign=h}else{let l=r.parse(e[s],1,J);if(!l)return null;let u=l.type.kind;if(u!==\"string\"&&u!==\"value\"&&u!==\"null\"&&u!==\"resolvedImage\")return r.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Id(n)}evaluate(e){return new er(this.sections.map(r=>{let i=r.content.evaluate(e);return Ct(i)===jn?new Ro(\"\",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new Ro(dn(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(\",\"):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}},qg=class Cd{constructor(e){this.type=jn,this.input=e}static parse(e,r){if(e.length!==2)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,Z);return i?new Cd(i):r.error(\"No image name provided.\")}evaluate(e){let r=this.input.evaluate(e),i=qe.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},Gg=class kd{constructor(e,r){this.input=e,this.key=r,this.type=M}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!==\"array\"&&i.type.kind!==\"string\"&&i.type.kind!==\"value\"?r.error(`Expected argument of type string or array, but found ${_t(i.type)} instead.`):new kd(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r==\"string\")return[...r].length;if(Array.isArray(r))return r.length;throw new bt(`Expected value to be of type string or array, but found ${_t(Ct(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},uh={Point:0,MultiPoint:1,LineString:1,MultiLineString:2,Polygon:2,MultiPolygon:3};function Md(t,e){return Array.isArray(t)?e===0?t.length>=2&&t.every(r=>typeof r==\"number\"):t.every(r=>Md(r,e-1)):!1}function ch(t){if(typeof t!=\"object\"||!t)return!1;let{type:e,coordinates:r}=t;return typeof e==\"string\"&&Object.keys(uh).includes(e)&&Md(r,uh[e])}function Pd(t){if(typeof t!=\"object\"||!t)return null;let{type:e,geometry:r,features:i}=t,n;if(e===\"FeatureCollection\"){if(!Array.isArray(i))return null;n=[];for(let s of i){if(typeof s!=\"object\"||!s)return null;s.geometry!==null&&n.push(s.geometry)}}else if(e===\"Feature\")n=[r];else return ch(t)?[t]:null;let a=[];for(let s of n)if(ch(s))a.push(s);else if((s==null?void 0:s.type)!==\"GeometryCollection\")return null;return a}var Ne=8192;function Xg(t,e){let r=Yg(t[0]),i=Zg(t[1]),n=2**e.z;return[Math.round(r*n*Ne),Math.round(i*n*Ne)]}function bu(t,e){let r=2**e.z,i=(t[0]/Ne+e.x)/r,n=(t[1]/Ne+e.y)/r;return[Wg(i),Hg(n)]}function Yg(t){return(180+t)/360}function Wg(t){return t*360-180}function Zg(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Hg(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function Un(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Dn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Kg(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Jg(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function ds(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return rx([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(hh(t,e,r,i)&&hh(r,i,t,e))}function Qg(t,e,r){for(let i of r)for(let n=0;n0&&h<0||c<0&&h>0}function wu(t,e,r){let i=[];for(let n=0;nr[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}Un(e,t)}function ix(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function ph(t,e,r,i){let n=2**i.z*Ne,a=[i.x*Ne,i.y*Ne],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];Ld(u,e,r,n),s.push(u)}return s}function fh(t,e,r,i){let n=2**i.z*Ne,a=[i.x*Ne,i.y*Ne],s=[];for(let o of t){let l=[];for(let u of o){let c=[u.x+a[0],u.y+a[1]];Un(e,c),l.push(c)}s.push(l)}if(e[2]-e[0]<=n/2){ix(e);for(let o of s)for(let l of o)Ld(l,e,r,n)}return s}function nx(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=wu(e.coordinates,i,n),s=ph(t.geometry(),r,i,n);if(!Dn(r,i))return!1;for(let o of s)if(!Pi(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=zd(e.coordinates,i,n),s=ph(t.geometry(),r,i,n);if(!Dn(r,i))return!1;for(let o of s)if(!tx(o,a))return!1}return!0}function ax(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=wu(e.coordinates,i,n),s=fh(t.geometry(),r,i,n);if(!Dn(r,i))return!1;for(let o of s)if(!Bd(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=zd(e.coordinates,i,n),s=fh(t.geometry(),r,i,n);if(!Dn(r,i))return!1;for(let o of s)if(!ex(o,a))return!1}return!0}var _u=class qo{constructor(e,r){this.type=tt,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);let i=_i(e[1])?Pd(e[1]):null;if(i){let n=e[1];if(n.type===\"FeatureCollection\"){let a=[];for(let{type:s,coordinates:o}of i)s===\"Polygon\"&&a.push(o),s===\"MultiPolygon\"&&a.push(...o);if(a.length)return new qo(n,{type:\"MultiPolygon\",coordinates:a})}else{let a=i[0];if((a==null?void 0:a.type)===\"Polygon\"||(a==null?void 0:a.type)===\"MultiPolygon\")return new qo(n,a)}}return r.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===\"Point\")return nx(e,this.geometries);if(e.geometryType()===\"LineString\")return ax(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Od=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}};function Vd(t,e,r=0,i=t.length-1,n=sx){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);Vd(t,e,Math.max(r,Math.floor(e-u*h/l+p)),Math.min(i,Math.floor(e+(l-u)*h/l+p)),n)}let a=t[e],s=r,o=i;for(Hi(t,r,e),n(t[i],a)>0&&Hi(t,r,i);s0;)o--}n(t[r],a)===0?Hi(t,r,o):(o++,Hi(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function Hi(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function sx(t,e){return te)}function ys(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=lx(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=c/this.kx*p,u+=h/this.ky*p)),c=this.wrap(e[0]-l)*this.kx,h=(e[1]-u)*this.ky;let f=c*c+h*h;f180;)t-=360;return t}};function Rd(t,e){return e[0]-t[0]}function Ua(t){return t[1]-t[0]+1}function ir(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];let r=Ua(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function Xo(t,e){if(!ir(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)Un(r,t[i]);return r}function Yo(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)Un(e,i);return e}function yh(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Su(t,e,r){if(!yh(t)||!yh(e))return NaN;let i=0,n=0;return t[2]e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]=i)return i;if(Dn(n,a)){if(mh(t,e))return 0}else if(mh(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,c=u-1;l0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],c=e?50:100;if(Ua(u)<=c){if(!ir(u,t.length))return NaN;if(e){let h=px(t,u,r,i);if(isNaN(h)||h===0)return h;a=Math.min(a,h)}else for(let h=u[0];h<=u[1];++h){let p=hx(t[h],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let h=Go(u,e);gh(s,a,i,t,o,h[0]),gh(s,a,i,t,o,h[1])}}return a}function Ga(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new Od([[0,[0,t.length-1],[0,r.length-1]]],Rd);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],c=l[2],h=e?50:100,p=i?50:100;if(Ua(u)<=h&&Ua(c)<=p){if(!ir(u,t.length)&&ir(c,r.length))return NaN;let f;if(e&&i)f=ux(t,u,r,c,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=c[0];y<=c[1];++y)if(f=Br(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(c[0],c[1]+1);for(let y=u[0];y<=u[1];++y)if(f=Br(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=cx(t,u,r,c,n),s=Math.min(s,f)}else{let f=Go(u,e),d=Go(c,i);ga(o,s,n,t,r,f[0],d[0]),ga(o,s,n,t,r,f[0],d[1]),ga(o,s,n,t,r,f[1],d[0]),ga(o,s,n,t,r,f[1],d[1])}}return s}function dx(t,e){let r=t.geometry(),i=r.flat().map(s=>bu([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new Du(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,Ga(i,!1,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,Ga(i,!1,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,qa(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function yx(t,e){let r=t.geometry(),i=r.flat().map(s=>bu([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new Du(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,Ga(i,!0,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,Ga(i,!0,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,qa(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function mx(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=ys(r,0).map(s=>s.map(o=>o.map(l=>bu([l.x,l.y],t.canonical)))),n=new Du(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case\"Point\":a=Math.min(a,qa([s.coordinates],!1,o,n,a));break;case\"LineString\":a=Math.min(a,qa(s.coordinates,!0,o,n,a));break;case\"Polygon\":a=Math.min(a,fx(o,s.coordinates,n,a))}if(a===0)return a}return a}function gx(t){return t.type===\"MultiPolygon\"?t.coordinates.map(e=>({type:\"Polygon\",coordinates:e})):t.type===\"MultiLineString\"?t.coordinates.map(e=>({type:\"LineString\",coordinates:e})):t.type===\"MultiPoint\"?t.coordinates.map(e=>({type:\"Point\",coordinates:e})):[t]}var Eu=class $d{constructor(e,r){this.type=M,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);let i=_i(e[1])?Pd(e[1]):null;return i?new $d(e[1],i.flatMap(n=>gx(n))):r.error(\"'distance' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===\"Point\")return dx(e,this.geometries);if(e.geometryType()===\"LineString\")return yx(e,this.geometries);if(e.geometryType()===\"Polygon\")return mx(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},xx=class Nd{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=J;break}this.type=Zt(r!=null?r:J,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!_i(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=Ct(i);if(n.kind===\"array\"){let a=i,s=r.concat(1),o=[];for(let l=0;lr.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},Tu=class jd{constructor(e){this.key=e,this.type=J}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error(\"Global state property must be defined.\"):typeof i==\"string\"?new jd(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){var i,n;let r=(i=e.globals)==null?void 0:i.globalState;return!r||Object.keys(r).length===0?null:(n=Nt(r,this.key))!=null?n:null}eachChild(){}outputDefined(){return!1}},fi={\"==\":Og,\"!=\":Vg,\">\":$g,\"<\":Rg,\">=\":jg,\"<=\":Ng,array:He,at:vg,boolean:He,case:Dg,coalesce:_d,collator:Ad,format:Fd,image:qg,in:bg,\"index-of\":wg,interpolate:ge,\"interpolate-hcl\":ge,\"interpolate-lab\":ge,\"interpolate-oklch\":ge,\"interpolate-oklab\":ge,length:Gg,let:fd,literal:Di,match:_g,number:He,\"number-format\":Ug,object:He,semiliteral:xx,slice:Sg,step:vu,string:He,\"to-boolean\":ui,\"to-color\":ui,\"to-number\":ui,\"to-string\":ui,var:yd,within:_u,distance:Eu,\"global-state\":Tu},Xr=class ln{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=ln.definitions[i];if(!n)return r.error(`Unknown expression \"${i}\". If you wanted a literal array, use [\"literal\", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,c]of o){l=new hd(r.registry,Xa,r.path,null,r.scope);let h=[],p=!1;for(let f=1;fbx(h)).join(\" | \"),c=[];for(let h=1;h>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function Fr(t){return{type:t}}Xr.register(fi,{error:[Ym,[Z],(t,[e],r)=>{throw new bt(e.evaluate(t),r)}],typeof:[Z,[J],(t,[e])=>_t(Ct(e.evaluate(t)))],\"to-rgba\":[Zt(M,4),[Fe],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[Fe,[M,M,M],xh],rgba:[Fe,[M,M,M,M],xh],has:{type:tt,overloads:[[[Z],(t,[e])=>vh(e.evaluate(t),t.properties())],[[Z,Lr],(t,[e,r])=>vh(e.evaluate(t),r.evaluate(t))]]},get:{type:J,overloads:[[[Z],(t,[e])=>lo(e.evaluate(t),t.properties())],[[Z,Lr],(t,[e,r])=>lo(e.evaluate(t),r.evaluate(t))]]},\"feature-state\":[J,[Z],(t,[e])=>lo(e.evaluate(t),t.featureState||{})],properties:[Lr,[],t=>t.properties()],\"geometry-type\":[Z,[],t=>t.geometryType()],id:[J,[],t=>t.id()],zoom:[M,[],t=>t.globals.zoom],pitch:[M,[],t=>t.globals.pitch||0],bearing:[M,[],t=>t.globals.bearing||0],\"heatmap-density\":[M,[],t=>t.globals.heatmapDensity||0],elevation:[M,[],t=>t.globals.elevation||0],\"line-progress\":[M,[],t=>t.globals.lineProgress||0],accumulated:[J,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],\"+\":[M,Fr(M),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],\"*\":[M,Fr(M),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],\"-\":{type:M,overloads:[[[M,M],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[M],(t,[e])=>-e.evaluate(t)]]},\"/\":[M,[M,M],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],\"%\":[M,[M,M],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[M,[],()=>Math.LN2],pi:[M,[],()=>Math.PI],e:[M,[],()=>Math.E],\"^\":[M,[M,M],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[M,[M],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[M,[M],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[M,[M],(t,[e])=>Math.log(e.evaluate(t))],log2:[M,[M],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[M,[M],(t,[e])=>Math.sin(e.evaluate(t))],cos:[M,[M],(t,[e])=>Math.cos(e.evaluate(t))],tan:[M,[M],(t,[e])=>Math.tan(e.evaluate(t))],asin:[M,[M],(t,[e])=>Math.asin(e.evaluate(t))],acos:[M,[M],(t,[e])=>Math.acos(e.evaluate(t))],atan:[M,[M],(t,[e])=>Math.atan(e.evaluate(t))],min:[M,Fr(M),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[M,Fr(M),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[M,[M],(t,[e])=>Math.abs(e.evaluate(t))],round:[M,[M],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[M,[M],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[M,[M],(t,[e])=>Math.ceil(e.evaluate(t))],\"filter-==\":[tt,[Z,J],(t,[e,r])=>t.properties()[e.value]===r.value],\"filter-id-==\":[tt,[J],(t,[e])=>t.id()===e.value],\"filter-type-==\":[tt,[Z],(t,[e])=>t.geometryType()===e.value],\"filter-<\":[tt,[Z,J],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{let r=t.id(),i=e.value;return typeof r==typeof i&&r\":[tt,[Z,J],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],\"filter-id->\":[tt,[J],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],\"filter-<=\":[tt,[Z,J],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],\"filter-id-<=\":[tt,[J],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],\"filter->=\":[tt,[Z,J],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],\"filter-id->=\":[tt,[J],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],\"filter-has\":[tt,[J],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],\"filter-has-id\":[tt,[],t=>t.id()!==null&&t.id()!==void 0],\"filter-type-in\":[tt,[Zt(Z)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],\"filter-id-in\":[tt,[Zt(J)],(t,[e])=>e.value.indexOf(t.id())>=0],\"filter-in-small\":[tt,[Z,Zt(J)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],\"filter-in-large\":[tt,[Z,Zt(J)],(t,[e,r])=>vx(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[Fr(tt),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[Fr(tt),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},\"!\":[tt,[tt],(t,[e])=>!e.evaluate(t)],\"is-supported-script\":[tt,[Z],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[Z,[Z],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Z,[Z],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Z,Fr(J),(t,e)=>e.map(r=>dn(r.evaluate(t))).join(\"\")],split:[Zt(Z),[Z,Z],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[Z,[Zt(Z),Z],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],\"resolved-locale\":[Z,[us],(t,[e])=>e.evaluate(t).resolvedLocale()]});function bx(t){return Array.isArray(t)?`(${t.map(_t).join(\", \")})`:`(${_t(t.type)}...)`}function Xa(t){if(t instanceof yd)return Xa(t.boundExpression);if(t instanceof Xr&&t.name===\"error\"||t instanceof Ad||t instanceof _u||t instanceof Eu||t instanceof Tu)return!1;let e=t instanceof ui||t instanceof He,r=!0;return t.eachChild(i=>{r&&(r=e?Xa(i):i instanceof Di)}),r?ms(t)&&Nr(t,[\"zoom\",\"pitch\",\"bearing\",\"heatmap-density\",\"elevation\",\"line-progress\",\"accumulated\",\"is-supported-script\"]):!1}function ms(t){if(t instanceof Xr&&(t.name===\"get\"&&t.args.length===1||t.name===\"feature-state\"||t.name===\"has\"&&t.args.length===1||t.name===\"properties\"||t.name===\"geometry-type\"||t.name===\"id\"||/^filter-/.test(t.name))||t instanceof _u||t instanceof Eu)return!1;let e=!0;return t.eachChild(r=>{e&&!ms(r)&&(e=!1)}),e}function Sn(t){if(t instanceof Xr&&t.name===\"feature-state\")return!1;let e=!0;return t.eachChild(r=>{e&&!Sn(r)&&(e=!1)}),e}function Nr(t,e){if(t instanceof Xr&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!Nr(i,e)&&(r=!1)}),r}function Wo(t){return{result:\"success\",value:t}}function kr(t){return{result:\"error\",value:t}}function Si(t){return t[\"property-type\"]===\"data-driven\"||t[\"property-type\"]===\"cross-faded-data-driven\"}function Ud(t){return!!t.expression&&t.expression.parameters.indexOf(\"zoom\")>-1}function Fu(t){return!!t.expression&&t.expression.interpolated}var Iu=/^(.*)-transition$/;function G(t){return pi(t,Number)?\"number\":pi(t,String)?\"string\":pi(t,Boolean)?\"boolean\":Array.isArray(t)?\"array\":t===null?\"null\":typeof t}function gs(t){return typeof t==\"object\"&&!!t&&!Array.isArray(t)&&Ct(t)===Lr}function wx(t){return t}function _x(t){switch(t.type){case\"color\":return xt.parse;case\"padding\":return Ge.parse;case\"numberArray\":return Xe.parse;case\"colorArray\":return ie.parse;default:return null}}function Dx(t){switch(t){case\"exponential\":return Gd;case\"interval\":return Ax;case\"categorical\":return Sx;case\"identity\":return Ex;default:throw Error(`Unknown function type \"${t}\"`)}}function qd(t,e){let r=t.stops&&typeof t.stops[0][0]==\"object\",i=r||t.property!==void 0,n=r||!i,a=t.type||(Fu(e)?\"exponential\":\"interval\"),s=_x(e);if(s&&(t=Y({},t),t.stops&&(t.stops=t.stops.map(c=>[c[0],s(c[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!yg(t.colorSpace))throw Error(`Unknown color space: \"${t.colorSpace}\"`);let o=Dx(a),l,u;if(a===\"categorical\"){l=Object.create(null);for(let c of t.stops)l[c[0]]=c[1];u=typeof t.stops[0][0]}if(r){let c={},h=[];for(let d=0;dd[0]),evaluate({zoom:d},y){return Gd({stops:p,base:t.base,colorSpace:t.colorSpace},e,d).evaluate(d,y)}}}if(n){let c=a===\"exponential\"?{name:\"exponential\",base:t.base===void 0?1:t.base}:null;return{kind:\"camera\",interpolationType:c,interpolationFactor:ge.interpolationFactor.bind(void 0,c),zoomStops:t.stops.map(h=>h[0]),evaluate:({zoom:h})=>o(t,e,h,l,u)}}return{kind:\"source\",evaluate(c,h){let p=h&&h.properties?h.properties[t.property]:void 0;return p===void 0?qn(t.default,e.default):o(t,e,p,l,u)}}}function qn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function Sx(t,e,r,i,n){return qn(typeof r===n?i[r]:void 0,t.default,e.default)}function Ax(t,e,r){if(G(r)!==\"number\")return qn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=fs(t.stops.map(a=>a[0]),r,\"\");return t.stops[n][1]}function Gd(t,e,r){let i=t.base===void 0?1:t.base;if(G(r)!==\"number\")return qn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=fs(t.stops.map(c=>c[0]),r,\"\"),s=Tx(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=rr[e.type]||wx;return typeof o.evaluate==\"function\"?{evaluate(...c){let h=o.evaluate.apply(void 0,c),p=l.evaluate.apply(void 0,c);if(h!==void 0&&p!==void 0)return u(h,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function Ex(t,e,r){switch(e.type){case\"color\":r=xt.parse(r);break;case\"formatted\":r=er.fromString(r.toString());break;case\"resolvedImage\":r=qe.fromString(r.toString());break;case\"padding\":r=Ge.parse(r);break;case\"colorArray\":r=ie.parse(r);break;case\"numberArray\":r=Xe.parse(r);break;default:G(r)===e.type||e.type===\"enum\"&&e.values[r]||(r=void 0)}return qn(r,t.default,e.default)}function Tx(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var Cu=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new cd,this._defaultValue=r?Kd(r):null,this._enumValues=r&&r.type===\"enum\"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=Ai(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=Ai(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s==\"number\"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new bt(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(\", \")}, but found ${JSON.stringify(s)} instead.`,\"\");return s}catch(s){let o=s instanceof bt?s.path:\"\",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<\"u\"&&console.warn(Xd(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function Xd(t,e,r,i){return`${t}${e}: ${r}${i==null?\"\":` Falling back to ${String(i)}.`}`}function Yd(t){if(!t)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. \"layers[3].paint.line-width\".')}function xs(t){return Array.isArray(t)&&t.length>0&&typeof t[0]==\"string\"&&Nt(fi,t[0])!==void 0}function jr(t,e,r,i){Yd(e);let n=new hd(fi,Xa,[],r?Cx(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type===\"string\"?{typeAnnotation:\"coerce\"}:void 0);return a?Wo(new Cu(a,e,r,i)):kr(n.errors)}var An=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!==\"constant\"&&!Sn(e.expression),this.globalStateRefs=Gn(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=Ai(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=Ai(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},Ya=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!==\"camera\"&&!Sn(e.expression),this.globalStateRefs=Gn(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=Ai(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=Ai(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?ge.interpolationFactor(this.interpolationType,t,e,r):0}};function Fx(t){return t._styleExpression!==void 0}function Wd(t,e,r,i){let n=jr(t,e,r,i);if(n.result===\"error\")return n;let a=n.value.expression,s=ms(a);if(!s&&!Si(r))return kr([new Te(\"\",\"data expressions not supported\")]);let o=Nr(a,[\"zoom\"]);if(!o&&!Ud(r))return kr([new Te(\"\",\"zoom expressions not supported\")]);if(!Nr(a,[\"pitch\",\"bearing\"]))return kr([new Te(\"\",'\"pitch\" and \"bearing\" expressions are only supported in symbol layer filters.')]);let l=La(a);if(!l&&!o)return kr([new Te(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);if(l instanceof Te)return kr([l]);if(l instanceof ge&&!Fu(r))return kr([new Te(\"\",'\"interpolate\" expressions cannot be used with this property')]);if(!l)return Wo(s?new An(\"constant\",n.value,i):new An(\"source\",n.value,i));let u=l instanceof ge?l.interpolation:void 0;return Wo(s?new Ya(\"camera\",n.value,l.labels,u,i):new Ya(\"composite\",n.value,l.labels,u,i))}var Zd=class Hd{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,Yd(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=Kd(i),this._warningHistory={};let n=qd(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<\"u\"&&console.warn(Xd(this._rootKey,\"\",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new Hd(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function Ix(t,e,r,i){if(gs(t))return new Zd(t,e,r);if(xs(t)){let n=Wd(t,e,r,i);if(n.result===\"error\")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(\", \"));return n.value}{let n=t;return r.type===\"color\"&&typeof t==\"string\"?n=xt.parse(t):r.type===\"padding\"&&(typeof t==\"number\"||Array.isArray(t))?n=Ge.parse(t):r.type===\"numberArray\"&&(typeof t==\"number\"||Array.isArray(t))?n=Xe.parse(t):r.type===\"colorArray\"&&(typeof t==\"string\"||Array.isArray(t))?n=ie.parse(t):r.type===\"variableAnchorOffsetCollection\"&&Array.isArray(t)?n=Ue.parse(t):r.type===\"projectionDefinition\"&&typeof t==\"string\"&&(n=Gr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:\"constant\",evaluate:()=>n}}}function La(t,e=new Map){if(e.has(t))return e.get(t);let r=null;if(t instanceof fd)r=La(t.result,e);else if(t instanceof _d){for(let i of t.args)if(r=La(i,e),r)break}else(t instanceof vu||t instanceof ge)&&t.input instanceof Xr&&t.input.name===\"zoom\"&&(r=t);return r instanceof Te?(e.set(t,r),r):(t.eachChild(i=>{let n=La(i,e);n instanceof Te?r=n:!r&&n?r=new Te(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.'):r&&n&&r!==n&&(r=new Te(\"\",'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.'))}),e.set(t,r),r)}function Gn(t,e=new Set){return t instanceof Tu&&e.add(t.key),t.eachChild(r=>{Gn(r,e)}),e}function Cx(t){let e={color:Fe,string:Z,number:M,enum:Z,boolean:tt,formatted:Nn,padding:cs,numberArray:hs,colorArray:wn,projectionDefinition:ls,resolvedImage:jn,variableAnchorOffsetCollection:ps};return t.type===\"array\"?Zt(e[t.value]||J,t.length):e[t.type]}function Kd(t){if(t.type===\"color\"&&gs(t.default))return new xt(0,0,0,0);switch(t.type){case\"color\":return xt.parse(t.default)||null;case\"padding\":return Ge.parse(t.default)||null;case\"numberArray\":return Xe.parse(t.default)||null;case\"colorArray\":return ie.parse(t.default)||null;case\"variableAnchorOffsetCollection\":return Ue.parse(t.default)||null;case\"projectionDefinition\":return Gr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function Ai(t,e){let{zoom:r,pitch:i,bearing:n,heatmapDensity:a,elevation:s,lineProgress:o,isSupportedScript:l,accumulated:u}=t!=null?t:{};return{zoom:r,pitch:i,bearing:n,heatmapDensity:a,elevation:s,lineProgress:o,isSupportedScript:l,accumulated:u,globalState:e}}function kx(t){let e=!1;for(let r of t){let i=Jd(r);if(i===\"expression\")return\"expression\";i===\"legacy\"&&(e=!0)}return e?\"legacy\":\"neutral\"}function Jd(t){if(typeof t==\"boolean\")return\"neutral\";if(!Array.isArray(t)||t.length===0)return\"legacy\";switch(t[0]){case\"has\":return t.length<2||t[1]===\"$id\"||t[1]===\"$type\"?\"legacy\":t.length===2?\"neutral\":\"expression\";case\"in\":return t.length>=3&&(typeof t[1]!=\"string\"||Array.isArray(t[2]))?\"expression\":\"legacy\";case\"!in\":case\"!has\":return\"legacy\";case\"==\":case\"!=\":case\">\":case\">=\":case\"<\":case\"<=\":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?\"expression\":\"legacy\";case\"none\":return\"legacy\";case\"any\":case\"all\":return kx(t.slice(1));default:return\"expression\"}}function ku(t){return Jd(t)!==\"legacy\"}function bh(t){return t===\"$type\"?[\"geometry-type\"]:t===\"$id\"?[\"id\"]:[\"get\",t]}function Mx(t){switch(t[0]){case\"==\":case\"!=\":case\"<\":case\"<=\":case\">\":case\">=\":return t.length!==3||typeof t[1]!=\"string\"?null:[t[0],bh(t[1]),t[2]];case\"in\":case\"!in\":{if(t.length<2||typeof t[1]!=\"string\")return null;let e=[\"in\",bh(t[1]),[\"literal\",t.slice(2)]];return t[0]===\"!in\"?[\"!\",e]:e}case\"has\":case\"!has\":{if(t.length!==2||typeof t[1]!=\"string\"||t[1]===\"$type\"||t[1]===\"$id\")return null;let e=[\"has\",t[1]];return t[0]===\"!has\"?[\"!\",e]:e}default:return null}}function Qd(t){if((t[0]===\"<\"||t[0]===\"<=\"||t[0]===\">\"||t[0]===\">=\")&&t[1]===\"$type\")return`\"$type\" cannot be use with operator \"${t[0]}\"`;let e=Mx(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function uo(t,e,r){let i=r[t];return Array.isArray(i)?ku(i)?Mu(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Mu(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case\"all\":case\"any\":case\"none\":for(let r=1;r\"u\")return;let i=r.path.map(n=>`[${n}]`).join(\"\");console.warn(`${e}${i}: ${Qd(r.legacyFilter)}`)}var Bx={type:\"boolean\",default:!1,transition:!1,\"property-type\":\"data-driven\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\",\"pitch\",\"bearing\"]}};function En(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,needCamera:!1,getGlobalStateRefs:()=>new Set};ku(t)?Px(t,e):t=Wa(t);let i=jr(t,e,Bx,r);if(i.result===\"error\")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(\", \"));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:ty(t),needCamera:!Nr(i.value.expression,[\"pitch\",\"bearing\"]),getGlobalStateRefs:()=>Gn(i.value.expression)}}function zx(t,e){return te)}function ty(t){if(!Array.isArray(t))return!1;if(t[0]===\"within\"||t[0]===\"distance\")return!0;for(let e=1;e\"||e===\"<=\"||e===\">=\"?co(t[1],t[2],e):e===\"any\"?Lx(t.slice(1)):e===\"all\"?[\"all\"].concat(t.slice(1).map(Wa)):e===\"none\"?[\"all\"].concat(t.slice(1).map(Wa).map(xa)):e===\"in\"?wh(t[1],t.slice(2)):e===\"!in\"?xa(wh(t[1],t.slice(2))):e===\"has\"?_h(t[1]):e!==\"!has\"||xa(_h(t[1]))}function co(t,e,r){switch(t){case\"$type\":return[`filter-type-${r}`,e];case\"$id\":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Lx(t){return[\"any\"].concat(t.map(Wa))}function wh(t,e){if(e.length===0)return!1;switch(t){case\"$type\":return[\"filter-type-in\",[\"literal\",e]];case\"$id\":return[\"filter-id-in\",[\"literal\",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?[\"filter-in-large\",t,[\"literal\",e.sort(zx)]]:[\"filter-in-small\",t,[\"literal\",e]]}}function _h(t){switch(t){case\"$type\":return!0;case\"$id\":return[\"filter-has-id\"];default:return[\"filter-has\",t]}}function xa(t){return[\"!\",t]}function Zo(t){let e=typeof t;if(e===\"number\"||e===\"boolean\"||e===\"string\"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n=\"[\";for(let a of t)n+=`${Zo(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i=\"{\";for(let n=0;ni.maximum?[new T(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new T(e,r,`number expected, ${n} found`)]}function ry(t){let e=t.valueSpec,r=St(t.value.type),i,n={},a,s,o=r!==\"categorical\"&&t.value.property===void 0,l=!o,u=G(t.value.stops)===\"array\"&&G(t.value.stops[0])===\"array\"&&G(t.value.stops[0][0])===\"object\",c=ue({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:h,default:d}});return r===\"identity\"&&o&&c.push(new T(t.key,t.value,'missing required property \"property\"')),r!==\"identity\"&&!t.value.stops&&c.push(new T(t.key,t.value,'missing required property \"stops\"')),r===\"exponential\"&&t.valueSpec.expression&&!Fu(t.valueSpec)&&c.push(new T(t.key,t.value,\"exponential functions not supported\")),t.styleSpec.$version>=8&&(l&&!Si(t.valueSpec)?c.push(new T(t.key,t.value,\"property functions not supported\")):o&&!Ud(t.valueSpec)&&c.push(new T(t.key,t.value,\"zoom functions not supported\"))),(r===\"categorical\"||u)&&t.value.property===void 0&&c.push(new T(t.key,t.value,'\"property\" property is required')),c;function h(y){if(r===\"identity\")return[new T(y.key,y.value,'identity function may not have a \"stops\" property')];let m=[],g=y.value;return m=m.concat(Pu({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),G(g)===\"array\"&&g.length===0&&m.push(new T(y.key,g,\"array must have at least one stop\")),m}function p(y){let m=[],g=y.value,x=y.key;if(G(g)!==\"array\")return[new T(x,g,`array expected, ${G(g)} found`)];if(g.length!==2)return[new T(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(G(g[0])!==\"object\")return[new T(x,g,`object expected, ${G(g[0])} found`)];if(g[0].zoom===void 0)return[new T(x,g,\"object stop key must have zoom\")];if(g[0].value===void 0)return[new T(x,g,\"object stop key must have value\")];if(G(g[0].zoom)!==\"number\")return[new T(`${x}[0].zoom`,g[0].zoom,`number expected, ${G(g[0].zoom)} found`)];if(s&&s>St(g[0].zoom))return[new T(x,g[0].zoom,\"stop zoom values must appear in ascending order\")];St(g[0].zoom)!==s&&(s=St(g[0].zoom),a=void 0,n={}),m=m.concat(ue({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:vs,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return xs($r(g[1]))?m.concat([new T(`${x}[1]`,g[1],\"expressions are not allowed in function stops.\")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=G(y.value),x=St(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new T(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!==\"number\"&&g!==\"string\"&&g!==\"boolean\")return[new T(y.key,v,\"stop domain value must be a number, string, or boolean\")];if(g!==\"number\"&&r!==\"categorical\"){let b=`number expected, ${g} found`;return Si(e)&&r===void 0&&(b+='\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.'),[new T(y.key,v,b)]}return r===\"categorical\"&&g===\"number\"&&(!isFinite(x)||Math.floor(x)!==x)?[new T(y.key,v,`integer expected, found ${x}`)]:r!==\"categorical\"&&g===\"number\"&&a!==void 0&&xnew T(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext===\"property\"&&t.propertyKey===\"text-font\"&&!r.outputDefined())return[new T(t.key,t.value,`Invalid data expression for \"${t.propertyKey}\". Output values must be contained as literals within the expression.`)];if(t.expressionContext===\"property\"&&t.propertyType===\"layout\"&&!Sn(r))return[new T(t.key,t.value,'\"feature-state\" data expressions are not supported with layout properties.')];if(t.expressionContext===\"filter\"&&!Sn(r))return[new T(t.key,t.value,'\"feature-state\" data expressions are not supported with filters.')];if((t.expressionContext!==\"filter\"||t.layerType!==\"symbol\")&&!Nr(r,[\"pitch\",\"bearing\"]))return[new T(t.key,t.value,'\"pitch\" and \"bearing\" expressions are only supported in symbol layer filters.')];if(t.expressionContext&&t.expressionContext.indexOf(\"cluster\")===0){if(!Nr(r,[\"zoom\",\"feature-state\"]))return[new T(t.key,t.value,'\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')];if(t.expressionContext===\"cluster-initial\"&&!ms(r))return[new T(t.key,t.value,\"Feature data expressions are not supported with initial expression part of cluster properties.\")]}return[]}function Rx(t){let e=t.value,r=t.key,i=G(e);return i===\"boolean\"?[]:[new T(r,e,`boolean expected, ${i} found`)]}function Ho(t){let e=t.key,r=t.value,i=G(r);return i===\"string\"?xt.parse(String(r))?[]:[new T(e,r,`color expected, \"${r}\" found`)]:[new T(e,r,`color expected, ${i} found`)]}function Tn(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(St(r))===-1&&n.push(new T(e,r,`expected one of [${i.values.join(\", \")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(St(r))===-1&&n.push(new T(e,r,`expected one of [${Object.keys(i.values).join(\", \")}], ${JSON.stringify(r)} found`)),n}function $x(t,e){let r=t;for(let i of e)r=r[i];return r}function Nx(t,e){let r=Mu(e);return r?[new T(`${t.key}${r.path.map(i=>`[${i}]`).join(\"\")}`,$x(t.value,r.path),Qd(r.legacyFilter),null,\"warning\")]:[]}function Bu(t){let e=$r(t.value);return ku(e)?[...Nx(t,e),...Ei(lt(Y({},t),{expressionContext:\"filter\",valueSpec:{value:\"boolean\"}}))]:iy(t)}function iy(t){let e=t.value,r=t.key;if(G(e)!==\"array\")return[new T(r,e,`array expected, ${G(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new T(r,e,\"filter array must have at least 1 element\")];switch(a=a.concat(Tn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),St(e[0])){case\"<\":case\"<=\":case\">\":case\">=\":e.length>=2&&St(e[1])===\"$type\"&&a.push(new T(r,e,`\"$type\" cannot be use with operator \"${e[0]}\"`));case\"==\":case\"!=\":e.length!==3&&a.push(new T(r,e,`filter array for operator \"${e[0]}\" must have 3 elements`));case\"in\":case\"!in\":e.length>=2&&(n=G(e[1]),n!==\"string\"&&a.push(new T(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s{h in r&&e.push(new T(i,r[h],`\"${h}\" is prohibited for ref layers`))});let c;n.layers.forEach(h=>{G(h)===\"object\"&&St(h.id)===o&&(c=h)}),c?c.ref?e.push(new T(i,r.ref,\"ref cannot reference another ref layer\")):s=St(c.type):e.push(new T(i,r.ref,`ref layer \"${Ae(o)}\" not found`))}else if(s!==\"background\")if(!r.source)e.push(new T(i,r,'missing required property \"source\"'));else{let c=Ae(r.source),h=n.sources&&Nt(n.sources,c),p=h&&St(h.type);h?p===\"vector\"&&s===\"raster\"?e.push(new T(i,r.source,`layer \"${Ae(r.id)}\" requires a raster source`)):p!==\"raster-dem\"&&s===\"hillshade\"||p!==\"raster-dem\"&&s===\"color-relief\"?e.push(new T(i,r.source,`layer \"${Ae(r.id)}\" requires a raster-dem source`)):p===\"raster\"&&s!==\"raster\"?e.push(new T(i,r.source,`layer \"${Ae(r.id)}\" requires a vector source`)):p===\"vector\"&&!r[\"source-layer\"]?e.push(new T(i,r,`layer \"${Ae(r.id)}\" must specify a \"source-layer\"`)):p===\"raster-dem\"&&s!==\"hillshade\"&&s!==\"color-relief\"?e.push(new T(i,r.source,\"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\")):s===\"line\"&&r.paint&&r.paint[\"line-gradient\"]&&(p!==\"geojson\"||!h.lineMetrics)&&e.push(new T(i,r,`layer \"${Ae(r.id)}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new T(i,r.source,`source \"${c}\" not found`))}return s===\"raster\"&&((l=r.paint)!=null&&l.resampling)&&((u=r.paint)!=null&&u[\"raster-resampling\"])&&e.push(new T(i,r.paint,`layer \"${Ae(r.id)}\" redundantly specifies \"resampling\" and \"raster-resampling\" paint properties, but only one is allowed. It is advised to use \"resampling\".`)),e=e.concat(ue({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{\"*\"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:\"type\"})},filter(c){return Bu(Y({layerType:s},c))},layout(c){return ue({layer:r,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{\"*\"(h){return sy(Y({layerType:s},h))}}})},paint(c){return ue({layer:r,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{\"*\"(h){return ay(Y({layerType:s},h))}}})}}})),e}function Sr(t){let e=t.value,r=t.key,i=G(e);return i===\"string\"?[]:[new T(r,e,`string expected, ${i} found`)]}function jx(t){var h;let e=(h=t.sourceName)!=null?h:\"\",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=G(r);if(r===void 0)return s;if(o!==\"object\")return s.push(new T(\"source_raster_dem\",r,`object expected, ${o} found`)),s;let l=St(r.encoding)===\"custom\",u=[\"redFactor\",\"greenFactor\",\"blueFactor\",\"baseShift\"],c=t.value.encoding?`\"${Ae(t.value.encoding)}\"`:\"Default\";for(let p in r)!l&&u.includes(p)?s.push(new T(p,r[p],`In \"${e}\": \"${p}\" is only valid when \"encoding\" is set to \"custom\". ${c} encoding found`)):Nt(n,p)?s=s.concat(t.validateSpec({key:p,value:r[p],valueSpec:n[p],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new T(p,r[p],`unknown property \"${p}\"`));return s}var Dh={promoteId:Ux};function ly(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(G(e)!==\"object\")return[new T(r,e,`object expected, ${G(e)} found`)];if(!e.type)return[new T(r,e,'\"type\" is required')];let s=St(e.type),o;switch(s){case\"vector\":case\"raster\":return o=ue({key:r,value:e,valueSpec:i[`source_${s.replace(\"-\",\"_\")}`],style:t.style,styleSpec:i,objectElementValidators:Dh,validateSpec:a}),o;case\"raster-dem\":return o=jx({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case\"geojson\":if(o=ue({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Dh}),e.cluster&&e.clusterProperties!==void 0){if(G(e.clusterProperties)!==\"object\")return o.push(new T(`${r}.clusterProperties`,e.clusterProperties,`object expected, ${G(e.clusterProperties)} found`)),o;for(let l in e.clusterProperties){let u=e.clusterProperties[l];if(G(u)!==\"array\"){o.push(new T(`${r}.${l}`,u,`array expected, ${G(u)} found`));continue}let[c,h]=u,p=typeof c==\"string\"?[c,[\"accumulated\"],[\"get\",l]]:c;o.push(...Ei({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:\"cluster-map\"})),o.push(...Ei({key:`${r}.${l}.reduce`,value:p,validateSpec:a,expressionContext:\"cluster-reduce\"}))}}return o;case\"video\":return ue({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case\"image\":return ue({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case\"canvas\":return[new T(r,null,\"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.\",\"source.canvas\")];default:return Tn({key:`${r}.type`,value:e.type,valueSpec:{values:[\"vector\",\"raster\",\"raster-dem\",\"geojson\",\"video\",\"image\"]},style:n,validateSpec:a,styleSpec:i})}}function Ux({key:t,value:e}){if(G(e)===\"string\")return Sr({key:t,value:e});{let r=[];for(let i in e)r.push(...Sr({key:`${t}.${i}`,value:e[i]}));return r}}function uy(t){var o;let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=G(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new T(\"light\",e,`object expected, ${s} found`)]),a;for(let l in e){let u=l.match(Iu);a=u&&((o=Nt(i,u[1]))!=null&&o.transition)?a.concat(t.validateSpec({key:l,value:e[l],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):Nt(i,l)?a.concat(t.validateSpec({key:l,value:e[l],valueSpec:i[l],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new T(l,e[l],`unknown property \"${l}\"`)])}return a}function cy(t){var o;let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=G(e);if(e===void 0)return[];if(a!==\"object\")return[new T(\"sky\",e,`object expected, ${a} found`)];let s=[];for(let l in e){let u=l.match(Iu);s=u&&((o=Nt(i,u[1]))!=null&&o.transition)?s.concat(t.validateSpec({key:l,value:e[l],valueSpec:r.transition,style:n,styleSpec:r})):Nt(i,l)?s.concat(t.validateSpec({key:l,value:e[l],valueSpec:i[l],style:n,styleSpec:r})):s.concat([new T(l,e[l],`unknown property \"${l}\"`)])}return s}function hy(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=G(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new T(\"terrain\",e,`object expected, ${s} found`)]),a;for(let o in e)a=Nt(i,o)?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new T(o,e[o],`unknown property \"${o}\"`)]);return a}function qx(t){return Sr(t).length===0?[]:Ei(t)}function Gx(t){return Sr(t).length===0?[]:Ei(t)}function Xx(t){let e=t.key,r=t.value;if(G(r)===\"array\"){if(r.length<1||r.length>4)return[new T(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:\"number\"},n=[];for(let a=0;a[new T(t,e,'invalid unicode range, expected a value such as \"U+26\", \"U+0-10FFFF\" or \"U+4??\"')],n=r.match(t2);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Sh||u>Sh?[new T(t,e,\"unicode range is out of bounds, the maximum code point is U+10FFFF\")]:l>u?[new T(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function dy(t){var o,l;let e=(o=t.key)!=null?o:\"font-faces\",r=t.value,i=t.validateSpec,n=(l=t.styleSpec)!=null?l:Xf,a=t.style;if(!Ko(r))return[new T(e,r,`object expected, ${G(r)} found`)];let s=[];for(let u in r){let c=r[u],h=G(c);if(h===\"string\")s.push(...Sr({key:`${e}.${u}`,value:c}));else if(h===\"array\"){let p={url:{type:\"string\",required:!0},\"unicode-range\":{type:\"array\",value:\"string\"}};for(let[f,d]of c.entries()){let y=`${e}.${u}[${f}]`;s.push(...ue({key:y,value:d,valueSpec:p,styleSpec:n,style:a,validateSpec:i}));let m=Ko(d)?d[\"unicode-range\"]:void 0;if(G(m)===\"array\")for(let[g,x]of m.entries())s.push(...e2(`${y}.unicode-range[${g}]`,x))}}else s.push(new T(`${e}.${u}`,c,`string or array expected, ${h} found`))}return s}var Ah={\"*\"(){return[]},array:Pu,boolean:Rx,number:vs,color:Ho,constants:ey,enum:Tn,filter:Bu,function:ry,layer:oy,object:ue,source:ly,light:uy,sky:cy,terrain:hy,projection:Hx,projectionDefinition:Kx,string:Sr,formatted:qx,resolvedImage:Gx,padding:Xx,numberArray:Yx,colorArray:Wx,variableAnchorOffsetCollection:Zx,sprite:py,state:fy,fontFaces:dy};function yn(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=yn,r.expression&&gs(St(e))?ry(t):r.expression&&xs($r(e))?Ei(t):r.type&&Ah[r.type]?Ah[r.type](t):ue(lt(Y({},t),{valueSpec:r.type?i[r.type]:r}))}function yy(t){let e=t.value,r=t.key,i=Sr(t);return i.length||(e.indexOf(\"{fontstack}\")===-1&&i.push(new T(r,e,'\"glyphs\" url must include a \"{fontstack}\" token')),e.indexOf(\"{range}\")===-1&&i.push(new T(r,e,'\"glyphs\" url must include a \"{range}\" token'))),i}function se(t,e=S){let r=[];return r=r.concat(yn({key:\"\",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:yn,objectElementValidators:{glyphs:yy,\"*\"(){return[]}}})),t!=null&&t.constants&&(r=r.concat(ey({key:\"constants\",value:t.constants,style:t,styleSpec:e,validateSpec:yn}))),my(r)}se.source=ye(de(ly)),se.sprite=ye(de(py)),se.glyphs=ye(de(yy)),se.fontFaces=ye(de(dy)),se.light=ye(de(uy)),se.sky=ye(de(cy)),se.terrain=ye(de(hy)),se.state=ye(de(fy)),se.layer=ye(de(oy)),se.filter=ye(de(Bu)),se.paintProperty=ye(de(ay)),se.layoutProperty=ye(de(sy));function de(t){return function(e){return t(Object.assign({},e,{validateSpec:yn}))}}function my(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function ye(t){return function(...e){return my(t.apply(this,e))}}var r2={type:\"enum\",\"property-type\":\"data-constant\",expression:{interpolated:!1,parameters:[\"global-state\"]},values:{visible:{},none:{}},transition:!1,default:\"visible\"},i2=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){var t;return(t=this._literalValue)!=null?t:this._compiledValue.evaluate({})}setValue(t){if(t==null||t===\"visible\"||t===\"none\"){this._literalValue=t===\"none\"?\"none\":\"visible\",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=jr(t,this._rootKey,r2,this._globalState);if(e.result===\"error\")throw this._literalValue=\"visible\",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(\", \"));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=Gn(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function n2(t,e,r){return new i2(t,e,r)}var zu={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:\"\"};function a2(t){return zu.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf(\"://\"))]}function s2(t,e){zu.REGISTERED_PROTOCOLS[t]=e}function o2(t){delete zu.REGISTERED_PROTOCOLS[t]}var Eh=\"global-dispatcher\",Za=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function gy(){var t;if(vi(self))return(t=self.worker)==null?void 0:t.referrer;if(window.location.protocol===\"blob:\")try{return window.parent.location.href}catch(e){}return window.location.href}var l2=t=>{var e;return t.startsWith(\"file:\")||((e=gy())==null?void 0:e.startsWith(\"file:\"))&&!/^\\w+:/.test(t)};function u2(t,e){return rt(this,null,function*(){let r=new Request(t.url,{method:t.method||\"GET\",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:gy(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type===\"json\"&&!r.headers.has(\"Accept\")&&r.headers.set(\"Accept\",\"application/json\");let i;try{i=yield fetch(r)}catch(s){throw qf(s)?s:new Za(0,$a(s).message,t.url,new Blob)}if(!i.ok){let s=yield i.blob();throw new Za(i.status,i.statusText,t.url,s)}let n;n=t.type===\"arrayBuffer\"||t.type===\"image\"?i.arrayBuffer():t.type===\"json\"?i.json():i.text();let a=yield n;return qm(e.signal),{data:a,cacheControl:i.headers.get(\"Cache-Control\"),expires:i.headers.get(\"Expires\"),etag:i.headers.get(\"ETag\")}})}function c2(t,e){return new Promise((r,i)=>{var a;let n=new XMLHttpRequest;n.open(t.method||\"GET\",t.url,!0),(t.type===\"arrayBuffer\"||t.type===\"image\")&&(n.responseType=\"arraybuffer\");for(let s in t.headers)n.setRequestHeader(s,t.headers[s]);t.type===\"json\"&&(n.responseType=\"text\",(a=t.headers)!=null&&a.Accept||n.setRequestHeader(\"Accept\",\"application/json\")),n.withCredentials=t.credentials===\"include\",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let s=n.response;if(t.type===\"json\")try{s=JSON.parse(n.response)}catch(o){i(o);return}r({data:s,cacheControl:n.getResponseHeader(\"Cache-Control\"),expires:n.getResponseHeader(\"Expires\"),etag:n.getResponseHeader(\"ETag\")})}else{let s=new Blob([n.response],{type:n.getResponseHeader(\"Content-Type\")});i(new Za(n.status,n.statusText,t.url,s))}},e.signal.addEventListener(\"abort\",()=>{n.abort(),i(new fu(e.signal.reason))}),n.send(t.body)})}var Lu=function(t,e){return rt(this,null,function*(){var r,i;if(t.url.includes(\"://\")&&!/^https?:|^file:/.test(t.url)){let n=a2(t.url);if(n){let a=yield n(t,e);return!a.data&&t.type===\"arrayBuffer\"?lt(Y({},a),{data:new ArrayBuffer(0)}):a}if(vi(self)&&((r=self.worker)!=null&&r.actor))return self.worker.actor.sendAsync({type:\"GR\",data:t,targetMapId:Eh},e)}if(!l2(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,\"signal\"))return u2(t,e);if(vi(self)&&((i=self.worker)!=null&&i.actor))return self.worker.actor.sendAsync({type:\"GR\",data:t,mustQueue:!0,targetMapId:Eh},e)}return c2(t,e)})},h2=(t,e)=>Lu(lt(Y({},t),{type:\"json\"}),e),p2=(t,e)=>Lu(lt(Y({},t),{type:\"arrayBuffer\"}),e),Je={};function B(t,e,r={}){if(Je[t])throw Error(`${t} is already registered.`);Object.defineProperty(e,\"_classRegistryKey\",{value:t,writeable:!1}),Je[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}B(\"Object\",Object),B(\"Set\",Set),B(\"TransferableGridIndex\",Oo),B(\"Color\",xt),B(\"Error\",Error),B(\"AJAXError\",Za),B(\"ResolvedImage\",qe),B(\"StylePropertyFunction\",Zd),B(\"StyleExpression\",Cu,{omit:[\"_evaluator\"]}),B(\"ZoomDependentExpression\",Ya),B(\"ZoomConstantExpression\",An),B(\"CompoundExpression\",Xr,{omit:[\"_evaluate\"]});for(let t in fi)fi[t]._classRegistryKey||B(`Expression_${t}`,fi[t]);function xy(t){var e;return t&&typeof ArrayBuffer<\"u\"&&(t instanceof ArrayBuffer||((e=t.constructor)==null?void 0:e.name)===\"ArrayBuffer\")}function Ou(t){let e=t.constructor;return t.$name||e._classRegistryKey}function f2(t){if(typeof t!=\"object\"||!t)return!1;let e=Ou(t);return e&&e!==\"Object\"}function vy(t){return!f2(t)&&(t==null||typeof t==\"boolean\"||typeof t==\"number\"||typeof t==\"string\"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||xy(t)||pu(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function mn(t,e){if(vy(t))return(xy(t)||pu(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let a=[];for(let s of t)a.push(mn(s,e));return a}if(typeof t!=\"object\")throw Error(`can't serialize object of type ${typeof t}`);let r=Ou(t);if(!r)throw Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!Je[r])throw Error(`${r} is not registered.`);let{klass:i}=Je[r],n=i.serialize?i.serialize(t,e):{};if(i.serialize){if(n===(e==null?void 0:e[e.length-1]))throw Error(\"statically serialized object won't survive transfer of $name property\")}else{for(let a in t){if(!t.hasOwnProperty(a)||Je[r].omit.includes(a))continue;let s=t[a];s!==void 0&&(n[a]=Je[r].shallow.includes(a)?s:mn(s,e))}t instanceof Error&&(n.message=t.message)}if(n.$name)throw Error(\"$name property is reserved for worker serialization logic.\");return r!==\"Object\"&&(n.$name=r),n}function gn(t){if(vy(t))return t;if(Array.isArray(t))return t.map(gn);if(typeof t!=\"object\")throw Error(`can't deserialize object of type ${typeof t}`);let e=Ou(t)||\"Object\";if(!Je[e])throw Error(`can't deserialize unregistered class ${e}`);let{klass:r}=Je[e];if(!r)throw Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let i=Object.create(r.prototype);for(let n of Object.keys(t)){if(n===\"$name\")continue;let a=t[n];i[n]=Je[e].shallow.includes(n)?a:gn(a)}return i}var d2=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>this._invoke()}trigger(){var t;this._triggered||(this._triggered=!0,(t=this._channel)==null||t.port1.postMessage(!0),setTimeout(()=>this._invoke(),0))}_invoke(){this._triggered&&(this._triggered=!1,this._methodToThrottle())}remove(){delete this._channel,this._methodToThrottle=()=>{}}},y2={once:!0},m2=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new d2(()=>this.process()),this.subscription=eh(this.target,\"message\",r=>this.receive(r),!1),this.globalScope=vi(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?eh(e.signal,\"abort\",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:\"\",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new fu(e.signal.reason))},y2):null;this.resolveRejects[n]={resolve:l=>{a==null||a.unsubscribe(),r(l)},reject:l=>{a==null||a.unsubscribe(),i(l)}};let s=[],o=lt(Y({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:mn(t.data,s)});this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=[\"file://\",\"resource://android\",\"null\"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId))if(e.type===\"\"){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort()}else vi(self)||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,e){return rt(this,null,function*(){if(e.type===\"\"){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject($a(gn(e.error))):n.resolve(gn(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=gn(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=yield this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,$a(n))}})}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:\"\",sourceMapId:this.mapId,origin:location.origin,error:e?mn(e):null,data:mn(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},Th=se;new Set(Object.keys(S).filter(t=>t.startsWith(\"source_\")).map(t=>t.slice(7).replaceAll(\"_\",\"-\")));function g2(t,e){let r=!1;for(let i of e)i.severity===\"warning\"?Ot(i.message):(t.fire(new ja(Error(i.message))),r=!0);return r}function x2(t,e,r,i){return(i==null?void 0:i.validate)!==!1&&g2(t,e(Y({styleSpec:S},r)))}var Fh=class{constructor(){this.first=!0}update(t,e){let r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},Fn=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=Ix(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind===\"source\"||this.expression.kind===\"composite\"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}readsGlobalState(t){let e=this.getGlobalStateRefs();return t.some(r=>e.has(r))}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},Jo=class{constructor(t,e,r){this.property=t,this.value=new Fn(t,void 0,e,r)}transitioned(t,e){return e.value===this.value?e:new Ih(this.property,this.value,e,Y(Y({},t.transition),this.transition),t.now)}untransitioned(){return new Ih(this.property,this.value,null,{},0)}},v2=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return gr(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new Jo(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new Fn(this._values[t].property,e===null?void 0:gr(e),this._propertyRootKey(t),this._globalState)}setValues(t){for(let e in t){let r=t[e];e.endsWith(\"-transition\")?this.setTransition(e.slice(0,-11),r):Lo(this._values[e].value.value,r)||this.setValue(e,r)}}getTransition(t){return gr(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new Jo(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=gr(e)||void 0}retainPriorGlobalState(t,e,r){for(let i of Object.keys(r._values))for(let n=r._values[i];n;n=n.prior){let{value:a}=n;a.property.specification.transition&&!a.isDataDriven()&&a.expression._globalState===this._globalState&&a.readsGlobalState(t)&&(n.value=new Fn(a.property,a.value,this._propertyRootKey(i),e))}}applyGlobalStateChange(t,e,r,i){this.retainPriorGlobalState(t,e,r);let n=!1;for(let a of Object.keys(this._values)){let{value:s}=this._values[a];s.readsGlobalState(t)&&(this.setValue(a,s.value),n=!0)}return n?this.transitioned(i,r):r}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}-transition`]=i)}return t}transitioned(t,e){let r=new Ch(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new Ch(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},Ih=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(ii.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},wy=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind===\"constant\"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new ct(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ct(Math.floor(e.zoom),e)),t.expression.evaluate(new ct(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},ws=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Qt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new Fn(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new Jo(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};B(\"DataDrivenProperty\",U),B(\"DataConstantProperty\",V),B(\"CrossFadedDataDrivenProperty\",In),B(\"CrossFadedProperty\",wy),B(\"ColorRampProperty\",ws);var Mh=\" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?\",ho=\" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?\",Ce=class extends Um{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,needCamera:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=n2(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!==\"custom\"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!==\"background\"&&(this.source=t.source,this.sourceLayer=t[\"source-layer\"],this.filter=t.filter,this._featureFilter=En(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new b2(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new v2(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new bs(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=En(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){var e;if(t===\"visibility\")return this.visibility;if((e=this._transitionablePaint)!=null&&e.hasProperty(t))throw Error(t+Mh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property \"${t}\" on layer type \"${this.type}\" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){var e;let t=new globalThis.Map;if(this._transitionablePaint)for(let r in this._transitionablePaint._values){let i=this._transitionablePaint._values[r].value;for(let n of i.getGlobalStateRefs()){let a=(e=t.get(n))!=null?e:[];a.push({name:r,value:i.value}),t.set(n,a)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){var i;t===\"visibility\"?(this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility()):(i=this._transitionablePaint)!=null&&i.hasProperty(t)?this.fire(new ja(Error(t+Mh))):e!=null&&this._validate(Th.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){var e,r;if(t.endsWith(\"-transition\")){let i=t.slice(0,-11);if(i===\"visibility\"||(e=this._unevaluatedLayout)!=null&&e.hasProperty(i))throw Error(t+ho);return this._transitionablePaint.getTransition(i)}if(t===\"visibility\"||(r=this._unevaluatedLayout)!=null&&r.hasProperty(t))throw Error(t+ho);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){var i;if(t===\"visibility\"||(i=this._unevaluatedLayout)!=null&&i.hasProperty(t))return this.fire(new ja(Error(t+ho))),!1;if(e!=null&&this._validate(Th.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(\"-transition\"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let n=this._transitionablePaint._values[t],a=n.property.specification[\"property-type\"]===\"cross-faded-data-driven\",s=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let l=this._transitionablePaint._values[t].value;return l.isDataDriven()||s||a||this._handleOverridablePaintPropertyUpdate(t,o,l)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility===\"none\"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}retainPriorGlobalState(t,e){var r;(r=this._transitionablePaint)==null||r.retainPriorGlobalState(t,e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){var e,r;let t={id:this.id,type:this.type,source:this.source,\"source-layer\":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)==null?void 0:e.serialize(),paint:(r=this._transitionablePaint)==null?void 0:r.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),Vm(t,(i,n)=>i!==void 0&&!(n===\"layout\"&&!Object.keys(i).length)&&!(n===\"paint\"&&!Object.keys(i).length))}_validate(t,e,r,i,n={}){return x2(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof ve&&Si(e.property.specification)&&(e.value.kind===\"source\"||e.value.kind===\"composite\")&&e.value.isStateDependent)return!0}return!1}},w2={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Xn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},Dt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error(\"_refreshViews() must be implemented by each concrete StructArray layout\")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function Ft(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=_2(n.type),s=r=Ph(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:Ph(r,Math.max(i,e)),alignment:e}}function _2(t){return w2[t].BYTES_PER_ELEMENT}function Ph(t,e){return Math.ceil(t/e)*e}var Cn=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};Cn.prototype.bytesPerElement=4,B(\"StructArrayLayout2i4\",Cn);var Qo=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};Qo.prototype.bytesPerElement=6,B(\"StructArrayLayout3i6\",Qo);var Bh=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Bh.prototype.bytesPerElement=8,B(\"StructArrayLayout4i8\",Bh);var tl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};tl.prototype.bytesPerElement=12,B(\"StructArrayLayout2i4i12\",tl);var el=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.int8=new Int8Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*5,c=t*10;return this.int16[u+0]=e,this.int16[u+1]=r,this.uint8[c+4]=i,this.uint8[c+5]=n,this.uint8[c+6]=a,this.uint8[c+7]=s,this.int8[c+8]=o,this.int8[c+9]=l,t}};el.prototype.bytesPerElement=10,B(\"StructArrayLayout2i4ub2b10\",el);var kn=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};kn.prototype.bytesPerElement=8,B(\"StructArrayLayout2f8\",kn);var Mn=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};Mn.prototype.bytesPerElement=4,B(\"StructArrayLayout1f4\",Mn);var rl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,c){let h=t*10;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=s,this.uint16[h+6]=o,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t}};rl.prototype.bytesPerElement=20,B(\"StructArrayLayout10ui20\",rl);var il=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};il.prototype.bytesPerElement=16,B(\"StructArrayLayout8ui16\",il);var nl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,c,h,p)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=c,this.int16[d+10]=h,this.int16[d+11]=p,this.float32[y+6]=f,t}};nl.prototype.bytesPerElement=28,B(\"StructArrayLayout4i4ui4i1f28\",nl);var al=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};al.prototype.bytesPerElement=12,B(\"StructArrayLayout3f12\",al);var sl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};sl.prototype.bytesPerElement=4,B(\"StructArrayLayout1ul4\",sl);var ol=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let c=t*10,h=t*5;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=a,this.int16[c+5]=s,this.uint32[h+3]=o,this.uint16[c+8]=l,this.uint16[c+9]=u,t}};ol.prototype.bytesPerElement=20,B(\"StructArrayLayout6i1ul2ui20\",ol);var ll=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};ll.prototype.bytesPerElement=12,B(\"StructArrayLayout2i2i2i12\",ll);var zh=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};zh.prototype.bytesPerElement=16,B(\"StructArrayLayout2f1f2i16\",zh);var ul=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};ul.prototype.bytesPerElement=16,B(\"StructArrayLayout2ub2f2i16\",ul);var cl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};cl.prototype.bytesPerElement=6,B(\"StructArrayLayout3ui6\",cl);var hl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x){let v=t*28,b=t*14,w=t*56;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint32[b+1]=i,this.uint16[v+4]=n,this.uint32[b+3]=a,this.uint32[b+4]=s,this.uint32[b+5]=o,this.uint16[v+12]=l,this.uint16[v+13]=u,this.uint16[v+14]=c,this.float32[b+8]=h,this.float32[b+9]=p,this.uint8[w+40]=f,this.uint8[w+41]=d,this.uint8[w+42]=y,this.uint32[b+11]=m,this.int16[v+24]=g,this.float32[b+13]=x,t}};hl.prototype.bytesPerElement=56,B(\"StructArrayLayout2i1ul1ui3ul3ui2f3ub1ul1i1f56\",hl);var pl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,D,_,A,E,O,k,P){let R=this.length;return this.resize(R+1),this.emplace(R,t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,D,_,A,E,O,k,P)}emplace(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,D,_,A,E,O,k,P,R){let C=t*34,I=t*17;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=i,this.int16[C+3]=n,this.int16[C+4]=a,this.int16[C+5]=s,this.int16[C+6]=o,this.int16[C+7]=l,this.uint16[C+8]=u,this.uint16[C+9]=c,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=f,this.uint16[C+13]=d,this.uint16[C+14]=y,this.uint16[C+15]=m,this.uint16[C+16]=g,this.uint16[C+17]=x,this.uint16[C+18]=v,this.uint16[C+19]=b,this.uint16[C+20]=w,this.uint16[C+21]=D,this.uint16[C+22]=_,this.uint32[I+12]=A,this.float32[I+13]=E,this.float32[I+14]=O,this.uint16[C+30]=k,this.uint16[C+31]=P,this.float32[I+16]=R,t}};pl.prototype.bytesPerElement=68,B(\"StructArrayLayout8i15ui1ul2f2ui1f68\",pl);var fl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};fl.prototype.bytesPerElement=12,B(\"StructArrayLayout1ui2f12\",fl);var dl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};dl.prototype.bytesPerElement=8,B(\"StructArrayLayout1ul2ui8\",dl);var yl=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};yl.prototype.bytesPerElement=4,B(\"StructArrayLayout2ui4\",yl);var Lh=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};Lh.prototype.bytesPerElement=2,B(\"StructArrayLayout1ui2\",Lh);var ml=class extends Dt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};ml.prototype.bytesPerElement=16,B(\"StructArrayLayout4f16\",ml);var _y=class extends Xn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new F(this.anchorPointX,this.anchorPointY)}};_y.prototype.size=20;var Dy=class extends ol{get(t){return new _y(this,t)}};B(\"CollisionBoxArray\",Dy);var Sy=class extends Xn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint32[this._pos4+1]}get numGlyphs(){return this._structArray.uint16[this._pos2+4]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineStartIndex(){return this._structArray.uint32[this._pos4+4]}get lineLength(){return this._structArray.uint32[this._pos4+5]}get segment(){return this._structArray.uint16[this._pos2+12]}get lowerSize(){return this._structArray.uint16[this._pos2+13]}get upperSize(){return this._structArray.uint16[this._pos2+14]}get lineOffsetX(){return this._structArray.float32[this._pos4+8]}get lineOffsetY(){return this._structArray.float32[this._pos4+9]}get writingMode(){return this._structArray.uint8[this._pos1+40]}get placedOrientation(){return this._structArray.uint8[this._pos1+41]}set placedOrientation(t){this._structArray.uint8[this._pos1+41]=t}get hidden(){return this._structArray.uint8[this._pos1+42]}set hidden(t){this._structArray.uint8[this._pos1+42]=t}get crossTileID(){return this._structArray.uint32[this._pos4+11]}set crossTileID(t){this._structArray.uint32[this._pos4+11]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+24]}get heightOffset(){return this._structArray.float32[this._pos4+13]}};Sy.prototype.size=56;var Ay=class extends hl{get(t){return new Sy(this,t)}};B(\"PlacedSymbolArray\",Ay);var Ey=class extends Xn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};Ey.prototype.size=68;var Ty=class extends pl{get(t){return new Ey(this,t)}};B(\"SymbolInstanceArray\",Ty);var Fy=class extends Mn{getoffsetX(t){return this.float32[t*1+0]}};B(\"GlyphOffsetArray\",Fy);var Iy=class extends Qo{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};B(\"SymbolLineVertexArray\",Iy);var Cy=class extends Xn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};Cy.prototype.size=12;var ky=class extends fl{get(t){return new Cy(this,t)}};B(\"TextAnchorOffsetArray\",ky);var My=class extends Xn{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};My.prototype.size=8;var Py=class extends dl{get(t){return new My(this,t)}};B(\"FeatureIndexArray\",Py);var D2=class extends Cn{},S2=class extends Cn{},A2=class extends Cn{},E2=class extends tl{},T2=class extends el{},F2=class extends kn{},I2=class extends Mn{},ii=class extends rl{},Oh=class extends il{},C2=class extends nl{},k2=class extends al{},M2=class extends sl{},Vh=class extends ll{},P2=class extends ul{},Yn=class extends cl{},gl=class extends yl{},xl=Ft([{name:\"a_pos\",components:2,type:\"Int16\"}],4),B2=xl.members;xl.size,xl.alignment;var he=class si{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>si.MAX_VERTEX_ARRAY_LENGTH&&Ot(`Max vertices per segment is ${si.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${si.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>si.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new si([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};he.MAX_VERTEX_ARRAY_LENGTH=2**16-1,B(\"SegmentVector\",he);function Rh(t,e){return t=Kt(Math.floor(t),0,255),e=Kt(Math.floor(e),0,255),256*t+e}var z2=Ft([{name:\"a_pattern_from\",components:4,type:\"Uint16\"},{name:\"a_pattern_to\",components:4,type:\"Uint16\"},{name:\"a_pixel_ratio_from\",components:1,type:\"Uint16\"},{name:\"a_pixel_ratio_to\",components:1,type:\"Uint16\"}]),L2=Ft([{name:\"a_dasharray_from\",components:4,type:\"Uint16\"},{name:\"a_dasharray_to\",components:4,type:\"Uint16\"}]),O2=lu(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,c=461845907,h,p=0;p>>16)*u&65535)<<16)|0,h=h<<15|h>>>17,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)|0,o^=h,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)|0,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(h=0,a){case 3:h^=(i.charCodeAt(p+2)&255)<<16;case 2:h^=(i.charCodeAt(p+1)&255)<<8;case 1:h^=i.charCodeAt(p)&255,h=(h&65535)*u+(((h>>>16)*u&65535)<<16)|0,h=h<<15|h>>>17,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)|0,o^=h}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)|0,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)|0,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),V2=lu(((t,e)=>{e.exports=function(r,i){for(var n=r.length,a=i^n,s=0,o;n>=4;)o=r.charCodeAt(s)&255|(r.charCodeAt(++s)&255)<<8|(r.charCodeAt(++s)&255)<<16|(r.charCodeAt(++s)&255)<<24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16)^o,n-=4,++s;switch(n){case 3:a^=(r.charCodeAt(s+2)&255)<<16;case 2:a^=(r.charCodeAt(s+1)&255)<<8;case 1:a^=r.charCodeAt(s)&255,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16)}return a^=a>>>13,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>15,a>>>0}})),Ha=vm(lu(((t,e)=>{var r=O2(),i=V2();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),By=class zy{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push($h(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error(\"Trying to get index, but feature positions are not indexed\");let r=$h(e),i=0,n=this.ids.length-1;for(;i>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return vl(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new zy;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function $h(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Ha.default)(String(t))}function vl(t,e,r,i){let n=!1;for(;r>1],s=r-1,o=i+1;for(;;){do s++;while(t[s]a);if(s>=o)break;va(t,s,o),va(e,3*s,3*o),va(e,3*s+1,3*o+1),va(e,3*s+2,3*o+2)}n=Math.min(o-r,i-o)>3,o-r`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type===\"color\"?new $2(t,e):new Ru(t,e)}},Mr=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.dashFrom=null,this.dashTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i===\"u_pattern_to\"?n=this.patternTo:i===\"u_pattern_from\"?n=this.patternFrom:i===\"u_dasharray_to\"?n=this.dashTo:i===\"u_dasharray_from\"?n=this.dashFrom:i===\"u_pixel_ratio_to\"?n=this.pixelRatioTo:i===\"u_pixel_ratio_from\"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith(\"u_pattern\")||r.startsWith(\"u_dasharray_\")?new R2(t,e):new Ru(t,e)}},We=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:\"Float32\",components:r===\"color\"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new ct(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new ct(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type===\"color\"){let i=bl(r);for(let n=t;n`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:\"Float32\",components:r===\"color\"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new ct(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new ct(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new ct(this.zoom,n),r,i),s=this.expression.evaluate(new ct(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type===\"color\"){let n=bl(r),a=bl(i);for(let s=t;s`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof We||r instanceof Se)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof dr){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof un||r instanceof Mr||r instanceof Se)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof un||n instanceof Mr||n instanceof Se){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof dr){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof We||r instanceof Se)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof We||r instanceof Se||r instanceof dr)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof We||e instanceof Se||e instanceof dr)&&e.destroy()}}},Ur=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new Vy(i,e,r);this.needsUpload=!1,this._featureMap=new By,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function N2(t,e){return{\"text-opacity\":[\"opacity\"],\"icon-opacity\":[\"opacity\"],\"text-color\":[\"fill_color\"],\"icon-color\":[\"fill_color\"],\"text-halo-color\":[\"halo_color\"],\"icon-halo-color\":[\"halo_color\"],\"text-halo-blur\":[\"halo_blur\"],\"icon-halo-blur\":[\"halo_blur\"],\"text-halo-width\":[\"halo_width\"],\"icon-halo-width\":[\"halo_width\"],\"line-gap-width\":[\"gapwidth\"],\"line-dasharray\":[\"dasharray_to\",\"dasharray_from\"],\"line-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-extrusion-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"]}[t]||[t.replace(`${e}-`,\"\").replace(/-/g,\"_\")]}function j2(t){return{\"line-pattern\":{source:ii,composite:ii},\"fill-pattern\":{source:ii,composite:ii},\"fill-extrusion-pattern\":{source:ii,composite:ii},\"line-dasharray\":{source:Oh,composite:Oh}}[t]}function Nh(t,e,r){var n;let i={color:{source:kn,composite:ml},number:{source:Mn,composite:kn}};return((n=j2(t))==null?void 0:n[r])||i[e][r]}B(\"ConstantBinder\",un),B(\"CrossFadedConstantBinder\",Mr),B(\"SourceExpressionBinder\",We),B(\"CrossFadedPatternBinder\",Ly),B(\"CrossFadedDasharrayBinder\",Oy),B(\"CompositeExpressionBinder\",Se),B(\"ProgramConfiguration\",Vy,{omit:[\"_buffers\"]}),B(\"ProgramConfigurationSet\",Ur);var wl=2**14-1,jh=-wl-1;function Yr(t){let e=it/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=Kt(a,jh,wl),n.y=Kt(s,jh,wl),(an.x+1||sn.y+1)&&Ot(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}return r}function Bi(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Yr(t):[]}}var Pn=class _l{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new _l;return r.extend(e(new F(this.minX,this.minY))),r.extend(e(new F(this.maxX,this.minY))),r.extend(e(new F(this.minX,this.maxY))),r.extend(e(new F(this.maxX,this.maxY))),r}static fromPoints(e){let r=new _l;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};Pn.fromPoints([new F(0,0),new F(it,it)]);function Ka(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function Uh(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}function $u(t){return t.x<0||t.x>=8192||t.y<0||t.y>=8192}var qh=-32768;function U2(t,e,r,i,n){t.emplaceBack(qh+e*8+i,qh+r*8+n)}var Nu=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new S2,this.indexArray=new Yn,this.segments=new he,this.programConfigurations=new Ur(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type===\"heatmap\";if(i.type===\"circle\"){let h=i;a=h.layout.get(\"circle-sort-key\"),s=!a.isConstant(),o||(o=h.paint.get(\"circle-pitch-alignment\")===\"map\")}let l=o?e.subdivisionGranularity.circle:1,u=new ct(this.zoom),c=this.layers[0]._featureFilter.needGeometry;for(let{feature:h,id:p,index:f,sourceLayerIndex:d}of t){let y=Bi(h,c);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:h.properties,type:h.type,sourceLayerIndex:d,index:f,geometry:c?y.geometry:Yr(h),patterns:{},sortKey:m};n.push(g)}s&&n.sort((h,p)=>h.sortKey-p.sortKey);for(let h of n){let{geometry:p,index:f,sourceLayerIndex:d}=h,y=t[f].feature;this.addFeature(h,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,B2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,c=l.y;if($u(l))continue;let h=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;for(let f=0;f=3){for(let n of i)if(Ti(t,n))return!0}if(X2(t,i,r))return!0}return!1}function X2(t,e,r){if(t.length>1){if(ju(t,e))return!0;for(let i of e)if(Dl(i,t,r))return!0}for(let i of t)if(Dl(i,e,r))return!0;return!1}function ju(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Gh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function Ti(t,e){let r=!1;for(let i=0,n=t.length-1;ie.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function W2(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new F(e,r),new F(e,n),new F(i,n),new F(i,r)];if(t.length>2){for(let s of a)if(Ti(t,s))return!0}for(let s=0;sn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return!1;let a=xr(t,e,r[0]);return a!==xr(t,e,r[1])||a!==xr(t,e,r[2])||a!==xr(t,e,r[3])}var Ke=63710088e-1,gt=class cn{constructor(e,r){if(isNaN(e)||isNaN(r))throw Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}wrap(){return new cn(Pr(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return Ke*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof cn)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new cn(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==\"object\"&&e)return new cn(Number(\"lng\"in e?e.lng:e.lon),Number(e.lat));throw Error(\"`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]\")}},po=6378137,Sl={origin:[-Math.PI*po,Math.PI*po],extentAtZoom0:2*Math.PI*po},Uu=2*Math.PI*Ke;function Ny(t){return Uu*Math.cos(t*Math.PI/180)}function qu(t){return(180+t)/360}function Gu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Al(t,e){return t/Ny(e)}function jy(t){return t*360-180}function Bn(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function H2(t,e){return t*Ny(Bn(e))}function Uy(t){return 1/Math.cos(t*Math.PI/180)}var be=class qy{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=gt.convert(e);return new qy(qu(i.lng),Gu(i.lat),Al(r,i.lat))}toLngLat(){return new gt(jy(this.x),Bn(this.y))}toAltitude(){return H2(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Uu*Uy(Bn(this.y))}},K2=new class{constructor(){this.name=\"mercator\",this.wraps=!0,this.tileMatrixSet=Sl}worldFromLngLat(t,e,r){return new be(qu(t),Gu(e),r===void 0?0:Al(r,e))}lngLatFromWorld(t,e){return new gt(jy(t),Bn(e))}hasLngLat(t,e){return!0}metersPerWorldUnit(t,e){return 1/(1/Uu*Uy(Bn(e)))}worldZFromAltitude(t,e){return Al(t,e.lat)}};function J2(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var Gy=class{constructor(t,e,r){if(!J2(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=di(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r,i=Sl){let n=Q2(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r===\"tms\"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?\"@2x\":\"\").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,()=>Xh(this.x,this.y,this.z,Sl)).replace(/{bbox}/g,()=>Xh(this.x,this.y,this.z,i))}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new F((t.x*e-this.x)*it,(t.y*e-this.y)*it)}toString(){return`${this.z}/${this.x}/${this.y}`}},Ja=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=di(t,e.z,e.z,e.x,e.y)}},Ds=class me{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Gy(i,+n,+a),this.key=di(r,e,i,n,a)}clone(){return new me(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new me(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new me(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?di(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):di(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new me(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new me(r,this.wrap,r,i,n),new me(r,this.wrap,r,i+1,n),new me(r,this.wrap,r,i,n+1),new me(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrape.wrap?!1:this.overscaledZe.overscaledZ?!1:this.canonical.xe.canonical.x?!1:this.canonical.y=0&&e=0&&r=u)return null;let h=this.canonical.x+n,p=this.wrap;return h<0?(p-=Math.ceil(-h/u),h=(h%u+u)%u):h>=u&&(p+=Math.floor(h/u),h%=u),{tileID:new me(this.overscaledZ,p,l,h,c),x:s,y:o}}};function di(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<0;n--){let a=1<this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),n&&a}intersects(e){if(e=Ze.convert(e),!(e.getNorth()>=this.getSouth()&&e.getSouth()<=this.getNorth()))return!1;let r=Math.abs(this.getEast()-this.getWest()),i=Math.abs(e.getEast()-e.getWest());if(r>=360||i>=360)return!0;let n=Pr(this.getWest(),-180,180),a=Pr(this.getEast(),-180,180),s=Pr(e.getWest(),-180,180),o=Pr(e.getEast(),-180,180),l=n>a,u=s>o;return l&&u?!0:l?o>=n||s<=a:u?a>=s||n<=o:s<=a&&o>=n}static convert(e){return e instanceof Ze||!e?e:new Ze(e)}static fromLngLat(e,r=0){let i=360*r/40075017,n=i/Math.cos(Math.PI/180*e.lat);return new Ze(new gt(e.lng-n,e.lat-i),new gt(e.lng+n,e.lat+i))}adjustAntiMeridian(){let e=new gt(this._sw.lng,this._sw.lat),r=new gt(this._ne.lng,this._ne.lat);return e.lng>r.lng?new Ze(e,new gt(r.lng+360,r.lat)):new Ze(e,r)}};function Yy(t,e,r){let i=1/(1<=0?1<0?t.verticalPerspective:t.mercator:t}function fo(t){return Pt(t).projection===\"vertical-perspective\"}function av(t){let e=Math.tan(t.pitchInRadians)*(t.cameraToCenterDistance||1);return t.centerPoint.add(new F(e*Math.sin(t.rollInRadians),e*Math.cos(t.rollInRadians)))}function Zy(t,e){let r=av(t);if(e.length===1)return[e[0],r];let{minX:i,minY:n,maxX:a,maxY:s}=Pn.fromPoints(e).extend(r);return[new F(i,n),new F(a,n),new F(a,s),new F(i,s),new F(i,n)]}function sv(t,e=1,r=0,i,n){let a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],s=n?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],o=2**r,l=a.map(p=>ov(p,t,e,o));i&&lv(l,s[0],i,n);let u=s.map(p=>{let f=Le([],cu([],tr([],l[p[0]],l[p[1]]),tr([],l[p[2]],l[p[1]]))),d=-wr(f,l[p[1]]);return f.concat(d)}),c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0];for(let p of l)for(let f=0;f<3;f++)c[f]=Math.min(c[f],p[f]),h[f]=Math.max(h[f],p[f]);return{points:l,planes:u,aabb:{min:c,max:h}}}function ov(t,e,r,i){let n=je([],t,e),a=1/n[3]/r*i;return Cm(n,n,[a,a,1/n[3],a])}function lv(t,e,r,i){let n=i?4:0,a=i?0:4,s=0,o=[],l=[];for(let h=0;h<4;h++){let p=tr([],t[h+a],t[h+n]),f=os(p);br(p,p,1/f),o.push(f),l.push(p)}for(let h=0;h<4;h++){let p=Pm(t[h+n],l[h],r);s=p!==null&&p>=0?Math.max(s,p):Math.max(s,o[h])}let u=uv(t,e),c=cv(r,u);if(c!==null){let h=c/wr(l[0],u);s=Math.min(s,h)}for(let h=0;h<4;h++){let p=Math.min(s,o[h]);t[h+a]=[t[h+n][0]+l[h][0]*p,t[h+n][1]+l[h][1]*p,t[h+n][2]+l[h][2]*p,1]}}function uv(t,e){let r=tr([],t[e[0]],t[e[1]]),i=tr([],t[e[2]],t[e[1]]),n=[0,0,0,0];return Le(n,cu([],r,i)),n[3]=-wr(n,t[e[0]]),n}function cv(t,e){let r=Im([],t,1/Po(t)),i=tr([],e,br([],r,wr(e,r))),n=Po(i);if(n>0){let a=Math.sqrt(1-r[3]*r[3]);return zo(e,Pa([],br([],r,-r[3]),br([],i,a/n)))}return null}var Yh=it*(1-1e-12),Wh={covered:!1,demLoaded:!1,elevation:0};function Hy(t,e,r,i,n){if(i<0||i>=1||!n&&(r<0||r>=1))return Wh;let a=n?Math.floor(r):0,s=r-a;for(let o of t.zooms){let l=1<n;a++){let s=(r+i)/2;e(t,s)?i=s:r=s}return{lo:r,hi:i}}var Zh=new WeakMap;function Tl(t){let e=Zh.get(t);return e||(e={posMatrices:new Map,alignedPosMatrices:new Map,fogMatrices:new Map},Zh.set(t,e)),e}function Hh(t){return ev(t)}function Kh(t,e){return e?t.lngLatFromWorld(e.x,e.y):void 0}function hv(t,e,r,i,n){let a=n.getCoverageIndex();if(!a)return null;let s=t.worldSize,o=i[0]-r[0],l=i[1]-r[1],u=i[2]-r[2],c={index:a,exaggeration:n.exaggeration,near:r,dx:o,dy:l,dz:u,worldSize:s,wraps:e.wraps},h=0,p=1;if(u===0){if(r[2]>a.maxElevation||r[2]p)return null}let f=Math.hypot(o,l),d=Kt(Math.ceil(f*(p-h)/4),1,512),y=0,m=!ba(c,0);for(let g=0;g<=d;g++){let x=h+(p-h)*g/d;if(!m)m=!ba(c,x);else if(ba(c,x)){let{lo:v,hi:b}=Jy(c,ba,y,x,.001/f),w=Oa(c,v),D=Oa(c,b),_=r[2]+v*u-w.elevation,A=r[2]+b*u-D.elevation,E=w.covered&&_>A?Kt(v+_*(b-v)/(_-A),v,b):b;return new be((r[0]+E*o)/s,(r[1]+E*l)/s,Oa(c,E).elevation)}y=x}return null}function Fl(t,e,r=0){let i=[e.x,e.y,r,1],n=[e.x,e.y,1,1];je(i,i,t.pixelMatrixInverse),je(n,n,t.pixelMatrixInverse);let a=i[3],s=n[3],o=t.elevation;return{near:[i[0]/a,i[1]/a,i[2]/a+o],far:[n[0]/s,n[1]/s,n[2]/s+o]}}function pr(t,e,r){let i=r||0,{near:n,far:a}=Fl(t,e),s=n[2]===a[2]?0:(i+t.elevation-n[2])/(a[2]-n[2]);return new be(rr.number(n[0],a[0],s)/t.worldSize,rr.number(n[1],a[1],s)/t.worldSize,i)}function Jh(t,e,r=0,i=t.pixelMatrix){let n=Qy(t,e,r,i),a=n[3];return a>0?new F(n[0]/a,n[1]/a):pv(t,n[0],n[1],a)}function Qy(t,e,r,i){let n=[e.x*t.worldSize,e.y*t.worldSize,r,1];return je(n,n,i)}function pv(t,e,r,i){let n=t.width/2,a=t.height/2,s=e-n*i,o=r-a*i;s===0&&o===0&&(o=1);let l=n+t.width,u=a+t.height,c=Math.min(s===0?1/0:l/Math.abs(s),o===0?1/0:u/Math.abs(o));return new F(n+s*c,a+o*c)}function yo(t,e,r=!1,i=!1){var l;let n=(l=e.key)!=null?l:di(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),a=r?Tl(t).alignedPosMatrices:Tl(t).posMatrices;if(a.has(n)){let u=a.get(n);return i?u.f32:u.f64}let s=El(e,t.worldSize);Mo(s,r?t.alignedModelViewProjectionMatrix:t.modelViewProjectionMatrix,s);let o={f64:s,f32:new Float32Array(s)};return a.set(n,o),i?o.f32:o.f64}function Oa(t,e){return Hy(t.index,t.exaggeration,(t.near[0]+e*t.dx)/t.worldSize,(t.near[1]+e*t.dy)/t.worldSize,t.wraps)}function ba(t,e){return Ky(Oa(t,e),t.near[2]+e*t.dz)}function Qh({near:t,far:e},r,i,n){let a=e[0]-t[0],s=e[1]-t[1],o=e[2]-t[2];return((r-t[0])*a+(i-t[1])*s+(n-t[2])*o)/(a*a+s*s+o*o)}var fv=class{getVisibleUnwrappedCoordinates(t,e,r){let i=[new Ja(0,r)];if(t.renderWorldCopies&&e.wraps){let n=pr(t,new F(0,0)),a=pr(t,new F(t.width,0)),s=pr(t,new F(t.width,t.height)),o=pr(t,new F(0,t.height)),l=Math.floor(Math.min(n.x,a.x,s.x,o.x)),u=Math.floor(Math.max(n.x,a.x,s.x,o.x));for(let c=l-1;c<=u+1;c++)c!==0&&i.push(new Ja(c,r))}return i}getCameraFrustum(t){return sv(t.inverseModelViewProjectionMatrix,t.worldSize)}locationToScreenPoint(t,e,r,i){let n=e.worldFromLngLat(r.lng,r.lat);return i?Jh(t,n,i.getElevationForLngLat(r,t.tileZoom),t.pixelMatrix3D):Jh(t,n)}screenPointToLocation(t,e,r,i){return Kh(e,this.screenPointToMercatorCoordinate(t,e,r,i))}screenPointToLocationAtElevation(t,e,r,i){return Kh(e,pr(t,r,i-t.elevation))}screenPointToMercatorCoordinate(t,e,r,i){if(i){let n=this.screenTerrainPointToMercatorCoordinate(t,e,r,i);if(n!=null)return n}return pr(t,r)}screenTerrainPointToMercatorCoordinate(t,e,r,i){let{near:n,far:a}=Fl(t,r,-1);return hv(t,e,n,a,i)}getBounds(t,e){let r=Math.max(0,t.height/2-Hh(t));return new Xy().extend(this.screenPointToLocation(t,e,new F(0,r))).extend(this.screenPointToLocation(t,e,new F(t.width,r))).extend(this.screenPointToLocation(t,e,new F(t.width,t.height))).extend(this.screenPointToLocation(t,e,new F(0,t.height)))}isPointOnMapSurface(t,e,r,i){if(i)return this.screenTerrainPointToMercatorCoordinate(t,e,r,i)!=null;let n=r.y>t.centerPoint.y-Hh(t);if(!n||e.wraps)return n;let a=pr(t,r);return e.hasLngLat(a.x,a.y)}calculateFogMatrix(t,e){let r=e.key,i=Tl(t).fogMatrices;if(i.has(r))return i.get(r);let n=El(e,t.worldSize);return Mo(n,t.fogMatrix,n),i.set(r,new Float32Array(n)),i.get(r)}maxPitchScaleFactor(t){if(!t.pixelMatrixInverse)return 1;let e=pr(t,new F(0,0)),r=[e.x*t.worldSize,e.y*t.worldSize,0,1];return je(r,r,t.pixelMatrix)[3]/t.cameraToCenterDistance}getCameraAltitude(t){return Math.cos(t.pitchInRadians)*t.cameraToCenterDistance/t.pixelsPerMeter+t.elevation}getCameraLngLat(t,e){let r=t.center,i=e.worldZFromAltitude(1,r),n=i*t.worldSize,a=t.cameraToCenterDistance/n,s=rv(e.worldFromLngLat(r.lng,r.lat,t.elevation),t.pitch,t.bearing,a*i);return e.lngLatFromWorld(s.x,s.y)}getProjectionData(t,e){let{overscaledTileID:r,aligned:i,applyTerrainMatrix:n}=e,a=Wy(r),s=r?yo(t,r,i,!0):null,o;return o=r!=null&&r.terrainRttPosMatrix32f&&n?r.terrainRttPosMatrix32f:s||Mm(),{mainMatrix:o,tileMercatorCoords:a,clippingPlane:[0,0,0,0],tileOrigin:[0,0,0,0],tileOriginPosition:[0,0],projectionTransition:0,fallbackMatrix:o,clipAntimeridian:!1}}isLocationOccluded(t,e,r,i,n){if(!(i!=null&&i.getCoverageIndex()))return!1;let a=e.worldFromLngLat(r.lng,r.lat);n!=null||(n=i.getElevationForLngLat(r,t.tileZoom));let s=Qy(t,a,n,t.pixelMatrix3D),o=s[3];if(o<=0||s[2]>o)return!0;let l=new F(s[0]/o,s[1]/o),u=this.screenTerrainPointToMercatorCoordinate(t,e,l,i);if(u==null)return!1;let c=Fl(t,l,-1),h=Qh(c,a.x*t.worldSize,a.y*t.worldSize,n);return Qh(c,u.x*t.worldSize,u.y*t.worldSize,u.z)1e-6){let i=t[0]/r,n=t[2]/r,a=Math.acos(n);return new gt(Pr((i>0?a:-a)/Math.PI*180,-180,180),e)}return new gt(0,e)}function mv(t){let e=Xt();return e[0]=t[0]*-t[3],e[1]=t[1]*-t[3],e[2]=t[2]*-t[3],{center:e,radius:Math.sqrt(1-t[3]*t[3])}}function gv(t,e,r){let i=Xt();tr(i,r,t);let n=Xt();return Nf(n,t,i,e/Po(i)),n}function tp(t){return Math.cos(Math.min(Math.abs(t),85.051129)*Math.PI/180)}function ts(t,e,r=1){let i=wr(t,e),n=r*r,a=Xt(),s=Xt();br(s,e,i),tr(a,t,s);let o=n-wr(a,a);if(o<0)return null;let l=wr(t,t)-n,u=-i+(i<0?1:-1)*Math.sqrt(o),c=l/u,h=u,p=Math.max(c,h);return p<0?null:{tMin:Math.min(c,h),tMax:p}}var ep=new WeakMap;function xv(t,e){let r=ep.get(t);r||(r=new Map,ep.set(t,r));let i=r.get(e.key);if(i)return i;let n=1<=0}function ip(t,e){if(!e1(t,e))return!1;let r=hu();return je(r,[...e,1],t.modelViewProjectionMatrix),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3],r[0]>-1&&r[0]<1&&r[1]>-1&&r[1]<1&&r[2]>-1&&r[2]<1}function go(t,e){let r=t.cameraPosition,i=xn(t,e),n=ts(r,i);if(n){let c=Xt();Pa(c,r,[i[0]*n.tMin,i[1]*n.tMin,i[2]*n.tMin]);let h=Xt();return Le(h,c),Qa(h)}let a=t.clippingPlane,s=a[0]*i[0]+a[1]*i[1]+a[2]*i[2],o=-zo(a,r)/s,l=Xt();if(o>0)Pa(l,r,[i[0]*o,i[1]*o,i[2]*o]);else{let c=Xt();Pa(c,r,[i[0]*2,i[1]*2,i[2]*2]);let h=zo(a,c);tr(l,c,[a[0]*h,a[1]*h,a[2]*h])}let u=mv(a);return Qa(gv(u.center,u.radius,l))}function r1(t,e){let r=Xt();Nf(r,t.origin,t.direction,e);let i=os(r),n=Xt();br(n,r,1/i);let a=Qa(n),s=be.fromLngLat(a),o=new be(s.x,Kt(s.y,0,.999999999)),l=Hy(t.index,t.exaggeration,o.x,o.y,!1),u=Math.abs(a.lat)>85.051129?0:l.elevation;return{sample:lt(Y({},l),{elevation:u}),radius:i,mercator:o}}function np(t,e){let{sample:r,radius:i}=r1(t,e);return Ky(r,(i-1)*Ke)}function ap(t,e){let r=Il(t);return br(r,r,1+e/Ke)}function sp(t,e,r){return wr($f(Xt(),r,t),e)}var bv=class{getProjectionData(t,e){let{overscaledTileID:r,applyGlobeMatrix:i}=e,n=Cl(t,r,i);if(!(i&&r!=null&&t.zoom>=10))return n;let a=xv(t,r.canonical);return n.mainMatrix=a.matrix,n.clippingPlane=a.clippingPlane,n.tileOrigin=a.tileOrigin,n.tileOriginPosition=a.tileOriginPosition,n}isLocationOccluded(t,e,r,i,n){let a=i==null?void 0:i.getCoverageIndex();n!=null||(n=a?i.getElevationForLngLat(r,t.tileZoom):0);let s=ap(r,n);if(!e1(t,s))return!0;if(!a)return!1;let o=mo(t,s),l=t.cameraPosition,u=xn(t,o),c=sp(l,u,s);if(c<=0)return!0;let h=this.screenTerrainPointToMercatorCoordinate(t,e,o,i);return h!=null&&sp(l,u,ap(h.toLngLat(),h.z))s&&(s=f),dl&&(l=d)}let h=[c.lng+o,c.lat+u,c.lng+s,c.lat+l];return ip(t,[0,1,0])&&(h[3]=90,h[0]=-180,h[2]=180),ip(t,[0,-1,0])&&(h[1]=-90,h[0]=-180,h[2]=180),new Xy(h)}locationToScreenPoint(t,e,r,i){let n=Il(r);return i&&br(n,n,1+i.getElevationForLngLat(r,t.tileZoom)/Ke),mo(t,n)}getCameraQueryGeometry(t,e){if(e.length!==1||!rp(t,e[0]))return Zy(t,e);let r=Il(go(t,e[0])),i=Le(Xt(),t.cameraPosition),n=[e[0]];for(let a=1;a<=8;a++){let s=Em(Xt(),r,i,a/8);n.push(mo(t,Le(s,s)))}return n}screenPointToMercatorCoordinate(t,e,r,i){if(i){let n=this.screenTerrainPointToMercatorCoordinate(t,e,r,i);if(n)return n}return be.fromLngLat(go(t,r))}screenTerrainPointToMercatorCoordinate(t,e,r,i){let n=i.getCoverageIndex();if(!n)return null;let a=t.cameraPosition,s=xn(t,r),o=ts(a,s,1+n.maxElevation/Ke);if(!o)return null;let l=ts(a,s,1+n.minElevation/Ke),u=Math.max(o.tMin,0),c=l?l.tMin:o.tMax;if(c<=u)return null;let h={index:n,exaggeration:i.exaggeration,origin:a,direction:s},p=0;for(let f=0;f<=256;f++){let d=u+(c-u)*f/256;if(np(h,d)){let{hi:y}=Jy(h,np,p,d,1e-12),{sample:m,mercator:g}=r1(h,y);return new be(g.x,g.y,m.elevation)}p=d}return null}screenPointToLocation(t,e,r,i){var n;return(n=this.screenPointToMercatorCoordinate(t,e,r,i))==null?void 0:n.toLngLat()}screenPointToLocationAtElevation(t,e,r,i){return this.screenPointToLocation(t,e,r)}isPointOnMapSurface(t,e,r,i){return rp(t,r)}getProjectionDataForCustomLayer(t,e=!0){let r=Cl(t,new Ds(0,0,0,0,0),e),i=Bo();return Dm(i,t.modelViewProjectionMatrix),lt(Y({},r),{mainMatrix:i,tileMercatorCoords:[0,0,1,1]})}getFastPathSimpleProjectionMatrix(t,e){}getClippingPlane(t){return t.clippingPlane}getRayDirectionFromPixel(t,e){return xn(t,e)}},wv=class{constructor(t,e){this._mercator=t,this._verticalPerspective=e}_renderedMath(t){return fo(t)?this._verticalPerspective:this._mercator}getProjectionData(t,e){let r=this._mercator.getProjectionData(t.mercator,e),i=Cl(t.verticalPerspective,e.overscaledTileID,e.applyGlobeMatrix);return{mainMatrix:fo(t)?i.mainMatrix:r.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,tileOrigin:i.tileOrigin,tileOriginPosition:i.tileOriginPosition,projectionTransition:e.applyGlobeMatrix?t.globeness:0,fallbackMatrix:r.fallbackMatrix,clipAntimeridian:i.clipAntimeridian}}getProjectionDataForCustomLayer(t,e=!0){let r=this._mercator.getProjectionDataForCustomLayer(t.mercator,e);if(!fo(t))return r;let i=this._verticalPerspective.getProjectionDataForCustomLayer(t.verticalPerspective,e);return i.fallbackMatrix=r.mainMatrix,i.projectionTransition=t.globeness,i}getFastPathSimpleProjectionMatrix(t,e){return this._renderedMath(t).getFastPathSimpleProjectionMatrix(Pt(t),e)}projectTileCoordinates(t,e,r,i,n){return this._renderedMath(t).projectTileCoordinates(Pt(t),e,r,i,n)}getPitchedTextCorrection(t,e,r,i){return Qc(this._mercator.getPitchedTextCorrection(t.mercator,e,r,i),this._verticalPerspective.getPitchedTextCorrection(t.verticalPerspective,e,r,i),t.globeness)}getCircleRadiusCorrection(t){return this._renderedMath(t).getCircleRadiusCorrection(Pt(t))}getPixelScale(t){return Qc(this._mercator.getPixelScale(t.mercator),this._verticalPerspective.getPixelScale(t.verticalPerspective),t.globeness)}transformLightDirection(t,e){return this._renderedMath(t).transformLightDirection(Pt(t),e)}calculateFogMatrix(t,e){return this._renderedMath(t).calculateFogMatrix(Pt(t),e)}getVisibleUnwrappedCoordinates(t,e,r){return this._renderedMath(t).getVisibleUnwrappedCoordinates(Pt(t),e,r)}getCameraFrustum(t){return this._renderedMath(t).getCameraFrustum(Pt(t))}getClippingPlane(t){return this._renderedMath(t).getClippingPlane(Pt(t))}maxPitchScaleFactor(t){return this._mercator.maxPitchScaleFactor(t.mercator)}getCameraAltitude(t){return this._renderedMath(t).getCameraAltitude(Pt(t))}getCameraLngLat(t,e){return this._renderedMath(t).getCameraLngLat(Pt(t),e)}getBounds(t,e){return this._renderedMath(t).getBounds(Pt(t),e)}isLocationOccluded(t,e,r,i,n){return this._renderedMath(t).isLocationOccluded(Pt(t),e,r,i,n)}locationToScreenPoint(t,e,r,i){return this._renderedMath(t).locationToScreenPoint(Pt(t),e,r,i)}screenPointToLocation(t,e,r,i){return this._renderedMath(t).screenPointToLocation(Pt(t),e,r,i)}screenPointToLocationAtElevation(t,e,r,i){return this._renderedMath(t).screenPointToLocationAtElevation(Pt(t),e,r,i)}screenPointToMercatorCoordinate(t,e,r,i){return this._renderedMath(t).screenPointToMercatorCoordinate(Pt(t),e,r,i)}screenTerrainPointToMercatorCoordinate(t,e,r,i){return this._renderedMath(t).screenTerrainPointToMercatorCoordinate(Pt(t),e,r,i)}isPointOnMapSurface(t,e,r,i){return this._renderedMath(t).isPointOnMapSurface(Pt(t),e,r,i)}getRayDirectionFromPixel(t,e){return this._verticalPerspective.getRayDirectionFromPixel(t.verticalPerspective,e)}getCameraQueryGeometry(t,e){return this._renderedMath(t).getCameraQueryGeometry(Pt(t),e)}},i1=new fv,n1=new bv,_v=new wv(i1,n1);function Ss(t){switch(t.projection){case\"mercator\":return i1;case\"vertical-perspective\":return n1;case\"globe\":return _v}}function yi(t,e,r){let i=e.paint.get(t).value;return i.kind===\"constant\"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function As(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Es(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=F.convert(e)._mult(n);r===\"viewport\"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function Dv(t){let e=[];for(let r=0;rXu(n,e,r,i))}var op,Cv=()=>op||(op=new Qt({\"circle-sort-key\":new U(S.layout_circle[\"circle-sort-key\"],\"circle-sort-key\")})),lp,kv=()=>lp||(lp=new Qt({\"circle-radius\":new U(S.paint_circle[\"circle-radius\"],\"circle-radius\"),\"circle-color\":new U(S.paint_circle[\"circle-color\"],\"circle-color\"),\"circle-blur\":new U(S.paint_circle[\"circle-blur\"],\"circle-blur\"),\"circle-opacity\":new U(S.paint_circle[\"circle-opacity\"],\"circle-opacity\"),\"circle-translate\":new V(S.paint_circle[\"circle-translate\"],\"circle-translate\"),\"circle-translate-anchor\":new V(S.paint_circle[\"circle-translate-anchor\"],\"circle-translate-anchor\"),\"circle-pitch-scale\":new V(S.paint_circle[\"circle-pitch-scale\"],\"circle-pitch-scale\"),\"circle-pitch-alignment\":new V(S.paint_circle[\"circle-pitch-alignment\"],\"circle-pitch-alignment\"),\"circle-stroke-width\":new U(S.paint_circle[\"circle-stroke-width\"],\"circle-stroke-width\"),\"circle-stroke-color\":new U(S.paint_circle[\"circle-stroke-color\"],\"circle-stroke-color\"),\"circle-stroke-opacity\":new U(S.paint_circle[\"circle-stroke-opacity\"],\"circle-stroke-opacity\")})),Mv={get paint(){return kv()},get layout(){return Cv()}},Pv=class extends Ce{constructor(t,e){super(t,Mv,e)}createBucket(t){return new Nu(t)}queryRadius(t){let e=t;return yi(\"circle-radius\",this,e)+yi(\"circle-stroke-width\",this,e)+As(this.paint.get(\"circle-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Es(t,this.paint.get(\"circle-translate\"),this.paint.get(\"circle-translate-anchor\"),-n.bearingInRadians,a),u=this.paint.get(\"circle-radius\").evaluate(e,r)+this.paint.get(\"circle-stroke-width\").evaluate(e,r),c=this.paint.get(\"circle-pitch-scale\"),h=this.paint.get(\"circle-pitch-alignment\"),p,f;return h===\"map\"?(p=l,f=u*a):(p=Iv(l,n,s,o),f=u),a1({queryGeometry:p,size:f,projectedCamera:n,unwrappedTileID:s,getElevation:o,pitchAlignment:h,pitchScale:c},i)}},s1=class extends Nu{};B(\"HeatmapBucket\",s1,{omit:[\"layers\"]});var up,Bv=()=>up||(up=new Qt({\"heatmap-radius\":new U(S.paint_heatmap[\"heatmap-radius\"],\"heatmap-radius\"),\"heatmap-weight\":new U(S.paint_heatmap[\"heatmap-weight\"],\"heatmap-weight\"),\"heatmap-intensity\":new V(S.paint_heatmap[\"heatmap-intensity\"],\"heatmap-intensity\"),\"heatmap-color\":new ws(S.paint_heatmap[\"heatmap-color\"],\"heatmap-color\"),\"heatmap-opacity\":new V(S.paint_heatmap[\"heatmap-opacity\"],\"heatmap-opacity\")})),zv={get paint(){return Bv()}};function Yu(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function o1(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Yu({},{width:e,height:r},i);Wu(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function Wu(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError(\"out of range source coordinates for image copy\");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError(\"out of range destination coordinates for image copy\");let s=t.data,o=e.data;if(s===o)throw Error(\"srcData equals dstData, so image is already copied\");for(let l=0;l{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;scp||(cp=new Qt({\"hillshade-illumination-direction\":new V(S.paint_hillshade[\"hillshade-illumination-direction\"],\"hillshade-illumination-direction\"),\"hillshade-illumination-altitude\":new V(S.paint_hillshade[\"hillshade-illumination-altitude\"],\"hillshade-illumination-altitude\"),\"hillshade-illumination-anchor\":new V(S.paint_hillshade[\"hillshade-illumination-anchor\"],\"hillshade-illumination-anchor\"),\"hillshade-exaggeration\":new V(S.paint_hillshade[\"hillshade-exaggeration\"],\"hillshade-exaggeration\"),\"hillshade-shadow-color\":new V(S.paint_hillshade[\"hillshade-shadow-color\"],\"hillshade-shadow-color\"),\"hillshade-highlight-color\":new V(S.paint_hillshade[\"hillshade-highlight-color\"],\"hillshade-highlight-color\"),\"hillshade-accent-color\":new V(S.paint_hillshade[\"hillshade-accent-color\"],\"hillshade-accent-color\"),\"hillshade-method\":new V(S.paint_hillshade[\"hillshade-method\"],\"hillshade-method\"),resampling:new V(S.paint_hillshade.resampling,\"resampling\")})),Rv={get paint(){return Vv()}},$v=class extends Ce{constructor(t,e){super(t,Rv,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get(\"hillshade-illumination-direction\").values,e=this.paint.get(\"hillshade-illumination-altitude\").values,r=this.paint.get(\"hillshade-highlight-color\").values,i=this.paint.get(\"hillshade-shadow-color\").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(bi);return{directionRadians:t.map(bi),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get(\"hillshade-exaggeration\")!==0&&!this.isHidden()}},hp,Nv=()=>hp||(hp=new Qt({\"color-relief-opacity\":new V(S[\"paint_color-relief\"][\"color-relief-opacity\"],\"color-relief-opacity\"),\"color-relief-color\":new ws(S[\"paint_color-relief\"][\"color-relief-color\"],\"color-relief-color\"),resampling:new V(S[\"paint_color-relief\"].resampling,\"resampling\")})),jv={get paint(){return Nv()}};function wa(t){return\"data\"in t}var pp=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){var u;let{width:i,height:n}=t,a=(((u=this.size)==null?void 0:u[0])!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!(e!=null&&e.useMipmap),a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&(e==null?void 0:e.premultiply)!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let c=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,c,o.RGBA8,i,n),wa(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:h}=t;l&&h&&(h=xo(h)),h&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,h)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else wa(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:c,y:h}=r||{x:0,y:0};wa(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,c,h,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,c,h,o))}this.useMipmap&&!(wa(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=xo(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=xo(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST&&r!==n.LINEAR_MIPMAP_LINEAR||this.useMipmap||(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Qe,c1=(Qe=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError(\"DEM tiles must be square\");if(i&&![\"mapbox\",\"terrarium\",\"custom\"].includes(i)){Ot(`\"${i}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Qe.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case\"terrarium\":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case\"custom\":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let c=-2;c=l)&&this.data.copyWithin(this._idx(0,c),h,h+l),this.data.fill(this.data[h],this._idx(-2,c),this._idx(0,c)),this.data.fill(this.data[h+l-1],this._idx(l,c),this._idx(l+1,c)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let c=0;cthis.max&&(this.max=f),f=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,c=this._unpackAtIndex(a,s),h=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return c*(1-l)*(1-u)+h*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return h1(e,this.getUnpackVector())}getPixels(){return new le({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error(\"dem dimension mismatch\");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let c=s;cc!==0);if(s.length===0)return{r:0,g:0,b:0};let o=Math.min(...s),l=Math.round((t+a)/o),u=c=>c===0?0:Math.floor(l*o/c)%256;return{r:u(r),g:u(i),b:u(n)}}B(\"DEMData\",c1);var Uv=class extends Ce{constructor(t,e){super(t,jv,e)}_createColorRamp(t){let e={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values[\"color-relief-color\"].value.expression;if(r instanceof An&&r._styleExpression.expression instanceof ge){this.colorRampExpression=r;let a=r._styleExpression.expression;e.elevationStops=a.labels,e.colorStops=[];for(let s of e.elevationStops)e.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[xt.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;let i={elevationStops:[],colorStops:[]},n=(e.elevationStops.length-1)/(t-1);for(let a=0;a80*r){o=t[0],l=t[1];let c=o,h=l;for(let p=r;pc&&(c=f),d>h&&(h=d)}u=Math.max(c-o,h-l),u=u===0?0:32767/u}return Bl(a,s,o,l,u),s}function p1(t,e,r,i,n){let a=null;if(n===ub(t,e,r,i)>0)for(let s=e;s=e;s-=i)a=yp(s/i|0,t[s],t[s+1],a);return a&&Ln(a,a.next)&&(Vn(a),a=a.next),a}function qr(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(zn.size===0||!zn.has(i))&&(Ln(i,i.next)||Lt(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),Pl=!0,Vn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Bl(t,e,r,i,n){n&&ib(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Lt(o,t,l)<0&&(n?Yv(t,r,i,n):Xv(t)))e.push(o.i,t.i,l.i),Vn(t),t=l,a=l;else if(t=l,t===a){if(Pl=!1,t=qr(t),Pl){a=t;continue}if(!s){t=Wv(t,e),a=t,s=!0;continue}Zv(t,e,r,i,n);break}}}function Xv(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,c=Math.min(n,a,s),h=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=c&&d.x<=p&&d.y>=h&&d.y<=f&&(n!==d.x||o!==d.y)&&is(n,o,a,l,s,u,d.x,d.y)&&Lt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Yv(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,c=n.y,h=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(c,h,p),y=Math.max(o,l,u),m=Math.max(c,h,p),g=Vl(f,d,e,r,i),x=Vl(y,m,e,r,i),v=t.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||c!==v.y)&&is(o,c,l,h,u,p,v.x,v.y)&&Lt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=t.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||c!==b.y)&&is(o,c,l,h,u,p,b.x,b.y)&&Lt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Wv(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;d1(n,r,r.next,a,!1)&&On(n,a)&&On(a,n)&&(e.push(n.i,r.i,a.i),Vn(r),Vn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?qr(r):r}function Zv(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&sb(a,s)){let o=y1(a,s);a=qr(a,a.next),o=qr(o,o.next),Bl(a,e,r,i,n),Bl(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var zl=!1;function Hv(t,e,r,i){let n=[];for(let a=0,s=e.length;as&&(s=c.x),c.yo&&(o=c.y),r=c}while(++l<16&&r!==e);Ol[i]=r;let u=i*4;Tt[u]=n,Tt[u+1]=a,Tt[u+2]=s,Tt[u+3]=o}while(r!==e)}function tb(t,e){let r=t.z*4;e.xTt[r+2]&&(Tt[r+2]=e.x),e.y>Tt[r+3]&&(Tt[r+3]=e.y)}function fp(t){let e=Ol[t];for(;e.prev.next!==e;)e=e.next;return Ol[t]=e,e}function dp(t){let e=Ll[t];for(;e.prev.next!==e;)e=e.next;return Ll[t]=e,e}function eb(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(Ln(t,r))return r;for(let p=0,f=0;pTt[f+3]||Tt[f]>i||Tt[f+2]<=a)continue;let d=fp(p);r=dp(p);do{if(r.prev.next===r){if(Ln(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.xi||Tt[f+3]c)continue;let d=fp(p);r=dp(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&is(ni)&&(ys.x||r.x===s.x&&rb(s,r)))&&(s=r,h=y)}r=r.next}while(r!==d)}return s}function rb(t,e){return Lt(t.prev,t,e.prev)<0&&Lt(e.next,t,t.next)<0}var oe=[],oi=[],Ir=new Uint32Array,Ki=new Uint32Array,Ji=new Uint32Array(256);function ib(t,e,r,i){let n=t,a=0;do n.z=Vl(n.x,n.y,e,r,i),oe[a++]=n,n=n.next;while(n!==t);nb(a);let s=null;for(let o=0;o=0&&oe[n].z>i;)oe[n+1]=oe[n],n--;oe[n+1]=r}else{Ir.length>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Ji[o];Ji[o]=s,s+=l}for(let o=0;o>>a&255]++;i[u]=e[o],n[u]=l}}function Vl(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function ab(t){let e=t,r=t;do(e.x=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function sb(t,e){let r=Ln(t,e)&&Lt(t.prev,t,t.next)>0&&Lt(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||On(t,e)&&On(e,t)&&(Lt(t.prev,t,e.prev)!==0||Lt(t,e.prev,e)!==0))&&!ob(t,e)&&(r||lb(t,e))}function Lt(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ln(t,e){return t.x===e.x&&t.y===e.y}function d1(t,e,r,i,n=!0){let a=Lt(t,e,r),s=Lt(t,e,i),o=Lt(r,i,t),l=Lt(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&Da(t,r,e)||s===0&&Da(t,i,e)||o===0&&Da(r,t,i)||l===0&&Da(r,e,i)):!1}function Da(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function ob(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.xa&&o.y>a||s.y=0&&Lt(t,t.prev,e)>=0:Lt(t,e,t.prev)<0||Lt(t,t.next,e)<0}function lb(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function y1(t,e){let r=Rl(t.i,t.x,t.y),i=Rl(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function yp(t,e,r,i){let n=Rl(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Vn(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),zl&&tb(t.prev,t.next)}function Rl(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function ub(t,e,r,i){let n=0;for(let a=e,s=r-i;at)throw Error(\"Min granularity must not be greater than base granularity.\");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<32767||e>32767)throw Error(\"Vertex coordinates are out of signed 16 bit integer range.\");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i),a=this._vertexDictionary.get(n);if(a!==void 0)return a;let s=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,s),this._vertexBuffer.push(r,i),s}_subdivideTrianglesScanline(t,e){if(this._granularity<2)return db(this._vertexBuffer,fb(t,e));let r=[],i=t.length;for(let n=0;n=1||b<=0)||m&&(ln)){c>=i&&c<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let _=o+f*v,A=l+d*v;a.push(this._vertexToIndex(_,A))}let w=o+f*Math.max(v,0),D=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,c,w,D),!m&&b<1){let _=o+f*b,A=l+d*b;a.push(this._vertexToIndex(_,A))}(m||c>=i&&c<=n)&&a.push(r[(s+1)%3]),!m&&(c<=i||c>=n)&&this._generateInterEdgeVertices(a,o,l,u,c,h,p,D,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,c=u?Math.min(e,i):Math.min(a,s),h=u?Math.max(e,i):Math.max(a,s),p=Math.floor(c/this._granularityCellSize)+1,f=Math.ceil(h/this._granularityCellSize)-1;if(u?e=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let c=n-r,h=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+h*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o=1||m<=0){let _=e-a,A=r-s,E=(l-s)/A,O=(u-s)/A,k=a+_*Math.min(E,O);x=Math.floor(Math.min(k,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(k,o)/this._granularityCellSize)-1,b=o0?u:l;if(b)for(let _=x;_<=v;_++){let A=_*this._granularityCellSize;t.push(this._vertexToIndex(A,D))}else for(let _=v;_>=x;_--){let A=_*this._granularityCellSize;t.push(this._vertexToIndex(A,D))}}_generateOutline(t,e){let r=[],i=0;for(let n of t){let a=this._granularity<2?this._ringPathIndices(n,i,e):this._pointArrayToIndices(zr(n,this._granularity,!0));i+=n.length;let s=[];for(let o=1;o=2&&g1(t)&&i.push(i[0]),i}_handlePoles(t){let e=!1,r=!1;this._canonical&&(this._canonical.y===0&&(e=!0),this._canonical.y===(1<n==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=it,a=t.length;for(let s=2;s=2&&((o=this._canonical)==null?void 0:o.z)===0&&(a=this._removeTrianglesOutsideTileX(a),s=s.map(l=>this._removeLinesOutsideTileX(l))),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:s}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,E=x>0?(Math.floor(D/n)+1)*n:(Math.ceil(D/n)-1)*n,O=Math.abs(w-A),k=Math.abs(D-E),P=Math.abs(w-f),R=Math.abs(D-d),C=y?O/v:1/0,I=m?k/b:1/0;if((P<=O||!y)&&(R<=k||!m))break;if(C0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function yb(t,e,r){if(e.length===0)throw Error(\"Subdivision vertex ring is empty.\");let i=0,n=t[e[0]*2];for(let l=1;l=0?s-1:a-1,u=(o+1)%a,c=t[e[l]*2],h=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(cp)x=!1;else{let v=g-y,b=-(m-d),w=y((p-d)*v+(f-y)*b)*w&&(x=!0)}if(x){let v=e[l],b=e[s],w=e[o];v!==b&&v!==w&&b!==w&&r.push(w,b,v),s--,s<0&&(s=a-1)}else{let v=e[u],b=e[s],w=e[o];v!==b&&v!==w&&b!==w&&r.push(w,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function x1(t,e,r,i,n,a,s,o,l){let u=n.length/2,c=s&&o&&l;if(uhe.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,c=0);let v=vn(s,i,a,o,p,y,u),b=vn(s,i,a,o,f,m,u),w=vn(s,i,a,o,d,g,u);r.emplaceBack(c+v-l,c+b-l,c+w-l),u.primitiveLength++}}function gb(t,e,r,i,n,a){let s=[];for(let h=0;hhe.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,c=0);let x=vn(s,i,a,o,f,y,u),v=vn(s,i,a,o,d,m,u);r.emplaceBack(c+x-l,c+v-l),u.primitiveLength++}}var v1=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new A2,this.indexArray=new Yn,this.indexArray2=new gl,this.programConfigurations=new Ur(t.layers,t.zoom),this.segments=new he,this.segments2=new he,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=es(\"fill\",this.layers,e);let i=this.layers[0].layout.get(\"fill-sort-key\"),n=!i.isConstant(),a=[],s=new ct(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Bi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:o?p.geometry:Yr(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:c,sourceLayerIndex:h}=l;if(this.hasDependencies){let f=Zu(\"fill\",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,c,r,{},e.subdivisionGranularity);let p=t[c].feature;e.featureIndex.insert(p,u,c,h,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get(\"fill-pattern\").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Ot(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer \"${t}\"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,qv),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of ys(e,500)){let o=m1(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;x1((u,c)=>{l.emplaceBack(u,c)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};B(\"FillBucket\",v1,{omit:[\"layers\",\"patternFeatures\"]});var mp,xb=()=>mp||(mp=new Qt({\"fill-sort-key\":new U(S.layout_fill[\"fill-sort-key\"],\"fill-sort-key\")})),gp,vb=()=>gp||(gp=new Qt({\"fill-antialias\":new V(S.paint_fill[\"fill-antialias\"],\"fill-antialias\"),\"fill-opacity\":new U(S.paint_fill[\"fill-opacity\"],\"fill-opacity\"),\"fill-layer-opacity\":new V(S.paint_fill[\"fill-layer-opacity\"],\"fill-layer-opacity\"),\"fill-layer-blend\":new V(S.paint_fill[\"fill-layer-blend\"],\"fill-layer-blend\"),\"fill-color\":new U(S.paint_fill[\"fill-color\"],\"fill-color\"),\"fill-outline-color\":new U(S.paint_fill[\"fill-outline-color\"],\"fill-outline-color\"),\"fill-translate\":new V(S.paint_fill[\"fill-translate\"],\"fill-translate\"),\"fill-translate-anchor\":new V(S.paint_fill[\"fill-translate-anchor\"],\"fill-translate-anchor\"),\"fill-pattern\":new In(S.paint_fill[\"fill-pattern\"],\"fill-pattern\"),\"fill-rounded-corner-distance\":new V(S.paint_fill[\"fill-rounded-corner-distance\"],\"fill-rounded-corner-distance\")})),bb={get paint(){return vb()},get layout(){return xb()}},wb=class extends Ce{constructor(t,e){super(t,bb,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values[\"fill-outline-color\"];r.value.kind===\"constant\"&&r.value.value===void 0&&(this.paint._values[\"fill-outline-color\"]=this.paint._values[\"fill-color\"])}createBucket(t){return new v1(t)}queryRadius(){return As(this.paint.get(\"fill-translate\"))}queryIntersectsFeature({queryGeometry:t,geometry:e,projectedCamera:r,pixelsToTileUnits:i}){return Ry(Es(t,this.paint.get(\"fill-translate\"),this.paint.get(\"fill-translate-anchor\"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},$l=Ft([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_normal_ed\",components:4,type:\"Int16\"}],4),_b=Ft([{name:\"a_centroid\",components:2,type:\"Int16\"}],4),Db=$l.members;$l.size,$l.alignment;var Wn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new F(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new F(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error(\"feature has no geometry\");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),no&&(o=n),au&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(h){return[(h.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(h.y+a)*2/i)*Math.PI))-90]}function l(h){return h.map(o)}let u;if(this.type===1){let h=[];for(let f of s)h.push(f[0]);let p=l(h);u=h.length===1?{type:\"Point\",coordinates:p[0]}:{type:\"MultiPoint\",coordinates:p}}else if(this.type===2){let h=s.map(l);u=h.length===1?{type:\"LineString\",coordinates:h[0]}:{type:\"MultiLineString\",coordinates:h}}else if(this.type===3){let h=b1(s),p=[];for(let f of h)p.push(f.map(l));u=p.length===1?{type:\"Polygon\",coordinates:p[0]}:{type:\"MultiPolygon\",coordinates:p}}else throw Error(\"unknown feature type\");let c={type:\"Feature\",geometry:u,properties:this.properties};return this.id!=null&&(c.id=this.id),c}};Wn.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];function b1(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a=this._features.length)throw Error(\"feature index out of bounds\");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Wn(this._pbf,e,this.extent,this._keys,this._values)}};function Eb(t){let e=null,r=t.readVarint()+t.pos;for(;t.poskb(r,e))}function Fb(t,e){let r=tv(it/2,it/2,e),i=be.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<0;e.push(o?s._perp():null)}let r=t.length-1,i=r>1&&t[0].equals(t[r]),n=[null];for(let a=1;a<=r;a++){let s=e[a];if(!s){n.push(null);continue}let o=i&&a===1?e[r]:e[a-1],l=i&&a===r?e[1]:e[a+1];n.push({start:xp(s,o),end:xp(s,l)})}return n}function xp(t,e){if(!e)return t.unit();let r=t.mag(),i=e.mag();return t.x*e.x+t.y*e.y=2*i?t.unit():i>=2*r?e.unit():t.add(e)._unit()}function kb(t,e){if(!t||t.length<3)return t;let r=t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y,i=r?t.length-1:t.length;if(i<3)return t;let n=[],a=Ka(t[i-1],t[0]);for(let o=0;o1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function Pb(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let c=.2,h=Math.min(n,o*c,l*c),p=r.add(a.mult(h)),f=r.add(s.mult(h)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(h/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var wo=8192;function Qi(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*wo)*2+s,n*wo*2,a*wo*2,Math.round(o))}var _1=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new E2,this.centroidVertexArray=new D2,this.indexArray=new Yn,this.programConfigurations=new Ur(t.layers,t.zoom),this.segments=new he,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=es(\"fill-extrusion\",this.layers,e);let i=new ct(this.zoom),n=this.layers[0],a=n.layout.get(\"fill-extrusion-rounded-corner-distance\"),s=a>0?Fb(a,r):0,o=n._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Bi(l,o);if(!n._featureFilter.filter(i,p,r))continue;let f={id:u,sourceLayerIndex:h,index:c,geometry:Tb(o?p.geometry:Yr(l),s),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(Zu(\"fill-extrusion\",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,c,r,{},e.subdivisionGranularity),e.featureIndex.insert(l,f.geometry,c,h,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Db),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,_b.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){for(let s of ys(e,500)){let o={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(o,i,t,s,a);let u=this.layoutVertexArray.length-l,c=Math.floor(o.x/o.sampleCount),h=Math.floor(o.y/o.sampleCount);for(let p=0;p{Qi(u,c,h,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0,i=this.layers[0].layout.get(\"fill-extrusion-rounded-corner-distance\")>0?Cb(t):null;for(let n=1;nhe.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=a.sub(s)._perp()._unit(),{start:l,end:u}=i?i[n]:{start:o,end:o},c=s.dist(a);r+c>32768&&(r=0),Qi(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,0,r),Qi(this.layoutVertexArray,a.x,a.y,u.x,u.y,0,1,r),r+=c,Qi(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,0,r),Qi(this.layoutVertexArray,s.x,s.y,l.x,l.y,0,1,r);let h=e.segment.vertexLength;this.indexArray.emplaceBack(h,h+2,h+1),this.indexArray.emplaceBack(h+1,h+2,h+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function Bb(t,e){for(let r=0;rvp||(vp=new Qt({\"fill-extrusion-rounded-corner-distance\":new V(S[\"layout_fill-extrusion\"][\"fill-extrusion-rounded-corner-distance\"],\"fill-extrusion-rounded-corner-distance\")})),bp,Lb=()=>bp||(bp=new Qt({\"fill-extrusion-opacity\":new U(S[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"],\"fill-extrusion-opacity\"),\"fill-extrusion-layer-opacity\":new V(S[\"paint_fill-extrusion\"][\"fill-extrusion-layer-opacity\"],\"fill-extrusion-layer-opacity\"),\"fill-extrusion-color\":new U(S[\"paint_fill-extrusion\"][\"fill-extrusion-color\"],\"fill-extrusion-color\"),\"fill-extrusion-translate\":new V(S[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"],\"fill-extrusion-translate\"),\"fill-extrusion-translate-anchor\":new V(S[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"],\"fill-extrusion-translate-anchor\"),\"fill-extrusion-pattern\":new In(S[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"],\"fill-extrusion-pattern\"),\"fill-extrusion-height\":new U(S[\"paint_fill-extrusion\"][\"fill-extrusion-height\"],\"fill-extrusion-height\"),\"fill-extrusion-base\":new U(S[\"paint_fill-extrusion\"][\"fill-extrusion-base\"],\"fill-extrusion-base\"),\"fill-extrusion-vertical-gradient\":new V(S[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"],\"fill-extrusion-vertical-gradient\")})),Ob={get paint(){return Lb()},get layout(){return zb()}},Vb=class extends Ce{constructor(t,e){super(t,Ob,e)}createBucket(t){return new _1(t)}queryRadius(){return As(this.paint.get(\"fill-extrusion-translate\"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a,unwrappedTileID:s}){let o=Es(t,this.paint.get(\"fill-extrusion-translate\"),this.paint.get(\"fill-extrusion-translate-anchor\"),-n.bearingInRadians,a),l=this.paint.get(\"fill-extrusion-height\").evaluate(e,r),u=this.paint.get(\"fill-extrusion-base\").evaluate(e,r),c=o.map(h=>_o(h,0,n,s));return Rb(i.map(h=>h.map(p=>_o(p,u,n,s))),i.map(h=>h.map(p=>_o(p,l,n,s))),c)}};function _o(t,e,r,i){let{point:n,signedDistanceFromCamera:a}=Ss(r).projectTileCoordinates(r,t.x,t.y,i,e),s=n;return s.z=a,s}function tn(t,e){return t.x*e.x+t.y*e.y}function wp(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r>1),o=r-e,l,u=t[e],c=t[e+1],h=t[r],p=t[r+1];for(let f=e+3;fa)l=f,a=d;else if(d===a){let y=Math.abs(f-s);yi&&(t[l+2]=a,l-e>3&&n.push(e,l),r-l>3&&n.push(l,r))}function jb(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function Vr(t,e,r,i){let n={id:t!=null?t:null,type:e,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,worldOffset:0};if(e===\"MultiPoint\")return Ep(n,r,0,r.length),n;let a=e===\"Polygon\"||e===\"MultiPolygon\";for(let s=0;s1?1:r}unprojectX(t){return(t-.5)*360}unprojectY(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}},qb=class{projectX(t){return t}projectY(t){return t}unprojectX(t){return t}unprojectY(t){return t}},Ku=new Ub,Gb=new qb;function Ju(t){return t===\"unitSquare\"?Gb:Ku}function Qu(t,e,r){let i=[];switch(t.type){case\"FeatureCollection\":for(let n=0;na?i.delete(s):i.set(s,lt(Y({},e),{id:s})))}function D1(t,e,r,i,n=0){var l;if(!e.geometry)return;if(n>1024)throw Error(\"GeometryCollection nesting exceeds supported depth: 1024\");if(e.geometry.type===\"GeometryCollection\"){Xb(t,e,e.geometry,r,i,n+1);return}if(!((l=e.geometry.coordinates)!=null&&l.length))return;let a=S1(e,r,i),s=(r.tolerance/((1<0&&(c+=n?(l*y-d*u)/2:Math.sqrt((d-l)**2+(y-u)**2)),l=d,u=y}let p=h-3;return e[o+2]=1,i>0&&$b(e,o,p,i),e[p+2]=1,e[r]=t.length,e[r+1]=n&&!a?Wb(c):Math.abs(c),h}function Zb(t,e=Ku){return{type:\"FeatureCollection\",features:t.map(r=>ns(r,e))}}function ns(t,e=Ku){let r={type:\"Feature\",geometry:Hb(t,e),properties:t.tags};return t.id!=null&&(r.id=t.id),r}function Hb(t,e){switch(t.type){case\"Point\":return{type:t.type,coordinates:[e.unprojectX(t.x),e.unprojectY(t.y)]};case\"MultiPoint\":return{type:t.type,coordinates:tc(t.geometry,t.worldOffset,0,t.geometry.length,e)};case\"LineString\":return{type:t.type,coordinates:Fp(t.geometry,t.worldOffset,e)[0]};case\"MultiLineString\":case\"Polygon\":return{type:t.type,coordinates:Fp(t.geometry,t.worldOffset,e)};case\"MultiPolygon\":return{type:t.type,coordinates:Kb(t.geometry,t.worldOffset,e)}}}function Fp(t,e,r){let i=[];for(let n=0;n=r&&s=i)return null;let l=[];for(let u of t){if(u.type===\"Point\"){let p=n===0?u.x:u.y;p>=r&&p=r&&h=i||(u.type===\"MultiPoint\"?Jb(u,l,r,i,n):Qb(u,l,r,i,n,o))}return l.length?l:null}function Jb(t,e,r,i,n){let a=t.geometry,s=t.worldOffset,o=n===0?s:0,l=0,u=0;for(let p=0;p=r&&f<=i&&(l++,u=p)}if(!l)return;if(l===1){e.push(Hu(t.id,a[u]+s,a[u+1],t.tags));return}let c=new Float64Array(l*3),h=0;for(let p=0;p=r&&f<=i&&(c[h]=a[p]+s,c[h+1]=a[p+1],c[h+2]=a[p+2],h+=3)}e.push(Vr(t.id,\"MultiPoint\",c,t.tags))}function Qb(t,e,r,i,n,a){let s=t.geometry,o=t.worldOffset,l=t.type===\"Polygon\"||t.type===\"MultiPolygon\",u=0;for(let m=0;mv&&(d=!0),m=g}if(f=n&&h++:d>a?y<=a&&h++:h++,y=n&&(h++,m=!0),y>a&&d<=a&&(h++,m=!0),!o&&m&&(c+=h,u++,h=0)}let p=t[i-3+s]+l;return p>=n&&p<=a&&h++,o&&h>=2&&h++,h>0&&(c+=h,u++),c*3+u*2}function ew(t,e,r,i,n,a,s,o,l,u,c,h,p){let f=s;a[s+1]=n,s+=2;let d=s,y=h?h.start:0,m=y,g,x;for(let _=r;_=o&&(x=Sa(a,s,A,E,k,P,o,u),s+=3,h&&(m=y+g*x)):R>l?C<=l&&(x=Sa(a,s,A,E,k,P,l,u),s+=3,h&&(m=y+g*x)):(a[s]=A,a[s+1]=E,a[s+2]=O,s+=3),C=o&&(x=Sa(a,s,A,E,k,P,o,u),s+=3,I=!0),C>l&&R<=l&&(x=Sa(a,s,A,E,k,P,l,u),s+=3,I=!0),!c&&I&&(a[f]=(s-d)/3,h&&(p.push(m,y+g*x),m=h.start),f=s,a[s+1]=n,s+=2,d=s),h&&(y+=g)}let v=i-3,b=t[v]+e,w=t[v+1],D=u===0?b:w;return D>=o&&D<=l&&(a[s]=b,a[s+1]=w,a[s+2]=t[v+2],s+=3),c&&s-d>=6&&(a[s-3]!==a[d]||a[s-2]!==a[d+1])&&(a[s]=a[d],a[s+1]=a[d+1],a[s+2]=a[d+2],s+=3),s===d?f:(a[f]=(s-d)/3,h&&p.push(m,h.end),s)}function Sa(t,e,r,i,n,a,s,o){let l;return o===0?(l=(s-r)/(n-r),t[e]=s,t[e+1]=i+(a-i)*l):(l=(s-i)/(a-i),t[e]=r+(n-r)*l,t[e+1]=s),t[e+2]=1,l}function ec(t,e){if(!e.wrap)return t;let r=e.buffer/e.extent,i=t,n=Ee(t,1,-1-r,r,0,-1,2,e),a=Ee(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=Ee(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=Ip(n,1).concat(i)),a&&(i=i.concat(Ip(a,-1)))),i}function Ip(t,e){let r=[];for(let i of t)i.type===\"Point\"?r.push(Hu(i.id,i.x+e,i.y,i.tags)):r.push(lt(Y({},i),{minX:i.minX+e,maxX:i.maxX+e,worldOffset:i.worldOffset+e}));return r}function rw(t,e,r,i){let n=aw(e,r),a=[];if(n.removeAll&&(a=t,t=[],i==null||i.clear()),n.remove.size||n.add.size){for(let o of n.remove)i==null||i.delete(o);let s=[];for(let o of t)(n.remove.has(o.id)||n.add.has(o.id))&&s.push(o);if(s.length){a=a.concat(s);let o=new Set(s.map(l=>l.id));t=t.filter(l=>!o.has(l.id))}if(n.add.size){let o=Qu({type:\"FeatureCollection\",features:Array.from(n.add.values())},lt(Y({},r),{generateId:!1}),i);o=ec(o,r),a=a.concat(o),t=t.concat(o)}}if(n.update.size){let s=new Map,o=[];for(let l of t)n.update.has(l.id)?s.set(l.id,[...s.get(l.id)||[],l]):o.push(l);for(let[l,u]of n.update){let c=s.get(l);if(!c||c.length===0){if(!(i!=null&&i.has(l)))continue;let p=nw(l,u,r,i);a=a.concat(p),o=o.concat(p);continue}let h=iw(c,u,r,i);a=a.concat(c,h),o=o.concat(h)}t=o}return{affected:a,source:t}}function iw(t,e,r,i){let n=!!e.newGeometry,a=T1(e);if(n){let s=t[0],o=a?Nl(s.tags,e):s.tags;return E1(s.id,e.newGeometry,o,r,i)}if(a){let s=[];for(let o of t){let l=Y({},o);l.tags=Nl(l.tags,e),s.push(l)}return s}return t}function nw(t,e,r,i){let n=i.get(t),a=T1(e)?Nl(n.properties,e):n.properties;return e.newGeometry?E1(t,e.newGeometry,a,r,i):(i.set(t,lt(Y({},n),{properties:a})),[])}function E1(t,e,r,i,n){return ec(Qu({type:\"FeatureCollection\",features:[{type:\"Feature\",id:t,geometry:e,properties:r}]},lt(Y({},i),{promoteId:void 0,generateId:!1}),n),i)}function T1(t){var e,r;return t.removeAllProperties||((e=t.removeProperties)==null?void 0:e.length)>0||((r=t.addOrUpdateProperties)==null?void 0:r.length)>0}function Nl(t,e){if(e.removeAllProperties)return{};let r=Y({},t||{});if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function aw(t,e){var r,i;return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map((r=t.add)==null?void 0:r.map(n=>{var a;return[e.promoteId?(a=n.properties)==null?void 0:a[e.promoteId]:n.id,n]})),update:new Map((i=t.update)==null?void 0:i.map(n=>[n.id,n]))}:{remove:new Set,add:new Map,update:new Map}}var Cp=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],wt=new Uint32Array(96),sw=class F1{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error(\"Data must be an instance of ArrayBuffer or SharedArrayBuffer.\");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error(\"Data does not appear to be in a KDBush format.\");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=Cp[i&15];if(!a)throw Error(\"Unrecognized array type.\");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new F1(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=Cp.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let c=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(c,8,e),this.coords=new i(c,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(c,0,2).set([219,16+s]),new Uint16Array(c,2,1)[0]=r,new Uint32Array(c,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return jl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;wt[0]=0,wt[1]=a.length-1,wt[2]=0;let l=3,u=[];for(;l>0;){let c=wt[--l],h=wt[--l],p=wt[--l];if(h-p<=o){for(let m=p;m<=h;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+h>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(c===0?e<=d:r<=y)&&(wt[l++]=p,wt[l++]=f-1,wt[l++]=1-c),(c===0?i>=d:n>=y)&&(wt[l++]=f+1,wt[l++]=h,wt[l++]=1-c)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;wt[0]=0,wt[1]=a.length-1,wt[2]=0;let l=3,u=0,c=i*i;for(;l>0;){let h=wt[--l],p=wt[--l],f=wt[--l];if(p-f<=o){for(let g=f;g<=p;g++)kp(s[2*g],s[2*g+1],e,r)<=c&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];kp(y,m,e,r)<=c&&(n[u++]=a[d]),(h===0?e-i<=y:r-i<=m)&&(wt[l++]=f,wt[l++]=d-1,wt[l++]=1-h),(h===0?e+i>=y:r+i>=m)&&(wt[l++]=d+1,wt[l++]=p,wt[l++]=1-h)}return u}};function jl(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;I1(t,e,s,i,n,a),jl(t,e,r,i,s-1,1-a),jl(t,e,r,s+1,n,1-a)}function I1(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,c=r-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*p*(u-p)/u)*(c-u/2<0?-1:1);I1(t,e,r,Math.max(i,Math.floor(r-c*p/u+f)),Math.min(n,Math.floor(r+(u-c)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(en(t,e,i,r),e[2*n+a]>s&&en(t,e,i,n);os;)l--}e[2*i+a]===s?en(t,e,i,l):(l++,en(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function en(t,e,r,i){Ao(t,r,i),Ao(e,2*r,2*i),Ao(e,2*r+1,2*i+1)}function Ao(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function kp(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var C1={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t,coordinates:\"lngLat\",wrap:!0},as=1073741824;function Jt(t){return(t-.5)*as}function Fi(t){return t/as+.5}function Mp(t){return Math.abs(Jt(t))<2147483647}var ow=class{constructor(t){this.options=Pp(t),this.worldCoordinateHelper=Ju(this.options.coordinates),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let i=r.geometry.type===\"MultiPoint\"?r.geometry.coordinates:[r.geometry.coordinates];for(let[n,a]of i){let[s,o]=[this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(a)];if(!this.options.wrap&&!Bp(s,o))continue;let l={id:r.id,type:\"Point\",x:s,y:o,tags:r.properties};e.push(l)}}this.createIndex(e)}initialize(t){let e=[];for(let r of t)if(r.type===\"Point\"){if(!this.isClustered(r.x,r.y))continue;e.push(r)}else if(r.type===\"MultiPoint\")for(let i=0;i=0&&t<1:Bp(t,e)}updateIndex(t,e,r){this.options=Pp(lt(Y({},r.clusterOptions),{coordinates:this.options.coordinates,wrap:this.options.wrap})),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;this.trees=Array(i+1),this.stride=this.options.reduce?5:4,this.clusterProps=[],e&&console.time(\"total time\");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=this.stride,s=i+1,o=new Int32Array(t.length*2),l=new Int32Array(t.length*a),u=0;for(let f=0;f=r;f--){let d=Date.now(),y=this.cluster(c,f,h,p);this.isSameAsTree(c,p,y)||(c=this.createTree(h.slice(0,y*2),p.slice(0,y*a),y)),this.trees[f]=c,e&&console.log(\"z%d: %d clusters in %dms\",f,c.numItems,Date.now()-d)}e&&console.timeEnd(\"total time\")}getClusters(t,e){return(this.options.wrap?this.options.coordinates===\"unitSquare\"?this.getClustersAcrossEdge(t,e):this.getClustersInternal(t,e):this.getClustersInWorld(t,e)).map(r=>ns(r,this.worldCoordinateHelper))}getClustersInWorld(t,e){let r=this.options.coordinates!==\"unitSquare\",i=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,t[1])):t[1]),n=this.worldCoordinateHelper.projectY(r?Math.max(-90,Math.min(90,t[3])):t[3]),a=Math.max(0,this.worldCoordinateHelper.projectX(t[0])),s=Math.min(1,this.worldCoordinateHelper.projectX(t[2]));return a>s?[]:this.getClustersInRange([a,Math.min(i,n),s,Math.max(i,n)],e)}getClustersAcrossEdge([t,e,r,i],n){if(r=1)return this.getClustersInRange([0,e,1,i],n);let a=Math.floor(t),s=t-a,o=r-a;return o<=1?this.getClustersInRange([s,e,o,i],n):this.getClustersInRange([s,e,1,i],n).concat(this.getClustersInRange([0,e,o-1,i],n))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let s=this.getClustersInternal([r,i,180,a],e),o=this.getClustersInternal([-180,i,n,a],e);return s.concat(o)}return this.getClustersInRange([this.worldCoordinateHelper.projectX(r),this.worldCoordinateHelper.projectY(a),this.worldCoordinateHelper.projectX(n),this.worldCoordinateHelper.projectY(i)],e)}getClustersInRange([t,e,r,i],n){let a=this.trees[this.limitZoom(n)],s=a.range(Jt(t),Jt(e),Jt(r),Jt(i)),o=a.flatCoords,l=a.flatData,u=[];for(let c of s){let h=this.stride*c;u.push(l[h+3]>1?lw(o,c,l,h,this.clusterProps):this.points[l[h+1]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error(\"No cluster with the specified id: \"+t),n=this.trees[r];if(!n)throw i;let a=n.flatCoords,s=n.flatData;if(e>=n.numItems)throw i;let o=this.options.radius/(this.options.extent*2**(r-1))*as,l=a[e*2],u=a[e*2+1],c=n.within(l,u,o),h=[];for(let p of c){let f=p*this.stride;s[f+2]===t&&h.push(s[f+3]>1?uw(a,p,s,f,this.clusterProps,this.worldCoordinateHelper):ns(this.points[s[f+1]],this.worldCoordinateHelper))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t;if(!this.options.wrap&&(e<0||e>=n||r<0||r>=n))return null;let{extent:a,radius:s}=this.options,o=s/a,l=Jt((r-o)/n),u=Jt((r+1+o)/n),c={features:[]};return this.addTileFeatures(i.range(Jt((e-o)/n),l,Jt((e+1+o)/n),u),i,e,r,n,c),this.options.wrap&&e===0&&this.addTileFeatures(i.range(Jt(1-o/n),l,Jt(1),u),i,n,r,n,c),this.options.wrap&&e===n-1&&this.addTileFeatures(i.range(Jt(0),l,Jt(o/n),u),i,-1,r,n,c),c}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o!=null&&o.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n1,h,p,f;if(c)h=rc(o,u,this.clusterProps),p=Fi(s[l*2]),f=Fi(s[l*2+1]);else{let m=this.points[o[u+1]];h=m.tags,p=m.x,f=m.y}let d={type:1,geometry:[[Math.round(this.options.extent*(p*n-r)),Math.round(this.options.extent*(f*n-i))]],tags:h},y;y=c||this.options.generateId?o[u+1]:this.points[o[u+1]].id,y!==void 0&&(d.id=y),a.features.push(d)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e,r,i){let{radius:n,extent:a,reduce:s,minPoints:o,maxZoom:l}=this.options,u=n/(a*2**e)*as,c=l+1,h=t.flatCoords,p=t.flatData,f=this.stride,d=new Uint32Array(t.numItems),y=0;for(let m=0;me&&(D+=p[A+3])}if(D>w&&D>=o){let _=x*w,A=v*w,E,O=-1,k=(m<<5)+(e+1)+this.points.length;for(let R=0;R1)for(let _=0;_>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+3]>1){let a=this.clusterProps[t[e+4]];return r?Object.assign({},a):a}let i=this.points[t[e+1]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function Pp(t){let e=Object.assign(Object.create(C1),t);return e.minZoom=Math.min(e.minZoom,30),e.maxZoom=Math.min(e.maxZoom,30),e}function lw(t,e,r,i,n){return{id:r[i+1],type:\"Point\",tags:rc(r,i,n),x:Fi(t[e*2]),y:Fi(t[e*2+1])}}function uw(t,e,r,i,n,a){return{type:\"Feature\",id:r[i+1],properties:rc(r,i,n),geometry:{type:\"Point\",coordinates:[a.unprojectX(Fi(t[e*2])),a.unprojectY(Fi(t[e*2+1]))]}}}function rc(t,e,r){let i=t[e+3],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+4],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+1],point_count:i,point_count_abbreviated:n})}function Bp(t,e){return t>=0&&t<=1&&e>=0&&e<=1}var k1=\"geojsonvt_clip_start\",M1=\"geojsonvt_clip_end\";function cw(t){return t.extent+t.buffer<=32767?Int16Array:Int32Array}function zp(t,e,r,i,n,a=cw(n)){let s=e===n.maxZoom?0:n.tolerance/((1<0&&Math.abs(a)<(l?c:o))return;let p=n-3;for(;p>i&&o>0&&e[p+2]<=c;)p-=3;let f=e[p]+r,d=e[p+1],y=0,m=0;for(let v=i;vc)&&(y+=(e[v]+r-f)*(e[v+1]+d),f=e[v]+r,d=e[v+1],m++);s.numSimplified+=m;let g=l&&y>0==!Ts(a),x=P1(e,r,i,n,o,m,g,u);l&&mw(e,r,i,n,o,g,x)&&gw(x),t.push(x)}function P1(t,e,r,i,n,a,s,o,l=o.CoordArray){let u=n*n,c=l===Int16Array?32767:2147483647,h=new l(a*2),p=s?h.length-2:0;for(let f=r;fu){let d=Ii(t[f]+e,o.tx,o),y=Ii(t[f+1],o.ty,o);if(l!==Float64Array&&!(Math.abs(d)<=c&&Math.abs(y)<=c))return P1(t,e,r,i,n,a,s,o,Float64Array);h[p]=d,h[p+1]=y,p+=s?-2:2}return h}function mw(t,e,r,i,n,a,s){let o=n*n,l=a?-3:3,u=0,c=0,h=0,p=0,f=0,d=0,y=0,m=0,g=0;for(let x=a?i-3:r;x>=r&&x0&&!(t[x+2]>o))){if(g===0)u=t[x]+e,c=t[x+1];else{let v=t[x]+e-u,b=t[x+1]-c,w=s[g]-s[0],D=s[g+1]-s[1];y+=h*b-v*p,m+=f*D-w*d,h=v,p=b,f=w,d=D}g+=2}return y*m<0}function gw(t){for(let e=0,r=t.length-2;e1&&(console.log(\"invalidating tiles\"),console.time(\"invalidating\")),this.invalidateTiles(e),r.debug>1&&console.timeEnd(\"invalidating\");let[i,n,a]=[0,0,0],s=this.clipToWorld(t),o=zp(s,i,n,a,r);o.source=s;let l=Aa(i,n,a);if(this.tiles[l]=o,this.tileCoords.push({z:i,x:n,y:a,id:l}),r.debug){let u=`z${i}`;this.stats[u]=(this.stats[u]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{debug:i}=this.options,n=1<=n))return null;e=e+n&n-1;let a=Aa(t,e,r);if(this.tiles[a])return Lp(this.tiles[a]);i>1&&console.log(\"drilling down to z%d-%d-%d\",t,e,r);let s=t,o=e,l=r,u;for(;!u&&s>0;)s--,o>>=1,l>>=1,u=this.tiles[Aa(s,o,l)];return!(u!=null&&u.source)||(i>1&&(console.log(\"found parent tile z%d-%d-%d\",s,o,l),console.time(\"drilling down\")),this.splitTile(u.source,s,o,l,t,e,r),i>1&&console.timeEnd(\"drilling down\"),!this.tiles[a])?null:Lp(this.tiles[a])}clipToWorld(t){let{wrap:e,coordinates:r}=this.options;if(e&&r!==\"unitSquare\")return t;let i=this.options.buffer/this.options.extent;return Ee(e?t:Ee(t,1,-i,1+i,0,-1/0,1/0,this.options)||[],1,-i,1+i,1,-1/0,1/0,this.options)||[]}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let c=1<1&&console.time(\"creation\"),p=this.tiles[h]=zp(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:h}),u)){u>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd(\"creation\"));let _=`z${e}`;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let _=n-e;if(r!==a>>_||i!==s>>_)continue}}if(p.source=null,!t.length)continue;u>1&&console.time(\"clipping\");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,w=Ee(t,c,r-f,r+y,0,p.minX,p.maxX,l),D=Ee(t,c,r+d,r+m,0,p.minX,p.maxX,l);w&&(g=Ee(w,c,i-f,i+y,1,p.minY,p.maxY,l),x=Ee(w,c,i+d,i+m,1,p.minY,p.maxY,l)),D&&(v=Ee(D,c,i-f,i+y,1,p.minY,p.maxY,l),b=Ee(D,c,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd(\"clipping\"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(v||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,_p(u)),n=Math.max(n,Sp(u)),a=Math.min(a,Dp(u)),s=Math.max(s,Ap(u));let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let c=this.tiles[u],h=1<=f||s=y)continue;let m=!1;for(let g of t)if(Sp(g)>=p&&_p(g)=d&&Dp(g)1&&console.log(\"invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",c.z,c.x,c.y,c.numFeatures,c.numPoints,c.numSimplified);let g=`z${c.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function Aa(t,e,r){return((1<24)throw Error(\"maxZoom should be in the 0-24 range\");if(e.promoteId&&e.generateId)throw Error(\"promoteId and generateId cannot be used together.\");e.updateable&&(this.unlocated=new Map),this.nextId=t.type===\"FeatureCollection\"?t.features.length:1;let i=Qu(t,e,this.unlocated);r&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",e.indexMaxZoom,e.indexMaxPoints),console.time(\"generate tiles\")),i=ec(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new ow(lt(Y({},e.clusterOptions),{coordinates:e.coordinates,wrap:e.wrap})):new vw(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error(\"to update tile geojson `updateable` option must be set to true\");r.generateId&&t.add&&(t=lt(Y({},t),{add:t.add.map(a=>lt(Y({},a),{id:this.nextId++}))}));let{affected:i,source:n}=rw(this.source,t,r,this.unlocated);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){var n;let i=new Set;for(let a of t)a.id!=null&&(r(ns(a,this.worldCoordinateHelper))||(e.push(a),i.add(a.id)));t=t.filter(a=>!i.has(a.id));for(let[a,s]of(n=this.unlocated)!=null?n:[])s.geometry&&!r(s)&&this.unlocated.delete(a);return{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error(\"to retrieve data the `updateable` option must be set to true\");return Zb(this.source,this.worldCoordinateHelper)}updateClusterOptions(t,e){if(!this.options.updateable)throw Error(\"to update cluster options the `updateable` option must be set to true\");let r=this.options.cluster;this.options.cluster=t,this.options.clusterOptions=e,r==t?this.tileIndex.updateIndex(this.source,[],this.options):this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},Ul=Ft([{name:\"a_pos_normal\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"},{name:\"a_offset_normal\",components:2,type:\"Int8\"}],2),_w=Ul.members;Ul.size,Ul.alignment;var ql=Ft([{name:\"a_uv_x\",components:1,type:\"Float32\"},{name:\"a_split_index\",components:1,type:\"Float32\"}]),Dw=ql.members;ql.size,ql.alignment;var Gl=Ft([{name:\"a_offset_distance\",components:1,type:\"Float32\"}]),Sw=Gl.members;Gl.size,Gl.alignment;var Aw=Math.cos(75/2*(Math.PI/180));function Vp(t,e){let r=e.x*t.x+e.y*t.y,i=e.sub(t.mult(r)),n=Math.sqrt(3),a=i.mag();return a>n&&i._mult(n/a),i._add(t)}function Ew(t){return!!t.paint.get(\"line-dasharray\").constantOr(1)&&t.paint.get(\"line-offset\").constantOr(1)!==0}var z1=1/2,Eo=2**14/z1,L1=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new T2,this.layoutVertexArray2=new F2,this.offsetDistanceArray=this.layers.some(Ew)?new I2:void 0,this.offsetDistanceBuffer=void 0,this.indexArray=new Yn,this.programConfigurations=new Ur(t.layers,t.zoom),this.segments=new he,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=es(\"line\",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get(\"line-sort-key\"),n=!i.isConstant(),a=[],s=new ct(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let p=Bi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:o?p.geometry:Yr(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:c,sourceLayerIndex:h}=l;this.hasDependencies?(es(\"line\",this.layers,e)?Zu(\"line\",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,c,r,{},{},e.subdivisionGranularity);let p=t[c].feature;e.featureIndex.insert(p,u,c,h,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){var e;this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Dw)),(e=this.offsetDistanceArray)!=null&&e.length&&(this.offsetDistanceBuffer=t.createVertexBuffer(this.offsetDistanceArray,Sw)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,_w),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){var t;this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),(t=this.offsetDistanceBuffer)==null||t.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,\"geojsonvt_clip_start\")&&Object.hasOwn(t.properties,\"geojsonvt_clip_end\"))return{start:+t.properties[k1],end:+t.properties[M1]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get(\"line-join\").evaluate(t,{}),u=o.get(\"line-cap\").evaluate(t,{}),c=o.get(\"line-miter-limit\").evaluate(t,{}),h=o.get(\"line-round-limit\").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e){let f=this.layoutVertexArray.length;this.addLine(p,t,l,u,c,h,i,s),this.offsetDistanceArray&&this.addOffsetDistances(f)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=zr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v=2&&t[c-1].equals(t[c-2]);)c--;let h=0;for(;h0,k=b.mult(Math.min(_,2)),P=Kt((_-3)/5,0,1);if(E&&v>h){let I=d.dist(y);if(I>2*p){let N=d.sub(d.sub(y)._mult(p/I)._round());this.updateDistance(y,N),this.addCurrentVertex(N,g,0,0,f,!1,Vp(g,k),P),y=N}}let R=y&&m,C=R?r:u?\"butt\":i;if(R&&C===\"round\"&&(_n&&(C=\"bevel\"),C===\"bevel\"&&(_>2&&(C=\"flipbevel\"),_100)b=x.mult(-1);else{let I=_*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(I*(O?-1:1))}this.addCurrentVertex(d,b,0,0,f,!1,k,P),this.addCurrentVertex(d,b.mult(-1),0,0,f,!1,k,P)}else if(C===\"bevel\"||C===\"fakeround\"){let I=-Math.sqrt(_*_-1),N=O?I:0,L=O?0:I;if(y&&this.addCurrentVertex(d,g,N,L,f,!1,k),C===\"fakeround\"){let $=Math.round(A*180/Math.PI/20);for(let st=1;st<$;st++){let mt=st/$;if(mt!==.5){let kt=mt-.5,Mt=1.0904+w*(-3.2452+w*(3.55645-w*1.43519)),Vt=.848013+w*(-1.06021+w*.215638);mt+=mt*kt*(mt-1)*(Mt*kt*kt+Vt)}let ht=x.sub(g)._mult(mt)._add(g)._unit()._mult(O?-1:1);this.addHalfVertex(d,ht.x,ht.y,O?-k.x:k.x,O?-k.y:k.y,!1,O,f)}}m&&this.addCurrentVertex(d,x,-N,-L,f,!1,k)}else if(C===\"butt\")this.addCurrentVertex(d,b,0,0,f,!1,k);else if(C===\"square\"){let I=y?1:-1;this.addCurrentVertex(d,b,I,I,f,!1,k)}else C===\"round\"&&(y&&(this.addCurrentVertex(d,g,0,0,f,!1,k,P),this.addCurrentVertex(d,g,1,1,f,!0,k,P)),m&&(this.addCurrentVertex(d,x,-1,-1,f,!0,k,P),this.addCurrentVertex(d,x,0,0,f,!1,k,P)));if(E&&v2*p){let N=d.add(m.sub(d)._mult(p/I)._round());this.updateDistance(d,N),this.addCurrentVertex(N,x,0,0,f,!1,Vp(x,k),P),d=N}}}}addCurrentVertex(t,e,r,i,n,a=!1,s=e,o=0){let l=e.x+e.y*r,u=e.y-e.x*r,c=-e.x+e.y*i,h=-e.y-e.x*i,p=s.x+(e.x-s.x)*o,f=s.y+(e.y-s.y)*o;this.addHalfVertex(t,l,u,p,f,a,!1,n),this.addHalfVertex(t,c,h,-p,-f,a,!0,n),this.distance>Eo/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a,s,o))}addHalfVertex({x:t,y:e},r,i,n,a,s,o,l){let u=(this.lineClips?this.scaledDistance*(Eo-1):this.scaledDistance)*z1;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!s,(e<<1)+ +!!o,Math.round(63*r)+128,Math.round(63*i)+128,(u&63)<<2,u>>6,Math.round(63*n),Math.round(63*a)),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let c=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,c,this.e2),l.primitiveLength++),o?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}addOffsetDistances(t){let{int16:e,int8:r}=this.layoutVertexArray,i=this.lineClips?(this.lineClips.end-this.lineClips.start)*(Eo-1)/this.totalDistance:1,n=0,a=0,s=0,o=0,l=0;for(let u=t;u>1,h=e[u*5+1]>>1,p=e[u*5+1]&1?-1:1,f=p*r[u*10+8]/63,d=p*r[u*10+9]/63,y=c-a,m=h-s;u>t&&(y!==0||m!==0)&&(n+=((f-o)*y+(d-l)*m)/Math.hypot(y,m)),this.offsetDistanceArray.emplaceBack(n*i),a=c,s=h,o=f,l=d}}hasLineDasharray(t){for(let e of t){let r=e.paint.get(\"line-dasharray\");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get(\"line-dasharray\");if(!a||a.value.kind===\"constant\")continue;let s=n.layout.get(\"line-cap\").evaluate(e,{})===\"round\",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},c=`${o.dasharray.join(\",\")},${o.round}`,h=`${l.dasharray.join(\",\")},${l.round}`,p=`${u.dasharray.join(\",\")},${u.round}`;i.dashDependencies[c]=o,i.dashDependencies[h]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:c,mid:h,max:p}}}};B(\"LineBucket\",L1,{omit:[\"layers\",\"patternFeatures\"]});var Rp,Tw=()=>Rp||(Rp=new Qt({\"line-cap\":new U(S.layout_line[\"line-cap\"],\"line-cap\"),\"line-join\":new U(S.layout_line[\"line-join\"],\"line-join\"),\"line-miter-limit\":new U(S.layout_line[\"line-miter-limit\"],\"line-miter-limit\"),\"line-round-limit\":new U(S.layout_line[\"line-round-limit\"],\"line-round-limit\"),\"line-sort-key\":new U(S.layout_line[\"line-sort-key\"],\"line-sort-key\")})),$p,Fw=()=>$p||($p=new Qt({\"line-opacity\":new U(S.paint_line[\"line-opacity\"],\"line-opacity\"),\"line-layer-opacity\":new V(S.paint_line[\"line-layer-opacity\"],\"line-layer-opacity\"),\"line-layer-blend\":new V(S.paint_line[\"line-layer-blend\"],\"line-layer-blend\"),\"line-color\":new U(S.paint_line[\"line-color\"],\"line-color\"),\"line-translate\":new V(S.paint_line[\"line-translate\"],\"line-translate\"),\"line-translate-anchor\":new V(S.paint_line[\"line-translate-anchor\"],\"line-translate-anchor\"),\"line-width\":new U(S.paint_line[\"line-width\"],\"line-width\"),\"line-gap-width\":new U(S.paint_line[\"line-gap-width\"],\"line-gap-width\"),\"line-offset\":new U(S.paint_line[\"line-offset\"],\"line-offset\"),\"line-blur\":new U(S.paint_line[\"line-blur\"],\"line-blur\"),\"line-dasharray\":new In(S.paint_line[\"line-dasharray\"],\"line-dasharray\"),\"line-pattern\":new In(S.paint_line[\"line-pattern\"],\"line-pattern\"),\"line-gradient\":new ws(S.paint_line[\"line-gradient\"],\"line-gradient\")})),Np={get paint(){return Fw()},get layout(){return Tw()}},Iw=class extends U{possiblyEvaluate(t,e){return e=new ct(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=new ct(Math.floor(e.zoom),e),super.evaluate(t,e,r,i)}},Ea,Cw=class extends Ce{constructor(t,e){super(t,Np,e),this.gradientVersion=0,Ea||(Ea=new Iw(Np.paint.properties[\"line-width\"].specification,\"line-floorwidth\"),Ea.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t===\"line-gradient\"){let e=this.gradientExpression();this.stepInterpolant=Fx(e)?e._styleExpression.expression instanceof vu:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values[\"line-gradient\"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values[\"line-floorwidth\"]=Ea.possiblyEvaluate(this._transitioningPaint._values[\"line-width\"].value,t)}createBucket(t){return new L1(t)}queryRadius(t){let e=t,r=jp(yi(\"line-width\",this,e),yi(\"line-gap-width\",this,e)),i=yi(\"line-offset\",this,e);return r/2+Math.abs(i)+As(this.paint.get(\"line-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,projectedCamera:n,pixelsToTileUnits:a}){let s=Es(t,this.paint.get(\"line-translate\"),this.paint.get(\"line-translate-anchor\"),-n.bearingInRadians,a),o=a/2*jp(this.paint.get(\"line-width\").evaluate(e,r),this.paint.get(\"line-gap-width\").evaluate(e,r)),l=this.paint.get(\"line-offset\").evaluate(e,r);return l&&(i=Sv(i,l*a)),G2(s,i,o)}isTileClipped(){return!0}};function jp(t,e){return e>0?e+2*t:t}var kw=Ft([{name:\"a_pos_offset\",components:4,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint16\"},{name:\"a_pixeloffset\",components:4,type:\"Int16\"},{name:\"a_height_offset\",components:1,type:\"Float32\"}],4),Mw=Ft([{name:\"a_projected_pos\",components:3,type:\"Float32\"}],4);Ft([{name:\"a_fade_opacity\",components:1,type:\"Uint32\"}],4);var Pw=Ft([{name:\"a_placed\",components:2,type:\"Uint8\"},{name:\"a_shift\",components:2,type:\"Float32\"},{name:\"a_box_real\",components:2,type:\"Int16\"}]);Ft([{type:\"Int16\",name:\"anchorPointX\"},{type:\"Int16\",name:\"anchorPointY\"},{type:\"Int16\",name:\"x1\"},{type:\"Int16\",name:\"y1\"},{type:\"Int16\",name:\"x2\"},{type:\"Int16\",name:\"y2\"},{type:\"Uint32\",name:\"featureIndex\"},{type:\"Uint16\",name:\"sourceLayerIndex\"},{type:\"Uint16\",name:\"bucketIndex\"}]);var Up=Ft([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_anchor_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"}],4);Ft([{name:\"a_pos\",components:2,type:\"Float32\"},{name:\"a_radius\",components:1,type:\"Float32\"},{name:\"a_flags\",components:2,type:\"Int16\"}],4),Ft([{name:\"triangle\",components:3,type:\"Uint16\"}]),Ft([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Uint32\",name:\"glyphStartIndex\"},{type:\"Uint16\",name:\"numGlyphs\"},{type:\"Uint32\",name:\"vertexStartIndex\"},{type:\"Uint32\",name:\"lineStartIndex\"},{type:\"Uint32\",name:\"lineLength\"},{type:\"Uint16\",name:\"segment\"},{type:\"Uint16\",name:\"lowerSize\"},{type:\"Uint16\",name:\"upperSize\"},{type:\"Float32\",name:\"lineOffsetX\"},{type:\"Float32\",name:\"lineOffsetY\"},{type:\"Uint8\",name:\"writingMode\"},{type:\"Uint8\",name:\"placedOrientation\"},{type:\"Uint8\",name:\"hidden\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Int16\",name:\"associatedIconIndex\"},{type:\"Float32\",name:\"heightOffset\"}]),Ft([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Int16\",name:\"rightJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"centerJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"leftJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedTextSymbolIndex\"},{type:\"Int16\",name:\"placedIconSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedIconSymbolIndex\"},{type:\"Uint16\",name:\"key\"},{type:\"Uint16\",name:\"textBoxStartIndex\"},{type:\"Uint16\",name:\"textBoxEndIndex\"},{type:\"Uint16\",name:\"verticalTextBoxStartIndex\"},{type:\"Uint16\",name:\"verticalTextBoxEndIndex\"},{type:\"Uint16\",name:\"iconBoxStartIndex\"},{type:\"Uint16\",name:\"iconBoxEndIndex\"},{type:\"Uint16\",name:\"verticalIconBoxStartIndex\"},{type:\"Uint16\",name:\"verticalIconBoxEndIndex\"},{type:\"Uint16\",name:\"featureIndex\"},{type:\"Uint16\",name:\"numHorizontalGlyphVertices\"},{type:\"Uint16\",name:\"numVerticalGlyphVertices\"},{type:\"Uint16\",name:\"numIconVertices\"},{type:\"Uint16\",name:\"numVerticalIconVertices\"},{type:\"Uint16\",name:\"useRuntimeCollisionCircles\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Float32\",name:\"textBoxScale\"},{type:\"Float32\",name:\"collisionCircleDiameter\"},{type:\"Uint16\",name:\"textAnchorOffsetStartIndex\"},{type:\"Uint16\",name:\"textAnchorOffsetEndIndex\"},{type:\"Float32\",name:\"heightOffset\"}]),Ft([{type:\"Float32\",name:\"offsetX\"}]),Ft([{type:\"Int16\",name:\"x\"},{type:\"Int16\",name:\"y\"},{type:\"Int16\",name:\"tileUnitDistanceFromAnchor\"}]),Ft([{type:\"Uint16\",name:\"textAnchor\"},{type:\"Float32\",components:2,name:\"textOffset\"}]);var Ci=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=\"unavailable\",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(Ci.isParsed())throw Error(\"RTL text plugin already registered.\");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,e){return rt(this,null,function*(){if(this.isParsed())return this.getState();if(t.pluginStatus!==\"loading\")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(yield e(r),yield Promise.race([i,n]),this.isParsed()){let a={pluginStatus:\"loaded\",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:\"error\",pluginURL:\"\"}),Error(`RTL Text Plugin failed to import scripts from ${r}`)})}};function Bw(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function zw(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function Lw(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function Zn(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function Ow(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function Vw(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function qp(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function Rw(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||new RegExp(\"^\\\\p{gc=Mc}\",\"u\").test(e)}var $w={C:\"18g,1;g2,3;4nb,1\",D:\"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f\",R:\"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1\",T:\"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1\"},Nw={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},jw={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},Gp=1604,Uw=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function qw(t,e,r){let i=0;for(let n of t.split(\";\")){let[a,s]=n.split(\",\").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l{let r=e.codePointAt(0);return{codePoint:r,type:Gw(r),form:null}})}function Hw(t){let e=t.filter(r=>r.type!==\"T\");for(let r=0;r0&&Xw(e[r-1].type),a=r+1String.fromCodePoint(Qw(r))).join(\"\")}function e3(t,e,r){var n;let i=e.layout.get(\"text-transform\").evaluate(r,{});return i===\"uppercase\"?t=t.toLocaleUpperCase():i===\"lowercase\"&&(t=t.toLocaleLowerCase()),((n=Ci.applyArabicShaping)!=null?n:t3)(t)}function r3(t,e,r){for(let i of t.sections)i.text=e3(i.text,e,r);return t}function To(t,e,r){let i=r?e.last.points:e.first.points,n=r?i[i.length-1]:i[0];return`${t}:${n.x}:${n.y}`}function i3(t){let e=t.first.points,r=e.length;for(let a=t.first.next;a;a=a.next)r+=a.points.length-1;let i=Array(r);for(let a=0;a=0&&Rw(e[i],r)?e[i]+=r:e.push(r)}return e}function a3(t){let e=new Set;if(V1){nn!=null||(nn=new Intl.Segmenter(void 0,{granularity:\"word\"}));for(let{index:i}of nn.segment(t))e.add(i);return e}let r=0;for(let i of t.split(new RegExp(\"\\\\b|(?=\\\\p{Ideo})\",\"u\")))e.add(r),r+=i.length;return e}function Yl(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function Rn(t){return/\\s/u.test(String.fromCodePoint(t))}function Fs(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function Wl(t){for(let e of t)if(Zn(e.codePointAt(0)))return!0;return!1}function R1(t){for(let e of t)if(!s3(e.codePointAt(0)))return!1;return!0}function s3(t){return!Bw(t)}function ki(t){return!(Zn(t)||Ow(t))}function $1(t){return new RegExp(\"\\\\p{sc=Arab}\",\"u\").test(String.fromCodePoint(t))}function N1(t){return zw(t)}function j1(t){for(let e of t)if(N1(e.codePointAt(0)))return!0;return!1}var ci={\"!\":\"\\uFE15\",\"#\":\"\\uFF03\",$:\"\\uFF04\",\"%\":\"\\uFF05\",\"&\":\"\\uFF06\",\"(\":\"\\uFE35\",\")\":\"\\uFE36\",\"*\":\"\\uFF0A\",\"+\":\"\\uFF0B\",\",\":\"\\uFE10\",\"-\":\"\\uFE32\",\".\":\"\\u30FB\",\"/\":\"\\uFF0F\",\":\":\"\\uFE13\",\";\":\"\\uFE14\",\"<\":\"\\uFE3F\",\"=\":\"\\uFF1D\",\">\":\"\\uFE40\",\"?\":\"\\uFE16\",\"@\":\"\\uFF20\",\"[\":\"\\uFE47\",\"\\\\\":\"\\uFF3C\",\"]\":\"\\uFE48\",\"^\":\"\\uFF3E\",_:\"\\uFE33\",\"`\":\"\\uFF40\",\"{\":\"\\uFE37\",\"|\":\"\\u2015\",\"}\":\"\\uFE38\",\"~\":\"\\uFF5E\",\"\\xA2\":\"\\uFFE0\",\"\\xA3\":\"\\uFFE1\",\"\\xA5\":\"\\uFFE5\",\"\\xA6\":\"\\uFFE4\",\"\\xAC\":\"\\uFFE2\",\"\\xAF\":\"\\uFFE3\",\"\\u2013\":\"\\uFE32\",\"\\u2014\":\"\\uFE31\",\"\\u2018\":\"\\uFE43\",\"\\u2019\":\"\\uFE44\",\"\\u201C\":\"\\uFE41\",\"\\u201D\":\"\\uFE42\",\"\\u2026\":\"\\uFE19\",\"\\u22EF\":\"\\uFE19\",\"\\u2027\":\"\\u30FB\",\"\\u20A9\":\"\\uFFE6\",\"\\u3001\":\"\\uFE11\",\"\\u3002\":\"\\uFE12\",\"\\u3008\":\"\\uFE3F\",\"\\u3009\":\"\\uFE40\",\"\\u300A\":\"\\uFE3D\",\"\\u300B\":\"\\uFE3E\",\"\\u300C\":\"\\uFE41\",\"\\u300D\":\"\\uFE42\",\"\\u300E\":\"\\uFE43\",\"\\u300F\":\"\\uFE44\",\"\\u3010\":\"\\uFE3B\",\"\\u3011\":\"\\uFE3C\",\"\\u3014\":\"\\uFE39\",\"\\u3015\":\"\\uFE3A\",\"\\u3016\":\"\\uFE17\",\"\\u3017\":\"\\uFE18\",\"\\uFF01\":\"\\uFE15\",\"\\uFF08\":\"\\uFE35\",\"\\uFF09\":\"\\uFE36\",\"\\uFF0C\":\"\\uFE10\",\"\\uFF0D\":\"\\uFE32\",\"\\uFF0E\":\"\\u30FB\",\"\\uFF1A\":\"\\uFE13\",\"\\uFF1B\":\"\\uFE14\",\"\\uFF1C\":\"\\uFE3F\",\"\\uFF1E\":\"\\uFE40\",\"\\uFF1F\":\"\\uFE16\",\"\\uFF3B\":\"\\uFE47\",\"\\uFF3D\":\"\\uFE48\",\"\\uFF3F\":\"\\uFE33\",\"\\uFF5B\":\"\\uFE37\",\"\\uFF5C\":\"\\u2015\",\"\\uFF5D\":\"\\uFE38\",\"\\uFF5F\":\"\\uFE35\",\"\\uFF60\":\"\\uFE36\",\"\\uFF61\":\"\\uFE12\",\"\\uFF62\":\"\\uFE41\",\"\\uFF63\":\"\\uFE42\"};function o3(t){let e=\"\",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!ki(s.value.codePointAt(0))||ci[s.value])&&(r.premature||!ki(r.value.codePointAt(0))||ci[r.value])&&ci[n.value]?e+=ci[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var l3={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},u3={40:!0};function Wp(t,e,r,i,n,a){var s;if(\"fontStack\"in e){let o=(s=r[e.fontStack])==null?void 0:s.default,l=o==null?void 0:o[t];if(l)return l.metrics.advance*e.scale+n;let u=0;for(let c of t){let h=o==null?void 0:o[c];h&&(u+=h.metrics.advance*e.scale+n)}return u}{let o=i[e.imageName];return o?o.displaySize[0]*e.scale*24/a+n:0}}function Zp(t,e,r,i){let n=(t-e)**2;return i?t{var u,c;let o=i.slice(n,n+a.length);n+=a.length;let l=this.getSection(s);return(r==null?void 0:r[s])!==!1&&\"fontStack\"in l&&((c=(u=e[l.fontStack])==null?void 0:u.vertical)!=null&&c[a])?a:o}),this.text=this.cachedGraphemes.join(\"\")}hasZeroWidthSpaces(){return this.text.includes(\"\\u200B\")}trim(){let e=this.graphemes(),r=0;for(;rr&&Hp(e[i-1]);)i--;this.text=e.slice(r,i).join(\"\"),this.sectionIndex=this.sectionIndex.slice(r,i),this.cachedGraphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(\"\"),n=this.sectionIndex.slice(e,r);return new Zl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join(\"\").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n0?i[i.length-1]:\"\",a=Xl(n+e);this.text+=e,this.cachedGraphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=this.determineTotalWidth(e,i,n,a);if(e>=0&&s>0&&s<=r&&!/[\\n\\r]/.test(this.text))return[this.length()];let o=[],l=s/Math.max(1,Math.ceil(s/r)),u=this.hasZeroWidthSpaces(),c=this.graphemes(),h=null,p=0,f=0;for(let d=0;d0){let m=c[d-1].codePointAt(0),g=y.codePointAt(0),x=Lw(m),v=qp(m)&&qp(g);(l3[m]||x||\"imageName\"in this.getSection(d-1)||c[d+1]!==void 0&&u3[g]||v&&(h!=null?h:h=a3(this.text)).has(f))&&o.push(Kp(d,p,l,o,c3(m,g,x&&u),!1))}Rn(y.codePointAt(0))||(p+=Wp(y,this.getSection(d),i,n,e,a)),f+=y.length}return U1(Kp(this.length(),p,l,o,0,!0))}determineTotalWidth(e,r,i,n){let a=0,s=0;for(let o of this.graphemes()){let l=this.getSection(s);a+=Wp(o,l,r,i,e,n),s++}return a}};function h3(){return(function(t){var e={R:\"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73\",EN:\"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9\",ES:\"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2\",ET:\"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj\",AN:\"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u\",CS:\"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b\",B:\"a,3,f+2,2v,690\",S:\"9,2,k\",WS:\"c,k,4f4,1vk+a,u,1j,335\",ON:\"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i\",BN:\"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1\",NSM:\"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n\",AL:\"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d\",LRO:\"6ct\",RLO:\"6cu\",LRE:\"6cq\",RLE:\"6cr\",PDF:\"6cs\",LRI:\"6ee\",RLI:\"6ef\",FSI:\"6eg\",PDI:\"6eh\"},r={},i={};r.L=1,i[1]=\"L\",Object.keys(e).forEach(function(q,Q){r[q]=1<1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1\",canonical:\"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye\"};function f(q,Q){var nt=0,z=new Map,ft=Q&&new Map,W;return q.split(\",\").forEach(function K(j){if(j.indexOf(\"+\")!==-1)for(var ut=+j;ut--;)K(W);else{W=j;var pt=j.split(\">\"),at=pt[0],At=pt[1];at=String.fromCodePoint(nt+=parseInt(at,36)),At=String.fromCodePoint(nt+=parseInt(At,36)),z.set(at,At),Q&&ft.set(At,at)}}),{map:z,reverseMap:ft}}var d,y,m;function g(){if(!d){var q=f(p.pairs,!0),Q=q.map,nt=q.reverseMap;d=Q,y=nt,m=f(p.canonical,!1).map}}function x(q){return g(),d.get(q)||null}function v(q){return g(),y.get(q)||null}function b(q){return g(),m.get(q)||null}var w=r.L,D=r.R,_=r.EN,A=r.ES,E=r.ET,O=r.AN,k=r.CS,P=r.B,R=r.S,C=r.ON,I=r.BN,N=r.NSM,L=r.AL,$=r.LRO,st=r.RLO,mt=r.LRE,ht=r.RLE,kt=r.PDF,Mt=r.LRI,Vt=r.RLI,te=r.FSI,pe=r.PDI,ke=\"14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1\",Me;function nr(){if(!Me){var q=f(ke,!0),Q=q.map;q.reverseMap.forEach(function(nt,z){Q.set(z,nt)}),Me=Q}}function ar(q){return nr(),Me.get(q)||null}function we(q,Q,nt,z){var ft=q.length;nt=Math.max(0,nt==null?0:+nt),z=Math.min(ft-1,z==null?ft-1:+z);var W=[];return Q.paragraphs.forEach(function(K){var j=Math.max(nt,K.start),ut=Math.min(z,K.end);if(j=j&&h(q[at])&l;at--)pt[at]=K.level;for(var At=K.level,ne=1/0,Er=0;ErAt&&(At=sr),sr=ne;or--)for(var dt=0;dt=or){for(var Et=dt;dt+1=or;)dt++;dt>Et&&W.push([Et+j,dt+j])}}}),W}function Hr(q,Q,nt,z){for(var ft=we(q,Q,nt,z),W=[],K=0;K0)Ye--;else if(ks>0){for(lr=0;!dt[dt.length-1]._isolate;)dt.pop();var Ms=dt[dt.length-1]._isolInitIndex;Ms!=null&&(ut.set(Ms,jt),ut.set(jt,Ms)),dt.pop(),ks--}Et=dt[dt.length-1],j[jt]=Et._level,Et._override&&K(jt,Et._override)}else Ut&kt?(Ye===0&&(lr>0?lr--:!Et._isolate&&dt.length>1&&(dt.pop(),Et=dt[dt.length-1])),j[jt]=Et._level):Ut&P&&(j[jt]=at.level);else j[jt]=Et._level,Et._override&&Ut!==I&&K(jt,Et._override)}for(var Kr=[],Pe=null,Tr=at.start;Tr<=at.end;Tr++){var Ps=z[Tr];if(!(Ps&o)){var Ac=j[Tr],Ec=Ps&n,im=Ps===pe;Pe&&Ac===Pe._level?(Pe._end=Tr,Pe._endsWithIsolInit=Ec):Kr.push(Pe={_start:Tr,_end:Tr,_level:Ac,_startsWithPDI:im,_endsWithIsolInit:Ec})}}for(var Bs=[],Jn=0;Jn=0;ea--)if(!(z[ea]&o)){Ic=j[ea];break}var Vs=Jr[Jr.length-1],am=j[Vs],Cc=at.level;if(!(z[Vs]&n)){for(var ra=Vs+1;ra<=at.end;ra++)if(!(z[ra]&o)){Cc=j[ra];break}}Bs.push({_seqIndices:Jr,_sosType:Math.max(Ic,nm)%2?D:w,_eosType:Math.max(Cc,am)%2?D:w})}}for(var Rs=0;Rs=0;na--)if(!(z[X[na]]&o)){Ns=z[X[na]];break}K(kc,Ns&(n|pe)?C:Ns)}}if(W.get(_))for(var aa=0;aa=-1;sa--){var Pc=sa===-1?Oi:z[X[sa]];if(Pc&a){Pc===L&&K(Mc,O);break}}}if(W.get(L))for(var js=0;js=0&&(ti=z[X[Gs]],ti&o);Gs--);for(var Xs=Vi+1;Xs=0&&z[X[oa]]&(E|o);oa--)K(X[oa],_);for(Be++;Be=0&&z[X[la]]&o;la--)K(X[la],C);for(var ua=Ri+1;ua=0;ji--){var Zs=ei[ji].char;if(Zs===Rc||Zs===v(b(Ni))||x(b(Zs))===Ni){ca.push([ei[ji].seqIndex,ri]),ei.length=ji;break}}}ca.sort(function(ee,_e){return ee[0]-_e[0]});for(var Hs=0;Hs=0;Qs--){var qc=X[Qs];if(z[qc]&Vc){var Gc=z[qc]&$i?D:w;ze=Gc===Qr?Qr:Gc;break}}}if(ze){if(z[X[ha]]=z[X[Ks]]=ze,ze!==Qr){for(var Ui=ha+1;Ui=0;Gi--)if(z[X[Gi]]&o)Xc=Gi;else{eo=z[X[Gi]]&$i?D:w;break}for(var Yc=sm,Xi=ur+1;Xi=0&&h(q[fa])&l;fa--)j[fa]=at.level}}return{levels:j,paragraphs:pt};function Wc(ee,_e){for(var re=ee;re=0;i--){let n=nc.getBidiCharTypeName(t[i].text[0]);d3.has(n)?(t[i].level=e,r=!0):r&&f3.has(n)?t[i].level=e:r=!1}}function g3(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)=i;a--)for(let s=0;s=a;)o++;for(let l=s,u=o;le>=n.start&&e<=n.end))==null?void 0:r.level)!=null?i:0}function b3(t,e,r,i,n){let a=y3(t,e,i,n);m3(a,r);let s=\"\",o=[];for(let l of g3(a,r)){if(p3.test(l.text))continue;let u=x3(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function w3(t,e){let r=e.filter(a=>a>0&&aa-s),n=[];for(let a=0;a+1n.start))).map(([n,a])=>b3(t,r,v3(i,n),n,a))}function _3(t,e){return q1(t,e).map(r=>r.text)}function D3(t,e,r){return q1(t,r).map(i=>[i.text,i.sourceIndices.map(n=>{var a;return(a=e[n])!=null?a:0})])}var Hl=4294967296,Jp=1/Hl,G1=new TextDecoder,X1=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Hl;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Hl;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,A3(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=(this.buf[e]<128?12:32)?G1.decode(this.buf.subarray(e,t)):R3(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd(),i=this.buf,n=this.pos;for(;n=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},S3=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e=0&&t<128)this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t;else if(t>268435455||t<0)T3(t,this);else{for(this.realloc(4);t>127;)this.buf[this.pos++]=t&127|128,t>>>=7;this.buf[this.pos++]=t}}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=$3(this.buf,t,this.pos);let r=this.pos-e;r>=128&&Qp(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&Qp(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,C3,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,k3,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,B3,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,M3,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,P3,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,z3,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,L3,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,O3,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,V3,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function A3(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return E3(t,n,e);throw Error(\"Expected varint not more than 10 bytes\")}function E3(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function T3(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error(\"Given varint doesn't fit into 10 bytes\");e.realloc(10),F3(r,i,e),I3(i,e)}function F3(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function I3(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Qp(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:4;r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function C3(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;sa)e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;else{for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}}e.pos=n}function k3(t,e){for(let r=0;r127){let s=t[n+1]^128,o=t[n+2]^128;if(a>=194&&a<224&&s<64&&n+1=2048&&(a<55296||a>57343))n+=2;else return G1.decode(t.subarray(e,r))}i+=String.fromCharCode(a)}return i}function $3(t,e,r){for(let i=0;i=128)return N3(t,e,r,i);t[r++]=n}return r}function N3(t,e,r,i){let n;for(let a;i55295&&a<57344)if(n){if(a<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=a;continue}a=(n-55296<<10|a-56320)+65536,n=null}else{a>56319?(t[r++]=239,t[r++]=191,t[r++]=189):n=a;continue}else n&&(n=(t[r++]=239,t[r++]=191,t[r++]=189,null));a<128?t[r++]=a:(a<2048?t[r++]=a>>6|192:(a<65536?t[r++]=a>>12|224:(t[r++]=a>>18|240,t[r++]=a>>12&63|128),t[r++]=a>>6&63|128),t[r++]=a&63|128)}return n&&(t[r++]=239,t[r++]=191,t[r++]=189),r}function j3(t){return typeof(t==null?void 0:t.renderWithWebGL)==\"function\"}function Y1(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o=r;a--)e.push(a);r=i+1}else{for(let a=r;at.toCodeUnitIndex(a)),i=Ci.isParsed()?Ci:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>ef(a,t.sections,[...a].map(()=>0))):_3(t.toString(),r).map(a=>Kl([...a],t.sections,[...a].map(()=>0)));let n=X3(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>ef(a,t.sections,s)):D3(t.text,n,r).map(([a,s])=>{let o=[...a];return Kl(o,t.sections,K1(o).map(l=>{var u;return(u=s[l])!=null?u:0}))})}function Kl(t,e,r){var a;let i=new ic(t.join(\"\"),e,[]),n=0;for(let s of i.graphemes())i.sectionIndex.push((a=r[n])!=null?a:0),n+=[...s].length;return i}function K1(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function ef(t,e,r){let i=[...t],n=K1(i),a=G3(i);return Kl(a.map(s=>i[s]),e,a.map(s=>{var o;return(o=r[n[s]])!=null?o:0}))}function Ta(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d){let y=ic.fromFeature(t,n,h===2,e),m=y.determineLineBreaks(u,a,e,i,f),g=j1(y.text)?Y3(y,m):q3(y,m),x=[],v={positionedLines:x,text:y.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return J3(v,e,r,i,g,s,o,l,h,u,p,d),!U3(x)&&v}function J1(t){let e=.5,r=.5;switch(t){case\"right\":case\"top-right\":case\"bottom-right\":e=1;break;case\"left\":case\"top-left\":case\"bottom-left\":e=0}switch(t){case\"bottom\":case\"bottom-right\":case\"bottom-left\":r=1;break;case\"top\":case\"top-right\":case\"top-left\":r=0}return{horizontalAlign:e,verticalAlign:r}}function W3(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function Q1(t){switch(t){case\"top\":return 0;case\"center\":return .5;default:return 1}}function Z3(t,e){return t!=null&&t.rect?t:e?{rect:null,metrics:e.metrics}:null}function t0(t,e,r){return!(t===1||!e&&!Zn(r)||e&&(Rn(r)||$1(r)))}function Va(t){return new RegExp(\"\\\\p{Nd}\",\"u\").test(String.fromCodePoint(t))}function e0(t){return new RegExp(\"\\\\p{Lu}\",\"u\").test(String.fromCodePoint(t))}function r0(t){let e=t.some(Va)&&t.every(i=>Va(i)||Fs(i)),r=t.length<=3&&t.every(i=>e0(i)||Va(i));return e||r}function i0(t){return(Va(t)||e0(t))&&!$1(t)}function H3(t,e){return e?t0(2,!0,t):!ki(t)||i0(t)||Fs(t)}function K3(t,e,r){let i=!1;for(let n=0;n=0&&e=0&&eo.codePointAt(0)),n=r.map((o,l)=>{var c,h;let u=t.getSection(l);return\"fontStack\"in u&&!!((h=(c=e[u.fontStack])==null?void 0:c.vertical)!=null&&h[o])}),a=i.map(Zn),s=o=>!a[o]&&!Rn(i[o])&&!(\"imageName\"in t.getSection(o));for(let o=0;oo&&!a[l])){let o=t.text;if(t.verticalizePunctuation(e,a),t.text!==o)return n0(t,e)}return K3(r,a,n)&&(t.text=r.join(\"\"),t.cachedGraphemes=r),a}function J3(t,e,r,i,n,a,s,o,l,u,c,h){var w,D;let p=0,f=0,d=0,y=0,m=o===\"right\"?1:o===\"left\"?0:.5,g=24/h,x=0;for(let _ of n){_.trim();let A=_.getMaxScale(),E={positionedGlyphs:[],lineOffset:0};t.positionedLines[x]=E;let O=E.positionedGlyphs,k=0;if(!_.length()){f+=a,++x;continue}let P=W3(i,_,g),R=l===2&&!c?n0(_,e):null,C=_.graphemes();for(let L=0;Lu){let p=Math.ceil(i/u);r*=p/n,n=p}return{x1:e,y1:r,x2:e+i,y2:r+n}}function nf(t,e,r,i,n,a,s=1){let o=t.image,l;if(o.content){let v=o.content,b=o.pixelRatio||1;l=[v[0]/b,v[1]/b,o.displaySize[0]-v[2]/b,o.displaySize[1]-v[3]/b]}let u=s>0?a/s:a,c=s>0?1/s:1,h=e.left*u,p=e.right*u,f,d,y,m;r===\"width\"||r===\"both\"?(m=n[0]+h-i[3]*c,d=n[0]+p+i[1]*c):(m=n[0]+(h+p-o.displaySize[0])/2,d=m+o.displaySize[0]);let g=e.top*u,x=e.bottom*u;return r===\"height\"||r===\"both\"?(f=n[1]+g-i[0]*c,y=n[1]+x+i[2]*c):(f=n[1]+(g+x-o.displaySize[1])/2,y=f+o.displaySize[1]),{image:o,top:f,right:d,bottom:y,left:m,collisionPadding:l}}var af=32640;function sf(t,e){let{expression:r}=e;if(r.kind===\"constant\")return{kind:\"constant\",layoutSize:r.evaluate(new ct(t+1))};if(r.kind===\"source\")return{kind:\"source\"};if(r.kind===\"composite\"){let{minZoom:i,maxZoom:n}=n5(r.zoomStops,t);return{kind:\"composite\",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=a5(r),n=r.evaluate(new ct(t+1));return{kind:\"camera\",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function n5(t,e){let r=0;for(;rt.evaluate(new ct(e===-1/0?t.zoomStops[1]-1:e)))}var mi=class s0 extends F{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new s0(this.x,this.y,this.angle,this.segment)}};B(\"Anchor\",mi);function o0(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;oi;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=h.dist(p)}return!0}function l0(t){let e=0;for(let r=0;ru){let d=(u-l)/f,y=new mi(rr.number(h.x,p.x,d),rr.number(h.y,p.y,d),p.angleTo(h),c);return y._round(),!s||o0(t,y,o,s,e)?y:void 0}l+=f}}function o5(t,e,r,i,n,a,s,o,l){let u=u0(i,a,s),c=c0(i,n),h=c*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-h=0&&b=0&&w=0&&p+u<=c){let D=new mi(b,w,x,d);D._round(),(!i||o0(t,D,a,i,n))&&f.push(D)}}h+=g}return o||f.length||s||(f=h0(t,h/2,r,i,n,a,s,!0,l)),f}function l5(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l=i&&c.x>=i||(u.x>=i?u=new F(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round():c.x>=i&&(c=new F(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round()),u.y>=n&&c.y>=n||(u.y>=n?u=new F(u.x+(c.x-u.x)*((n-u.y)/(c.y-u.y)),n)._round():c.y>=n&&(c=new F(u.x+(c.x-u.x)*((n-u.y)/(c.y-u.y)),n)._round()),o&&u.equals(o[o.length-1])||(o=[u],a.push(o)),o.push(c)))))}}return a}function u5(t,e,r,i,n,a){let s=of(t,e,r,n,0);return s=of(s,e,i,a,1),s}function of(t,e,r,i,n){switch(e){case 1:return c5(t,r,i,n);case 2:return lf(t,r,i,n,!1);case 3:return lf(t,r,i,n,!0)}return[]}function c5(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function h5(t,e,r,i,n){let a=i===0?p5:f5,s=[],o=[];for(let c=0;c=e&&s.push(a(h,p,e)):f>r?d<=r&&s.push(a(h,p,r)):s.push(h),d=e&&(s.push(a(h,p,e)),y=!0),d>r&&f<=r&&(s.push(a(h,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new F(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function lf(t,e,r,i,n){let a=[];for(let s of t){let o=h5(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function p5(t,e,r){let i=(r-t.x)/(e.x-t.x);return new F(r,t.y+(e.y-t.y)*i)}function f5(t,e,r){let i=(r-t.y)/(e.y-t.y);return new F(t.x+(e.x-t.x)*i,r)}function uf(t,e,r,i,n=1){let a=[],s=t.image,o=s.pixelRatio,l=s.paddedRect.w-2,u=s.paddedRect.h-2,c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=s.stretchX||[[0,l]],p=s.stretchY||[[0,u]],f=(I,N)=>I+N[1]-N[0],d=h.reduce(f,0),y=p.reduce(f,0),m=l-d,g=u-y,x=0,v=d,b=0,w=y,D=0,_=m,A=0,E=g;if(s.content&&i){let I=s.content,N=I[2]-I[0],L=I[3]-I[1];(s.textFitWidth||s.textFitHeight)&&(c=a0(t)),x=Fa(h,0,I[0]),b=Fa(p,0,I[1]),v=Fa(h,I[0],I[2]),w=Fa(p,I[1],I[3]),D=I[0]-x,A=I[1]-b,_=N-v,E=L-w}let O=c.x1,k=c.y1,P=c.x2-O,R=c.y2-k,C=(I,N,L,$)=>{let st=Ia(I.stretch-x,v,P,O),mt=Ca(I.fixed-D,_,I.stretch,d),ht=Ia(N.stretch-b,w,R,k),kt=Ca(N.fixed-A,E,N.stretch,y),Mt=Ia(L.stretch-x,v,P,O),Vt=Ca(L.fixed-D,_,L.stretch,d),te=Ia($.stretch-b,w,R,k),pe=Ca($.fixed-A,E,$.stretch,y),ke=new F(st,ht),Me=new F(Mt,ht),nr=new F(Mt,te),ar=new F(st,te),we=n/o,Hr=new F(mt*we,kt*we),q=new F(Vt*we,pe*we),Q=e*Math.PI/180;if(Q){let K=Math.sin(Q),j=Math.cos(Q),ut=[j,-K,K,j];ke._matMult(ut),Me._matMult(ut),ar._matMult(ut),nr._matMult(ut)}let nt=I.stretch+I.fixed,z=L.stretch+L.fixed,ft=N.stretch+N.fixed,W=$.stretch+$.fixed;return{tl:ke,tr:Me,bl:ar,br:nr,tex:{x:s.paddedRect.x+1+nt,y:s.paddedRect.y+1+ft,w:z-nt,h:W-ft},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Hr,pixelOffsetBR:q,minFontScaleX:_*we/P,minFontScaleY:E*we/R,isSDF:r}};if(!i||!s.stretchX&&!s.stretchY)a.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));else{let I=cf(h,m,d),N=cf(p,g,y);for(let L=0;L0&&(d=Math.max(10,d),this.circleDiameter=d)}else{let h=(c=a.image)!=null&&c.content&&(a.image.textFitWidth||a.image.textFitHeight)?a0(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};h.y1=h.y1*s-o[0],h.y2=h.y2*s+o[2],h.x1=h.x1*s-o[3],h.x2=h.x2*s+o[1];let p=a.collisionPadding;if(p&&(h.x1-=p[0]*s,h.y1-=p[1]*s,h.x2+=p[2]*s,h.y2+=p[3]*s),u){let f=new F(h.x1,h.y1),d=new F(h.x2,h.y1),y=new F(h.x1,h.y2),m=new F(h.x2,h.y2),g=u*Math.PI/180;f._rotate(g),d._rotate(g),y._rotate(g),m._rotate(g),h.x1=Math.min(f.x,d.x,y.x,m.x),h.x2=Math.max(f.x,d.x,y.x,m.x),h.y1=Math.min(f.y,d.y,y.y,m.y),h.y2=Math.max(f.y,d.y,y.y,m.y)}t.emplaceBack(e.x,e.y,h.x1,h.y1,h.x2,h.y2,r,i,n)}this.boxEndIndex=t.length}},y5=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}};function m5(t,e=1){let r=Pn.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new y5([],g5),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new F(s,o);for(let p=s;ph.d||!h.d)&&(h=p),p.max-h.d<=e||(n=p.h/2,a.push(new li(p.p.x-n,p.p.y-n,n,t)),a.push(new li(p.p.x+n,p.p.y-n,n,t)),a.push(new li(p.p.x-n,p.p.y+n,n,t)),a.push(new li(p.p.x+n,p.p.y+n,n,t)))}return c.d>0&&h.d-c.d<=e?c.p:h.p}function g5(t,e){return e.max-t.max}var li=class{constructor(t,e,r,i){this.p=new F(t,e),this.h=r,this.d=x5(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function x5(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;at.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,$y(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function v5(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;ap*24);c.startsWith(\"top\")?h[1]-=7:c.startsWith(\"bottom\")&&(h[1]+=7),l[u+1]=h}return new Ue(l)}let a=i.get(\"text-variable-anchor\");if(a){let o;o=t._unevaluatedLayout.getValue(\"text-radial-offset\")===void 0?i.get(\"text-offset\").evaluate(e,{},r).map(u=>u*24):[i.get(\"text-radial-offset\").evaluate(e,{},r)*24,ac];let l=[];for(let u of a)l.push(u,p0(u,o));return new Ue(l)}return null}function w5(t){var c,h;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=it/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n[\"icon-size\"].possiblyEvaluate(new ct(t.bucket.zoom+1),t.canonical),layoutTextSize:n[\"text-size\"].possiblyEvaluate(new ct(t.bucket.zoom+1),t.canonical),textMaxSize:n[\"text-size\"].possiblyEvaluate(new ct(18))};if(t.bucket.textSizeData.kind===\"composite\"){let{minZoom:p,maxZoom:f}=t.bucket.textSizeData;a.compositeTextSizes=[n[\"text-size\"].possiblyEvaluate(new ct(p),t.canonical),n[\"text-size\"].possiblyEvaluate(new ct(f),t.canonical)]}if(t.bucket.iconSizeData.kind===\"composite\"){let{minZoom:p,maxZoom:f}=t.bucket.iconSizeData;a.compositeIconSizes=[n[\"icon-size\"].possiblyEvaluate(new ct(p),t.canonical),n[\"icon-size\"].possiblyEvaluate(new ct(f),t.canonical)]}let s=i.get(\"text-line-height\")*24,o=i.get(\"text-rotation-alignment\")!==\"viewport\"&&i.get(\"symbol-placement\")!==\"point\",l=i.get(\"text-keep-upright\"),u=i.get(\"text-size\");for(let p of t.bucket.features){let f=i.get(\"text-font\").evaluate(p,{},t.canonical).join(\",\"),d=u.evaluate(p,{},t.canonical),y=a.layoutTextSize.evaluate(p,{},t.canonical),m=a.layoutIconSize.evaluate(p,{},t.canonical),g={horizontal:{},vertical:void 0},x=p.text,v=[0,0];if(x){let _=x.toString(),A=i.get(\"text-letter-spacing\").evaluate(p,{},t.canonical)*24,E=R1(_)?A:0,O=i.get(\"text-anchor\").evaluate(p,{},t.canonical),k=f0(r,p,t.canonical);if(!k){let I=i.get(\"text-radial-offset\").evaluate(p,{},t.canonical);v=I?p0(O,[I*24,ac]):i.get(\"text-offset\").evaluate(p,{},t.canonical).map(N=>N*24)}let P=o?\"center\":i.get(\"text-justify\").evaluate(p,{},t.canonical),R=i.get(\"symbol-placement\")===\"point\"?i.get(\"text-max-width\").evaluate(p,{},t.canonical)*24:1/0,C=()=>{t.bucket.allowVerticalPlacement&&Wl(_)&&(g.vertical=Ta(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,R,s,O,\"left\",E,v,2,!0,y,d))};if(!o&&k){let I=new Set;if(P===\"auto\")for(let L=0;L{$u($)||S5(t,$,L,r,i,n,C,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,[D,D,D,D],E,l,b,_,O,y,e,a,u,c,s,o,p)};if(k===\"line\")for(let L of l5(e.geometry,0,0,it,it)){let $=zr(L,I),st=o5($,w,A,r.vertical||m,i,24,v,t.overscaling,it);for(let mt of st){let ht=m;ht&&A5(t,ht.text,P,mt)||N($,mt)}}else if(k===\"line-center\"){for(let L of e.geometry)if(L.length>1){let $=zr(L,I),st=s5($,A,r.vertical||m,i,24,v);st&&N($,st)}}else if(e.type===\"Polygon\")for(let L of ys(e.geometry,0)){let $=m5(L,16);N(zr(L[0],I,!0),new mi($.x,$.y,0))}else if(e.type===\"LineString\")for(let L of e.geometry){let $=zr(L,I);N($,new mi($[0].x,$[0].y,0))}else if(e.type===\"Point\")for(let L of e.geometry)for(let $ of L)N([$],new mi($.x,$.y,0))}function D5(t,e){let r=t.length,i=e==null?void 0:e.values;if((i==null?void 0:i.length)>0)for(let n=0;n32640&&Ot(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)):g.kind===\"composite\"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Ot(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)),t.addSymbols(t.text,m,x,o,a,s,c,e,u.lineStartIndex,u.lineLength,f,y,l);for(let v of h)p[v]=t.text.placedSymbolArray.length-1;return m.length*4}function d0(t){for(let e in t)return t[e];return null}function S5(t,e,r,i,n,a,s,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,D,_,A,E,O){let k=t.addToLineVertexArray(e,r),P=o.layout.get(\"symbol-height-offset\").evaluate(b,{},_);P>t.maxHeightOffset&&(t.maxHeightOffset=P);let R,C,I,N,L=0,$=0,st=0,mt=0,ht=-1,kt=-1,Mt={},Vt=(0,Ha.default)(\"\");if(t.allowVerticalPlacement&&i.vertical){let j=o.layout.get(\"text-rotate\").evaluate(b,{},_)+90;I=new ka(l,e,u,c,h,i.vertical,p,f,d,j),s&&(N=new ka(l,e,u,c,h,s,m,g,d,j))}if(n){let j=o.layout.get(\"icon-rotate\").evaluate(b,{}),ut=o.layout.get(\"icon-text-fit\")!==\"none\",pt=uf(n,j,D,ut,E),at=s?uf(s,j,D,ut,E):void 0;C=new ka(l,e,u,c,h,n,m,g,!1,j),L=pt.length*4;let At=t.iconSizeData,ne=null;At.kind===\"source\"?(ne=[128*o.layout.get(\"icon-size\").evaluate(b,{})],ne[0]>32640&&Ot(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)):At.kind===\"composite\"&&(ne=[128*w.compositeIconSizes[0].evaluate(b,{},_),128*w.compositeIconSizes[1].evaluate(b,{},_)],(ne[0]>32640||ne[1]>32640)&&Ot(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)),t.addSymbols(t.icon,pt,ne,v,x,b,0,e,k.lineStartIndex,k.lineLength,-1,_,P),ht=t.icon.placedSymbolArray.length-1,at&&($=at.length*4,t.addSymbols(t.icon,at,ne,v,x,b,2,e,k.lineStartIndex,k.lineLength,-1,_,P),kt=t.icon.placedSymbolArray.length-1)}let te=Object.keys(i.horizontal);for(let j of te){let ut=i.horizontal[j];R||(R=(Vt=(0,Ha.default)(ut.text),new ka(l,e,u,c,h,ut,p,f,d,o.layout.get(\"text-rotate\").evaluate(b,{},_))));let pt=ut.positionedLines.length===1;if(st+=pf(t,e,ut,a,o,d,b,y,P,k,i.vertical?1:3,pt?te:[j],Mt,ht,w,_),pt)break}i.vertical&&(mt+=pf(t,e,i.vertical,a,o,d,b,y,P,k,2,[\"vertical\"],Mt,kt,w,_));let pe=R?R.boxStartIndex:t.collisionBoxArray.length,ke=R?R.boxEndIndex:t.collisionBoxArray.length,Me=I?I.boxStartIndex:t.collisionBoxArray.length,nr=I?I.boxEndIndex:t.collisionBoxArray.length,ar=C?C.boxStartIndex:t.collisionBoxArray.length,we=C?C.boxEndIndex:t.collisionBoxArray.length,Hr=N?N.boxStartIndex:t.collisionBoxArray.length,q=N?N.boxEndIndex:t.collisionBoxArray.length,Q=-1,nt=(j,ut)=>j!=null&&j.circleDiameter?Math.max(j.circleDiameter,ut):ut;Q=nt(R,Q),Q=nt(I,Q),Q=nt(C,Q),Q=nt(N,Q);let z=+(Q>-1);z&&(Q*=A/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Ot(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let ft=f0(o,b,_),[W,K]=D5(t.textAnchorOffsets,ft);O&&(Vt=E5(Vt,b)),t.symbolInstances.emplaceBack(e.x,e.y,Mt.right>=0?Mt.right:-1,Mt.center>=0?Mt.center:-1,Mt.left>=0?Mt.left:-1,Mt.vertical||-1,ht,kt,Vt,pe,ke,Me,nr,ar,we,Hr,q,u,st,mt,L,$,z,0,p,Q,W,K,P)}function A5(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])!R1(e.text))}var Jl=class{constructor(t){this.layoutVertexArray=new C2,this.indexArray=new Yn,this.programConfigurations=t,this.segments=new he,this.dynamicLayoutVertexArray=new k2,this.opacityVertexArray=new M2,this.hasVisibleVertices=!1,this.placedSymbolArray=new Ay}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,kw.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Mw.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,T5,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};B(\"SymbolBuffers\",Jl);var Ql=class{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new he,this.collisionVertexArray=new P2}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Pw.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};B(\"CollisionBuffers\",Ql);var y0=class{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.hasCursiveText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=sf(this.zoom,e[\"text-size\"]),this.iconSizeData=sf(this.zoom,e[\"icon-size\"]);let r=this.layers[0].layout,i=r.get(\"symbol-sort-key\"),n=r.get(\"symbol-z-order\");this.canOverlap=ff(r,\"text-overlap\",\"text-allow-overlap\")!==\"never\"||ff(r,\"icon-overlap\",\"icon-allow-overlap\")!==\"never\"||r.get(\"text-ignore-placement\")||r.get(\"icon-ignore-placement\"),this.sortFeaturesByKey=n!==\"viewport-y\"&&!i.isConstant();let a=n===\"viewport-y\"||n===\"auto\"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get(\"symbol-placement\")===\"point\"&&(this.writingModes=r.get(\"text-writing-mode\").map(s=>H1[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new Jl(new Ur(this.layers,this.zoom,t=>t.startsWith(\"text\"))),this.icon=new Jl(new Ur(this.layers,this.zoom,t=>t.startsWith(\"icon\"))),this.glyphOffsetArray=new Fy,this.lineVertexArray=new Iy,this.symbolInstances=new Ty,this.textAnchorOffsets=new ky}calculateGlyphDependencies(t,e,r,i){var s;let n=ic.fromFeature(t,r,!1),a=n.graphemes();for(let o=0;o0)&&(a.value.kind!==\"constant\"||a.value.value.length>0),u=o.value.kind!==\"constant\"||!!o.value.value||Object.keys(o.parameters).length>0,c=n.get(\"symbol-sort-key\"),h=n.get(\"symbol-placement\")===\"point\";if(this.features=[],!l&&!u)return;let p=e.iconDependencies,f=e.glyphDependencies,d=e.availableImages,y=new ct(this.zoom),m=n.get(\"text-keep-upright\");for(let{feature:x,id:v,index:b,sourceLayerIndex:w}of t){let D=i._featureFilter.needGeometry,_=Bi(x,D);if(!i._featureFilter.filter(y,_,r)||(D||(_.geometry=Yr(x)),h&&x.type===1&&k5(_.geometry)))continue;let A;if(l){let P=i.getValueAndResolveTokens(\"text-field\",_,r,d),R=er.factory(P);this.hasRTLText||(this.hasRTLText=I5(R)),this.hasCursiveText||(this.hasCursiveText=C5(R)),A=r3(R,i,_)}let E;if(u){let P=i.getValueAndResolveTokens(\"icon-image\",_,r,d);E=P instanceof qe?P:qe.fromString(P)}if(!A&&!E)continue;let O=this.sortFeaturesByKey?c.evaluate(_,{},r):void 0,k={id:v,text:A,icon:E,index:b,sourceLayerIndex:w,geometry:_.geometry,properties:x.properties,type:Wn.types[x.type],sortKey:O};if(this.features.push(k),E&&(p[E.name]=!0),A){let P=a.evaluate(_,{},r).join(\",\"),R=n.get(\"text-rotation-alignment\")!==\"viewport\"&&n.get(\"symbol-placement\")!==\"point\";this.allowVerticalPlacement=(g=this.writingModes)==null?void 0:g.includes(2);let C=(R&&m||this.allowVerticalPlacement)&&Wl(A.toString());this.calculateGlyphDependencies(A,f,P,C);for(let I of A.sections)I.image&&(p[I.image.name]=!0)}}n.get(\"symbol-placement\")===\"line\"&&(this.features=n3(this.features)),this.sortFeaturesByKey&&this.features.sort((x,v)=>x.sortKey-v.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){w5({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity,hasPromoteId:t.featureIndex.promoteId!=null})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;s0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;ni[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];(r==null?void 0:r.sortKey)===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};function k5(t){return t.every(e=>e.every($u))}B(\"SymbolBucket\",y0,{omit:[\"layers\",\"collisionBoxArray\",\"features\",\"compareText\"]});function M5(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):\"\")}var df,P5=()=>df||(df=new Qt({\"symbol-placement\":new V(S.layout_symbol[\"symbol-placement\"],\"symbol-placement\"),\"symbol-spacing\":new V(S.layout_symbol[\"symbol-spacing\"],\"symbol-spacing\"),\"symbol-avoid-edges\":new V(S.layout_symbol[\"symbol-avoid-edges\"],\"symbol-avoid-edges\"),\"symbol-sort-key\":new U(S.layout_symbol[\"symbol-sort-key\"],\"symbol-sort-key\"),\"symbol-z-order\":new V(S.layout_symbol[\"symbol-z-order\"],\"symbol-z-order\"),\"icon-allow-overlap\":new V(S.layout_symbol[\"icon-allow-overlap\"],\"icon-allow-overlap\"),\"icon-overlap\":new V(S.layout_symbol[\"icon-overlap\"],\"icon-overlap\"),\"icon-ignore-placement\":new V(S.layout_symbol[\"icon-ignore-placement\"],\"icon-ignore-placement\"),\"icon-optional\":new V(S.layout_symbol[\"icon-optional\"],\"icon-optional\"),\"icon-rotation-alignment\":new U(S.layout_symbol[\"icon-rotation-alignment\"],\"icon-rotation-alignment\"),\"icon-size\":new U(S.layout_symbol[\"icon-size\"],\"icon-size\"),\"icon-text-fit\":new V(S.layout_symbol[\"icon-text-fit\"],\"icon-text-fit\"),\"icon-text-fit-padding\":new V(S.layout_symbol[\"icon-text-fit-padding\"],\"icon-text-fit-padding\"),\"icon-image\":new U(S.layout_symbol[\"icon-image\"],\"icon-image\"),\"icon-rotate\":new U(S.layout_symbol[\"icon-rotate\"],\"icon-rotate\"),\"icon-padding\":new U(S.layout_symbol[\"icon-padding\"],\"icon-padding\"),\"icon-keep-upright\":new V(S.layout_symbol[\"icon-keep-upright\"],\"icon-keep-upright\"),\"icon-offset\":new U(S.layout_symbol[\"icon-offset\"],\"icon-offset\"),\"icon-anchor\":new U(S.layout_symbol[\"icon-anchor\"],\"icon-anchor\"),\"icon-pitch-alignment\":new V(S.layout_symbol[\"icon-pitch-alignment\"],\"icon-pitch-alignment\"),\"text-pitch-alignment\":new V(S.layout_symbol[\"text-pitch-alignment\"],\"text-pitch-alignment\"),\"text-rotation-alignment\":new V(S.layout_symbol[\"text-rotation-alignment\"],\"text-rotation-alignment\"),\"text-field\":new U(S.layout_symbol[\"text-field\"],\"text-field\"),\"text-font\":new U(S.layout_symbol[\"text-font\"],\"text-font\"),\"text-size\":new U(S.layout_symbol[\"text-size\"],\"text-size\"),\"text-max-width\":new U(S.layout_symbol[\"text-max-width\"],\"text-max-width\"),\"text-line-height\":new V(S.layout_symbol[\"text-line-height\"],\"text-line-height\"),\"text-letter-spacing\":new U(S.layout_symbol[\"text-letter-spacing\"],\"text-letter-spacing\"),\"text-justify\":new U(S.layout_symbol[\"text-justify\"],\"text-justify\"),\"text-radial-offset\":new U(S.layout_symbol[\"text-radial-offset\"],\"text-radial-offset\"),\"text-variable-anchor\":new V(S.layout_symbol[\"text-variable-anchor\"],\"text-variable-anchor\"),\"text-variable-anchor-offset\":new U(S.layout_symbol[\"text-variable-anchor-offset\"],\"text-variable-anchor-offset\"),\"text-anchor\":new U(S.layout_symbol[\"text-anchor\"],\"text-anchor\"),\"text-max-angle\":new V(S.layout_symbol[\"text-max-angle\"],\"text-max-angle\"),\"text-writing-mode\":new V(S.layout_symbol[\"text-writing-mode\"],\"text-writing-mode\"),\"text-rotate\":new U(S.layout_symbol[\"text-rotate\"],\"text-rotate\"),\"text-padding\":new V(S.layout_symbol[\"text-padding\"],\"text-padding\"),\"text-keep-upright\":new V(S.layout_symbol[\"text-keep-upright\"],\"text-keep-upright\"),\"text-transform\":new U(S.layout_symbol[\"text-transform\"],\"text-transform\"),\"text-offset\":new U(S.layout_symbol[\"text-offset\"],\"text-offset\"),\"text-allow-overlap\":new V(S.layout_symbol[\"text-allow-overlap\"],\"text-allow-overlap\"),\"text-overlap\":new V(S.layout_symbol[\"text-overlap\"],\"text-overlap\"),\"text-ignore-placement\":new V(S.layout_symbol[\"text-ignore-placement\"],\"text-ignore-placement\"),\"text-optional\":new V(S.layout_symbol[\"text-optional\"],\"text-optional\"),\"symbol-height-offset\":new U(S.layout_symbol[\"symbol-height-offset\"],\"symbol-height-offset\"),\"symbol-height-anchor\":new V(S.layout_symbol[\"symbol-height-anchor\"],\"symbol-height-anchor\")})),yf,B5=()=>yf||(yf=new Qt({\"icon-opacity\":new U(S.paint_symbol[\"icon-opacity\"],\"icon-opacity\"),\"icon-color\":new U(S.paint_symbol[\"icon-color\"],\"icon-color\"),\"icon-halo-color\":new U(S.paint_symbol[\"icon-halo-color\"],\"icon-halo-color\"),\"icon-halo-width\":new U(S.paint_symbol[\"icon-halo-width\"],\"icon-halo-width\"),\"icon-halo-blur\":new U(S.paint_symbol[\"icon-halo-blur\"],\"icon-halo-blur\"),\"icon-translate\":new V(S.paint_symbol[\"icon-translate\"],\"icon-translate\"),\"icon-translate-anchor\":new V(S.paint_symbol[\"icon-translate-anchor\"],\"icon-translate-anchor\"),\"text-opacity\":new U(S.paint_symbol[\"text-opacity\"],\"text-opacity\"),\"text-color\":new U(S.paint_symbol[\"text-color\"],\"text-color\",{runtimeType:Fe,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),\"text-halo-color\":new U(S.paint_symbol[\"text-halo-color\"],\"text-halo-color\"),\"text-halo-width\":new U(S.paint_symbol[\"text-halo-width\"],\"text-halo-width\"),\"text-halo-blur\":new U(S.paint_symbol[\"text-halo-blur\"],\"text-halo-blur\"),\"text-translate\":new V(S.paint_symbol[\"text-translate\"],\"text-translate\"),\"text-translate-anchor\":new V(S.paint_symbol[\"text-translate-anchor\"],\"text-translate-anchor\")})),Fo={get paint(){return B5()},get layout(){return P5()}},m0=class{constructor(t){if(t.property.overrides===void 0)throw Error(\"overrides must be provided to instantiate FormatSectionOverride class\");this.type=t.property.overrides?t.property.overrides.runtimeType:$n,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e!=null&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}};B(\"FormatSectionOverride\",m0,{omit:[\"defaultValue\"]});var z5=class tu extends Ce{constructor(e,r){super(e,Fo,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get(\"icon-rotation-alignment\");if((i.value.kind!==\"constant\"||i.value.value===\"auto\")&&(this.layout._values[\"icon-rotation-alignment\"]=new ve(i.property,{kind:\"constant\",value:this.layout.get(\"symbol-placement\")===\"point\"?\"viewport\":\"map\"},i.parameters)),this.layout.get(\"text-rotation-alignment\")===\"auto\"&&(this.layout.get(\"symbol-placement\")===\"point\"?this.layout._values[\"text-rotation-alignment\"]=\"viewport\":this.layout._values[\"text-rotation-alignment\"]=\"map\"),this.layout.get(\"text-pitch-alignment\")===\"auto\"&&(this.layout._values[\"text-pitch-alignment\"]=this.layout.get(\"text-rotation-alignment\")===\"map\"?\"map\":\"viewport\"),this.layout.get(\"icon-pitch-alignment\")===\"auto\"&&(this.layout._values[\"icon-pitch-alignment\"]=this.layout.get(\"icon-rotation-alignment\").constantOr(\"viewport\")),this.layout.get(\"symbol-placement\")===\"point\"){let n=this.layout.get(\"text-writing-mode\");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values[\"text-writing-mode\"]=a}else this.layout._values[\"text-writing-mode\"]=[\"horizontal\"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!xs(s.value)&&a?M5(r.properties,a):a}createBucket(e){return new y0(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error(\"Should take a different path in FeatureIndex\")}_setPaintOverrides(){for(let e of Fo.paint.overridableProperties){if(!tu.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Cu(new m0(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind===\"constant\"||r.value.kind===\"source\"?new An(\"source\",i):new Ya(\"composite\",i,r.value.zoomStops),this.paint._values[e]=new ve(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:tu.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get(\"text-field\"),n=Fo.paint.properties[r],a=!1,s=o=>{var l;for(let u of o)if((l=n.overrides)!=null&&l.hasOverride(u)){a=!0;return}};if(i.value.kind===\"constant\"&&i.value.value instanceof er)s(i.value.value.sections);else if(i.value.kind===\"source\"||i.value.kind===\"composite\"){let o=u=>{if(!a)if(u instanceof Di&&Ct(u.value)===Nn){let c=u.value;s(c.sections)}else u instanceof Fd?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function L5(t,e,r,i=1){var a;let n=(a=t.get(\"icon-padding\").evaluate(e,{},r))==null?void 0:a.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var mf,O5=()=>mf||(mf=new Qt({\"background-color\":new V(S.paint_background[\"background-color\"],\"background-color\"),\"background-pattern\":new wy(S.paint_background[\"background-pattern\"],\"background-pattern\"),\"background-opacity\":new V(S.paint_background[\"background-opacity\"],\"background-opacity\")})),V5={get paint(){return O5()}},R5=class extends Ce{constructor(t,e){super(t,V5,e)}},gf,$5=()=>gf||(gf=new Qt({\"raster-opacity\":new V(S.paint_raster[\"raster-opacity\"],\"raster-opacity\"),\"raster-layer-blend\":new V(S.paint_raster[\"raster-layer-blend\"],\"raster-layer-blend\"),\"raster-hue-rotate\":new V(S.paint_raster[\"raster-hue-rotate\"],\"raster-hue-rotate\"),\"raster-brightness-min\":new V(S.paint_raster[\"raster-brightness-min\"],\"raster-brightness-min\"),\"raster-brightness-max\":new V(S.paint_raster[\"raster-brightness-max\"],\"raster-brightness-max\"),\"raster-saturation\":new V(S.paint_raster[\"raster-saturation\"],\"raster-saturation\"),\"raster-contrast\":new V(S.paint_raster[\"raster-contrast\"],\"raster-contrast\"),resampling:new V(S.paint_raster.resampling,\"resampling\"),\"raster-resampling\":new V(S.paint_raster[\"raster-resampling\"],\"raster-resampling\"),\"raster-fade-duration\":new V(S.paint_raster[\"raster-fade-duration\"],\"raster-fade-duration\")})),N5={get paint(){return $5()}},j5=class extends Ce{constructor(t,e){super(t,N5,e)}},U5=class extends Ce{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode===\"3d\"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error(\"Custom layers cannot be serialized\")}};function q5(t,e){if(t.type===\"custom\")return new U5(t,e);switch(t.type){case\"background\":return new R5(t,e);case\"circle\":return new Pv(t,e);case\"color-relief\":return new Uv(t,e);case\"fill\":return new wb(t,e);case\"fill-extrusion\":return new Vb(t,e);case\"heatmap\":return new Ov(t,e);case\"hillshade\":return new $v(t,e);case\"line\":return new Cw(t,e);case\"raster\":return new j5(t,e);case\"symbol\":return new z5(t,e)}}var G5=class{constructor(t,e){this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},this.extent=e,\"id\"in t&&(typeof t.id==\"string\"?this.id=parseInt(t.id,10):typeof t.id==\"number\"&&!isNaN(t.id)&&(this.id=t.id))}loadGeometry(){let t=[],e=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let r of e){let i=[];for(let n of r)i.push(new F(n[0],n[1]));t.push(i)}return t}},eu=\"_geojsonTileLayer\",X5=class{constructor(t,e){this.layers={[eu]:this},this.name=eu,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=t.length,this.features=t}feature(t){return new G5(this.features[t],this.extent)}};function g0(t,e=\"\"){let r=new S3;return Y5(t,r,e),r.finish()}function Y5(t,e,r=\"\"){for(let i in t.layers)e.writeMessage(3,(n,a)=>W5(n,a,r),t.layers[i])}function W5(t,e,r=\"\"){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||\"\"),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s>31}function K5(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(Io(1,o));let l=s[s.length-1],u=i===3&&s.length>1&&l.x===s[0].x&&l.y===s[0].y?s.length-1:s.length;for(let c=0;c=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},Dr,Q5=(Dr=class{constructor(e,r,i,n,a,s){this.type=\"Feature\",this._vectorTileFeature=e,this._x=i,this._y=n,this._z=r,s!==K2&&Dr.worldCoordinateHelpers.set(this,s);for(let o in e.properties)typeof e.properties[o]==\"string\"&&e.properties[o].startsWith(\"__$json__:\")&&(e.properties[o]=JSON.parse(e.properties[o].slice(10)));this.properties=e.properties,this.id=a}projectPoint(e,r,i,n,a){if(a){let s=a.lngLatFromWorld((e.x+r)/n,(e.y+i)/n);return[s.lng,s.lat]}return[(e.x+r)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+i)*2/n)*Math.PI))-90]}projectLine(e,r,i,n,a){return e.map(s=>this.projectPoint(s,r,i,n,a))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,r=Dr.worldCoordinateHelpers.get(this),i=e.extent*2**this._z,n=e.extent*this._x,a=e.extent*this._y,s=e.loadGeometry();switch(e.type){case 1:{let o=[];for(let u of s)o.push(u[0]);let l=this.projectLine(o,n,a,i,r);this._geometry=o.length===1?{type:\"Point\",coordinates:l[0]}:{type:\"MultiPoint\",coordinates:l};break}case 2:{let o=s.map(l=>this.projectLine(l,n,a,i,r));this._geometry=o.length===1?{type:\"LineString\",coordinates:o[0]}:{type:\"MultiLineString\",coordinates:o};break}case 3:{let o=b1(s),l=[];for(let u of o)l.push(u.map(c=>this.projectLine(c,n,a,i,r)));this._geometry=l.length===1?{type:\"Polygon\",coordinates:l[0]}:{type:\"MultiPolygon\",coordinates:l};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r!==\"_geometry\"&&r!==\"_vectorTileFeature\"&&r!==\"_x\"&&r!==\"_y\"&&r!==\"_z\"&&(e[r]=this[r]);return e}},Dr.worldCoordinateHelpers=new WeakMap,Dr),Wr=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r==\"number\"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){var e;return((e=this.nullabilityBuffer)==null?void 0:e.get(t))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Is=class extends Wr{},sc=class extends Is{getValueFromBuffer(t){return this.dataBuffer[t]}},oc=class extends Is{getValueFromBuffer(t){return this.dataBuffer[t]}},v0=class extends Wr{constructor(t,e,r,i){super(t,e,i),this.delta=r}},lc=class extends v0{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},uc=class extends Wr{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},t6=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error(\"Missing layer name\")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var t;return(t=this._propertyVectors)!=null?t:[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r>>32-t;var ru=cc,hc=65536;function pc(t,e){return t-t%e}function e6(t){return pc(t+31,32)}function _0(t){if(!Number.isFinite(t)||t<=0)return hc;let e=pc(Math.floor(t),256);return e===0?256:e}function r6(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function i6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function n6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function a6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function s6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function o6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(c&3)<<4)&63,r[n++]=c>>>2&63,r[n++]=c>>>8&63,r[n++]=c>>>14&63,r[n++]=c>>>20&63,r[n]=c>>>26&63}function l6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(c&1)<<6)&127,r[n++]=c>>>1&127,r[n++]=c>>>8&127,r[n++]=c>>>15&127,r[n++]=c>>>22&127,r[n++]=(c>>>29|(h&15)<<3)&127,r[n++]=h>>>4&127,r[n++]=h>>>11&127,r[n++]=h>>>18&127,r[n]=h>>>25&127}function u6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function c6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(c&3)<<7)&511,r[n++]=c>>>2&511,r[n++]=c>>>11&511,r[n++]=c>>>20&511,r[n++]=(c>>>29|(h&63)<<3)&511,r[n++]=h>>>6&511,r[n++]=h>>>15&511,r[n++]=(h>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function h6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=c>>>0&1023,r[n++]=c>>>10&1023,r[n++]=c>>>20&1023,r[n++]=(c>>>30|(h&255)<<2)&1023,r[n++]=h>>>8&1023,r[n++]=h>>>18&1023,r[n++]=(h>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function p6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(c&31)<<6)&2047,r[n++]=c>>>5&2047,r[n++]=c>>>16&2047,r[n++]=(c>>>27|(h&63)<<5)&2047,r[n++]=h>>>6&2047,r[n++]=h>>>17&2047,r[n++]=(h>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function f6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(c&255)<<4)&4095,r[n++]=c>>>8&4095,r[n++]=c>>>20&4095,r[n++]=h>>>0&4095,r[n++]=h>>>12&4095,r[n++]=(h>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function d6(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,c=t[e+5]>>>0,h=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,v=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function y6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function m6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function g6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function x6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=c>>>0&15,r[n++]=c>>>4&15,r[n++]=c>>>8&15,r[n++]=c>>>12&15,r[n++]=c>>>16&15,r[n++]=c>>>20&15,r[n++]=c>>>24&15,r[n++]=c>>>28&15}}function v6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(c&15)<<1)&31,r[n++]=c>>>4&31,r[n++]=c>>>9&31,r[n++]=c>>>14&31,r[n++]=c>>>19&31,r[n++]=c>>>24&31,r[n++]=(c>>>29|(h&3)<<3)&31,r[n++]=h>>>2&31,r[n++]=h>>>7&31,r[n++]=h>>>12&31,r[n++]=h>>>17&31,r[n++]=h>>>22&31,r[n++]=h>>>27&31}}function b6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=c>>>0&63,r[n++]=c>>>6&63,r[n++]=c>>>12&63,r[n++]=c>>>18&63,r[n++]=c>>>24&63,r[n++]=(c>>>30|(h&15)<<2)&63,r[n++]=h>>>4&63,r[n++]=h>>>10&63,r[n++]=h>>>16&63,r[n++]=h>>>22&63,r[n++]=(h>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function w6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(c&3)<<5)&127,r[n++]=c>>>2&127,r[n++]=c>>>9&127,r[n++]=c>>>16&127,r[n++]=c>>>23&127,r[n++]=(c>>>30|(h&31)<<2)&127,r[n++]=h>>>5&127,r[n++]=h>>>12&127,r[n++]=h>>>19&127,r[n++]=(h>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function _6(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function D6(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function S6(t,e,r,i,n){let a=ru[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let c=0;c<8;c++){for(let h=0;h<32;h++)if(o+n<=32){let p=l>>>o&a;r[u+h]=p|0,o+=n,o===32&&(o=0,s++,h!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<>>0)}}var iu=_0(hc),A6=3*iu/256+iu|0;function D0(){let t=new Uint8Array(A6);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function E6(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:D0()}}function T6(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function F6(t,e,r,i){i.byteContainer.length>>2;if(n.byteOffset&3)for(let o=0;o>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u>>(u<<3)&255}return n}function I6(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=e6(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length>>5)|0,r.exceptionSizes[a]=s}return e}function C6(t,e,r,i,n){switch(n){case 1:y6(t,e,r,i);break;case 2:m6(t,e,r,i);break;case 3:g6(t,e,r,i);break;case 4:x6(t,e,r,i);break;case 5:v6(t,e,r,i);break;case 6:b6(t,e,r,i);break;case 7:w6(t,e,r,i);break;case 8:_6(t,e,r,i);break;case 16:D6(t,e,r,i);break;default:S6(t,e,r,i,n)}return e+(n<<3)|0}function k6(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function M6(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function P6(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:c,bytePosIn:h}=M6(n,a,s,r,i,l);if(s=h,c===1){let m=1<y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${c} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m0&&(h=P6(n,m,d,y,o,l,h,u,p))}if(c!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${c}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function z6(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,c=t[u]>>>0,h=c+3>>>2,p=u+1,f=p+h;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${c} (metaInts=${h}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=F6(t,p,c,a),y=c,m=I6(t,f,a);return a.dataPointers.fill(0),B6(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function L6(t,e,r,i,n,a){let s=i+pc(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(iu,s-o);l=z6(t,e,l,o,u,a),o=o+u|0}return l}function O6(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,c=n,h=n+a,p=0,f=0;for(;o>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${c-u}/${a}, inPos=${o}, inEnd=${l})`)}if(c!==h)throw Error(`FastPFOR VByte: truncated stream (decoded=${c-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function V6(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r!=null?r:D0();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=L6(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return O6(t,i,o,a,n,l),a}function R6(t,e,r,i,n){switch(n){case 2:i6(t,e,r,i);return;case 3:n6(t,e,r,i);return;case 4:a6(t,e,r,i);return;case 5:s6(t,e,r,i);return;case 6:o6(t,e,r,i);return;case 7:l6(t,e,r,i);return;case 8:u6(t,e,r,i);return;case 9:c6(t,e,r,i);return;case 10:h6(t,e,r,i);return;case 11:p6(t,e,r,i);return;case 12:f6(t,e,r,i);return;case 16:d6(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=ru[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let c=l>>>o&a;r[i+u]=c|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let c=32-o,h=l>>>o;s++,l=t[s]>>>0;let p=ru[n-c]>>>0,f=(h|(l&p)<t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length0){let o=t.byteOffset+e;if(o&3)for(let l=0;l=64)throw Error(\"Varint too long\")}return e.set(n),r}function j6(t,e,r){let i=new Float64Array(r);for(let n=0;n>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error(\"Expected varint not more than 10 bytes\")}function G6(t,e,r,i){return X6(t,e,r,i,E6(r>>>2))}function X6(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=T6(n,s);$6(t,a,r,o);let l=V6(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function et(t){return t>>>1^-(t&1)}function Gt(t){return t>>BigInt(1)^-(t&BigInt(1))}function yr(t){return t%2==1?(t+1)/-2:t/2}function Y6(t){let e=new Int32Array(t.length);for(let r=0;r=4)for(;i=4)for(;i=4)for(;r=4)for(let i=t[0];r=4)for(;i=4)for(;l>>0;for(let r=1;r>>0;return e}function _f(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Gt(t[0]));for(let r=1;r>>0,e[1]=et(t[1])>>>0;for(let r=2;r>>0,e[r+1]=e[r-1]+et(t[r+1])>>>0;return e}function l_(t,e,r,i){let n=A0(t,e,r,i);return new Uint32Array(n)}function u_(t){return t[1]}function c_(t){return et(t[1])}function h_(t){if(t.length===2){let e=et(t[1]);return[e,e]}return[et(t[2]),et(t[3])]}function p_(t){return t[1]}function f_(t){return Gt(t[1])}function d_(t){if(t.length===2){let e=Gt(t[1]);return[e,e]}return[Gt(t[2]),Gt(t[3])]}var It;(function(t){t.PRESENT=\"PRESENT\",t.DATA=\"DATA\",t.OFFSET=\"OFFSET\",t.LENGTH=\"LENGTH\"})(It||(It={}));var Ht;(function(t){t.NONE=\"NONE\",t.SINGLE=\"SINGLE\",t.SHARED=\"SHARED\",t.VERTEX=\"VERTEX\",t.MORTON=\"MORTON\",t.FSST=\"FSST\"})(Ht||(Ht={}));var Oe;(function(t){t.VERTEX=\"VERTEX\",t.INDEX=\"INDEX\",t.STRING=\"STRING\",t.KEY=\"KEY\"})(Oe||(Oe={}));var zt;(function(t){t.VAR_BINARY=\"VAR_BINARY\",t.GEOMETRIES=\"GEOMETRIES\",t.PARTS=\"PARTS\",t.RINGS=\"RINGS\",t.TRIANGLES=\"TRIANGLES\",t.SYMBOL=\"SYMBOL\",t.DICTIONARY=\"DICTIONARY\"})(zt||(zt={}));var y_=[It.PRESENT,It.DATA,It.OFFSET,It.LENGTH],Df=[H.NONE,H.DELTA,H.COMPONENTWISE_DELTA,H.RLE,H.MORTON],m_=[ce.NONE,ce.FAST_PFOR,ce.VARINT],g_=[Ht.NONE,Ht.SINGLE,Ht.SHARED,Ht.VERTEX,Ht.MORTON,Ht.FSST],x_=[Oe.VERTEX,Oe.INDEX,Oe.STRING,Oe.KEY],v_=[zt.VAR_BINARY,zt.GEOMETRIES,zt.PARTS,zt.RINGS,zt.TRIANGLES,zt.SYMBOL,zt.DICTIONARY];function vt(t,e){let r=__(t,e);return r.logicalLevelTechnique1===H.MORTON?b_(r,t,e):(H.RLE===r.logicalLevelTechnique1||H.RLE===r.logicalLevelTechnique2)&&ce.NONE!==r.physicalLevelTechnique?w_(r,t,e):r}function b_(t,e,r){let i=Yt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function w_(t,e,r){let i=Yt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function __(t,e){let r=t[e.get()],i=y_[r>>4],n={};switch(i){case It.DATA:n={dictionaryType:g_[r&15]};break;case It.OFFSET:n={offsetType:x_[r&15]};break;case It.LENGTH:n={lengthType:v_[r&15]}}e.increment();let a=t[e.get()],s=Df[a>>5],o=Df[a>>2&7],l=m_[a&3];e.increment();let u=Yt(t,e,2),c=u[0],h=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:c,byteLength:h,decompressedCount:c}}var yt;(function(t){t[t.FLAT=0]=\"FLAT\",t[t.CONST=1]=\"CONST\",t[t.SEQUENCE=2]=\"SEQUENCE\",t[t.DICTIONARY=3]=\"DICTIONARY\",t[t.FSST_DICTIONARY=4]=\"FSST_DICTIONARY\"})(yt||(yt={}));var Ie=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<>r&1}size(){return this._size}getBuffer(){return this.values}};function Zr(t,e,r){if(!e)return t;let i=e.size(),n=new t.constructor(i),a=0;for(let s=0;s=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],c=Math.min(a+l,e);n.fill(u,a,c),a=c}else{let l=256-o;for(let u=0;u=12?T_.decode(t.subarray(e,r)):F_(t,e,r)}function F_(t,e,r){let i=\"\",n=e;for(;n239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,c;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],c=t[n+3],(l&192)==128&&(u&192)==128&&(c&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function ss(t,e,r,i,n){return P_(Li(t,e,r),r,i,n)}function qt(t,e,r,i,n){return B_(Li(t,e,r),r,i,n)}function mr(t,e,r){return L_(Li(t,e,r),r)}function Li(t,e,r){let i=r.physicalLevelTechnique;switch(i){case ce.FAST_PFOR:return G6(t,r.numValues,r.byteLength,e);case ce.VARINT:return Yt(t,e,r.numValues);case ce.NONE:return A_(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Hn(t,e,r){let i=r.physicalLevelTechnique;switch(i){case ce.VARINT:return fc(t,e,r.numValues);case ce.NONE:return E_(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function I_(t,e,r){let i=Li(t,e,r);return i.length===1?et(i[0]):c_(i)}function mc(t,e,r){let i=Li(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?et(i[0]):i[0]:u_(i)}function I0(t,e,r){return h_(Li(t,e,r))}function C0(t,e,r){return d_(fc(t,e,r.numValues))}function k0(t,e,r,i){return P0(Hn(t,e,r),r,i)}function gc(t,e,r,i){return B0(Hn(t,e,r),r,i)}function C_(t,e,r,i){let n=k_(t,e,r,!1);return i?Zr(n,i,0):n}function k_(t,e,r,i){if(r.physicalLevelTechnique===ce.VARINT)return z_(j6(t,e,r.numValues),r,i);let n=Hn(t,e,r),a=i?P0(n,r):B0(n,r);return Float64Array.from(a,Number)}function M_(t,e,r){let i=Hn(t,e,r);return i.length===1?Gt(i[0]):f_(i)}function M0(t,e,r){let i=Hn(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?Gt(i[0]):i[0]:p_(i)}function P_(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;if(!i)return a_(t,a.runs,a.numRleValues);t=nu(t,a.runs,a.numRleValues),n=vf(t)}else n=vf(t);break;case H.RLE:n=K6(t,e.runs,e.numRleValues);break;case H.MORTON:dc(t),n=new Int32Array(t);break;case H.COMPONENTWISE_DELTA:if(r&&!i)return A0(t,r.scale,r.min,r.max);n=e_(t);break;case H.NONE:n=Y6(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Zr(n,i,0):n}function B_(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;n=wf(nu(t,a.runs,a.numRleValues))}else n=wf(t);break;case H.RLE:n=nu(t,e.runs,e.numRleValues);break;case H.MORTON:dc(t),n=t;break;case H.COMPONENTWISE_DELTA:n=r&&!i?l_(t,r.scale,r.min,r.max):o_(t);break;case H.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Zr(n,i,0):n}function P0(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;if(!r)return s_(t,n.runs,n.numRleValues);t=au(t,n.runs,n.numRleValues),i=bf(t)}else i=bf(t);break;case H.RLE:i=J6(t,e.runs,e.numRleValues);break;case H.NONE:i=W6(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Zr(i,r,BigInt(0)):i}function B0(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;i=_f(au(t,n.runs,n.numRleValues))}else i=_f(t);break;case H.RLE:i=au(t,e.runs,e.numRleValues);break;case H.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Zr(i,r,BigInt(0)):i}function z_(t,e,r){switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let i=e;t=S0(t,i.runs,i.numRleValues)}return H6(t),t;case H.RLE:return V_(t,e,r);case H.NONE:return r&&Z6(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function L_(t,e){if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.NONE)return r_(t);if(e.logicalLevelTechnique1===H.RLE&&e.logicalLevelTechnique2===H.NONE){let r=e;return n_(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===H.NONE&&e.logicalLevelTechnique2===H.NONE){t_(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.RLE){let r=e,i=i_(t,r.runs,r.numRleValues);return dc(i),new Uint32Array(i)}throw Error(\"Only delta encoding is supported for transforming length to offset streams yet.\")}function Cs(t,e,r,i,n=\"int32\"){let a=t.logicalLevelTechnique1;if(a===H.RLE)return t.runs===1?yt.CONST:yt.FLAT;if(a!==H.DELTA||t.logicalLevelTechnique2!==H.RLE)return t.numValues===1?yt.CONST:yt.FLAT;let s=e instanceof Ie?e.size():e,o=t;if(o.numRleValues!==s)return yt.FLAT;if(o.runs===1)return yt.SEQUENCE;if(o.runs!==2)return t.numValues===1?yt.CONST:yt.FLAT;let l=i.get();if(t.physicalLevelTechnique===ce.VARINT)return O_(r,i,n)?yt.SEQUENCE:t.numValues===1?yt.CONST:yt.FLAT;let u=i.get(),c=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),c[2]===2&&c[3]===2?yt.SEQUENCE:t.numValues===1?yt.CONST:yt.FLAT}function O_(t,e,r){let i=new w0(e.get());if(r===\"int64\"){let a=fc(t,i,4);return a[2]===BigInt(2)&&a[3]===BigInt(2)}let n=Yt(t,i,4);return n[2]===2&&n[3]===2}function V_(t,e,r){return r?Q6(t,e.runs,e.numRleValues):S0(t,e.runs,e.numRleValues)}var z0=class extends Is{getValueFromBuffer(t){return this.dataBuffer[t]}},L0=class extends v0{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function xc(t,e,r){return{x:Sf(t,e)-r,y:Sf(t>>1,e)-r}}function Sf(t,e){let r=0;for(let i=0;i>i;return r}var $t;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\",t[t.MULTIPOINT=3]=\"MULTIPOINT\",t[t.MULTILINESTRING=4]=\"MULTILINESTRING\",t[t.MULTIPOLYGON=5]=\"MULTIPOLYGON\"})($t||($t={}));var Af;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\"})(Af||(Af={}));var Ar;(function(t){t[t.MORTON=0]=\"MORTON\",t[t.VEC_2=1]=\"VEC_2\",t[t.VEC_3=2]=\"VEC_3\"})(Ar||(Ar={}));function R_(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,c=u.geometryOffsets,h=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g[w]),r+=v,i+=v}break;case $t.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=h[r]-h[r-1],r++;let b;d?(b=ni(m,s,v,!1),s+=v*2):(b=Cr(t.vertexBufferType,m,f,o,v,!1,l),o+=v),e[a++]=[b],c&&n++}break;case $t.POLYGON:{let v=h[r]-h[r-1];r++;let b=Array(v-1),w,D=p[i]-p[i-1];if(i++,d){w=ni(m,s,D,!0),s+=D*2;for(let _=0;_r?e[a++]:1);return i}function Ff(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l0;)n[a++]=t[u++]}}return n}var U0=class extends vc{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s!=null?s:e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){var n,a,s;(s=this.decodedDictionary)!=null||(this.decodedDictionary=(n=this.sharedDictionaryCache)==null?void 0:n.decodedDictionary,(a=this.decodedDictionary)!=null||(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return yc(this.decodedDictionary,r,i)}decodeDictionary(){var t;return(t=this.symbolLengthBuffer)!=null||(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),Q_(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=vt(t,e);m=new Ie(zi(t,x.numValues,x.byteLength,e),x.numValues)}let g=qt(t,e,vt(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column \"${y}\"`);c[p++]=new U0(y,g,n,a,s,o,m,h)}else c[p++]=new gi(y,g,n,a,m)}return c}var Cf=class extends Wr{constructor(t,e,r){super(t,new Uint8Array,r!=null?r:e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},Ve;(function(t){t[t.STRING=1]=\"STRING\",t[t.INT32=2]=\"INT32\",t[t.UINT32=4]=\"UINT32\",t[t.INT64=8]=\"INT64\",t[t.UINT64=16]=\"UINT64\",t[t.FLOAT=32]=\"FLOAT\",t[t.DOUBLE=64]=\"DOUBLE\",t[t.PRESENCE=128]=\"PRESENCE\"})(Ve||(Ve={}));var vr;(function(t){t[t.FALSE=0]=\"FALSE\",t[t.TRUE=1]=\"TRUE\",t[t.START_MAP=2]=\"START_MAP\",t[t.START_LIST=3]=\"START_LIST\",t[t.COUNT=4]=\"COUNT\"})(vr||(vr={}));function nD(t,e,r,i){let n=aD(r);if(i===0)return n.map(c=>new Cf(c,[]));let a=sD(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let c=0;c{var i;return t.name+((i=r.name)!=null?i:\"\")})}function sD(t,e,r){let i=t[e.get()];e.add(1);let n=qt(t,e,vt(t,e)),a=r-1,s=[];i&Ve.STRING&&(a-=oD(t,e,s)),a-=lD(t,e,i,s),a-=uD(t,e,i,s);let o,l=0;if(i&Ve.PRESENCE){let c=cD(t,e);o=c.value,l=c.count,a--}let u=new Uint32Array;if(a>0&&(u=qt(t,e,vt(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function oD(t,e,r){let i=t[e.get()];e.add(1);let n=q0(\"\",t,e,i);if(n)for(let a=0;aa.length)throw Error(\"Merged map counts underflow while decoding child streams\");let f=Array(r),d=i,y=n;for(let x=0;xs.length)throw Error(\"Map value stream underflow while decoding feature payload\");let b=pD(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x=r)throw Error(\"Unexpected end of map value stream\");let n=t[e];if(n===vr.FALSE)return{value:!1,nextIndex:e+1};if(n===vr.TRUE)return{value:!0,nextIndex:e+1};if(n===vr.START_MAP){let a=kf(t,e,r);return{value:G0(t,e+2,a,i).value,nextIndex:a}}if(n===vr.START_LIST){let a=kf(t,e,r),s=[],o=e+2;for(;o=r)throw Error(\"Missing length for nested map/list payload\");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error(\"Nested payload exceeds containing payload bounds\");return n}function X0(t,e){let r=t-vr.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function hi(t,e){for(let r of e)t.push(r)}function fD(t,e,r,i,n,a){var s;return r.type===\"scalarType\"?a&&!a.has(r.name)?(E0(i,t,e),null):dD(i,t,e,n,r.scalarType,r):((s=r.complexType)==null?void 0:s.physicalType)===_r.MAP?nD(t,e,r,i):i===0?null:iD(t,e,r,a)}function dD(t,e,r,i,n,a){var l;let s;if(t===0)return null;if(a.nullable){let u=vt(e,r),c=u.numValues,h=r.get(),p=zi(e,c,u.byteLength,r);r.set(h+u.byteLength),s=new Ie(p,u.numValues)}let o=s!=null?s:i;switch(n.physicalType){case ot.UINT_32:case ot.INT_32:return vD(e,r,a,n,o);case ot.STRING:{let u=a.nullable?t-1:t;return(l=q0(a.name,e,r,u,s))!=null?l:null}case ot.BOOLEAN:return yD(e,r,a,i,o);case ot.UINT_64:case ot.INT_64:return xD(e,r,a,o,n);case ot.FLOAT:return mD(e,r,a,o);case ot.DOUBLE:return gD(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function yD(t,e,r,i,n){let a=vt(t,e),s=a.numValues,o=e.get(),l=Kn(n)?n:void 0,u=zi(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let c=new Ie(u,s);return new H_(r.name,c,n)}function mD(t,e,r,i){let n=vt(t,e),a=Kn(i)?i:void 0,s=T0(t,e,n.numValues,a);return new K_(r.name,s,i)}function gD(t,e,r,i){let n=vt(t,e),a=Kn(i)?i:void 0,s=F0(t,e,n.numValues,a);return new oc(r.name,s,i)}function xD(t,e,r,i,n){let a=vt(t,e),s=Cs(a,i,t,e,\"int64\"),o=n.physicalType===ot.INT_64;if(s===yt.FLAT){let u=Kn(i)?i:void 0,c=o?k0(t,e,a,u):gc(t,e,a,u);return new z0(r.name,c,i)}if(s===yt.SEQUENCE){let u=C0(t,e,a);return new L0(r.name,u[0],u[1],a.numRleValues,o)}let l=o?M_(t,e,a):M0(t,e,a);return new j0(r.name,l,i,o)}function vD(t,e,r,i,n){let a=vt(t,e),s=Cs(a,n,t,e),o=i.physicalType===ot.INT_32;if(s===yt.FLAT){let u=Kn(n)?n:void 0,c=o?ss(t,e,a,void 0,u):qt(t,e,a,void 0,u);return new sc(r.name,c,n)}if(s===yt.SEQUENCE){let u=I0(t,e,a);return new lc(r.name,u[0],u[1],a.numRleValues,o)}let l=o?I_(t,e,a):mc(t,e,a);return new uc(r.name,l,n,o)}function Kn(t){return t instanceof Ie}var Rt={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function Y0(t){switch(t){case Rt.ID:case Rt.ID|Rt.ID_NULLABLE:case Rt.ID|Rt.ID_LONG:case Rt.ID|Rt.ID_LONG|Rt.ID_NULLABLE:return{nullable:(t&Rt.ID_NULLABLE)!==0,columnScope:pn.FEATURE,type:\"scalarType\",scalarType:{longID:(t&Rt.ID_LONG)!==0,type:\"logicalType\",logicalType:b0.ID}};case Rt.GEOMETRY:return{nullable:!1,columnScope:pn.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:_r.GEOMETRY,children:[]}};case Rt.STRUCT:return{nullable:!1,columnScope:pn.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:_r.STRUCT,children:[]}};case Rt.MAP:return{nullable:!0,columnScope:pn.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:_r.MAP,children:[]}};default:return SD(t)}}function bD(t){return t>=Rt.SCALAR_BASE}function W0(t){return t===Rt.STRUCT||t===Rt.MAP}function wD(t){if(t.type===\"scalarType\"){let e=t.scalarType;if(e.type===\"physicalType\")switch(e.physicalType){case ot.BOOLEAN:case ot.INT_8:case ot.UINT_8:case ot.INT_32:case ot.UINT_32:case ot.INT_64:case ot.UINT_64:case ot.FLOAT:case ot.DOUBLE:return!1;case ot.STRING:return!0;default:return!1}if(e.type===\"logicalType\")return!1}else if(t.type===\"complexType\"){let e=t.complexType;if(e.type===\"physicalType\")switch(e.physicalType){case _r.GEOMETRY:case _r.STRUCT:case _r.MAP:return!0;default:return!1}}return console.warn(\"Unexpected column type in hasStreamCount\",t),!1}function _D(t){var e;return t.type===\"scalarType\"&&((e=t.scalarType)==null?void 0:e.type)===\"logicalType\"&&t.scalarType.logicalType===b0.ID}function DD(t){var e;return t.type===\"complexType\"&&((e=t.complexType)==null?void 0:e.type)===\"physicalType\"&&t.complexType.physicalType===_r.GEOMETRY}function SD(t){let e;switch(t){case 10:case 11:e=ot.BOOLEAN;break;case 12:case 13:e=ot.INT_8;break;case 14:case 15:e=ot.UINT_8;break;case 16:case 17:e=ot.INT_32;break;case 18:case 19:e=ot.UINT_32;break;case 20:case 21:e=ot.INT_64;break;case 22:case 23:e=ot.UINT_64;break;case 24:case 25:e=ot.FLOAT;break;case 26:case 27:e=ot.DOUBLE;break;case 28:case 29:e=ot.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:pn.FEATURE,type:\"scalarType\",scalarType:{longID:!1,type:\"physicalType\",physicalType:e}}}var AD=new TextDecoder,Mf=\"0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)\";function wc(t,e){let r=Yt(t,e,1)[0];if(r===0)return\"\";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),AD.decode(a)}function ED(t){let e=t.name,r=t.nullable;return t.type===\"scalarType\"?{type:\"scalarField\",scalarField:t.scalarType,name:e,nullable:r}:{type:\"complexField\",complexField:t.complexType,name:e,nullable:r}}function Z0(t,e){let r=Yt(t,e,1)[0]>>>0,i=r>=Rt.SCALAR_BASE?Y0(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n=lt(Y({},i),{name:wc(t,e)});if(n.type===\"complexType\"&&W0(r)){let a=n.complexType,s=Yt(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o>>0,i=Y0(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${Mf}`);let n;if(bD(r))n=wc(t,e);else if(r>>0,o=a.complexType;o.children=Array(s);for(let l=0;l>>0,a=Yt(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=Yt(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=FD(t,i),c=l.featureTables[0],h=null,p=null,f=[],d=0;for(let m of c.columns){let g=m.name;if(_D(m)){let x=null;if(m.nullable){let b=vt(t,i),w=i.get(),D=zi(t,b.numValues,b.byteLength,i);i.set(w+b.byteLength),x=new Ie(D,b.numValues)}let v=vt(t,i);d=x?x.size():v.decompressedCount,h=CD(t,m,i,g,v,x!=null?x:d,r)}else if(DD(m)){let x=Yt(t,i,1)[0];if(d===0){let v=i.get();d=vt(t,i).decompressedCount,i.set(v)}e&&(e.scale=e.extent/u),p=Y_(t,x,i,d,e)}else{let x=wD(m)?Yt(t,i,1)[0]:1;if(x===0)continue;let v=fD(t,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new t6(c.name,p,h,f,u);n.push(y),i.set(s)}return n}function CD(t,e,r,i,n,a,s=!1){var c;let o=(c=e.scalarType)!=null&&c.longID?ot.UINT_64:ot.UINT_32,l=typeof a==\"number\"?void 0:a,u=Cs(n,a,t,r,o===ot.UINT_64?\"int64\":\"int32\");if(o===ot.UINT_32)switch(u){case yt.FLAT:return new sc(i,qt(t,r,n,void 0,l),a);case yt.SEQUENCE:{let h=I0(t,r,n);return new lc(i,h[0],h[1],n.numRleValues,!1)}case yt.CONST:return new uc(i,mc(t,r,n),a,!1)}switch(u){case yt.FLAT:return s?new oc(i,C_(t,r,n,l),a):new z0(i,gc(t,r,n,l),a);case yt.SEQUENCE:{let h=C0(t,r,n);return new L0(i,h[0],h[1],n.numRleValues,!1)}case yt.CONST:return new j0(i,M0(t,r,n),a,!1)}throw Error(\"Vector type not supported for id column.\")}var ko=_0(hc);ko/32*4,3*ko/256+ko|0;var kD=class{constructor(t,e){var r;switch(this._featureData=t,this.properties=this._featureData.properties||{},(r=this._featureData.geometry)==null?void 0:r.type){case $t.POINT:case $t.MULTIPOINT:this.type=1;break;case $t.LINESTRING:case $t.MULTILINESTRING:this.type=2;break;case $t.POLYGON:case $t.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new F(i.x,i.y));t.push(r)}return t}},MD=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new kD(this.features[t],this.extent)}},H0=class{constructor(t){this.layers={};let e=ID(new Uint8Array(t));this.layers=e.reduce((r,i)=>lt(Y({},r),{[i.name]:new MD(i)}),{})}},K0=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Oo(it,16,0),this.grid3D=new Oo(it,16,0),this.featureIndexArray=new Py,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let c of l)u[0]=Math.min(u[0],c.x),u[1]=Math.min(u[1],c.y),u[2]=Math.max(u[2],c.x),u[3]=Math.max(u[3],c.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding===\"mlt\"?this.vtLayers=new H0(this.rawTileData).layers:this.vtLayers=new w1(new X1(this.rawTileData)).layers,this.sourceLayerCoder=new x0(this.vtLayers?Object.keys(this.vtLayers).sort():[eu])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=it/t.tileSize/t.scale,s=En(n.filter,\"queryRenderedFeatures filter\",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Pn.fromPoints(o),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),h=Pn.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(h.minX,h.minY,h.maxX,h.maxY,(y,m,g,x)=>W2(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)c.push(y);c.sort(BD);let f={},d;for(let y of c){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,t.worldCoordinateHelper,i,(x,v,b)=>(g||(g=Yr(x)),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,projectedCamera:t.projectedCamera,pixelsToTileUnits:a,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,c,h){let p=this.bucketLayerIDs[e];if(a&&!p.some(m=>a.has(m)))return;let f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(i);if(n.needGeometry){let m=Bi(d,!0);if(!n.filter(new ct(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!n.filter(new ct(this.tileID.overscaledZ),d))return;let y=this.getId(d,f);for(let m of p){if(a&&!a.has(m))continue;let g=o[m];if(!g)continue;let x={};y&&c&&(x=c.getState(g.sourceLayer||\"_geojsonTileLayer\",y));let v=Y({},l[m]);v.paint=Pf(v.paint,g.paint,d,x,s),v.layout=Pf(v.layout,g.layout,d,x,s);let b=!h||h(d,g,x);if(!b)continue;let w=new Q5(d,this.z,this.x,this.y,y,u);w.layer=v;let D=t[m];D===void 0&&(D=t[m]=[]),D.push({featureIndex:i,feature:w,intersectionZ:b})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=En(n.filterSpec,\"queryRenderedFeatures symbol filter\",n.globalState);for(let c of t)this.loadMatchingFeature(l,r,i,c,u,a,s,o,e,n.worldCoordinateHelper);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){var i;let r=t.id;if(this.promoteId){let n=typeof this.promoteId==\"string\"?this.promoteId:this.promoteId[e];r=t.properties[n],typeof r==\"boolean\"&&(r=Number(r)),r===void 0&&((i=t.properties)!=null&&i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};B(\"FeatureIndex\",K0,{omit:[\"rawTileData\",\"sourceLayerCoder\"]});function PD(t){return typeof t==\"object\"&&!!t&&\"evaluate\"in t}function Pf(t,e,r,i,n){return Object.fromEntries(Object.keys(t!=null?t:{}).map(a=>{let s=e instanceof bs?e.get(a):null;return[a,PD(s)?s.evaluate(r,i,void 0,n):s]}))}function BD(t,e){return e-t}var zD=class{constructor(t,e){this.keyCache={},t&&this.replace(t,e)}replace(t,e){this._layerConfigs={},this._layers={},this.update(t,[],e)}update(t,e,r){for(let n of t){this._layerConfigs[n.id]=n;let a=this._layers[n.id]=q5(n,r);a._featureFilter=En(a.filter,`layers[${n.id}].filter`,r),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(let n of e)delete this.keyCache[n],delete this._layerConfigs[n],delete this._layers[n];this.familiesBySource=Object.create(null);let i=Vx(Object.values(this._layerConfigs),this.keyCache);for(let n of i){let a=n.map(h=>this._layers[h.id]),s=a[0];if(s.isHidden())continue;let o=s.source||\"\",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]=Object.create(null));let u=s.sourceLayer||\"_geojsonTileLayer\",c=l[u];c||(c=l[u]=[]),c.push(a)}}},J0=class{constructor(t){let e={},r=[];for(let s in t){let o=e[s]={};for(let l in t[s]){let u=t[s][l];o[l]={};for(let c in u){let h=u[c];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let p={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};r.push(p),o[l][c]={rect:p,metrics:h.metrics}}}}let{w:i,h:n}=Y1(r),a=new kl({width:i||1,height:n||1});for(let s in t)for(let o in t[s]){let l=t[s][o];for(let u in l){let c=l[u];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let h=e[s][o][u].rect;kl.copy(c.bitmap,a,{x:0,y:0},{x:h.x+1,y:h.y+1},c.bitmap)}}this.image=a,this.positions=e}};B(\"GlyphAtlas\",J0);var Q0=class{constructor(t){this.tileID=new Ds(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,e,r,i,n){return rt(this,null,function*(){this.data=t,this.collisionBoxArray=new Dy;let a=new x0(Object.keys(t.layers).sort()),s=new K0(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let A in u){let E=t.layers[A];if(!E)continue;E.version===1&&Ot(`Vector tile source \"${this.source}\" layer \"${A}\" does not use vector tile spec v2 and therefore may have some rendering errors.`);let O=a.encode(A),k=[];for(let P=0;PC.id)))}}let c=Object.fromEntries(Object.entries(l.glyphDependencies).map(([A,E])=>[A,Object.fromEntries(Object.entries(E).map(([O,k])=>[O,Object.keys(k)]))]));for(let A of this.inFlightDependencies)A==null||A.abort();this.inFlightDependencies=[];let h=Promise.resolve({});if(Object.keys(c).length){let A=new AbortController;this.inFlightDependencies.push(A),h=i.sendAsync({type:\"GG\",data:{stacks:c,source:this.source,tileID:this.tileID,type:\"glyphs\"}},A)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let A=new AbortController;this.inFlightDependencies.push(A),f=i.sendAsync({type:\"GI\",data:{icons:p,source:this.source,tileID:this.tileID,type:\"icons\"}},A)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let A=new AbortController;this.inFlightDependencies.push(A),y=i.sendAsync({type:\"GI\",data:{icons:d,source:this.source,tileID:this.tileID,type:\"patterns\"}},A)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let A=new AbortController;this.inFlightDependencies.push(A),g=i.sendAsync({type:\"GDA\",data:{dashes:m}},A)}let[x,v,b,w]=yield Promise.all([h,f,y,g]),D=new J0(x),_=new Z1(v,b);for(let A in o){let E=o[A];E.hasDependencies&&(Bf(E.layers,this.zoom,r),E.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:D.positions,iconMap:v,iconPositions:_.iconPositions,patternMap:b,patternPositions:_.patternPositions,dashPositions:w,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(A=>!A.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:D.image,imageAtlas:_,dashPositions:w,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?D.positions:null}})}};function Bf(t,e,r){let i=new ct(e);for(let n of t)n.recalculate(i,r)}var tm=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e!=null&&e.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},LD=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}},em=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},OD=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new F(e.x,e.y)))}},VD=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},RD=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function $D(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l0&&o.addLayer(h)}let l={vectorTile:o,rawData:g0(o).buffer};return this.overzoomedTileResultCache.set(a,l),l}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error(\"Should not be trying to reload a tile that was never loaded or has been removed\");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(t.tileID.wrap),yield this._parseWorkerTile(r,t)})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}},jD=class{constructor(){this.loaded={}}loadTile(t){return rt(this,null,function*(){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,c=new c1(e,pu(i)?new le({width:l,height:u},yield jm(i,-2,-2,l,u)):i,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=c,c})}removeTile(t){let e=this.loaded,r=t.uid;e!=null&&e[r]&&delete e[r]}},zf=class{constructor(t){this.wraps=!1,this._crs=t,this._originX=t.tileMatrixSet.origin[0],this._originY=t.tileMatrixSet.origin[1],this._extent=t.tileMatrixSet.extentAtZoom0}get name(){return this._crs.name}get tileMatrixSet(){return this._crs.tileMatrixSet}worldFromLngLat(t,e,r){let[i,n]=this._crs.projection.forward([t,e]);return new be((i-this._originX)/this._extent,(this._originY-n)/this._extent,r===void 0?0:r/this._extent)}lngLatFromWorld(t,e){var a,s,o;let r=Kt(t,0,1),i=Kt(e,0,1),n=(o=(s=(a=this._inverse(t,e))!=null?a:this._inverse(r,i))!=null?s:this._inverseTowardCenter(r,i))!=null?o:this._finiteInverse(r,i);if(!n)throw Error(`The inverse of the projection \"${this._crs.name}\" has no answer inside its tile matrix set.`);return new gt(n[0],Kt(n[1],-90,90))}hasLngLat(t,e){let r=this._inverse(t,e);return r!==null&&Math.abs(r[1])<=90}_inverse(t,e){let r=this._finiteInverse(t,e);if(!r)return null;let i=this._originX+t*this._extent,n=this._originY-e*this._extent,[a,s]=this._crs.projection.forward(r);return Math.hypot(a-i,s-n)<=.001*this._extent?r:null}_finiteInverse(t,e){let r;try{r=this._crs.projection.inverse([this._originX+t*this._extent,this._originY-e*this._extent])}catch(i){return null}return r&&Number.isFinite(r[0])&&Number.isFinite(r[1])?r:null}_inverseTowardCenter(t,e){let r=0,i=1;for(let n=0;n<30;n++){let a=(r+i)/2;this._inverse(.5+(t-.5)*a,.5+(e-.5)*a)?r=a:i=a}return this._inverse(.5+(t-.5)*r,.5+(e-.5)*r)}metersPerWorldUnit(t,e){return this._extent}worldZFromAltitude(t,e){return t/this._extent}get latitudeRange(){var t;return(t=this._latitudeRange)!=null||(this._latitudeRange=[this._findLatitudeLimit(-90),this._findLatitudeLimit(90)]),this._latitudeRange}_findLatitudeLimit(t){let e=this.lngLatFromWorld(.5,.5),r=10*this._meridianStretch(e.lng,e.lat);if(!(r>0))return t;let i=Math.sign(t-e.lat);for(let n=e.lat;Math.abs(t-n)>1;n+=i)if(!(this._meridianStretch(e.lng,n+i)<=r))return n;return t}_meridianStretch(t,e){let[r,i]=this._crs.projection.forward([t,e]),[n,a]=this._crs.projection.forward([t,e>=0?e-.01:e+.01]);return Math.hypot(n-r,a-i)}},UD=class{forward(t){return[t[0],t[1]]}inverse(t){return[t[0],t[1]]}},qD=new class{constructor(){this.name=\"identity\",this.projection=new UD,this.tileMatrixSet={origin:[-90,90],extentAtZoom0:180}}},su=null,Ra=new Map;function GD(t){su=t,Ra.clear()}function XD(t){if(!t.definition)return new zf(qD);if(!su)Ot(\"GeoJSON sources are drawn in the wrong place: no projection handler is set in the workers, see `setProjectionHandler` in the custom CRS guide.\");else return Ra.has(t.definition)||Ra.set(t.definition,su(t.definition)),new zf({name:t.name,definition:t.definition,projection:Ra.get(t.definition),tileMatrixSet:t.tileMatrixSet})}function ou(t,e){let r=([s,o,...l])=>{let{x:u,y:c}=e.worldFromLngLat(s,o);return[u,c,...l]},[i,n]=e.latitudeRange;if(i===-90&&n===90)return xi(t,r);let a=s=>s===i&&i>-90||s===n&&n<90;return xi(t,r,s=>{let o=!1,l=s.map(p=>p[1]>=i&&p[1]<=n?r(p):(o=!0,p));if(!o)return l;let u=[],c=0,h=NaN;for(let p=0;p{let a=e.lngLatFromWorld(r,i);return[a.lng,a.lat,...n]})}function WD(t,e){let r=Y({},t);return t.add&&(r.add=t.add.map(i=>ou(i,e))),t.update&&(r.update=t.update.map(i=>i.newGeometry?lt(Y({},i),{newGeometry:ou(i.newGeometry,e)}):i)),r}function xi(t,e,r=i=>i.map(e)){if(!t||typeof t!=\"object\")return t;switch(t.type){case\"FeatureCollection\":return lt(Y({},t),{features:t.features.map(i=>xi(i,e,r))});case\"Feature\":return lt(Y({},t),{geometry:t.geometry?xi(t.geometry,e,r):t.geometry});case\"GeometryCollection\":return lt(Y({},t),{geometries:t.geometries.map(i=>xi(i,e,r))});case\"Point\":return lt(Y({},t),{coordinates:e(t.coordinates)});case\"MultiPoint\":return lt(Y({},t),{coordinates:t.coordinates.map(e)});case\"LineString\":return lt(Y({},t),{coordinates:r(t.coordinates)});case\"MultiLineString\":case\"Polygon\":return lt(Y({},t),{coordinates:t.coordinates.map(i=>r(i))});case\"MultiPolygon\":return lt(Y({},t),{coordinates:t.coordinates.map(i=>i.map(n=>r(n)))});default:return t}}var ZD=class{constructor(t,e,r,i=HD){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new tm,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error(\"Unable to parse the data into a cluster or geojson\");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new X5(n.features,{version:2,extent:it});return{vectorTile:a,rawData:g0(a,\"__$json__:\").buffer}}loadTile(t){return rt(this,null,function*(){let{uid:e}=t,r=new Q0(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),yield this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}})}_parseWorkerTile(t,e){return rt(this,null,function*(){let r=this.tileState.getParsing(t.uid),i=yield t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=Y({rawTileData:n.slice(0),encoding:\"mvt\"},i),this.tileState.removeParsing(t.uid)}return i})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}loadData(t){return rt(this,null,function*(){var r;(r=this._pendingRequest)==null||r.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let i={};return t.request&&(i.data=t.data),this._finishRequestTiming(e,t,i),i}catch(i){if(delete this._pendingRequest,!qf(i))throw i;return{abandoned:!0}}})}_startRequestTiming(t){var e;if((e=t.request)!=null&&e.collectResourceTiming)return new em(t.request.url)}_finishRequestTiming(t,e,r){let i=t==null?void 0:t.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return yield this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,r.tileID=r.tileID.unwrapTo(t.tileID.wrap),yield this._parseWorkerTile(r,t)})}loadAndProcessGeoJSON(t,e){return rt(this,null,function*(){var r;if(t.request&&(t.data=(yield h2(t.request,e)).data),this._crsHelper=t.crs?XD(t.crs):void 0,t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source);let i=this._crsHelper?ou(t.data,this._crsHelper):t.data;this._geoJSONIndex=this._createGeoJSONIndex(i,t,this._crsHelper!==void 0)}else{if(t.dataDiff){(r=this._geoJSONIndex)!=null||(this._geoJSONIndex=this._createGeoJSONIndex({type:\"FeatureCollection\",features:[]},t,this._crsHelper!==void 0));let i=this._crsHelper?WD(t.dataDiff,this._crsHelper):t.dataDiff;this._geoJSONIndex.updateData(i,this._getFilterPredicate(t.filter,t.source))}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,rm(t)),this._geoJSONIndex==null)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}})}_filterGeoJSON(t,e,r){if(t.type!==\"FeatureCollection\")return t;let i=this._getFilterPredicate(e,r);return i?{type:\"FeatureCollection\",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!=\"boolean\"&&!(t!=null&&t.length))return;let r=jr(t,`sources.${e}.filter`,{type:\"boolean\",\"property-type\":\"data-driven\",overridable:!1,transition:!1});if(r.result===\"error\")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(\", \"));return i=>r.value.evaluate({zoom:0},i)}removeSource(t){return rt(this,null,function*(){var e;(e=this._pendingRequest)==null||e.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._toLngLat(this._geoJSONIndex.getClusterChildren(t.clusterId))}getClusterLeaves(t){return this._toLngLat(this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset))}_toLngLat(t){return this._crsHelper?t.map(e=>YD(e,this._crsHelper)):t}};function HD(t,e,r){return new ww(t,lt(Y({},e.geojsonVtOptions),{updateable:!0,clusterOptions:rm(e),coordinates:r?\"unitSquare\":\"lngLat\",wrap:!r}))}function rm({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,c]=e[l],h=jr(c,`sources.${r}.clusterProperties.${l}[1]`),p=jr(typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=h.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let c of o)u[c]=i[c].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let c of o)a.accumulated=l[c],l[c]=n[c].evaluate(a,s)},t.clusterOptions}function KD(t){return rt(this,null,function*(){if(t.endsWith(\".mjs\")){yield import(t);return}let e=yield fetch(t,{credentials:\"same-origin\"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=yield e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:\"text/javascript\"}));try{yield import(i)}finally{URL.revokeObjectURL(i)}}else globalThis.eval(r)})}var JD=class{constructor(t){this.self=t,this.actor=new m2(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.importedScripts=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name \"${e}\" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=s2,this.self.removeProtocol=o2,this.self.registerRTLTextPlugin=e=>{Ci.setMethods(e)},this.self.makeRequest=Lu,this.self.setProjectionHandler=GD,this.actor.registerMessageHandler(\"LDT\",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RDT\",(e,r)=>rt(this,null,function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})),this.actor.registerMessageHandler(\"GCEZ\",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})),this.actor.registerMessageHandler(\"GCC\",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})),this.actor.registerMessageHandler(\"GCL\",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})),this.actor.registerMessageHandler(\"LD\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler(\"LT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler(\"AT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler(\"RMT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler(\"RS\",(e,r)=>rt(this,null,function*(){var n,a;if(!((a=(n=this.workerSources[e])==null?void 0:n[r.type])!=null&&a[r.source]))return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)})),this.actor.registerMessageHandler(\"RM\",e=>rt(this,null,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)})),this.actor.registerMessageHandler(\"SR\",(e,r)=>rt(this,null,function*(){this.referrer=r})),this.actor.registerMessageHandler(\"PI\",()=>rt(this,null,function*(){})),this.actor.registerMessageHandler(\"SRPS\",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler(\"IS\",(e,r)=>this._importScript(r)),this.actor.registerMessageHandler(\"SI\",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler(\"UL\",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))})),this.actor.registerMessageHandler(\"UGS\",(e,r)=>rt(this,null,function*(){let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]})),this.actor.registerMessageHandler(\"SL\",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).replace(r,this._getGlobalState(e))}))}_importScript(t){return rt(this,null,function*(){let e=this.importedScripts.get(t);if(e)return e;let r=KD(t);this.importedScripts.set(t,r);try{yield r}catch(i){throw this.importedScripts.delete(t),i}})}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}_setImages(t,e){return rt(this,null,function*(){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}})}_syncRTLPluginState(t,e){return rt(this,null,function*(){return yield Ci.syncState(e,r=>this._importScript(r))})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new zD),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case\"vector\":this.workerSources[t][e][r]=new ND(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case\"geojson\":this.workerSources[t][e][r]=new ZD(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new jD),this.demWorkerSources[t][e]}};vi(self)&&(self.worker=new JD(self));export{JD as default};\n/*! Bundled license information:\n\nmaplibre-gl/dist/maplibre-gl-worker.mjs:\n (**\n * MapLibre GL JS\n * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.20.0/LICENSE.txt\n *)\n*/\n"; diff --git a/package-lock.json b/package-lock.json index fd5458bce66..c79e1428cea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "d3-geo": "^1.12.1", "d3-geo-projection": "^2.9.0", "d3-hierarchy": "^1.1.9", - "d3-interpolate": "^3.0.1", + "d3-interpolate": "^3.0.2", "d3-time": "^1.1.0", "d3-time-format": "^2.3.0", "fast-isnumeric": "^1.1.4", @@ -35,13 +35,13 @@ "has-hover": "^1.0.1", "has-passive-events": "^1.0.0", "is-mobile": "^5.0.0", - "maplibre-gl": "6.11.2", + "maplibre-gl": "6.20.0", "mouse-event-offset": "^3.0.2", "native-promise-only": "^0.8.1", "parse-svg-path": "^0.2.0", "point-in-polygon": "^1.1.0", "polybooljs": "^1.2.2", - "probe-image-size": "^7.4.0", + "probe-image-size": "^7.5.0", "regl-error2d": "^2.0.12", "regl-line2d": "^3.1.4", "regl-scatter2d": "^3.4.0", @@ -53,13 +53,12 @@ "world-calendars": "^1.0.4" }, "devDependencies": { - "@biomejs/biome": "^2.5.15", + "@biomejs/biome": "^2.6.9", "@plotly/mathjax-v3": "npm:mathjax@^3.2.2", "@plotly/mathjax-v4": "npm:mathjax@^4.1.3", - "@types/node": "^26.6.4", + "@types/node": "^26.6.11", "assert": "^2.1.0", "buffer": "^6.0.3", - "canvas": "^3.2.3", "check-node-version": "^4.2.1", "deep-equal": "^2.2.3", "esbuild": "^0.28.2", @@ -69,12 +68,12 @@ "falafel": "^2.2.5", "fs-extra": "^11.4.1", "fuse.js": "^7.5.0", - "glob": "^13.0.6", + "glob": "^14.0.6", "gzip-size": "^7.0.0", "into-stream": "^9.1.0", "jasmine": "3.5.0", "jasmine-core": "3.5.0", - "jsdom": "^29.1.1", + "jsdom": "^31.0.1", "karma": "^6.4.4", "karma-chrome-launcher": "^3.2.0", "karma-esbuild": "^2.3.0", @@ -83,14 +82,14 @@ "karma-jasmine-spec-tags": "^1.3.0", "karma-spec-reporter": "^0.0.37", "karma-verbose-reporter": "^0.0.8", - "karma-viewport": "1.0.2", + "karma-viewport": "1.0.9", "minify-stream": "^2.1.0", "npm-link-check": "^5.0.1", "pixelmatch": "^7.2.0", "pretty-bytes": "^7.2.0", "read-last-lines": "^1.10.0", "run-series": "^1.1.9", - "sass": "^1.105.1", + "sass": "^1.108.2", "sirv": "^3.0.2", "stream-browserify": "^3.0.0", "true-case-path": "^2.2.1", @@ -102,61 +101,10 @@ "node": ">=22.0.0" } }, - "node_modules/@asamuzakjp/css-color": { - "version": "5.1.11", - "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-5.1.11.tgz", - "integrity": "sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@asamuzakjp/generational-cache": "^1.0.1", - "@csstools/css-calc": "^3.2.0", - "@csstools/css-color-parser": "^4.1.0", - "@csstools/css-parser-algorithms": "^4.0.0", - "@csstools/css-tokenizer": "^4.0.0" - }, - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" - } - }, - "node_modules/@asamuzakjp/dom-selector": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-7.1.1.tgz", - "integrity": "sha512-67RZDnYRc8H/8MLDgQCDE//zoqVFwajkepHZgmXrbwybzXOEwOWGPYGmALYl9J2DOLfFPPs6kKCqmbzV895hTQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@asamuzakjp/generational-cache": "^1.0.1", - "@asamuzakjp/nwsapi": "^2.3.9", - "bidi-js": "^1.0.3", - "css-tree": "^3.2.1", - "is-potential-custom-element-name": "^1.0.1" - }, - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" - } - }, - "node_modules/@asamuzakjp/generational-cache": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@asamuzakjp/generational-cache/-/generational-cache-1.0.1.tgz", - "integrity": "sha512-wajfB8KqzMCN2KGNFdLkReeHncd0AslUSrvHVvvYWuU8ghncRJoA50kT3zP9MVL0+9g4/67H+cdvBskj9THPzg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" - } - }, - "node_modules/@asamuzakjp/nwsapi": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/@asamuzakjp/nwsapi/-/nwsapi-2.3.9.tgz", - "integrity": "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==", - "dev": true, - "license": "MIT" - }, "node_modules/@biomejs/biome": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.15.tgz", - "integrity": "sha512-WZTW4slm/pdkh92K6t/3aEN++44JD1PQ7squ7RCMLI1flHGl43DVOIGXvCjHiZgBMO1V4uYxoFNtqrIA4qGuIQ==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.6.9.tgz", + "integrity": "sha512-RelCBDzTXu4DBU8c35P4iMrDO80SUjW0OgjDA7CT1z3UcCU5IclWTZ2XnMelI4frQL//xg2K2BQxAhcOKxdPQA==", "dev": true, "license": "MIT OR Apache-2.0", "bin": { @@ -170,20 +118,56 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "2.5.15", - "@biomejs/cli-darwin-x64": "2.5.15", - "@biomejs/cli-linux-arm64": "2.5.15", - "@biomejs/cli-linux-arm64-musl": "2.5.15", - "@biomejs/cli-linux-x64": "2.5.15", - "@biomejs/cli-linux-x64-musl": "2.5.15", - "@biomejs/cli-win32-arm64": "2.5.15", - "@biomejs/cli-win32-x64": "2.5.15" + "@biomejs/cli-android-arm64": "2.6.9", + "@biomejs/cli-android-x64": "2.6.9", + "@biomejs/cli-darwin-arm64": "2.6.9", + "@biomejs/cli-darwin-x64": "2.6.9", + "@biomejs/cli-linux-arm64": "2.6.9", + "@biomejs/cli-linux-arm64-musl": "2.6.9", + "@biomejs/cli-linux-x64": "2.6.9", + "@biomejs/cli-linux-x64-musl": "2.6.9", + "@biomejs/cli-win32-arm64": "2.6.9", + "@biomejs/cli-win32-x64": "2.6.9" + } + }, + "node_modules/@biomejs/cli-android-arm64": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-android-arm64/-/cli-android-arm64-2.6.9.tgz", + "integrity": "sha512-/3Aj5aiG+Iz8yDBJJb/GFDsptr9ONk3n1wZUIERuU+pVXMIslBaOnrTYJI5QVVXZ9jE494myQHiIvFrjQCBYeQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-android-x64": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-android-x64/-/cli-android-x64-2.6.9.tgz", + "integrity": "sha512-erjbUpD9KJhzTsGHY9oStJ1bSiUJ1ikUXgdr0iOFoIAMiKqW+GdVdEqAlEyqiZA6CBiFqf2fV+g0AVl3hYOuYg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=14.21.3" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.15.tgz", - "integrity": "sha512-BZVzFhJ/mUvTLMYbc9x6el0o2Uv5zP7bACYyhFb6fSc1giroXm7PL0a5KqMJ9F+/BnkYRjagD/ROSDVOZ6eapg==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.6.9.tgz", + "integrity": "sha512-fO67s0SF+lKGhNPQ7jUXiz0yXGl/1Qm3XTIn/4Hd2Z2z3ewQMrotWIMVdIPxZAgLJdQtRLBOzgsTRzTl981yWA==", "cpu": [ "arm64" ], @@ -198,9 +182,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.15.tgz", - "integrity": "sha512-V5Kw63V+fVGNFhFrizDxMbGXAzZCh8kYzJpy3GI6gTapWDg7bZK9oYC9CbVgQSEdTnupz0U5Efz8Ev+5vdBBXw==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.6.9.tgz", + "integrity": "sha512-RdjT3Z6dLlii0x6EroncTp9jg38FMx2R1aeaaU4BbZ4//3TJ2mA2R39KMIrZYxHdHXcfv9X2V5hwKkXhg08w/g==", "cpu": [ "x64" ], @@ -215,9 +199,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.15.tgz", - "integrity": "sha512-XaG7P7eeSLYETD3K9grfB0mQmpLQZjygdbsxekWBJAg4am79fGAtRpfRyNnTvXB2fZFNnJZG3nXm7HBat0+VUw==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.6.9.tgz", + "integrity": "sha512-x73OpQSuQLuvNfzXWEjf0mK95NxlJQX4eG/jmuSrGWOz+/jcLUE4N/21yBu3n0X+wa8bJ3NsWNvmNacLnyc2CQ==", "cpu": [ "arm64" ], @@ -232,9 +216,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.15.tgz", - "integrity": "sha512-tGzZUTcJCV7tj5Adh/Gn6nR4MycqA3iohq2LEcrarAgRBkU0h0OKd2UzCRkOsOYOuUGaUJb4YmqRqyy2feGGSw==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.6.9.tgz", + "integrity": "sha512-qoG0R5MhJ8VFozVFZQC42V3qCI1TInDhL/YcPPg0oTzfv3vuh0ZDXj+2nNahq8gboHUMv7MWpGjRDLhpQatJ+A==", "cpu": [ "arm64" ], @@ -249,9 +233,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.15.tgz", - "integrity": "sha512-xE4iEW/3LqlYj9GFgGrFsFSH51dEEpUbYWBfeOv0q87WkUDxK2o/HhreSb7qMJqck70RVM6Lg96hgedcAYcOkA==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.6.9.tgz", + "integrity": "sha512-uVrqS0HDjRzFlx88ZpfmlZvJ+xIwTU+110vunzrYvZQ5OqXl/1ugMTNvAs61hejH7jh7iequKJwagRVarrYcSQ==", "cpu": [ "x64" ], @@ -266,9 +250,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.15.tgz", - "integrity": "sha512-IlxUcyxilVGPsE008x13pWdkTbU3nQpP2i9b5UrbOYj6goBkKsRX1XB7yJLcV+O1H9LBchIIm4adOaVLZBX0ZQ==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.6.9.tgz", + "integrity": "sha512-o73Sk1hCbGOFOrDlxtpHGIubnLwMXscT32+ujMwUyq9o0f4onxO7OznzkFgcZGbwKy1R3ohroOkqZDXqj1u29g==", "cpu": [ "x64" ], @@ -283,9 +267,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.15.tgz", - "integrity": "sha512-2kPKzhNlm8C+Ru3GcO0Me2ODkCBLrVOUNuyi84RJyWDVKAA4+Kjj3jMjL938lF6BRfvltC4vB2nPY9SvN51Ovg==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.6.9.tgz", + "integrity": "sha512-4yvNG4nQGJsJA/PTVAt8IBFXvY6hXk4UdjtPlTf4QTMIjH7ysOwBew78bKThkRv1eyRwH2mGLIk4lAZp8tfAdw==", "cpu": [ "arm64" ], @@ -300,9 +284,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "2.5.15", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.15.tgz", - "integrity": "sha512-yAzh4UqEImV6Hcy0zjUqNfJAsUhoD64FBQCdTG8Md/Z2wQeVP/ZmJ3XRYAs1g8J9fjTFyl2fCtc5FB5til47+g==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.6.9.tgz", + "integrity": "sha512-mwarNc4GEg5JknsRaJDyJDFr4kICD7snsGM8yYFOoIHimSU1ekWNbcZ44QDa6/30fUZC9077wbBpXE8fp03aug==", "cpu": [ "x64" ], @@ -316,19 +300,6 @@ "node": ">=14.21.3" } }, - "node_modules/@bramus/specificity": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@bramus/specificity/-/specificity-2.4.2.tgz", - "integrity": "sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "css-tree": "^3.0.0" - }, - "bin": { - "specificity": "bin/cli.js" - } - }, "node_modules/@choojs/findup": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@choojs/findup/-/findup-0.2.1.tgz", @@ -351,146 +322,6 @@ "node": ">=0.1.90" } }, - "node_modules/@csstools/color-helpers": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.1.2.tgz", - "integrity": "sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT-0", - "engines": { - "node": ">=20.19.0" - } - }, - "node_modules/@csstools/css-calc": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.4.3.tgz", - "integrity": "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "engines": { - "node": ">=20.19.0" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^4.0.2", - "@csstools/css-tokenizer": "^4.0.2" - } - }, - "node_modules/@csstools/css-color-parser": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.2.6.tgz", - "integrity": "sha512-iiPQ3iRWwnJkeEn6RIu6SJPr7hYrLz6XZ9s/QZl+2/LI5KQVjpl2fdmDSZKuD4xP6GMmMPgHFFXg6k1Wkz0Trg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "dependencies": { - "@csstools/color-helpers": "^6.1.2", - "@csstools/css-calc": "^3.4.3" - }, - "engines": { - "node": ">=20.19.0" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^4.0.2", - "@csstools/css-tokenizer": "^4.0.2" - } - }, - "node_modules/@csstools/css-parser-algorithms": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.2.tgz", - "integrity": "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "engines": { - "node": ">=20.19.0" - }, - "peerDependencies": { - "@csstools/css-tokenizer": "^4.0.2" - } - }, - "node_modules/@csstools/css-syntax-patches-for-csstree": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.15.tgz", - "integrity": "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT-0", - "peerDependencies": { - "css-tree": "^3.2.1" - }, - "peerDependenciesMeta": { - "css-tree": { - "optional": true - } - } - }, - "node_modules/@csstools/css-tokenizer": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.2.tgz", - "integrity": "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "engines": { - "node": ">=20.19.0" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.28.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", @@ -951,6 +782,13 @@ } } }, + "node_modules/@isaacs/nonrecursive-glob-match": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz", + "integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/@mapbox/jsonlint-lines-primitives": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.3.tgz", @@ -967,9 +805,9 @@ "license": "ISC" }, "node_modules/@mapbox/tiny-sdf": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.2.0.tgz", - "integrity": "sha512-LVL4wgI9YAum5V+LNVQO6QgFBPw7/MIIY4XJPNsPDMrjEwcE+JfKk1LuIl8GnF197ejVdC9QdPaxrx5gfgdGXg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.3.0.tgz", + "integrity": "sha512-gBvcNDBBB66bgQYvnaJ6Jk+VCaMmVq5+IZR2kWPisT88Z8s0kBQt6hfVi8QgRW8Vpg0UWZzBA4ZSyzHHC+VeRA==", "license": "BSD-2-Clause" }, "node_modules/@mapbox/unitbezier": { @@ -990,18 +828,18 @@ } }, "node_modules/@maplibre/geojson-vt": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@maplibre/geojson-vt/-/geojson-vt-6.1.1.tgz", - "integrity": "sha512-FVMOcmSP/yqol45t7StApEyTL5/vmqBCuFhH9n+fFuINenhaX+YgHHIt1yJ86S8kln3uJLcMvmEU2cfn6E2eCQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@maplibre/geojson-vt/-/geojson-vt-7.0.1.tgz", + "integrity": "sha512-xq3+TiG4hZtx9lHjq/oZginEBtJLJTJqRVmEIhPDSznlkl231z/p4foorEqASpD233EHO9+GVnnu6GNA4Pl+YQ==", "license": "ISC", "dependencies": { "kdbush": "^4.1.0" } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "26.4.4", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-26.4.4.tgz", - "integrity": "sha512-hG4RZR4PBd/+6A3ODdZ3AnQRF106ZQk1y3bhwDg8bH/A4Oz2tnRUJVVWs9BZa6gXZ1d3UKe89C+Mm+olGBELvA==", + "version": "26.11.0", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-26.11.0.tgz", + "integrity": "sha512-MQMBqOkmVm7fLLun2l/bwOv9bURkvyEVISo/OYleb9/nsnfjQ6gs29isysARt5FK/k9RFM4SmH4eMTUQGlv0Pw==", "license": "ISC", "dependencies": { "@mapbox/jsonlint-lines-primitives": "^2.0.3", @@ -1027,14 +865,14 @@ } }, "node_modules/@maplibre/vt-pbf": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@maplibre/vt-pbf/-/vt-pbf-4.3.2.tgz", - "integrity": "sha512-j6p0AdjvAR19Z3XaCysle7A4ZSo08tYOzxD0Y9NQylwPAkwJJeYub5b2eVucdeDh7erhv69DahoLOevDRERRUw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@maplibre/vt-pbf/-/vt-pbf-4.3.3.tgz", + "integrity": "sha512-dEe5XUd64RQbxNxy2OzIkJnwNDWjVmSXjCd0A7zLirm7QJ/WWbmtDFIkfsiM4yt1cplqzG6oSivRYeWx1SM1yg==", "license": "MIT", "dependencies": { "@mapbox/point-geometry": "^1.1.0", "@types/geojson": "^7946.0.16", - "pbf": "^5.1.0" + "pbf": "^5.1.2" } }, "node_modules/@mathjax/mathjax-newcm-font": { @@ -1494,13 +1332,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@types/bluebird": { - "version": "3.5.42", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.42.tgz", - "integrity": "sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/cors": { "version": "2.8.19", "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", @@ -1524,20 +1355,20 @@ "license": "MIT" }, "node_modules/@types/karma": { - "version": "1.7.8", - "resolved": "https://registry.npmjs.org/@types/karma/-/karma-1.7.8.tgz", - "integrity": "sha512-/s9ZtTDo52/KuC9DmwjpfBL5XsH9ikOX4c05VUnomIcFvOgxj8iR8qU9SCMD1LE8U97NAPExF78sM9FYEGQT6Q==", + "version": "6.3.9", + "resolved": "https://registry.npmjs.org/@types/karma/-/karma-6.3.9.tgz", + "integrity": "sha512-sjE/MHnoAZAQYAKRXAbjTOiBKyGGErEM725bruRcmDdMa2vp1bjWPhApI7/i564PTyHlzc3vIGXLL6TFIpAxFg==", "dev": true, "license": "MIT", "dependencies": { - "@types/bluebird": "*", - "@types/node": "*" + "@types/node": "*", + "log4js": "^6.4.1" } }, "node_modules/@types/node": { - "version": "26.6.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.4.tgz", - "integrity": "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==", + "version": "26.6.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.11.tgz", + "integrity": "sha512-uUyQ2XLEz+EXh34lmS3GhKrkqn/8FU7KUiKRpk347At2bmnMVWss45yz8b4FG/tUtmV1tV/+TVkITItPROyeeQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2083,6 +1914,33 @@ ], "license": "MIT" }, + "node_modules/bcp-47": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.2.tgz", + "integrity": "sha512-wsv86UuNFuPnVieKLyECTT+CP1WSAHeoIg5P3xu2kA9Z+7fVPoKt7dxzSeEhtJel0AI+NW3fIW3KtTKQKUCngg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/bidi-js": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.1.0.tgz", @@ -2195,9 +2053,9 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.0.tgz", + "integrity": "sha512-aa11Dv491GKnYqxaul3aRJ0szew7yMJMfZPnqD44NjGrZXoj62l41OEDDpdpC4eE2P88vBFfLuSyRhpG91NUvg==", "dev": true, "license": "MIT", "dependencies": { @@ -2311,21 +2169,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/canvas": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/canvas/-/canvas-3.2.3.tgz", - "integrity": "sha512-PzE5nJZPz72YUAfo8oTp0u3fqqY7IzlTubneAihqDYAUcBk7ryeCmBbdJBEdaH0bptSOe2VT2Zwcb3UaFyaSWw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "node-addon-api": "^7.0.0", - "prebuild-install": "^7.1.3" - }, - "engines": { - "node": "^18.12.0 || >= 20.9.0" - } - }, "node_modules/chalk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", @@ -2386,13 +2229,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true, - "license": "ISC" - }, "node_modules/clamp": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz", @@ -2663,20 +2499,6 @@ "integrity": "sha512-1umTtVd/fXS25ftfjB71eASCrYhilmEsvDEI6wG/QplnmlfmVM5HkZ/ZX46DT5K3eblFPgLUHt5BRCb0YXkSFA==", "license": "MIT" }, - "node_modules/css-tree": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz", - "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", - "dev": true, - "license": "MIT", - "dependencies": { - "mdn-data": "2.27.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" - } - }, "node_modules/culori": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/culori/-/culori-4.0.2.tgz", @@ -2801,9 +2623,9 @@ "license": "BSD-3-Clause" }, "node_modules/d3-interpolate": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", - "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.2.tgz", + "integrity": "sha512-IRzGU62DtxhvsnSTWMQIdnoZ6gA+BCWwBon1EJI6SjoN595799b6z/QRBzXfFhE8iupUPp3042yBNo0STPqnzQ==", "license": "ISC", "dependencies": { "d3-color": "1 - 3" @@ -2855,17 +2677,17 @@ "license": "BSD-3-Clause" }, "node_modules/data-urls": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-7.0.0.tgz", - "integrity": "sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-8.0.0.tgz", + "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==", "dev": true, "license": "MIT", "dependencies": { "whatwg-mimetype": "^5.0.0", - "whatwg-url": "^16.0.0" + "whatwg-url": "^17.1.2" }, "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + "node": "^22.14.0 || >=24.0.0" } }, "node_modules/date-format": { @@ -2882,6 +2704,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -2894,22 +2717,6 @@ "dev": true, "license": "MIT" }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-equal": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", @@ -2943,16 +2750,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -3031,6 +2828,7 @@ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "dev": true, "license": "Apache-2.0", + "optional": true, "engines": { "node": ">=8" } @@ -3226,9 +3024,9 @@ } }, "node_modules/entities": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-8.1.0.tgz", - "integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-9.0.0.tgz", + "integrity": "sha512-oJFNDJg3kTPwAD1cNn2+WmUq4wFoo09npc3Ydf1D7ED4smRiWrsKnaLxykrTWgyGEcusc87P5dxlAleol9kpkg==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -3564,16 +3362,6 @@ "node": ">=0.8.x" } }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "dev": true, - "license": "(MIT OR WTFPL)", - "engines": { - "node": ">=6" - } - }, "node_modules/ext": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", @@ -3674,9 +3462,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz", - "integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==", + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.3.tgz", + "integrity": "sha512-toOSoqN6d51Wjf1aOFJYcoVv1aND9rj/CwjLU0Vz40oDuSpWDayCeKe4JpL5NL0WdFvoOOCI3BRo69HahjbR1A==", "dev": true, "funding": [ { @@ -3784,13 +3572,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true, - "license": "MIT" - }, "node_modules/fs-extra": { "version": "11.4.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.1.tgz", @@ -3926,13 +3707,6 @@ "node": ">= 0.4" } }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", - "dev": true, - "license": "MIT" - }, "node_modules/gl-mat4": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gl-mat4/-/gl-mat4-1.2.0.tgz", @@ -3986,15 +3760,15 @@ } }, "node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "version": "14.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-14.0.6.tgz", + "integrity": "sha512-OwXjVP2svY5EyLY75Vek96C8qK43gqrt4xsZ+qSILdnaEiJPXkd62mcfUSNx/TQErQRdu5uM5kF67sfONragKw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "minimatch": "^10.2.2", + "minimatch": "^11.0.5", "minipass": "^7.1.3", - "path-scurry": "^2.0.2" + "path-scurry": "^3.0.0" }, "engines": { "node": "18 || 20 || >=22" @@ -4411,16 +4185,16 @@ } }, "node_modules/html-encoding-sniffer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-6.0.0.tgz", - "integrity": "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-7.0.0.tgz", + "integrity": "sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==", "dev": true, "license": "MIT", "dependencies": { - "@exodus/bytes": "^1.6.0" + "@exodus/bytes": "^1.15.1" }, "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + "node": "^22.13.0 || >=24.0.0" } }, "node_modules/http-errors": { @@ -4527,13 +4301,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true, - "license": "ISC" - }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -4568,6 +4335,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-arguments": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", @@ -4700,6 +4493,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -5133,42 +4937,39 @@ } }, "node_modules/jsdom": { - "version": "29.1.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-29.1.1.tgz", - "integrity": "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q==", + "version": "31.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-31.0.1.tgz", + "integrity": "sha512-CbhJL8ZQg3eKswxSZth4QO9tW0jPIhmR0vtSXQSbKSfWbwIT6hoRc17wdHIVTQ43KI0mdV5iTJr3281IDgVZ5g==", "dev": true, "license": "MIT", "dependencies": { - "@asamuzakjp/css-color": "^5.1.11", - "@asamuzakjp/dom-selector": "^7.1.1", - "@bramus/specificity": "^2.4.2", - "@csstools/css-syntax-patches-for-csstree": "^1.1.3", - "@exodus/bytes": "^1.15.0", - "css-tree": "^3.2.1", - "data-urls": "^7.0.0", + "@exodus/bytes": "^1.16.0", + "bcp-47": "^2.1.2", + "bcp-47-match": "^2.0.3", + "data-urls": "^8.0.0", "decimal.js": "^10.6.0", - "html-encoding-sniffer": "^6.0.0", + "html-encoding-sniffer": "^7.0.0", "is-potential-custom-element-name": "^1.0.1", - "lru-cache": "^11.3.5", - "parse5": "^8.0.1", + "lru-cache": "^11.5.3", + "parse5": "^8.1.0", + "parse5-parser-stream": "^8.1.0", "saxes": "^6.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^6.0.1", - "undici": "^7.25.0", - "w3c-xmlserializer": "^5.0.0", + "tough-cookie": "^6.0.2", + "undici": "^8.12.3", + "w3c-xmlserializer": "^6.0.0", "webidl-conversions": "^8.0.1", "whatwg-mimetype": "^5.0.0", - "whatwg-url": "^16.0.1", + "whatwg-url": "^17.3.0", "xml-name-validator": "^5.0.0" }, "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24.0.0" + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" }, "peerDependencies": { - "canvas": "^3.0.0" + "@napi-rs/canvas": "^1.0.13" }, "peerDependenciesMeta": { - "canvas": { + "@napi-rs/canvas": { "optional": true } } @@ -5346,14 +5147,14 @@ } }, "node_modules/karma-viewport": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/karma-viewport/-/karma-viewport-1.0.2.tgz", - "integrity": "sha512-rvzY9UTVXHPt9QRwawyh1D50qzqtxRsoPe5svgOY5kvV7eigv8e5dcW3RSmPZ6m/3Hx+QwJEMY+kLhCmamKJ6A==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/karma-viewport/-/karma-viewport-1.0.9.tgz", + "integrity": "sha512-E1xVe66vBQtI66TGOtZMzV5nf6BW5tW4TQVUqPK+oakVLdsG/ZUG688tGK0lL1q0t7nfQD1dwLD8Z9Guu/RVdg==", "dev": true, "license": "MIT", "dependencies": { - "@types/karma": "^1.7.3", - "jsonschema": "^1.1.1" + "@types/karma": "^6.3.3", + "jsonschema": "^1.4.0" } }, "node_modules/karma/node_modules/balanced-match": { @@ -5506,29 +5307,30 @@ "license": "Public Domain" }, "node_modules/maplibre-gl": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-6.11.2.tgz", - "integrity": "sha512-Xh06pxoipjX/Ad1sUPGhiNh9go9naCNGZZ1IJm3sIeqK1kYGuMaMDSTIGDQ2igOLfVyukJU7kvEOA089VO7Z7g==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-6.20.0.tgz", + "integrity": "sha512-7manvqXeNoN0mKRzenYDopkb3VW9j7iag45RvopkOVFZ7c+La7CBWtK8eBS5bKrI6NyxqAIxPxIG1PMcotcY1w==", "license": "BSD-3-Clause", "dependencies": { "@mapbox/point-geometry": "^1.1.0", - "@mapbox/tiny-sdf": "^2.2.0", + "@mapbox/tiny-sdf": "^2.3.0", "@mapbox/unitbezier": "^1.0.0", "@mapbox/vector-tile": "^3.0.0", - "@maplibre/geojson-vt": "^6.1.1", - "@maplibre/maplibre-gl-style-spec": "^26.4.4", + "@maplibre/geojson-vt": "^7.0.1", + "@maplibre/maplibre-gl-style-spec": "^26.11.0", "@maplibre/mlt": "^1.3.0", - "@maplibre/vt-pbf": "^4.3.2", + "@maplibre/vt-pbf": "^4.3.3", "@types/geojson": "^7946.0.16", "bidi-js": "^1.1.0", - "earcut": "^3.2.3", + "earcut": "^3.2.4", "gl-matrix": "^3.4.4", "kdbush": "^4.1.0", "murmurhash-js": "^1.0.0", - "pbf": "^5.1.2", + "pbf": "^5.2.0", "potpack": "^2.1.0", "quickselect": "^3.0.0", - "tinyqueue": "^3.0.0" + "tinyqueue": "^3.0.0", + "zustand": "^5.1.0" }, "engines": { "node": ">=16.14.0", @@ -5557,13 +5359,6 @@ "node": ">=0.10.0" } }, - "node_modules/mdn-data": { - "version": "2.27.1", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz", - "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", - "dev": true, - "license": "CC0-1.0" - }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -5610,19 +5405,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/minify-stream": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/minify-stream/-/minify-stream-2.1.0.tgz", @@ -5642,16 +5424,17 @@ } }, "node_modules/minimatch": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", - "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "version": "11.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz", + "integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^5.0.8" + "@isaacs/nonrecursive-glob-match": "^1.1.0", + "brace-expansion": "^5.0.12" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -5689,13 +5472,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", - "dev": true, - "license": "MIT" - }, "node_modules/mouse-event-offset": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/mouse-event-offset/-/mouse-event-offset-3.0.2.tgz", @@ -5716,6 +5492,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, "license": "MIT" }, "node_modules/murmurhash-js": { @@ -5724,13 +5501,6 @@ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", "license": "MIT" }, - "node_modules/napi-build-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", - "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", - "dev": true, - "license": "MIT" - }, "node_modules/native-promise-only": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", @@ -5785,38 +5555,13 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "license": "ISC" }, - "node_modules/node-abi": { - "version": "3.96.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.96.0.tgz", - "integrity": "sha512-rebQ/lz7i0EkoLzUVSrKRzA69zMkwLp95kKMWoMDkkM00Suxz0D7zEQPwRml5fQum24mj7bPvmlgLAmu2JCiYg==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/node-addon-api": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true }, "node_modules/normalize-path": { "version": "3.0.0", @@ -6040,13 +5785,26 @@ "license": "MIT" }, "node_modules/parse5": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.1.tgz", - "integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.1.1.tgz", + "integrity": "sha512-EcR/6WDcU7b2N3vQSxKALCk9lXGtUMQxXio008OEMBE0kavu/7JLfBEeFPzi43nMqVDSbEn3QCK+BMCc9zO//w==", "dev": true, "license": "MIT", "dependencies": { - "entities": "^8.0.0" + "entities": "^9.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-8.1.1.tgz", + "integrity": "sha512-hMcVbbUJcQmP8rURWUdYrT1flRiBiBVjq/RYGguJpDUgIXSqdYKlE0CxthmdMWoSlBAuL5bUBa73g0pttSy7Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse5": "^8.1.1" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" @@ -6090,9 +5848,9 @@ "license": "MIT" }, "node_modules/path-scurry": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", - "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", + "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -6124,12 +5882,12 @@ } }, "node_modules/pbf": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/pbf/-/pbf-5.1.2.tgz", - "integrity": "sha512-mnvGdvOrIvJOBGUEdGkrVXjN8E/VkIJCkf2eS1DH2yv82ORUlLttmDt0rWY38yYZmVwciZwBUvHM20qxBZf40w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-5.2.1.tgz", + "integrity": "sha512-5s6y6g3akGMF98eemb+3QZAWTCUHyox40TJOwcY4M1w40RvoXrfbRUVmY02RlRiEPyE6KVaM0xxfF4+4vjSJTQ==", "license": "BSD-3-Clause", "dependencies": { - "resolve-protobuf-schema": "^2.1.0" + "protocol-buffers-schema": "^3.6.1" }, "bin": { "pbf": "bin/pbf" @@ -6211,34 +5969,6 @@ "integrity": "sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==", "license": "ISC" }, - "node_modules/prebuild-install": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", - "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", - "deprecated": "No longer maintained. Please contact the author of the relevant native addon; alternatives are available.", - "dev": true, - "license": "MIT", - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^2.0.0", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/pretty-bytes": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-7.2.0.tgz", @@ -6253,9 +5983,9 @@ } }, "node_modules/probe-image-size": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.4.0.tgz", - "integrity": "sha512-cdEprVtZxV+awMde9X+4jILBFYh4CARxVrQaMl4wY4YcPWbul9jntXrIW95NInBDyJwcVUP3U0T6yukN8rMBaQ==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.5.0.tgz", + "integrity": "sha512-ietdx4XPgmnzHRZOq1/KtcnsBkL4bRsBe+Szj5Tuq1/KPqDG42OspG1IhJb7vz6Z9pSzhp0J6UPnw6hujJTWoQ==", "funding": [ { "type": "github", @@ -6269,8 +5999,7 @@ "license": "MIT", "dependencies": { "lodash.merge": "^4.6.2", - "needle": "^2.5.2", - "stream-parser": "~0.3.1" + "needle": "^2.5.2" } }, "node_modules/process": { @@ -6295,17 +6024,6 @@ "integrity": "sha512-VG2K63Igkiv9p76tk1lilczEK1cT+kCjKtkdhw1dQZV3k3IXJbd3o6Ho8b9zJZaHSnT2hKe4I+ObmX9w6m5SmQ==", "license": "MIT" }, - "node_modules/pump": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", - "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -6406,22 +6124,6 @@ "node": ">= 0.8" } }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, "node_modules/read-last-lines": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/read-last-lines/-/read-last-lines-1.10.0.tgz", @@ -6608,15 +6310,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-protobuf-schema": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", - "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", - "license": "MIT", - "dependencies": { - "protocol-buffers-schema": "^3.3.1" - } - }, "node_modules/rfdc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", @@ -6785,9 +6478,9 @@ "license": "MIT" }, "node_modules/sass": { - "version": "1.105.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.105.1.tgz", - "integrity": "sha512-1CnAWPyrrnVQzXGB/DUep1vYCKCm1CIBr+YxjjiW6wk9qtzemnGP4qicH56T2F9S4Hjtv/Ne3jDz8JqfdDU4oA==", + "version": "1.108.2", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.108.2.tgz", + "integrity": "sha512-kugK8djotnG9HQRPTOf36asKYlxg8rWWsNLYHOgWDIVOiZQqlRfKBgF4XXM6kfw146kIDMvm57B4GIkvDSyTzA==", "dev": true, "license": "MIT", "dependencies": { @@ -7000,53 +6693,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, "node_modules/sirv": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", @@ -7263,15 +6909,6 @@ "readable-stream": "^3.5.0" } }, - "node_modules/stream-parser": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", - "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", - "license": "MIT", - "dependencies": { - "debug": "2" - } - }, "node_modules/stream-shift": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", @@ -7400,16 +7037,6 @@ "node": ">=8" } }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strongly-connected-components": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strongly-connected-components/-/strongly-connected-components-1.0.1.tgz", @@ -7483,80 +7110,6 @@ "integrity": "sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==", "license": "MIT" }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true, - "license": "MIT" - }, - "node_modules/tar-fs": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.5.tgz", - "integrity": "sha512-OboTd8mmMhZDNPV+UjQcK9yKAatXu2aJ+r1w4im1Otd4M4fl2hwvdoXUxIYHFTHWK/3y3FarBP70v3vwmGlOxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tar-stream/node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/tar-stream/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/terser": { "version": "4.8.1", "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", @@ -7733,16 +7286,16 @@ } }, "node_modules/tr46": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-6.0.0.tgz", - "integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-7.0.0.tgz", + "integrity": "sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==", "dev": true, "license": "MIT", "dependencies": { "punycode": "^2.3.1" }, "engines": { - "node": ">=20" + "node": "^22.14.0 || >=24.0.0" } }, "node_modules/tr46/node_modules/punycode": { @@ -7787,19 +7340,6 @@ "fsevents": "~2.3.3" } }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, "node_modules/type": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", @@ -7899,13 +7439,13 @@ } }, "node_modules/undici": { - "version": "7.30.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz", - "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-8.13.1.tgz", + "integrity": "sha512-Kt7EaPjh0s93lJH/PmW3d5rhkcpUa6fS3jqZ7+YGxNd9L7Xy/i827xe4C2uhhq+pJebM4tQOl5AgHmW11G5Skg==", "dev": true, "license": "MIT", "engines": { - "node": ">=20.18.1" + "node": ">=22.19.0" } }, "node_modules/undici-types": { @@ -8005,16 +7545,16 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", - "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz", + "integrity": "sha512-4Nsy8K5Tr6SPDH9jhKJOHf7ChDrc1zufZTVSF7x72hwuEXBqxqk9G6cK+K2NRUtB3iELRJqjXb4JPDMBjMTl2Q==", "dev": true, "license": "MIT", "dependencies": { "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=18" + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" } }, "node_modules/weak-map": { @@ -8053,18 +7593,18 @@ } }, "node_modules/whatwg-url": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-16.0.1.tgz", - "integrity": "sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==", + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-17.3.0.tgz", + "integrity": "sha512-KwOAJrpf+GTgBvcBQJcP38sMF0DsQKdwtG+TxM2pW44P6E5k0hDbWrDmyuJDIF0Uef0aQq0ZoJs+5oI+k8ddhg==", "dev": true, "license": "MIT", "dependencies": { - "@exodus/bytes": "^1.11.0", - "tr46": "^6.0.0", + "@exodus/bytes": "^1.16.0", + "tr46": "^7.0.0", "webidl-conversions": "^8.0.1" }, "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + "node": "^22.14.0 || >=24.0.0" } }, "node_modules/which": { @@ -8260,6 +7800,35 @@ "engines": { "node": ">=10" } + }, + "node_modules/zustand": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.1.0.tgz", + "integrity": "sha512-ciJZlP48M1PTQbVQq81CGVFxHTLpZNrFjKqwjtCU34AWuXTZT/jrF3p9+fI84Cf1eSCMLapxqBy/SNTfwOBuqA==", + "license": "MIT", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=18.0.0", + "immer": ">=9.0.6", + "react": ">=18.0.0", + "use-sync-external-store": ">=1.2.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + }, + "use-sync-external-store": { + "optional": true + } + } } } } diff --git a/package.json b/package.json index 68965f2b9cf..af20f6a42f6 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "d3-geo": "^1.12.1", "d3-geo-projection": "^2.9.0", "d3-hierarchy": "^1.1.9", - "d3-interpolate": "^3.0.1", + "d3-interpolate": "^3.0.2", "d3-time": "^1.1.0", "d3-time-format": "^2.3.0", "fast-isnumeric": "^1.1.4", @@ -109,13 +109,13 @@ "has-hover": "^1.0.1", "has-passive-events": "^1.0.0", "is-mobile": "^5.0.0", - "maplibre-gl": "6.11.2", + "maplibre-gl": "6.20.0", "mouse-event-offset": "^3.0.2", "native-promise-only": "^0.8.1", "parse-svg-path": "^0.2.0", "point-in-polygon": "^1.1.0", "polybooljs": "^1.2.2", - "probe-image-size": "^7.4.0", + "probe-image-size": "^7.5.0", "regl-error2d": "^2.0.12", "regl-line2d": "^3.1.4", "regl-scatter2d": "^3.4.0", @@ -127,13 +127,12 @@ "world-calendars": "^1.0.4" }, "devDependencies": { - "@biomejs/biome": "^2.5.15", + "@biomejs/biome": "^2.6.9", "@plotly/mathjax-v3": "npm:mathjax@^3.2.2", "@plotly/mathjax-v4": "npm:mathjax@^4.1.3", - "@types/node": "^26.6.4", + "@types/node": "^26.6.11", "assert": "^2.1.0", "buffer": "^6.0.3", - "canvas": "^3.2.3", "check-node-version": "^4.2.1", "deep-equal": "^2.2.3", "esbuild": "^0.28.2", @@ -143,12 +142,12 @@ "falafel": "^2.2.5", "fs-extra": "^11.4.1", "fuse.js": "^7.5.0", - "glob": "^13.0.6", + "glob": "^14.0.6", "gzip-size": "^7.0.0", "into-stream": "^9.1.0", "jasmine": "3.5.0", "jasmine-core": "3.5.0", - "jsdom": "^29.1.1", + "jsdom": "^31.0.1", "karma": "^6.4.4", "karma-chrome-launcher": "^3.2.0", "karma-esbuild": "^2.3.0", @@ -157,14 +156,14 @@ "karma-jasmine-spec-tags": "^1.3.0", "karma-spec-reporter": "^0.0.37", "karma-verbose-reporter": "^0.0.8", - "karma-viewport": "1.0.2", + "karma-viewport": "1.0.9", "minify-stream": "^2.1.0", "npm-link-check": "^5.0.1", "pixelmatch": "^7.2.0", "pretty-bytes": "^7.2.0", "read-last-lines": "^1.10.0", "run-series": "^1.1.9", - "sass": "^1.105.1", + "sass": "^1.108.2", "sirv": "^3.0.2", "stream-browserify": "^3.0.0", "true-case-path": "^2.2.1", diff --git a/stackgl_modules/package-lock.json b/stackgl_modules/package-lock.json index 14821f3e0a9..0961819ddab 100644 --- a/stackgl_modules/package-lock.json +++ b/stackgl_modules/package-lock.json @@ -4,6 +4,7 @@ "requires": true, "packages": { "": { + "name": "stackgl_modules", "dependencies": { "alpha-shape": "^1.0.0", "box-intersect": "plotly/box-intersect#v1.1.0", @@ -1049,9 +1050,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.7.tgz", - "integrity": "sha512-dOvZVzjdZdz7phd9v6jCbwxrBW3fK6n8Rc0CtdmM4bumzMnxywBYhuph6J819RRw/ku+rLbelwfMunktuzVVHg==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", "dev": true, "funding": [ { diff --git a/stackgl_modules/package.json b/stackgl_modules/package.json index ccaabe9fbd3..a145e05bf6b 100644 --- a/stackgl_modules/package.json +++ b/stackgl_modules/package.json @@ -1,4 +1,5 @@ { + "name": "stackgl_modules", "browserify": { "transform": [ "glslify" diff --git a/tasks/util/plotly_node.mjs b/tasks/util/plotly_node.mjs index 58caf64abff..edaf50b3bc8 100644 --- a/tasks/util/plotly_node.mjs +++ b/tasks/util/plotly_node.mjs @@ -1,6 +1,10 @@ import fs from 'fs'; import { JSDOM } from 'jsdom'; +// When plotly loads, some of its WebGL text dependencies call `canvas.getContext('2d')`. +// jsdom has no canvas backend without the optional `@napi-rs/canvas` package, so `getContext` returns null. +// For each call, jsdom then prints "Not implemented: HTMLCanvasElement's getContext() method". +// These scripts never draw, so the message is harmless. var window = new JSDOM('', { runScripts: 'dangerously' }).window;