aviation-chart 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aviation-chart.umd.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +86 -86
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Y,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],ft):(Y=typeof globalThis<"u"?globalThis:Y||self,ft(Y.AviationChart={},Y.maplibregl))})(this,function(Y,ft){"use strict";var wt,St,At;function kt(o,a){if(!wt)wt=a;else if(!St)St=a;else{var u="var sharedChunk = {}; ("+wt+")(sharedChunk); ("+St+")(sharedChunk);",g={};wt(g),At=a(g),typeof window<"u"&&(At.workerUrl=window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})))}}kt(["exports"],function(o){class a{constructor(e,i){this.start=e,this.end=i,this.points=[],this.append=this.append.bind(this),this.prepend=this.prepend.bind(this)}append(e,i){this.points.push(Math.round(e),Math.round(i))}prepend(e,i){this.points.splice(0,0,Math.round(e),Math.round(i))}lineString(){return this.toArray()}isEmpty(){return this.points.length<2}appendFragment(e){this.points.push(...e.points),this.end=e.end}toArray(){return this.points}}const u=[[],[[[1,2],[0,1]]],[[[2,1],[1,2]]],[[[2,1],[0,1]]],[[[1,0],[2,1]]],[[[1,2],[0,1]],[[1,0],[2,1]]],[[[1,0],[1,2]]],[[[1,0],[0,1]]],[[[0,1],[1,0]]],[[[1,2],[1,0]]],[[[0,1],[1,0]],[[2,1],[1,2]]],[[[2,1],[1,0]]],[[[0,1],[2,1]]],[[[1,2],[2,1]]],[[[0,1],[1,2]]],[]];function g(t,e,i,n){return e=e*2+n[0],i=i*2+n[1],e+i*(t+1)*2}function y(t,e,i){return(e-t)/(i-t)}function x(t,e,i=4096,n=1){if(!t)return{};const r=i/(e.width-1);let l,s,c,m,f,d;const h={},w=new Map,F=new Map;function C(P,I,k){P[0]===0?k(r*(d-1),r*(f-y(c,I,l))):P[0]===2?k(r*d,r*(f-y(m,I,s))):P[1]===0?k(r*(d-y(s,I,l)),r*(f-1)):k(r*(d-y(m,I,c)),r*f)}for(f=1-n;f<e.height+n;f++){s=e.get(0,f-1),m=e.get(0,f);let P=Math.min(s,m),I=Math.max(s,m);for(d=1-n;d<e.width+n;d++){l=s,c=m,s=e.get(d,f-1),m=e.get(d,f);const k=P,V=I;if(P=Math.min(s,m),I=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const yt=Math.min(k,P),xt=Math.max(V,I),X=Math.ceil(yt/t)*t,rt=Math.floor(xt/t)*t;for(let R=X;R<=rt;R+=t){const It=l>R,tt=s>R,st=c>R,vt=m>R;for(const Dt of u[(It?8:0)|(tt?4:0)|(vt?2:0)|(st?1:0)]){let H=w.get(R);H||w.set(R,H=new Map);let ct=F.get(R);ct||F.set(R,ct=new Map);const Lt=Dt[0],Et=Dt[1],gt=g(e.width,d,f,Lt),mt=g(e.width,d,f,Et);let L,Ft;if(L=ct.get(gt))if(ct.delete(gt),Ft=H.get(mt))if(H.delete(mt),L===Ft){if(C(Et,R,L.append),!L.isEmpty()){let at=h[R];at||(h[R]=at=[]),at.push(L.lineString())}}else L.appendFragment(Ft),ct.set(L.end=Ft.end,L);else C(Et,R,L.append),ct.set(L.end=mt,L);else if(L=H.get(mt))H.delete(mt),C(Lt,R,L.prepend),H.set(L.start=gt,L);else{const at=new a(gt,mt);C(Lt,R,at.append),C(Et,R,at.append),H.set(gt,at),ct.set(mt,at)}}}}}for(const[P,I]of w.entries()){let k=null;for(const V of I.values())V.isEmpty()||(k==null&&(k=h[P]||(h[P]=[])),k.push(V.lineString()))}return h}function z(t){const e=Object.entries(t);return e.sort(([i],[n])=>i<n?-1:i>n?1:0),e}function S(t){return z(t).map(([e,i])=>[e,...typeof i=="number"?[i]:i].join("*")).join("~")}function O(t){return Object.fromEntries(t.split("~").map(e=>e.split("*").map(Number)).map(([e,...i])=>[e,i]))}function A({thresholds:t,...e}){return z({thresholds:S(t),...e}).map(([i,n])=>`${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&")}function _(t){return Object.fromEntries(t.replace(/^.*\?/,"").split("&").map(e=>{const i=e.split("=").map(decodeURIComponent),n=i[0];let r=i[1];switch(n){case"thresholds":r=O(r);break;case"extent":case"multiplier":case"overzoom":case"buffer":r=Number(r)}return[n,r]}))}function p(t){return z(t).map(([e,i])=>`${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",")}function b(t,e){const{thresholds:i,...n}=t;let r=[],l=-1/0;return Object.entries(i).forEach(([s,c])=>{const m=Number(s);m<=e&&m>l&&(l=m,r=typeof c=="number"?[c]:c)}),{levels:r,...n}}function v(t){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}function D(t,e){return t.then(({data:i,...n})=>{let r=i;return e&&(r=new Float32Array(i.length),r.set(i)),{...n,data:r,transferrables:[r.buffer]}})}function M(t){return t.then(({arrayBuffer:e})=>{const i=v(e);return{arrayBuffer:i,transferrables:[i]}})}let j=null;function dt(){return j==null&&(j=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),j||!1}let et=null;function Z(){if(et==null&&(et=!1,dt()&&typeof VideoFrame<"u")){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let r=0;r<5*5;r++){const l=r*4;i.fillStyle=`rgb(${l},${l+1},${l+2})`,i.fillRect(r%5,Math.floor(r/5),1,1)}const n=i.getImageData(0,0,5,5).data;for(let r=0;r<5*5*4;r++)if(r%4!==3&&n[r]!==r){et=!0;break}}}return et||!1}function G(t,e,i){let n=()=>{};const r=setTimeout(()=>{n(new Error("timed out")),i==null||i.abort()},t);U(i,()=>{n(new Error("aborted")),clearTimeout(r)});const l=new Promise((s,c)=>{n=c});return Promise.race([l,e.finally(()=>clearTimeout(r))])}function U(t,e){e&&(t==null||t.signal.addEventListener("abort",e))}function B(t){var e;return!!(!((e=t==null?void 0:t.signal)===null||e===void 0)&&e.aborted)}let E=0;class J{constructor(e=100){this.size=()=>this.items.size,this.get=(i,n,r)=>{let l=this.items.get(i);if(l)l.lastUsed=++E,l.waiting++;else{const f=new AbortController,d=n(i,f);l={abortController:f,item:d,lastUsed:++E,waiting:1},this.items.set(i,l),this.prune()}const s=this.items,c=l.item.then(f=>f,f=>(s.delete(i),Promise.reject(f)));let m=!1;return U(r,()=>{var f;l&&l.abortController&&!m&&(m=!0,--l.waiting<=0&&((f=l.abortController)===null||f===void 0||f.abort(),s.delete(i)))}),c},this.clear=()=>this.items.clear(),this.maxSize=e,this.items=new Map}prune(){if(this.items.size>this.maxSize){let e,i=1/0;this.items.forEach((n,r)=>{n.lastUsed<i&&(i=n.lastUsed,e=r)}),typeof e<"u"&&this.items.delete(e)}}}let K,it,N,ot;async function lt(t,e,i){const n=await createImageBitmap(t);return B(i)?null:W(n,e)}function W(t,e){return K||(K=new OffscreenCanvas(t.width,t.height),it=K.getContext("2d",{willReadFrequently:!0})),$t(t,e,K,it)}async function bt(t,e,i){var n,r,l;const s=await createImageBitmap(t);if(B(i))return null;const c=new VideoFrame(s,{timestamp:0});try{if(!(((n=c==null?void 0:c.format)===null||n===void 0?void 0:n.startsWith("BGR"))||((r=c==null?void 0:c.format)===null||r===void 0?void 0:r.startsWith("RGB"))))throw new Error(`Unrecognized format: ${c==null?void 0:c.format}`);const f=(l=c==null?void 0:c.format)===null||l===void 0?void 0:l.startsWith("BGR"),d=c.allocationSize(),h=new Uint8ClampedArray(d);if(await c.copyTo(h),f)for(let w=0;w<h.length;w+=4){const F=h[w];h[w]=h[w+2],h[w+2]=F}return Ct(s.width,s.height,e,h)}catch{return B(i)?null:W(s,e)}finally{c.close()}}async function we(t,e,i){N||(N=document.createElement("canvas"),ot=N.getContext("2d",{willReadFrequently:!0}));const n=new Image;U(i,()=>n.src="");const r=await new Promise((l,s)=>{n.onload=()=>{B(i)||l(n),URL.revokeObjectURL(n.src),n.onload=null},n.onerror=()=>s(new Error("Could not load image.")),n.src=t.size?URL.createObjectURL(t):""});return $t(r,e,N,ot)}function _e(t,e,i){return self.actor.send("decodeImage",[],i,void 0,t,e)}function be(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const jt=Z()?bt:dt()?lt:be()?_e:we;function $t(t,e,i,n){if(i.width=t.width,i.height=t.height,!n)throw new Error("failed to get context");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height).data;return Ct(t.width,t.height,e,r)}function Ct(t,e,i,n){const r=i==="mapbox"?(s,c,m)=>-1e4+(s*256*256+c*256+m)*.1:(s,c,m)=>s*256+c+m/256-32768,l=new Float32Array(t*e);for(let s=0;s<n.length;s+=4)l[s/4]=r(n[s],n[s+1],n[s+2]);return{width:t,height:e,data:l}}const ze=-12e3,Te=9e3;function ve(t){return!isNaN(t)&&t>=ze&&t<=Te}class ${constructor(e,i,n){this.split=(r,l,s)=>{if(r===0)return this;const c=1<<r,m=l*this.width/c,f=s*this.height/c;return new $(this.width/c,this.height/c,(d,h)=>this.get(d+m,h+f))},this.subsamplePixelCenters=r=>{const l=(m,f,d)=>isNaN(m)?f:isNaN(f)?m:m+(f-m)*d;if(r<=1)return this;const s=.5-1/(2*r),c=(m,f)=>{const d=m/r-s,h=f/r-s,w=Math.floor(d),F=Math.floor(h),C=this.get(w,F),P=this.get(w+1,F),I=this.get(w,F+1),k=this.get(w+1,F+1),V=d-w,yt=h-F,xt=l(C,P,V),X=l(I,k,V);return l(xt,X,yt)};return new $(this.width*r,this.height*r,c)},this.averagePixelCentersToGrid=(r=1)=>new $(this.width+1,this.height+1,(l,s)=>{let c=0,m=0,f=0;for(let d=l-r;d<l+r;d++)for(let h=s-r;h<s+r;h++)isNaN(f=this.get(d,h))||(m++,c+=f);return m===0?NaN:c/m}),this.scaleElevation=r=>r===1?this:new $(this.width,this.height,(l,s)=>this.get(l,s)*r),this.materialize=(r=2)=>{const l=this.width+2*r,s=new Float32Array(l*(this.height+2*r));let c=0;for(let m=-r;m<this.height+r;m++)for(let f=-r;f<this.width+r;f++)s[c++]=this.get(f,m);return new $(this.width,this.height,(m,f)=>s[(f+r)*l+m+r])},this.get=n,this.width=e,this.height=i}static fromRawDem(e){return new $(e.width,e.height,(i,n)=>{const r=e.data[n*e.width+i];return ve(r)?r:NaN})}static combineNeighbors(e){if(e.length!==9)throw new Error("Must include a tile plus 8 neighbors");const i=e[4];if(!i)return;const n=i.width,r=i.height;return new $(n,r,(l,s)=>{let c=0;s<0?s+=r:s<r?c+=3:(s-=r,c+=6),l<0?l+=n:l<n?c+=1:(l-=n,c+=2);const m=e[c];return m?m.get(l,s):NaN})}}function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pt={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Pt.read=function(t,e,i,n,r){var l,s,c=r*8-n-1,m=(1<<c)-1,f=m>>1,d=-7,h=i?r-1:0,w=i?-1:1,F=t[e+h];for(h+=w,l=F&(1<<-d)-1,F>>=-d,d+=c;d>0;l=l*256+t[e+h],h+=w,d-=8);for(s=l&(1<<-d)-1,l>>=-d,d+=n;d>0;s=s*256+t[e+h],h+=w,d-=8);if(l===0)l=1-f;else{if(l===m)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,n),l=l-f}return(F?-1:1)*s*Math.pow(2,l-n)},Pt.write=function(t,e,i,n,r,l){var s,c,m,f=l*8-r-1,d=(1<<f)-1,h=d>>1,w=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:l-1,C=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+h>=1?e+=w/m:e+=w*Math.pow(2,1-h),e*m>=2&&(s++,m/=2),s+h>=d?(c=0,s=d):s+h>=1?(c=(e*m-1)*Math.pow(2,r),s=s+h):(c=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+F]=c&255,F+=C,c/=256,r-=8);for(s=s<<r|c,f+=r;f>0;t[i+F]=s&255,F+=C,s/=256,f-=8);t[i+F-C]|=P*128};var Ee=T,zt=Pt;function T(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}T.Varint=0,T.Fixed64=1,T.Bytes=2,T.Fixed32=5;var Ot=65536*65536,Yt=1/Ot,Fe=12,Kt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");T.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,l=this.pos;this.type=n&7,t(r,e,this),this.pos===l&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Tt(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Zt(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Tt(this.buf,this.pos)+Tt(this.buf,this.pos+4)*Ot;return this.pos+=8,t},readSFixed64:function(){var t=Tt(this.buf,this.pos)+Zt(this.buf,this.pos+4)*Ot;return this.pos+=8,t},readFloat:function(){var t=zt.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=zt.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,i,n;return n=e[this.pos++],i=n&127,n<128||(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,Se(i,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Fe&&Kt?Ve(this.buf,e,t):Ne(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==T.Bytes)return t.push(this.readVarint(e));var i=Q(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==T.Bytes)return t.push(this.readSVarint());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==T.Bytes)return t.push(this.readBoolean());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==T.Bytes)return t.push(this.readFloat());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==T.Bytes)return t.push(this.readDouble());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==T.Bytes)return t.push(this.readFixed32());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==T.Bytes)return t.push(this.readSFixed32());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==T.Bytes)return t.push(this.readFixed64());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==T.Bytes)return t.push(this.readSFixed64());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===T.Varint)for(;this.buf[this.pos++]>127;);else if(e===T.Bytes)this.pos=this.readVarint()+this.pos;else if(e===T.Fixed32)this.pos+=4;else if(e===T.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ut(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ut(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ut(this.buf,t&-1,this.pos),ut(this.buf,Math.floor(t*Yt),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ut(this.buf,t&-1,this.pos),ut(this.buf,Math.floor(t*Yt),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Ae(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:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=Ue(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ht(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),zt.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),zt.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Ht(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,T.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ce,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Pe,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ie,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Oe,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Me,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Le,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ge,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Be,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Xe,e)},writeBytesField:function(t,e){this.writeTag(t,T.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,T.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,T.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,T.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,T.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,T.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,T.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,T.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,T.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,T.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function Se(t,e,i){var n=i.buf,r,l;if(l=n[i.pos++],r=(l&112)>>4,l<128||(l=n[i.pos++],r|=(l&127)<<3,l<128)||(l=n[i.pos++],r|=(l&127)<<10,l<128)||(l=n[i.pos++],r|=(l&127)<<17,l<128)||(l=n[i.pos++],r|=(l&127)<<24,l<128)||(l=n[i.pos++],r|=(l&1)<<31,l<128))return ht(t,r,e);throw new Error("Expected varint not more than 10 bytes")}function Q(t){return t.type===T.Bytes?t.readVarint()+t.pos:t.pos+1}function ht(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Ae(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),i^4294967295?i=i+1|0:(i=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),ke(i,n,e),Re(n,e)}function ke(t,e,i){i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos]=t&127}function Re(t,e){var i=(t&7)<<4;e.buf[e.pos++]|=i|((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 Ht(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Ce(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Pe(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Oe(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Me(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Ie(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Le(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Ge(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Be(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Xe(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Tt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function ut(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Zt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Ne(t,e,i){for(var n="",r=e;r<i;){var l=t[r],s=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;var m,f,d;c===1?l<128&&(s=l):c===2?(m=t[r+1],(m&192)===128&&(s=(l&31)<<6|m&63,s<=127&&(s=null))):c===3?(m=t[r+1],f=t[r+2],(m&192)===128&&(f&192)===128&&(s=(l&15)<<12|(m&63)<<6|f&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):c===4&&(m=t[r+1],f=t[r+2],d=t[r+3],(m&192)===128&&(f&192)===128&&(d&192)===128&&(s=(l&15)<<18|(m&63)<<12|(f&63)<<6|d&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,c=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),r+=c}return n}function Ve(t,e,i){return Kt.decode(t.subarray(e,i))}function Ue(t,e,i){for(var n=0,r,l;n<e.length;n++){if(r=e.charCodeAt(n),r>55295&&r<57344)if(l)if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,l=r;continue}else r=l-55296<<10|r-56320|65536,l=null;else{r>56319||n+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):l=r;continue}else l&&(t[i++]=239,t[i++]=191,t[i++]=189,l=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=r&63|128)}return i}var We=De(Ee),pt;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.POINT=1]="POINT",t[t.LINESTRING=2]="LINESTRING",t[t.POLYGON=3]="POLYGON"})(pt||(pt={}));function je(t){const e=new We;for(const i in t.layers){const n=t.layers[i];n.extent||(n.extent=t.extent),e.writeMessage(3,$e,{...n,id:i})}return e.finish()}function $e(t,e){if(!e)throw new Error("pbf undefined");e.writeVarintField(15,2),e.writeStringField(1,t.id||""),e.writeVarintField(5,t.extent||4096);const i={keys:[],values:[],keycache:{},valuecache:{}};for(const n of t.features)i.feature=n,e.writeMessage(2,Ye,i);for(const n of i.keys)e.writeStringField(3,n);for(const n of i.values)e.writeMessage(4,Ze,n)}function Ye(t,e){const i=t.feature;if(!i||!e)throw new Error;e.writeMessage(2,Ke,t),e.writeVarintField(3,i.type),e.writeMessage(4,He,i)}function Ke(t,e){const i=t.feature;if(!i||!e)throw new Error;const n=t.keys,r=t.values,l=t.keycache,s=t.valuecache;for(const c in i.properties){let m=i.properties[c],f=l[c];if(m===null)continue;typeof f>"u"&&(n.push(c),f=n.length-1,l[c]=f),e.writeVarint(f);const d=typeof m;d!=="string"&&d!=="boolean"&&d!=="number"&&(m=JSON.stringify(m));const h=`${d}:${m}`;let w=s[h];typeof w>"u"&&(r.push(m),w=r.length-1,s[h]=w),e.writeVarint(w)}}function Mt(t,e){return(e<<3)+(t&7)}function Jt(t){return t<<1^t>>31}function He(t,e){if(!e)throw new Error;const i=t.geometry,n=t.type;let r=0,l=0;for(const s of i){let c=1;n===pt.POINT&&(c=s.length/2),e.writeVarint(Mt(1,c));const m=s.length/2,f=n===pt.POLYGON?m-1:m;for(let d=0;d<f;d++){d===1&&n!==1&&e.writeVarint(Mt(2,f-1));const h=s[d*2]-r,w=s[d*2+1]-l;e.writeVarint(Jt(h)),e.writeVarint(Jt(w)),r+=h,l+=w}n===pt.POLYGON&&e.writeVarint(Mt(7,1))}}function Ze(t,e){if(!e)throw new Error;typeof t=="string"?e.writeStringField(1,t):typeof t=="boolean"?e.writeBooleanField(7,t):typeof t=="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class Je{constructor(e,i,n,r,l){this.loaded=Promise.resolve(),this.decodeImage=jt,this.fetchAndParseTile=(s,c,m,f,d)=>{const h=this,w=this.demUrlPattern.replace("{z}",s.toString()).replace("{x}",c.toString()).replace("{y}",m.toString());return d==null||d.useTile(w),this.parsedCache.get(w,async(F,C)=>{const P=await h.fetchTile(s,c,m,C,d);if(B(C))throw new Error("canceled");const I=h.decodeImage(P.data,h.encoding,C),k=d==null?void 0:d.marker("decode"),V=await I;return k==null||k(),V},f)},this.tileCache=new J(i),this.parsedCache=new J(i),this.contourCache=new J(i),this.timeoutMs=l,this.demUrlPattern=e,this.encoding=n,this.maxzoom=r}fetchTile(e,i,n,r,l){const s=this.demUrlPattern.replace("{z}",e.toString()).replace("{x}",i.toString()).replace("{y}",n.toString());return l==null||l.useTile(s),this.tileCache.get(s,(c,m)=>{const f={signal:m.signal};l==null||l.fetchTile(s);const d=l==null?void 0:l.marker("fetch");return G(this.timeoutMs,fetch(s,f).then(async h=>{if(d==null||d(),!h.ok)throw new Error(`Bad response: ${h.status} for ${s}`);return{data:await h.blob(),expires:h.headers.get("expires")||void 0,cacheControl:h.headers.get("cache-control")||void 0}}),m)},r)}async fetchDem(e,i,n,r,l,s){const c=Math.min(e-(r.overzoom||0),this.maxzoom),m=e-c,f=1<<m,d=Math.floor(i/f),h=Math.floor(n/f),w=await this.fetchAndParseTile(c,d,h,l,s);return $.fromRawDem(w).split(m,i%f,n%f)}fetchContourTile(e,i,n,r,l,s){const{levels:c,multiplier:m=1,buffer:f=1,extent:d=4096,contourLayer:h="contours",elevationKey:w="ele",levelKey:F="level",subsampleBelow:C=100}=r;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const P=[e,i,n,p(r)].join("/");return this.contourCache.get(P,async(I,k)=>{const V=1<<e,yt=[];for(let tt=n-1;tt<=n+1;tt++)for(let st=i-1;st<=i+1;st++)yt.push(tt<0||tt>=V?void 0:this.fetchDem(e,(st+V)%V,tt,r,k,s));const xt=await Promise.all(yt);let X=$.combineNeighbors(xt);if(!X||B(k))return{arrayBuffer:new Uint8Array().buffer};const rt=s==null?void 0:s.marker("isoline");if(X.width>=C)X=X.materialize(2);else for(;X.width<C;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const R=x(c[0],X,d,f);rt==null||rt();const It=je({extent:d,layers:{[h]:{features:Object.entries(R).map(([tt,st])=>{const vt=Number(tt);return{type:pt.LINESTRING,geometry:st,properties:{[w]:vt,[F]:Math.max(...c.map((Dt,H)=>vt%Dt===0?H:0))}}})}}});return rt==null||rt(),{arrayBuffer:It.buffer}},l)}}const q=typeof performance<"u"?performance:void 0,Qe=q?q.timeOrigin||new Date().getTime()-q.now():new Date().getTime();function qe(t){var e;return JSON.parse(JSON.stringify(((e=q==null?void 0:q.getEntriesByName)===null||e===void 0?void 0:e.call(q,t))||[]))}function Qt(){return q?q.now():new Date().getTime()}function ti(t){const e=[];for(const i of t)e.push(...i);return e}class qt{constructor(e){this.marks={},this.urls=[],this.fetched=[],this.resources=[],this.tilesFetched=0,this.timeOrigin=Qe,this.finish=i=>{this.markFinish();const n=m=>{const f=this.marks[m]||[],d=Math.max(...f.map(w=>Math.max(...w))),h=Math.min(...f.map(w=>Math.min(...w)));return Number.isFinite(d)?d-h:void 0},r=n("main")||0,l=n("fetch"),s=n("decode"),c=n("isoline");return{url:i,tilesUsed:this.tilesFetched,origin:this.timeOrigin,marks:this.marks,resources:[...this.resources,...ti(this.fetched.map(qe))],duration:r,fetch:l,decode:s,process:c,wait:r-(l||0)-(s||0)-(c||0)}},this.error=i=>({...this.finish(i),error:!0}),this.marker=i=>{var n;this.marks[i]||(this.marks[i]=[]);const r=[Qt()];return(n=this.marks[i])===null||n===void 0||n.push(r),()=>r.push(Qt())},this.useTile=i=>{this.urls.indexOf(i)<0&&(this.urls.push(i),this.tilesFetched++)},this.fetchTile=i=>{this.fetched.indexOf(i)<0&&this.fetched.push(i)},this.addAll=i=>{var n;this.tilesFetched+=i.tilesUsed;const r=i.origin-this.timeOrigin;for(const l in i.marks){const s=l;(this.marks[s]||(this.marks[s]=[])).push(...((n=i.marks[s])===null||n===void 0?void 0:n.map(m=>m.map(f=>f+r)))||[])}this.resources.push(...i.resources.map(l=>ii(l,r)))},this.markFinish=this.marker(e)}}const ei=/(Start$|End$|^start|^end)/;function ii(t,e){const i={};for(const n in t)t[n]!==0&&ei.test(n)?i[n]=Number(t[n])+e:i[n]=t[n];return i}let oi=0;class ri{constructor(e,i,n=2e4){this.callbacks={},this.cancels={},this.dest=e,this.timeoutMs=n,this.dest.onmessage=async({data:r})=>{const l=r;if(l.type==="cancel"){const s=this.cancels[l.id];delete this.cancels[l.id],s==null||s.abort()}else if(l.type==="response"){const s=this.callbacks[l.id];delete this.callbacks[l.id],s&&s(l.error?new Error(l.error):void 0,l.response,l.timings)}else if(l.type==="request"){const s=new qt("worker"),c=i[l.name],m=new AbortController,f=c.apply(c,[...l.args,m,s]),d=`${l.name}_${l.id}`;if(l.id&&f){this.cancels[l.id]=m;try{const h=await f,w=h==null?void 0:h.transferrables;this.postMessage({id:l.id,type:"response",response:h,timings:s.finish(d)},w)}catch(h){this.postMessage({id:l.id,type:"response",error:(h==null?void 0:h.toString())||"error",timings:s.finish(d)})}delete this.cancels[l.id]}}}}postMessage(e,i){this.dest.postMessage(e,i||[])}send(e,i,n,r,...l){const s=++oi,c=new Promise((m,f)=>{this.postMessage({id:s,type:"request",name:e,args:l},i),this.callbacks[s]=(d,h,w)=>{r==null||r.addAll(w),d?f(d):m(h)}});return U(n,()=>{delete this.callbacks[s],this.postMessage({id:s,type:"cancel"})}),G(this.timeoutMs,c,n)}}o.A=ri,o.H=$,o.L=Je,o.T=qt,o.a=_,o.b=x,o.c=Ct,o.d=jt,o.e=A,o.f=M,o.g=b,o.p=D}),kt(["./shared"],function(o){const a=y=>Promise.reject(new Error(`No manager registered for ${y}`));class u{constructor(){this.managers={},this.init=(x,z)=>(this.managers[x.managerId]=new o.L(x.demUrlPattern,x.cacheSize,x.encoding,x.maxzoom,x.timeoutMs),Promise.resolve()),this.fetchTile=(x,z,S,O,A,_)=>{var p;return((p=this.managers[x])===null||p===void 0?void 0:p.fetchTile(z,S,O,A,_))||a(x)},this.fetchAndParseTile=(x,z,S,O,A,_)=>{var p;return o.p(((p=this.managers[x])===null||p===void 0?void 0:p.fetchAndParseTile(z,S,O,A,_))||a(x),!0)},this.fetchContourTile=(x,z,S,O,A,_,p)=>{var b;return o.f(((b=this.managers[x])===null||b===void 0?void 0:b.fetchContourTile(z,S,O,A,_,p))||a(x))}}}const g=typeof self<"u"?self:typeof window<"u"?window:global;g.actor=new o.A(g,new u)}),kt(["./shared"],function(o){const a={workerUrl:""};let u,g=0;class y{constructor(){this.decodeImage=(b,v,D)=>o.p(o.d(b,v,D),!1)}}function x(){if(!u){const p=new Worker(a.workerUrl),b=new y;u=new o.A(p,b)}return u}class z{constructor(b,v,D,M,j,dt){this.fetchTile=(Z,G,U,B,E)=>this.actor.send("fetchTile",[],B,E,this.managerId,Z,G,U),this.fetchAndParseTile=(Z,G,U,B,E)=>this.actor.send("fetchAndParseTile",[],B,E,this.managerId,Z,G,U),this.fetchContourTile=(Z,G,U,B,E,J)=>this.actor.send("fetchContourTile",[],E,J,this.managerId,Z,G,U,B);const et=this.managerId=++g;this.actor=dt||x(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:v,demUrlPattern:b,encoding:D,maxzoom:M,managerId:et,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((b,v)=>{const D=new FileReader;D.onload=M=>{var j;return b((j=M.target)===null||j===void 0?void 0:j.result)},D.onerror=v,D.readAsArrayBuffer(this)})});const S=p=>(b,v)=>{if(v instanceof AbortController)return p(b,v);{const D=new AbortController;return p(b,D).then(M=>v(void 0,M.data,M.cacheControl,M.expires),M=>v(M)),{cancel:()=>D.abort()}}},O=new Set;class A{constructor({url:b,cacheSize:v=100,id:D="dem",encoding:M="terrarium",maxzoom:j=12,worker:dt=!0,timeoutMs:et=1e4,actor:Z}){this.timingCallbacks=[],this.onTiming=E=>{this.timingCallbacks.push(E)},this.setupMaplibre=E=>{E.addProtocol(this.sharedDemProtocolId,this.sharedDemProtocol),E.addProtocol(this.contourProtocolId,this.contourProtocol)},this.sharedDemProtocolV4=async(E,J)=>{const[K,it,N]=this.parseUrl(E.url),ot=new o.T("main");let lt;try{const W=await this.manager.fetchTile(K,it,N,J,ot);return lt=ot.finish(E.url),{data:await W.data.arrayBuffer(),cacheControl:W.cacheControl,expires:W.expires}}catch(W){throw lt=ot.error(E.url),W}finally{this.timingCallbacks.forEach(W=>W(lt))}},this.contourProtocolV4=async(E,J)=>{const K=new o.T("main");let it;try{const[N,ot,lt]=this.parseUrl(E.url),W=o.a(E.url),bt=await this.manager.fetchContourTile(N,ot,lt,o.g(W,N),J,K);return it=K.finish(E.url),{data:bt.arrayBuffer}}catch(N){throw it=K.error(E.url),N}finally{this.timingCallbacks.forEach(N=>N(it))}},this.contourProtocol=S(this.contourProtocolV4),this.sharedDemProtocol=S(this.sharedDemProtocolV4),this.contourProtocolUrl=E=>`${this.contourProtocolUrlBase}?${o.e(E)}`;let G=D,U=1;for(;O.has(G);)G=D+U++;O.add(G),this.sharedDemProtocolId=`${G}-shared`,this.contourProtocolId=`${G}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=dt?z:o.L;this.manager=new B(b,v,M,j,et,Z)}getDemTile(b,v,D,M){return this.manager.fetchAndParseTile(b,v,D,M||new AbortController)}parseUrl(b){const[,v,D,M]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(b)||[];return[Number(v),Number(D),Number(M)]}}return{generateIsolines:o.b,DemSource:A,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){a.workerUrl=p},get workerUrl(){return a.workerUrl}}});var te=At;function ee(o){return o}function ie(o){if(o==null)return ee;var a,u,g=o.scale[0],y=o.scale[1],x=o.translate[0],z=o.translate[1];return function(S,O){O||(a=u=0);var A=2,_=S.length,p=new Array(_);for(p[0]=(a+=S[0])*g+x,p[1]=(u+=S[1])*y+z;A<_;)p[A]=S[A],++A;return p}}function oe(o,a){for(var u,g=o.length,y=g-a;y<--g;)u=o[y],o[y++]=o[g],o[g]=u}function Gt(o,a){return typeof a=="string"&&(a=o.objects[a]),a.type==="GeometryCollection"?{type:"FeatureCollection",features:a.geometries.map(function(u){return Bt(o,u)})}:Bt(o,a)}function Bt(o,a){var u=a.id,g=a.bbox,y=a.properties==null?{}:a.properties,x=re(o,a);return u==null&&g==null?{type:"Feature",properties:y,geometry:x}:g==null?{type:"Feature",id:u,properties:y,geometry:x}:{type:"Feature",id:u,bbox:g,properties:y,geometry:x}}function re(o,a){var u=ie(o.transform),g=o.arcs;function y(_,p){p.length&&p.pop();for(var b=g[_<0?~_:_],v=0,D=b.length;v<D;++v)p.push(u(b[v],v));_<0&&oe(p,D)}function x(_){return u(_)}function z(_){for(var p=[],b=0,v=_.length;b<v;++b)y(_[b],p);return p.length<2&&p.push(p[0]),p}function S(_){for(var p=z(_);p.length<4;)p.push(p[0]);return p}function O(_){return _.map(S)}function A(_){var p=_.type,b;switch(p){case"GeometryCollection":return{type:p,geometries:_.geometries.map(A)};case"Point":b=x(_.coordinates);break;case"MultiPoint":b=_.coordinates.map(x);break;case"LineString":b=z(_.arcs);break;case"MultiLineString":b=_.arcs.map(z);break;case"Polygon":b=O(_.arcs);break;case"MultiPolygon":b=_.arcs.map(O);break;default:return null}return{type:p,coordinates:b}}return A(a)}const ae={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function ne(){const o="navdata",a=ae;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#F7F9FB","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":4,"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.6,8,.4]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#6600cc","text-halo-color":"#ffffff","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.5,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":6,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":"#fc9c02","fill-opacity":["interpolate",["linear"],["zoom"],10,.15,11.5,0]}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":"#f6bf65","line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-letter-spacing":.1,"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,filter:["all",["!=",["get","CODE_TYPE"],"CTA"],["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"fill-color":a.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.035,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1],"line-dasharray":[1,1.4]}},{id:"controlled-label",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-letter-spacing":.2,"text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.controlledStroke}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#E8A020",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-optional":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#3E4759"},`
|
|
1
|
+
(function(Y,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],ft):(Y=typeof globalThis<"u"?globalThis:Y||self,ft(Y.AviationChart={},Y.maplibregl))})(this,function(Y,ft){"use strict";var wt,St,At;function kt(o,a){if(!wt)wt=a;else if(!St)St=a;else{var u="var sharedChunk = {}; ("+wt+")(sharedChunk); ("+St+")(sharedChunk);",g={};wt(g),At=a(g),typeof window<"u"&&(At.workerUrl=window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})))}}kt(["exports"],function(o){class a{constructor(e,i){this.start=e,this.end=i,this.points=[],this.append=this.append.bind(this),this.prepend=this.prepend.bind(this)}append(e,i){this.points.push(Math.round(e),Math.round(i))}prepend(e,i){this.points.splice(0,0,Math.round(e),Math.round(i))}lineString(){return this.toArray()}isEmpty(){return this.points.length<2}appendFragment(e){this.points.push(...e.points),this.end=e.end}toArray(){return this.points}}const u=[[],[[[1,2],[0,1]]],[[[2,1],[1,2]]],[[[2,1],[0,1]]],[[[1,0],[2,1]]],[[[1,2],[0,1]],[[1,0],[2,1]]],[[[1,0],[1,2]]],[[[1,0],[0,1]]],[[[0,1],[1,0]]],[[[1,2],[1,0]]],[[[0,1],[1,0]],[[2,1],[1,2]]],[[[2,1],[1,0]]],[[[0,1],[2,1]]],[[[1,2],[2,1]]],[[[0,1],[1,2]]],[]];function g(t,e,i,n){return e=e*2+n[0],i=i*2+n[1],e+i*(t+1)*2}function y(t,e,i){return(e-t)/(i-t)}function x(t,e,i=4096,n=1){if(!t)return{};const r=i/(e.width-1);let l,s,c,m,f,d;const h={},w=new Map,F=new Map;function C(P,I,k){P[0]===0?k(r*(d-1),r*(f-y(c,I,l))):P[0]===2?k(r*d,r*(f-y(m,I,s))):P[1]===0?k(r*(d-y(s,I,l)),r*(f-1)):k(r*(d-y(m,I,c)),r*f)}for(f=1-n;f<e.height+n;f++){s=e.get(0,f-1),m=e.get(0,f);let P=Math.min(s,m),I=Math.max(s,m);for(d=1-n;d<e.width+n;d++){l=s,c=m,s=e.get(d,f-1),m=e.get(d,f);const k=P,V=I;if(P=Math.min(s,m),I=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const yt=Math.min(k,P),xt=Math.max(V,I),X=Math.ceil(yt/t)*t,rt=Math.floor(xt/t)*t;for(let R=X;R<=rt;R+=t){const It=l>R,tt=s>R,st=c>R,vt=m>R;for(const Dt of u[(It?8:0)|(tt?4:0)|(vt?2:0)|(st?1:0)]){let H=w.get(R);H||w.set(R,H=new Map);let ct=F.get(R);ct||F.set(R,ct=new Map);const Lt=Dt[0],Et=Dt[1],gt=g(e.width,d,f,Lt),mt=g(e.width,d,f,Et);let L,Ft;if(L=ct.get(gt))if(ct.delete(gt),Ft=H.get(mt))if(H.delete(mt),L===Ft){if(C(Et,R,L.append),!L.isEmpty()){let at=h[R];at||(h[R]=at=[]),at.push(L.lineString())}}else L.appendFragment(Ft),ct.set(L.end=Ft.end,L);else C(Et,R,L.append),ct.set(L.end=mt,L);else if(L=H.get(mt))H.delete(mt),C(Lt,R,L.prepend),H.set(L.start=gt,L);else{const at=new a(gt,mt);C(Lt,R,at.append),C(Et,R,at.append),H.set(gt,at),ct.set(mt,at)}}}}}for(const[P,I]of w.entries()){let k=null;for(const V of I.values())V.isEmpty()||(k==null&&(k=h[P]||(h[P]=[])),k.push(V.lineString()))}return h}function z(t){const e=Object.entries(t);return e.sort(([i],[n])=>i<n?-1:i>n?1:0),e}function S(t){return z(t).map(([e,i])=>[e,...typeof i=="number"?[i]:i].join("*")).join("~")}function O(t){return Object.fromEntries(t.split("~").map(e=>e.split("*").map(Number)).map(([e,...i])=>[e,i]))}function A({thresholds:t,...e}){return z({thresholds:S(t),...e}).map(([i,n])=>`${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&")}function _(t){return Object.fromEntries(t.replace(/^.*\?/,"").split("&").map(e=>{const i=e.split("=").map(decodeURIComponent),n=i[0];let r=i[1];switch(n){case"thresholds":r=O(r);break;case"extent":case"multiplier":case"overzoom":case"buffer":r=Number(r)}return[n,r]}))}function p(t){return z(t).map(([e,i])=>`${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",")}function b(t,e){const{thresholds:i,...n}=t;let r=[],l=-1/0;return Object.entries(i).forEach(([s,c])=>{const m=Number(s);m<=e&&m>l&&(l=m,r=typeof c=="number"?[c]:c)}),{levels:r,...n}}function v(t){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}function D(t,e){return t.then(({data:i,...n})=>{let r=i;return e&&(r=new Float32Array(i.length),r.set(i)),{...n,data:r,transferrables:[r.buffer]}})}function M(t){return t.then(({arrayBuffer:e})=>{const i=v(e);return{arrayBuffer:i,transferrables:[i]}})}let j=null;function dt(){return j==null&&(j=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),j||!1}let et=null;function Z(){if(et==null&&(et=!1,dt()&&typeof VideoFrame<"u")){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let r=0;r<5*5;r++){const l=r*4;i.fillStyle=`rgb(${l},${l+1},${l+2})`,i.fillRect(r%5,Math.floor(r/5),1,1)}const n=i.getImageData(0,0,5,5).data;for(let r=0;r<5*5*4;r++)if(r%4!==3&&n[r]!==r){et=!0;break}}}return et||!1}function G(t,e,i){let n=()=>{};const r=setTimeout(()=>{n(new Error("timed out")),i==null||i.abort()},t);U(i,()=>{n(new Error("aborted")),clearTimeout(r)});const l=new Promise((s,c)=>{n=c});return Promise.race([l,e.finally(()=>clearTimeout(r))])}function U(t,e){e&&(t==null||t.signal.addEventListener("abort",e))}function B(t){var e;return!!(!((e=t==null?void 0:t.signal)===null||e===void 0)&&e.aborted)}let E=0;class J{constructor(e=100){this.size=()=>this.items.size,this.get=(i,n,r)=>{let l=this.items.get(i);if(l)l.lastUsed=++E,l.waiting++;else{const f=new AbortController,d=n(i,f);l={abortController:f,item:d,lastUsed:++E,waiting:1},this.items.set(i,l),this.prune()}const s=this.items,c=l.item.then(f=>f,f=>(s.delete(i),Promise.reject(f)));let m=!1;return U(r,()=>{var f;l&&l.abortController&&!m&&(m=!0,--l.waiting<=0&&((f=l.abortController)===null||f===void 0||f.abort(),s.delete(i)))}),c},this.clear=()=>this.items.clear(),this.maxSize=e,this.items=new Map}prune(){if(this.items.size>this.maxSize){let e,i=1/0;this.items.forEach((n,r)=>{n.lastUsed<i&&(i=n.lastUsed,e=r)}),typeof e<"u"&&this.items.delete(e)}}}let K,it,N,ot;async function lt(t,e,i){const n=await createImageBitmap(t);return B(i)?null:W(n,e)}function W(t,e){return K||(K=new OffscreenCanvas(t.width,t.height),it=K.getContext("2d",{willReadFrequently:!0})),$t(t,e,K,it)}async function bt(t,e,i){var n,r,l;const s=await createImageBitmap(t);if(B(i))return null;const c=new VideoFrame(s,{timestamp:0});try{if(!(((n=c==null?void 0:c.format)===null||n===void 0?void 0:n.startsWith("BGR"))||((r=c==null?void 0:c.format)===null||r===void 0?void 0:r.startsWith("RGB"))))throw new Error(`Unrecognized format: ${c==null?void 0:c.format}`);const f=(l=c==null?void 0:c.format)===null||l===void 0?void 0:l.startsWith("BGR"),d=c.allocationSize(),h=new Uint8ClampedArray(d);if(await c.copyTo(h),f)for(let w=0;w<h.length;w+=4){const F=h[w];h[w]=h[w+2],h[w+2]=F}return Ct(s.width,s.height,e,h)}catch{return B(i)?null:W(s,e)}finally{c.close()}}async function we(t,e,i){N||(N=document.createElement("canvas"),ot=N.getContext("2d",{willReadFrequently:!0}));const n=new Image;U(i,()=>n.src="");const r=await new Promise((l,s)=>{n.onload=()=>{B(i)||l(n),URL.revokeObjectURL(n.src),n.onload=null},n.onerror=()=>s(new Error("Could not load image.")),n.src=t.size?URL.createObjectURL(t):""});return $t(r,e,N,ot)}function _e(t,e,i){return self.actor.send("decodeImage",[],i,void 0,t,e)}function be(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const jt=Z()?bt:dt()?lt:be()?_e:we;function $t(t,e,i,n){if(i.width=t.width,i.height=t.height,!n)throw new Error("failed to get context");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height).data;return Ct(t.width,t.height,e,r)}function Ct(t,e,i,n){const r=i==="mapbox"?(s,c,m)=>-1e4+(s*256*256+c*256+m)*.1:(s,c,m)=>s*256+c+m/256-32768,l=new Float32Array(t*e);for(let s=0;s<n.length;s+=4)l[s/4]=r(n[s],n[s+1],n[s+2]);return{width:t,height:e,data:l}}const ze=-12e3,Te=9e3;function ve(t){return!isNaN(t)&&t>=ze&&t<=Te}class ${constructor(e,i,n){this.split=(r,l,s)=>{if(r===0)return this;const c=1<<r,m=l*this.width/c,f=s*this.height/c;return new $(this.width/c,this.height/c,(d,h)=>this.get(d+m,h+f))},this.subsamplePixelCenters=r=>{const l=(m,f,d)=>isNaN(m)?f:isNaN(f)?m:m+(f-m)*d;if(r<=1)return this;const s=.5-1/(2*r),c=(m,f)=>{const d=m/r-s,h=f/r-s,w=Math.floor(d),F=Math.floor(h),C=this.get(w,F),P=this.get(w+1,F),I=this.get(w,F+1),k=this.get(w+1,F+1),V=d-w,yt=h-F,xt=l(C,P,V),X=l(I,k,V);return l(xt,X,yt)};return new $(this.width*r,this.height*r,c)},this.averagePixelCentersToGrid=(r=1)=>new $(this.width+1,this.height+1,(l,s)=>{let c=0,m=0,f=0;for(let d=l-r;d<l+r;d++)for(let h=s-r;h<s+r;h++)isNaN(f=this.get(d,h))||(m++,c+=f);return m===0?NaN:c/m}),this.scaleElevation=r=>r===1?this:new $(this.width,this.height,(l,s)=>this.get(l,s)*r),this.materialize=(r=2)=>{const l=this.width+2*r,s=new Float32Array(l*(this.height+2*r));let c=0;for(let m=-r;m<this.height+r;m++)for(let f=-r;f<this.width+r;f++)s[c++]=this.get(f,m);return new $(this.width,this.height,(m,f)=>s[(f+r)*l+m+r])},this.get=n,this.width=e,this.height=i}static fromRawDem(e){return new $(e.width,e.height,(i,n)=>{const r=e.data[n*e.width+i];return ve(r)?r:NaN})}static combineNeighbors(e){if(e.length!==9)throw new Error("Must include a tile plus 8 neighbors");const i=e[4];if(!i)return;const n=i.width,r=i.height;return new $(n,r,(l,s)=>{let c=0;s<0?s+=r:s<r?c+=3:(s-=r,c+=6),l<0?l+=n:l<n?c+=1:(l-=n,c+=2);const m=e[c];return m?m.get(l,s):NaN})}}function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pt={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Pt.read=function(t,e,i,n,r){var l,s,c=r*8-n-1,m=(1<<c)-1,f=m>>1,d=-7,h=i?r-1:0,w=i?-1:1,F=t[e+h];for(h+=w,l=F&(1<<-d)-1,F>>=-d,d+=c;d>0;l=l*256+t[e+h],h+=w,d-=8);for(s=l&(1<<-d)-1,l>>=-d,d+=n;d>0;s=s*256+t[e+h],h+=w,d-=8);if(l===0)l=1-f;else{if(l===m)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,n),l=l-f}return(F?-1:1)*s*Math.pow(2,l-n)},Pt.write=function(t,e,i,n,r,l){var s,c,m,f=l*8-r-1,d=(1<<f)-1,h=d>>1,w=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:l-1,C=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+h>=1?e+=w/m:e+=w*Math.pow(2,1-h),e*m>=2&&(s++,m/=2),s+h>=d?(c=0,s=d):s+h>=1?(c=(e*m-1)*Math.pow(2,r),s=s+h):(c=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+F]=c&255,F+=C,c/=256,r-=8);for(s=s<<r|c,f+=r;f>0;t[i+F]=s&255,F+=C,s/=256,f-=8);t[i+F-C]|=P*128};var Ee=T,zt=Pt;function T(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}T.Varint=0,T.Fixed64=1,T.Bytes=2,T.Fixed32=5;var Ot=65536*65536,Yt=1/Ot,Fe=12,Kt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");T.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,l=this.pos;this.type=n&7,t(r,e,this),this.pos===l&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Tt(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Zt(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Tt(this.buf,this.pos)+Tt(this.buf,this.pos+4)*Ot;return this.pos+=8,t},readSFixed64:function(){var t=Tt(this.buf,this.pos)+Zt(this.buf,this.pos+4)*Ot;return this.pos+=8,t},readFloat:function(){var t=zt.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=zt.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,i,n;return n=e[this.pos++],i=n&127,n<128||(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,Se(i,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Fe&&Kt?Ve(this.buf,e,t):Ne(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==T.Bytes)return t.push(this.readVarint(e));var i=Q(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==T.Bytes)return t.push(this.readSVarint());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==T.Bytes)return t.push(this.readBoolean());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==T.Bytes)return t.push(this.readFloat());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==T.Bytes)return t.push(this.readDouble());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==T.Bytes)return t.push(this.readFixed32());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==T.Bytes)return t.push(this.readSFixed32());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==T.Bytes)return t.push(this.readFixed64());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==T.Bytes)return t.push(this.readSFixed64());var e=Q(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===T.Varint)for(;this.buf[this.pos++]>127;);else if(e===T.Bytes)this.pos=this.readVarint()+this.pos;else if(e===T.Fixed32)this.pos+=4;else if(e===T.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ut(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ut(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ut(this.buf,t&-1,this.pos),ut(this.buf,Math.floor(t*Yt),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ut(this.buf,t&-1,this.pos),ut(this.buf,Math.floor(t*Yt),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Ae(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:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=Ue(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Ht(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),zt.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),zt.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Ht(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,T.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ce,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Pe,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ie,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Oe,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Me,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Le,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ge,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Be,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Xe,e)},writeBytesField:function(t,e){this.writeTag(t,T.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,T.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,T.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,T.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,T.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,T.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,T.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,T.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,T.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,T.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function Se(t,e,i){var n=i.buf,r,l;if(l=n[i.pos++],r=(l&112)>>4,l<128||(l=n[i.pos++],r|=(l&127)<<3,l<128)||(l=n[i.pos++],r|=(l&127)<<10,l<128)||(l=n[i.pos++],r|=(l&127)<<17,l<128)||(l=n[i.pos++],r|=(l&127)<<24,l<128)||(l=n[i.pos++],r|=(l&1)<<31,l<128))return ht(t,r,e);throw new Error("Expected varint not more than 10 bytes")}function Q(t){return t.type===T.Bytes?t.readVarint()+t.pos:t.pos+1}function ht(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Ae(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),i^4294967295?i=i+1|0:(i=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),ke(i,n,e),Re(n,e)}function ke(t,e,i){i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos]=t&127}function Re(t,e){var i=(t&7)<<4;e.buf[e.pos++]|=i|((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 Ht(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Ce(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Pe(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Oe(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Me(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Ie(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Le(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Ge(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Be(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Xe(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Tt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function ut(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Zt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Ne(t,e,i){for(var n="",r=e;r<i;){var l=t[r],s=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;var m,f,d;c===1?l<128&&(s=l):c===2?(m=t[r+1],(m&192)===128&&(s=(l&31)<<6|m&63,s<=127&&(s=null))):c===3?(m=t[r+1],f=t[r+2],(m&192)===128&&(f&192)===128&&(s=(l&15)<<12|(m&63)<<6|f&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):c===4&&(m=t[r+1],f=t[r+2],d=t[r+3],(m&192)===128&&(f&192)===128&&(d&192)===128&&(s=(l&15)<<18|(m&63)<<12|(f&63)<<6|d&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,c=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),r+=c}return n}function Ve(t,e,i){return Kt.decode(t.subarray(e,i))}function Ue(t,e,i){for(var n=0,r,l;n<e.length;n++){if(r=e.charCodeAt(n),r>55295&&r<57344)if(l)if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,l=r;continue}else r=l-55296<<10|r-56320|65536,l=null;else{r>56319||n+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):l=r;continue}else l&&(t[i++]=239,t[i++]=191,t[i++]=189,l=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=r&63|128)}return i}var We=De(Ee),pt;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.POINT=1]="POINT",t[t.LINESTRING=2]="LINESTRING",t[t.POLYGON=3]="POLYGON"})(pt||(pt={}));function je(t){const e=new We;for(const i in t.layers){const n=t.layers[i];n.extent||(n.extent=t.extent),e.writeMessage(3,$e,{...n,id:i})}return e.finish()}function $e(t,e){if(!e)throw new Error("pbf undefined");e.writeVarintField(15,2),e.writeStringField(1,t.id||""),e.writeVarintField(5,t.extent||4096);const i={keys:[],values:[],keycache:{},valuecache:{}};for(const n of t.features)i.feature=n,e.writeMessage(2,Ye,i);for(const n of i.keys)e.writeStringField(3,n);for(const n of i.values)e.writeMessage(4,Ze,n)}function Ye(t,e){const i=t.feature;if(!i||!e)throw new Error;e.writeMessage(2,Ke,t),e.writeVarintField(3,i.type),e.writeMessage(4,He,i)}function Ke(t,e){const i=t.feature;if(!i||!e)throw new Error;const n=t.keys,r=t.values,l=t.keycache,s=t.valuecache;for(const c in i.properties){let m=i.properties[c],f=l[c];if(m===null)continue;typeof f>"u"&&(n.push(c),f=n.length-1,l[c]=f),e.writeVarint(f);const d=typeof m;d!=="string"&&d!=="boolean"&&d!=="number"&&(m=JSON.stringify(m));const h=`${d}:${m}`;let w=s[h];typeof w>"u"&&(r.push(m),w=r.length-1,s[h]=w),e.writeVarint(w)}}function Mt(t,e){return(e<<3)+(t&7)}function Jt(t){return t<<1^t>>31}function He(t,e){if(!e)throw new Error;const i=t.geometry,n=t.type;let r=0,l=0;for(const s of i){let c=1;n===pt.POINT&&(c=s.length/2),e.writeVarint(Mt(1,c));const m=s.length/2,f=n===pt.POLYGON?m-1:m;for(let d=0;d<f;d++){d===1&&n!==1&&e.writeVarint(Mt(2,f-1));const h=s[d*2]-r,w=s[d*2+1]-l;e.writeVarint(Jt(h)),e.writeVarint(Jt(w)),r+=h,l+=w}n===pt.POLYGON&&e.writeVarint(Mt(7,1))}}function Ze(t,e){if(!e)throw new Error;typeof t=="string"?e.writeStringField(1,t):typeof t=="boolean"?e.writeBooleanField(7,t):typeof t=="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class Je{constructor(e,i,n,r,l){this.loaded=Promise.resolve(),this.decodeImage=jt,this.fetchAndParseTile=(s,c,m,f,d)=>{const h=this,w=this.demUrlPattern.replace("{z}",s.toString()).replace("{x}",c.toString()).replace("{y}",m.toString());return d==null||d.useTile(w),this.parsedCache.get(w,async(F,C)=>{const P=await h.fetchTile(s,c,m,C,d);if(B(C))throw new Error("canceled");const I=h.decodeImage(P.data,h.encoding,C),k=d==null?void 0:d.marker("decode"),V=await I;return k==null||k(),V},f)},this.tileCache=new J(i),this.parsedCache=new J(i),this.contourCache=new J(i),this.timeoutMs=l,this.demUrlPattern=e,this.encoding=n,this.maxzoom=r}fetchTile(e,i,n,r,l){const s=this.demUrlPattern.replace("{z}",e.toString()).replace("{x}",i.toString()).replace("{y}",n.toString());return l==null||l.useTile(s),this.tileCache.get(s,(c,m)=>{const f={signal:m.signal};l==null||l.fetchTile(s);const d=l==null?void 0:l.marker("fetch");return G(this.timeoutMs,fetch(s,f).then(async h=>{if(d==null||d(),!h.ok)throw new Error(`Bad response: ${h.status} for ${s}`);return{data:await h.blob(),expires:h.headers.get("expires")||void 0,cacheControl:h.headers.get("cache-control")||void 0}}),m)},r)}async fetchDem(e,i,n,r,l,s){const c=Math.min(e-(r.overzoom||0),this.maxzoom),m=e-c,f=1<<m,d=Math.floor(i/f),h=Math.floor(n/f),w=await this.fetchAndParseTile(c,d,h,l,s);return $.fromRawDem(w).split(m,i%f,n%f)}fetchContourTile(e,i,n,r,l,s){const{levels:c,multiplier:m=1,buffer:f=1,extent:d=4096,contourLayer:h="contours",elevationKey:w="ele",levelKey:F="level",subsampleBelow:C=100}=r;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const P=[e,i,n,p(r)].join("/");return this.contourCache.get(P,async(I,k)=>{const V=1<<e,yt=[];for(let tt=n-1;tt<=n+1;tt++)for(let st=i-1;st<=i+1;st++)yt.push(tt<0||tt>=V?void 0:this.fetchDem(e,(st+V)%V,tt,r,k,s));const xt=await Promise.all(yt);let X=$.combineNeighbors(xt);if(!X||B(k))return{arrayBuffer:new Uint8Array().buffer};const rt=s==null?void 0:s.marker("isoline");if(X.width>=C)X=X.materialize(2);else for(;X.width<C;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const R=x(c[0],X,d,f);rt==null||rt();const It=je({extent:d,layers:{[h]:{features:Object.entries(R).map(([tt,st])=>{const vt=Number(tt);return{type:pt.LINESTRING,geometry:st,properties:{[w]:vt,[F]:Math.max(...c.map((Dt,H)=>vt%Dt===0?H:0))}}})}}});return rt==null||rt(),{arrayBuffer:It.buffer}},l)}}const q=typeof performance<"u"?performance:void 0,Qe=q?q.timeOrigin||new Date().getTime()-q.now():new Date().getTime();function qe(t){var e;return JSON.parse(JSON.stringify(((e=q==null?void 0:q.getEntriesByName)===null||e===void 0?void 0:e.call(q,t))||[]))}function Qt(){return q?q.now():new Date().getTime()}function ti(t){const e=[];for(const i of t)e.push(...i);return e}class qt{constructor(e){this.marks={},this.urls=[],this.fetched=[],this.resources=[],this.tilesFetched=0,this.timeOrigin=Qe,this.finish=i=>{this.markFinish();const n=m=>{const f=this.marks[m]||[],d=Math.max(...f.map(w=>Math.max(...w))),h=Math.min(...f.map(w=>Math.min(...w)));return Number.isFinite(d)?d-h:void 0},r=n("main")||0,l=n("fetch"),s=n("decode"),c=n("isoline");return{url:i,tilesUsed:this.tilesFetched,origin:this.timeOrigin,marks:this.marks,resources:[...this.resources,...ti(this.fetched.map(qe))],duration:r,fetch:l,decode:s,process:c,wait:r-(l||0)-(s||0)-(c||0)}},this.error=i=>({...this.finish(i),error:!0}),this.marker=i=>{var n;this.marks[i]||(this.marks[i]=[]);const r=[Qt()];return(n=this.marks[i])===null||n===void 0||n.push(r),()=>r.push(Qt())},this.useTile=i=>{this.urls.indexOf(i)<0&&(this.urls.push(i),this.tilesFetched++)},this.fetchTile=i=>{this.fetched.indexOf(i)<0&&this.fetched.push(i)},this.addAll=i=>{var n;this.tilesFetched+=i.tilesUsed;const r=i.origin-this.timeOrigin;for(const l in i.marks){const s=l;(this.marks[s]||(this.marks[s]=[])).push(...((n=i.marks[s])===null||n===void 0?void 0:n.map(m=>m.map(f=>f+r)))||[])}this.resources.push(...i.resources.map(l=>ii(l,r)))},this.markFinish=this.marker(e)}}const ei=/(Start$|End$|^start|^end)/;function ii(t,e){const i={};for(const n in t)t[n]!==0&&ei.test(n)?i[n]=Number(t[n])+e:i[n]=t[n];return i}let oi=0;class ri{constructor(e,i,n=2e4){this.callbacks={},this.cancels={},this.dest=e,this.timeoutMs=n,this.dest.onmessage=async({data:r})=>{const l=r;if(l.type==="cancel"){const s=this.cancels[l.id];delete this.cancels[l.id],s==null||s.abort()}else if(l.type==="response"){const s=this.callbacks[l.id];delete this.callbacks[l.id],s&&s(l.error?new Error(l.error):void 0,l.response,l.timings)}else if(l.type==="request"){const s=new qt("worker"),c=i[l.name],m=new AbortController,f=c.apply(c,[...l.args,m,s]),d=`${l.name}_${l.id}`;if(l.id&&f){this.cancels[l.id]=m;try{const h=await f,w=h==null?void 0:h.transferrables;this.postMessage({id:l.id,type:"response",response:h,timings:s.finish(d)},w)}catch(h){this.postMessage({id:l.id,type:"response",error:(h==null?void 0:h.toString())||"error",timings:s.finish(d)})}delete this.cancels[l.id]}}}}postMessage(e,i){this.dest.postMessage(e,i||[])}send(e,i,n,r,...l){const s=++oi,c=new Promise((m,f)=>{this.postMessage({id:s,type:"request",name:e,args:l},i),this.callbacks[s]=(d,h,w)=>{r==null||r.addAll(w),d?f(d):m(h)}});return U(n,()=>{delete this.callbacks[s],this.postMessage({id:s,type:"cancel"})}),G(this.timeoutMs,c,n)}}o.A=ri,o.H=$,o.L=Je,o.T=qt,o.a=_,o.b=x,o.c=Ct,o.d=jt,o.e=A,o.f=M,o.g=b,o.p=D}),kt(["./shared"],function(o){const a=y=>Promise.reject(new Error(`No manager registered for ${y}`));class u{constructor(){this.managers={},this.init=(x,z)=>(this.managers[x.managerId]=new o.L(x.demUrlPattern,x.cacheSize,x.encoding,x.maxzoom,x.timeoutMs),Promise.resolve()),this.fetchTile=(x,z,S,O,A,_)=>{var p;return((p=this.managers[x])===null||p===void 0?void 0:p.fetchTile(z,S,O,A,_))||a(x)},this.fetchAndParseTile=(x,z,S,O,A,_)=>{var p;return o.p(((p=this.managers[x])===null||p===void 0?void 0:p.fetchAndParseTile(z,S,O,A,_))||a(x),!0)},this.fetchContourTile=(x,z,S,O,A,_,p)=>{var b;return o.f(((b=this.managers[x])===null||b===void 0?void 0:b.fetchContourTile(z,S,O,A,_,p))||a(x))}}}const g=typeof self<"u"?self:typeof window<"u"?window:global;g.actor=new o.A(g,new u)}),kt(["./shared"],function(o){const a={workerUrl:""};let u,g=0;class y{constructor(){this.decodeImage=(b,v,D)=>o.p(o.d(b,v,D),!1)}}function x(){if(!u){const p=new Worker(a.workerUrl),b=new y;u=new o.A(p,b)}return u}class z{constructor(b,v,D,M,j,dt){this.fetchTile=(Z,G,U,B,E)=>this.actor.send("fetchTile",[],B,E,this.managerId,Z,G,U),this.fetchAndParseTile=(Z,G,U,B,E)=>this.actor.send("fetchAndParseTile",[],B,E,this.managerId,Z,G,U),this.fetchContourTile=(Z,G,U,B,E,J)=>this.actor.send("fetchContourTile",[],E,J,this.managerId,Z,G,U,B);const et=this.managerId=++g;this.actor=dt||x(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:v,demUrlPattern:b,encoding:D,maxzoom:M,managerId:et,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((b,v)=>{const D=new FileReader;D.onload=M=>{var j;return b((j=M.target)===null||j===void 0?void 0:j.result)},D.onerror=v,D.readAsArrayBuffer(this)})});const S=p=>(b,v)=>{if(v instanceof AbortController)return p(b,v);{const D=new AbortController;return p(b,D).then(M=>v(void 0,M.data,M.cacheControl,M.expires),M=>v(M)),{cancel:()=>D.abort()}}},O=new Set;class A{constructor({url:b,cacheSize:v=100,id:D="dem",encoding:M="terrarium",maxzoom:j=12,worker:dt=!0,timeoutMs:et=1e4,actor:Z}){this.timingCallbacks=[],this.onTiming=E=>{this.timingCallbacks.push(E)},this.setupMaplibre=E=>{E.addProtocol(this.sharedDemProtocolId,this.sharedDemProtocol),E.addProtocol(this.contourProtocolId,this.contourProtocol)},this.sharedDemProtocolV4=async(E,J)=>{const[K,it,N]=this.parseUrl(E.url),ot=new o.T("main");let lt;try{const W=await this.manager.fetchTile(K,it,N,J,ot);return lt=ot.finish(E.url),{data:await W.data.arrayBuffer(),cacheControl:W.cacheControl,expires:W.expires}}catch(W){throw lt=ot.error(E.url),W}finally{this.timingCallbacks.forEach(W=>W(lt))}},this.contourProtocolV4=async(E,J)=>{const K=new o.T("main");let it;try{const[N,ot,lt]=this.parseUrl(E.url),W=o.a(E.url),bt=await this.manager.fetchContourTile(N,ot,lt,o.g(W,N),J,K);return it=K.finish(E.url),{data:bt.arrayBuffer}}catch(N){throw it=K.error(E.url),N}finally{this.timingCallbacks.forEach(N=>N(it))}},this.contourProtocol=S(this.contourProtocolV4),this.sharedDemProtocol=S(this.sharedDemProtocolV4),this.contourProtocolUrl=E=>`${this.contourProtocolUrlBase}?${o.e(E)}`;let G=D,U=1;for(;O.has(G);)G=D+U++;O.add(G),this.sharedDemProtocolId=`${G}-shared`,this.contourProtocolId=`${G}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=dt?z:o.L;this.manager=new B(b,v,M,j,et,Z)}getDemTile(b,v,D,M){return this.manager.fetchAndParseTile(b,v,D,M||new AbortController)}parseUrl(b){const[,v,D,M]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(b)||[];return[Number(v),Number(D),Number(M)]}}return{generateIsolines:o.b,DemSource:A,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){a.workerUrl=p},get workerUrl(){return a.workerUrl}}});var te=At;function ee(o){return o}function ie(o){if(o==null)return ee;var a,u,g=o.scale[0],y=o.scale[1],x=o.translate[0],z=o.translate[1];return function(S,O){O||(a=u=0);var A=2,_=S.length,p=new Array(_);for(p[0]=(a+=S[0])*g+x,p[1]=(u+=S[1])*y+z;A<_;)p[A]=S[A],++A;return p}}function oe(o,a){for(var u,g=o.length,y=g-a;y<--g;)u=o[y],o[y++]=o[g],o[g]=u}function Gt(o,a){return typeof a=="string"&&(a=o.objects[a]),a.type==="GeometryCollection"?{type:"FeatureCollection",features:a.geometries.map(function(u){return Bt(o,u)})}:Bt(o,a)}function Bt(o,a){var u=a.id,g=a.bbox,y=a.properties==null?{}:a.properties,x=re(o,a);return u==null&&g==null?{type:"Feature",properties:y,geometry:x}:g==null?{type:"Feature",id:u,properties:y,geometry:x}:{type:"Feature",id:u,bbox:g,properties:y,geometry:x}}function re(o,a){var u=ie(o.transform),g=o.arcs;function y(_,p){p.length&&p.pop();for(var b=g[_<0?~_:_],v=0,D=b.length;v<D;++v)p.push(u(b[v],v));_<0&&oe(p,D)}function x(_){return u(_)}function z(_){for(var p=[],b=0,v=_.length;b<v;++b)y(_[b],p);return p.length<2&&p.push(p[0]),p}function S(_){for(var p=z(_);p.length<4;)p.push(p[0]);return p}function O(_){return _.map(S)}function A(_){var p=_.type,b;switch(p){case"GeometryCollection":return{type:p,geometries:_.geometries.map(A)};case"Point":b=x(_.coordinates);break;case"MultiPoint":b=_.coordinates.map(x);break;case"LineString":b=z(_.arcs);break;case"MultiLineString":b=_.arcs.map(z);break;case"Polygon":b=O(_.arcs);break;case"MultiPolygon":b=_.arcs.map(O);break;default:return null}return{type:p,coordinates:b}}return A(a)}const ae={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function ne(){const o="navdata",a=ae;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#F7F9FB","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":4,"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.6,8,.4]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#6600cc","text-halo-color":"#ffffff","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.5,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":6,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":"##FAD7A0","fill-opacity":["interpolate",["linear"],["zoom"],10,.15,11.5,0]}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":"#f6bf65","line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-letter-spacing":.1,"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,filter:["all",["!=",["get","CODE_TYPE"],"CTA"],["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"fill-color":a.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.035,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1],"line-dasharray":[1,1.4]}},{id:"controlled-label",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-letter-spacing":.2,"text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.controlledStroke}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#E8A020",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-optional":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#3E4759"},`
|
|
2
2
|
`,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#E8A020"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#E8A020"},`
|
|
3
3
|
`,["case",["all",["has","TXT_DESIG_HIGH"],["!=",["get","TXT_DESIG_HIGH"],""]],["get","TXT_DESIG_HIGH"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":.95,"text-color":"#3E4759"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"text-halo-color":"#ffffff","text-halo-width":.1,"icon-color":a.segment,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3],"icon-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3]}},{id:"segment-radial",type:"symbol",source:o,"source-layer":"segment-radial",minzoom:10,layout:{"text-field":["concat",["get","bearing"],"°"],"text-size":9,"text-rotate":["to-number",["get","line_angle"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0,"text-offset":[0,-.6],"text-justify":"auto"},paint:{"text-color":a.segment}},{id:"airport-circle",type:"symbol",source:o,minzoom:3,"source-layer":"airport",filter:["case",["<",["zoom"],6],["==",["get","level"],1],!0],layout:{"icon-image":["case",["==",["get","CODE_TYPE_MIL_OPS"],"MIL"],"airport-mil",["==",["get","CODE_TYPE_MIL_OPS"],"MILEXT"],"airport-milext","airport-civ"],"icon-size":["interpolate",["linear"],["zoom"],4,.5,10,.9],"symbol-z-order":"viewport-y","text-field":["get","codeId"],"text-letter-spacing":.05,"text-anchor":"bottom","text-justify":"center","text-size":["interpolate",["linear"],["zoom"],4,0,5,12],"text-offset":["interpolate",["linear"],["zoom"],4,["literal",[0,-1.2]],5,["literal",[0,-.6]]],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,visibility:"none","icon-size":["interpolate",["linear"],["zoom"],5,.6,9,1.2,12,1.3]},paint:{"icon-color":["case",["has","has_amm"],"#4B2D6E",a.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2]}},{id:"airport-label",type:"symbol",source:o,"source-layer":"airport",minzoom:4,filter:["case",["<",["zoom"],8],["==",["get","level"],1],!0],layout:{"text-field":["get","CODE_ID"],"text-size":["interpolate",["linear"],["zoom"],4,9,8,11],"text-anchor":"top","text-offset":[0,1],"text-allow-overlap":!1,"text-ignore-placement":!1},paint:{"text-color":["case",["has","has_amm"],"#4B2D6E",a.airport]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,maxzoom:11,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,13,10]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,maxzoom:11,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,4],"line-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"runway-label",type:"symbol",source:o,"source-layer":"runway",minzoom:10,layout:{"text-field":["concat",["to-string",["get","VAL_LEN"]],"×",["to-string",["get","VAL_WID"]],"m"],"text-size":10,"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":a.runway,"text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",minzoom:8,layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],8,.072,10,.072,11,.126,12,.18,13,.234,14,.288,15,.342,16,.396,17,.45,22,.45],"icon-rotate":["to-number",["get","VAL_MAG_VAR"],0],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,visibility:"none"},paint:{"icon-color":"#0b417a"}},{id:"vor-symbol-normal",minzoom:4,maxzoom:9,type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"v2:vor-normal","icon-size":["interpolate",["linear"],["zoom"],4,.7,8,1],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"icon-color":"#3874cb","icon-opacity":["interpolate",["linear"],["zoom"],8,1,9,0]}},{id:"vor-label",type:"symbol",source:o,"source-layer":"vor",minzoom:5,layout:{"text-field":["get","CODE_ID"],"text-size":10,"text-anchor":"bottom","text-offset":[0,-.8]},paint:{"text-color":a.vor,"text-halo-color":"#ffffff","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"v2:ndb-normal","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["format",["get","CODE_ID"],{"text-color":a.ndb,"font-scale":1.1},"",{},["coalesce",["get","VAL_FREQ"],""],{"text-color":a.ndb,"font-scale":.95}],"text-size":10,"text-offset":[0,.5],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,"text-anchor":"top"},paint:{"text-color":a.ndb,"text-halo-color":"#ffffff","text-halo-width":.5,"text-halo-blur":1,"icon-color":a.ndb,"text-opacity":["interpolate",["linear"],["zoom"],4,0,5.5,0,6,.6,8,1,10,.3,12,0],"icon-opacity":["interpolate",["linear"],["zoom"],4,0,5,.3,5.5,.8,8,1,12,1,14,.6]}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":10,"text-letter-spacing":.02,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto"},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-halo-color":"rgba(0,0,0,0)","icon-halo-width":0,"icon-opacity":["interpolate",["linear"],["zoom"],5,.5,12,1,15,.2],"text-halo-color":"#FFFFFF","text-halo-blur":0,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,.9,15,.15]}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-opacity":["interpolate",["linear"],["zoom"],7,.5,12,1,15,.2],"text-opacity":["interpolate",["linear"],["zoom"],7,1,12,.9,15,.15]}}]}const le={airspaceStroke:"#18C29C",restrictedStroke:"#f87171",controlledStroke:"#38bdf8",controlledFill:"#38bdf8",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function se(){const o="navdata",a=le;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#0A111A","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-color":"#2A303C","line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#a855f7","line-width":["interpolate",["linear"],["zoom"],3,3,7,6],"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.7,8,.5]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#c084fc","text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,layout:{"line-cap":"butt","line-join":"miter","line-miter-limit":0},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.8,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":5,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":["case",["==",["get","CODE_TYPE"],"P"],"#ef4444",["==",["get","CODE_TYPE"],"D"],"#f97316","#ef4444"],"fill-opacity":.04}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":a.restrictedStroke,"line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,paint:{"fill-color":a.controlledFill,"fill-opacity":.03}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1],"line-dasharray":[2,2]}},{id:"controlled-label",type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.controlledStroke,"text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#fbbf24",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#cbd5e1"},`
|
|
4
4
|
`,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#FFFFFF"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#FFFFFF"},`
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jt=require("maplibre-gl");var vt,Ct,Ot;function Mt(o,a){if(!vt)vt=a;else if(!Ct)Ct=a;else{var u="var sharedChunk = {}; ("+vt+")(sharedChunk); ("+Ct+")(sharedChunk);",g={};vt(g),Ot=a(g),typeof window<"u"&&(Ot.workerUrl=window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})))}}Mt(["exports"],function(o){class a{constructor(e,i){this.start=e,this.end=i,this.points=[],this.append=this.append.bind(this),this.prepend=this.prepend.bind(this)}append(e,i){this.points.push(Math.round(e),Math.round(i))}prepend(e,i){this.points.splice(0,0,Math.round(e),Math.round(i))}lineString(){return this.toArray()}isEmpty(){return this.points.length<2}appendFragment(e){this.points.push(...e.points),this.end=e.end}toArray(){return this.points}}const u=[[],[[[1,2],[0,1]]],[[[2,1],[1,2]]],[[[2,1],[0,1]]],[[[1,0],[2,1]]],[[[1,2],[0,1]],[[1,0],[2,1]]],[[[1,0],[1,2]]],[[[1,0],[0,1]]],[[[0,1],[1,0]]],[[[1,2],[1,0]]],[[[0,1],[1,0]],[[2,1],[1,2]]],[[[2,1],[1,0]]],[[[0,1],[2,1]]],[[[1,2],[2,1]]],[[[0,1],[1,2]]],[]];function g(t,e,i,n){return e=e*2+n[0],i=i*2+n[1],e+i*(t+1)*2}function y(t,e,i){return(e-t)/(i-t)}function x(t,e,i=4096,n=1){if(!t)return{};const r=i/(e.width-1);let l,s,c,m,h,d;const f={},w=new Map,F=new Map;function C(P,I,k){P[0]===0?k(r*(d-1),r*(h-y(c,I,l))):P[0]===2?k(r*d,r*(h-y(m,I,s))):P[1]===0?k(r*(d-y(s,I,l)),r*(h-1)):k(r*(d-y(m,I,c)),r*h)}for(h=1-n;h<e.height+n;h++){s=e.get(0,h-1),m=e.get(0,h);let P=Math.min(s,m),I=Math.max(s,m);for(d=1-n;d<e.width+n;d++){l=s,c=m,s=e.get(d,h-1),m=e.get(d,h);const k=P,V=I;if(P=Math.min(s,m),I=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const ut=Math.min(k,P),pt=Math.max(V,I),X=Math.ceil(ut/t)*t,ot=Math.floor(pt/t)*t;for(let R=X;R<=ot;R+=t){const kt=l>R,q=s>R,nt=c>R,_t=m>R;for(const bt of u[(kt?8:0)|(q?4:0)|(_t?2:0)|(nt?1:0)]){let K=w.get(R);K||w.set(R,K=new Map);let lt=F.get(R);lt||F.set(R,lt=new Map);const Rt=bt[0],zt=bt[1],yt=g(e.width,d,h,Rt),st=g(e.width,d,h,zt);let L,Tt;if(L=lt.get(yt))if(lt.delete(yt),Tt=K.get(st))if(K.delete(st),L===Tt){if(C(zt,R,L.append),!L.isEmpty()){let rt=f[R];rt||(f[R]=rt=[]),rt.push(L.lineString())}}else L.appendFragment(Tt),lt.set(L.end=Tt.end,L);else C(zt,R,L.append),lt.set(L.end=st,L);else if(L=K.get(st))K.delete(st),C(Rt,R,L.prepend),K.set(L.start=yt,L);else{const rt=new a(yt,st);C(Rt,R,rt.append),C(zt,R,rt.append),K.set(yt,rt),lt.set(st,rt)}}}}}for(const[P,I]of w.entries()){let k=null;for(const V of I.values())V.isEmpty()||(k==null&&(k=f[P]||(f[P]=[])),k.push(V.lineString()))}return f}function z(t){const e=Object.entries(t);return e.sort(([i],[n])=>i<n?-1:i>n?1:0),e}function S(t){return z(t).map(([e,i])=>[e,...typeof i=="number"?[i]:i].join("*")).join("~")}function O(t){return Object.fromEntries(t.split("~").map(e=>e.split("*").map(Number)).map(([e,...i])=>[e,i]))}function A({thresholds:t,...e}){return z({thresholds:S(t),...e}).map(([i,n])=>`${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&")}function _(t){return Object.fromEntries(t.replace(/^.*\?/,"").split("&").map(e=>{const i=e.split("=").map(decodeURIComponent),n=i[0];let r=i[1];switch(n){case"thresholds":r=O(r);break;case"extent":case"multiplier":case"overzoom":case"buffer":r=Number(r)}return[n,r]}))}function p(t){return z(t).map(([e,i])=>`${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",")}function b(t,e){const{thresholds:i,...n}=t;let r=[],l=-1/0;return Object.entries(i).forEach(([s,c])=>{const m=Number(s);m<=e&&m>l&&(l=m,r=typeof c=="number"?[c]:c)}),{levels:r,...n}}function v(t){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}function D(t,e){return t.then(({data:i,...n})=>{let r=i;return e&&(r=new Float32Array(i.length),r.set(i)),{...n,data:r,transferrables:[r.buffer]}})}function M(t){return t.then(({arrayBuffer:e})=>{const i=v(e);return{arrayBuffer:i,transferrables:[i]}})}let j=null;function mt(){return j==null&&(j=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),j||!1}let tt=null;function H(){if(tt==null&&(tt=!1,mt()&&typeof VideoFrame<"u")){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let r=0;r<5*5;r++){const l=r*4;i.fillStyle=`rgb(${l},${l+1},${l+2})`,i.fillRect(r%5,Math.floor(r/5),1,1)}const n=i.getImageData(0,0,5,5).data;for(let r=0;r<5*5*4;r++)if(r%4!==3&&n[r]!==r){tt=!0;break}}}return tt||!1}function G(t,e,i){let n=()=>{};const r=setTimeout(()=>{n(new Error("timed out")),i==null||i.abort()},t);U(i,()=>{n(new Error("aborted")),clearTimeout(r)});const l=new Promise((s,c)=>{n=c});return Promise.race([l,e.finally(()=>clearTimeout(r))])}function U(t,e){e&&(t==null||t.signal.addEventListener("abort",e))}function B(t){var e;return!!(!((e=t==null?void 0:t.signal)===null||e===void 0)&&e.aborted)}let E=0;class Z{constructor(e=100){this.size=()=>this.items.size,this.get=(i,n,r)=>{let l=this.items.get(i);if(l)l.lastUsed=++E,l.waiting++;else{const h=new AbortController,d=n(i,h);l={abortController:h,item:d,lastUsed:++E,waiting:1},this.items.set(i,l),this.prune()}const s=this.items,c=l.item.then(h=>h,h=>(s.delete(i),Promise.reject(h)));let m=!1;return U(r,()=>{var h;l&&l.abortController&&!m&&(m=!0,--l.waiting<=0&&((h=l.abortController)===null||h===void 0||h.abort(),s.delete(i)))}),c},this.clear=()=>this.items.clear(),this.maxSize=e,this.items=new Map}prune(){if(this.items.size>this.maxSize){let e,i=1/0;this.items.forEach((n,r)=>{n.lastUsed<i&&(i=n.lastUsed,e=r)}),typeof e<"u"&&this.items.delete(e)}}}let Y,et,N,it;async function at(t,e,i){const n=await createImageBitmap(t);return B(i)?null:W(n,e)}function W(t,e){return Y||(Y=new OffscreenCanvas(t.width,t.height),et=Y.getContext("2d",{willReadFrequently:!0})),Lt(t,e,Y,et)}async function xt(t,e,i){var n,r,l;const s=await createImageBitmap(t);if(B(i))return null;const c=new VideoFrame(s,{timestamp:0});try{if(!(((n=c==null?void 0:c.format)===null||n===void 0?void 0:n.startsWith("BGR"))||((r=c==null?void 0:c.format)===null||r===void 0?void 0:r.startsWith("RGB"))))throw new Error(`Unrecognized format: ${c==null?void 0:c.format}`);const h=(l=c==null?void 0:c.format)===null||l===void 0?void 0:l.startsWith("BGR"),d=c.allocationSize(),f=new Uint8ClampedArray(d);if(await c.copyTo(f),h)for(let w=0;w<f.length;w+=4){const F=f[w];f[w]=f[w+2],f[w+2]=F}return Et(s.width,s.height,e,f)}catch{return B(i)?null:W(s,e)}finally{c.close()}}async function qt(t,e,i){N||(N=document.createElement("canvas"),it=N.getContext("2d",{willReadFrequently:!0}));const n=new Image;U(i,()=>n.src="");const r=await new Promise((l,s)=>{n.onload=()=>{B(i)||l(n),URL.revokeObjectURL(n.src),n.onload=null},n.onerror=()=>s(new Error("Could not load image.")),n.src=t.size?URL.createObjectURL(t):""});return Lt(r,e,N,it)}function te(t,e,i){return self.actor.send("decodeImage",[],i,void 0,t,e)}function ee(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const It=H()?xt:mt()?at:ee()?te:qt;function Lt(t,e,i,n){if(i.width=t.width,i.height=t.height,!n)throw new Error("failed to get context");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height).data;return Et(t.width,t.height,e,r)}function Et(t,e,i,n){const r=i==="mapbox"?(s,c,m)=>-1e4+(s*256*256+c*256+m)*.1:(s,c,m)=>s*256+c+m/256-32768,l=new Float32Array(t*e);for(let s=0;s<n.length;s+=4)l[s/4]=r(n[s],n[s+1],n[s+2]);return{width:t,height:e,data:l}}const ie=-12e3,oe=9e3;function re(t){return!isNaN(t)&&t>=ie&&t<=oe}class ${constructor(e,i,n){this.split=(r,l,s)=>{if(r===0)return this;const c=1<<r,m=l*this.width/c,h=s*this.height/c;return new $(this.width/c,this.height/c,(d,f)=>this.get(d+m,f+h))},this.subsamplePixelCenters=r=>{const l=(m,h,d)=>isNaN(m)?h:isNaN(h)?m:m+(h-m)*d;if(r<=1)return this;const s=.5-1/(2*r),c=(m,h)=>{const d=m/r-s,f=h/r-s,w=Math.floor(d),F=Math.floor(f),C=this.get(w,F),P=this.get(w+1,F),I=this.get(w,F+1),k=this.get(w+1,F+1),V=d-w,ut=f-F,pt=l(C,P,V),X=l(I,k,V);return l(pt,X,ut)};return new $(this.width*r,this.height*r,c)},this.averagePixelCentersToGrid=(r=1)=>new $(this.width+1,this.height+1,(l,s)=>{let c=0,m=0,h=0;for(let d=l-r;d<l+r;d++)for(let f=s-r;f<s+r;f++)isNaN(h=this.get(d,f))||(m++,c+=h);return m===0?NaN:c/m}),this.scaleElevation=r=>r===1?this:new $(this.width,this.height,(l,s)=>this.get(l,s)*r),this.materialize=(r=2)=>{const l=this.width+2*r,s=new Float32Array(l*(this.height+2*r));let c=0;for(let m=-r;m<this.height+r;m++)for(let h=-r;h<this.width+r;h++)s[c++]=this.get(h,m);return new $(this.width,this.height,(m,h)=>s[(h+r)*l+m+r])},this.get=n,this.width=e,this.height=i}static fromRawDem(e){return new $(e.width,e.height,(i,n)=>{const r=e.data[n*e.width+i];return re(r)?r:NaN})}static combineNeighbors(e){if(e.length!==9)throw new Error("Must include a tile plus 8 neighbors");const i=e[4];if(!i)return;const n=i.width,r=i.height;return new $(n,r,(l,s)=>{let c=0;s<0?s+=r:s<r?c+=3:(s-=r,c+=6),l<0?l+=n:l<n?c+=1:(l-=n,c+=2);const m=e[c];return m?m.get(l,s):NaN})}}function ae(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ft={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ft.read=function(t,e,i,n,r){var l,s,c=r*8-n-1,m=(1<<c)-1,h=m>>1,d=-7,f=i?r-1:0,w=i?-1:1,F=t[e+f];for(f+=w,l=F&(1<<-d)-1,F>>=-d,d+=c;d>0;l=l*256+t[e+f],f+=w,d-=8);for(s=l&(1<<-d)-1,l>>=-d,d+=n;d>0;s=s*256+t[e+f],f+=w,d-=8);if(l===0)l=1-h;else{if(l===m)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,n),l=l-h}return(F?-1:1)*s*Math.pow(2,l-n)},Ft.write=function(t,e,i,n,r,l){var s,c,m,h=l*8-r-1,d=(1<<h)-1,f=d>>1,w=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:l-1,C=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+f>=1?e+=w/m:e+=w*Math.pow(2,1-f),e*m>=2&&(s++,m/=2),s+f>=d?(c=0,s=d):s+f>=1?(c=(e*m-1)*Math.pow(2,r),s=s+f):(c=e*Math.pow(2,f-1)*Math.pow(2,r),s=0));r>=8;t[i+F]=c&255,F+=C,c/=256,r-=8);for(s=s<<r|c,h+=r;h>0;t[i+F]=s&255,F+=C,s/=256,h-=8);t[i+F-C]|=P*128};var ne=T,gt=Ft;function T(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}T.Varint=0,T.Fixed64=1,T.Bytes=2,T.Fixed32=5;var St=65536*65536,Gt=1/St,le=12,Bt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");T.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,l=this.pos;this.type=n&7,t(r,e,this),this.pos===l&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=wt(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Nt(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=wt(this.buf,this.pos)+wt(this.buf,this.pos+4)*St;return this.pos+=8,t},readSFixed64:function(){var t=wt(this.buf,this.pos)+Nt(this.buf,this.pos+4)*St;return this.pos+=8,t},readFloat:function(){var t=gt.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=gt.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,i,n;return n=e[this.pos++],i=n&127,n<128||(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,se(i,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=le&&Bt?ze(this.buf,e,t):be(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==T.Bytes)return t.push(this.readVarint(e));var i=J(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==T.Bytes)return t.push(this.readSVarint());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==T.Bytes)return t.push(this.readBoolean());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==T.Bytes)return t.push(this.readFloat());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==T.Bytes)return t.push(this.readDouble());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==T.Bytes)return t.push(this.readFixed32());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==T.Bytes)return t.push(this.readSFixed32());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==T.Bytes)return t.push(this.readFixed64());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==T.Bytes)return t.push(this.readSFixed64());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===T.Varint)for(;this.buf[this.pos++]>127;);else if(e===T.Bytes)this.pos=this.readVarint()+this.pos;else if(e===T.Fixed32)this.pos+=4;else if(e===T.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),dt(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),dt(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),dt(this.buf,t&-1,this.pos),dt(this.buf,Math.floor(t*Gt),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),dt(this.buf,t&-1,this.pos),dt(this.buf,Math.floor(t*Gt),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){ce(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:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=Te(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Xt(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),gt.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),gt.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Xt(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,T.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,de,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,fe,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ye,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ue,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,pe,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,xe,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ge,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,we,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_e,e)},writeBytesField:function(t,e){this.writeTag(t,T.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,T.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,T.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,T.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,T.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,T.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,T.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,T.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,T.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,T.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function se(t,e,i){var n=i.buf,r,l;if(l=n[i.pos++],r=(l&112)>>4,l<128||(l=n[i.pos++],r|=(l&127)<<3,l<128)||(l=n[i.pos++],r|=(l&127)<<10,l<128)||(l=n[i.pos++],r|=(l&127)<<17,l<128)||(l=n[i.pos++],r|=(l&127)<<24,l<128)||(l=n[i.pos++],r|=(l&1)<<31,l<128))return ht(t,r,e);throw new Error("Expected varint not more than 10 bytes")}function J(t){return t.type===T.Bytes?t.readVarint()+t.pos:t.pos+1}function ht(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function ce(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),i^4294967295?i=i+1|0:(i=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),me(i,n,e),he(n,e)}function me(t,e,i){i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos]=t&127}function he(t,e){var i=(t&7)<<4;e.buf[e.pos++]|=i|((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 Xt(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function de(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function fe(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function ue(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function pe(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function ye(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function xe(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function ge(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function we(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function _e(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function wt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function dt(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Nt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function be(t,e,i){for(var n="",r=e;r<i;){var l=t[r],s=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;var m,h,d;c===1?l<128&&(s=l):c===2?(m=t[r+1],(m&192)===128&&(s=(l&31)<<6|m&63,s<=127&&(s=null))):c===3?(m=t[r+1],h=t[r+2],(m&192)===128&&(h&192)===128&&(s=(l&15)<<12|(m&63)<<6|h&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):c===4&&(m=t[r+1],h=t[r+2],d=t[r+3],(m&192)===128&&(h&192)===128&&(d&192)===128&&(s=(l&15)<<18|(m&63)<<12|(h&63)<<6|d&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,c=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),r+=c}return n}function ze(t,e,i){return Bt.decode(t.subarray(e,i))}function Te(t,e,i){for(var n=0,r,l;n<e.length;n++){if(r=e.charCodeAt(n),r>55295&&r<57344)if(l)if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,l=r;continue}else r=l-55296<<10|r-56320|65536,l=null;else{r>56319||n+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):l=r;continue}else l&&(t[i++]=239,t[i++]=191,t[i++]=189,l=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=r&63|128)}return i}var ve=ae(ne),ft;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.POINT=1]="POINT",t[t.LINESTRING=2]="LINESTRING",t[t.POLYGON=3]="POLYGON"})(ft||(ft={}));function De(t){const e=new ve;for(const i in t.layers){const n=t.layers[i];n.extent||(n.extent=t.extent),e.writeMessage(3,Ee,{...n,id:i})}return e.finish()}function Ee(t,e){if(!e)throw new Error("pbf undefined");e.writeVarintField(15,2),e.writeStringField(1,t.id||""),e.writeVarintField(5,t.extent||4096);const i={keys:[],values:[],keycache:{},valuecache:{}};for(const n of t.features)i.feature=n,e.writeMessage(2,Fe,i);for(const n of i.keys)e.writeStringField(3,n);for(const n of i.values)e.writeMessage(4,ke,n)}function Fe(t,e){const i=t.feature;if(!i||!e)throw new Error;e.writeMessage(2,Se,t),e.writeVarintField(3,i.type),e.writeMessage(4,Ae,i)}function Se(t,e){const i=t.feature;if(!i||!e)throw new Error;const n=t.keys,r=t.values,l=t.keycache,s=t.valuecache;for(const c in i.properties){let m=i.properties[c],h=l[c];if(m===null)continue;typeof h>"u"&&(n.push(c),h=n.length-1,l[c]=h),e.writeVarint(h);const d=typeof m;d!=="string"&&d!=="boolean"&&d!=="number"&&(m=JSON.stringify(m));const f=`${d}:${m}`;let w=s[f];typeof w>"u"&&(r.push(m),w=r.length-1,s[f]=w),e.writeVarint(w)}}function At(t,e){return(e<<3)+(t&7)}function Vt(t){return t<<1^t>>31}function Ae(t,e){if(!e)throw new Error;const i=t.geometry,n=t.type;let r=0,l=0;for(const s of i){let c=1;n===ft.POINT&&(c=s.length/2),e.writeVarint(At(1,c));const m=s.length/2,h=n===ft.POLYGON?m-1:m;for(let d=0;d<h;d++){d===1&&n!==1&&e.writeVarint(At(2,h-1));const f=s[d*2]-r,w=s[d*2+1]-l;e.writeVarint(Vt(f)),e.writeVarint(Vt(w)),r+=f,l+=w}n===ft.POLYGON&&e.writeVarint(At(7,1))}}function ke(t,e){if(!e)throw new Error;typeof t=="string"?e.writeStringField(1,t):typeof t=="boolean"?e.writeBooleanField(7,t):typeof t=="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class Re{constructor(e,i,n,r,l){this.loaded=Promise.resolve(),this.decodeImage=It,this.fetchAndParseTile=(s,c,m,h,d)=>{const f=this,w=this.demUrlPattern.replace("{z}",s.toString()).replace("{x}",c.toString()).replace("{y}",m.toString());return d==null||d.useTile(w),this.parsedCache.get(w,async(F,C)=>{const P=await f.fetchTile(s,c,m,C,d);if(B(C))throw new Error("canceled");const I=f.decodeImage(P.data,f.encoding,C),k=d==null?void 0:d.marker("decode"),V=await I;return k==null||k(),V},h)},this.tileCache=new Z(i),this.parsedCache=new Z(i),this.contourCache=new Z(i),this.timeoutMs=l,this.demUrlPattern=e,this.encoding=n,this.maxzoom=r}fetchTile(e,i,n,r,l){const s=this.demUrlPattern.replace("{z}",e.toString()).replace("{x}",i.toString()).replace("{y}",n.toString());return l==null||l.useTile(s),this.tileCache.get(s,(c,m)=>{const h={signal:m.signal};l==null||l.fetchTile(s);const d=l==null?void 0:l.marker("fetch");return G(this.timeoutMs,fetch(s,h).then(async f=>{if(d==null||d(),!f.ok)throw new Error(`Bad response: ${f.status} for ${s}`);return{data:await f.blob(),expires:f.headers.get("expires")||void 0,cacheControl:f.headers.get("cache-control")||void 0}}),m)},r)}async fetchDem(e,i,n,r,l,s){const c=Math.min(e-(r.overzoom||0),this.maxzoom),m=e-c,h=1<<m,d=Math.floor(i/h),f=Math.floor(n/h),w=await this.fetchAndParseTile(c,d,f,l,s);return $.fromRawDem(w).split(m,i%h,n%h)}fetchContourTile(e,i,n,r,l,s){const{levels:c,multiplier:m=1,buffer:h=1,extent:d=4096,contourLayer:f="contours",elevationKey:w="ele",levelKey:F="level",subsampleBelow:C=100}=r;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const P=[e,i,n,p(r)].join("/");return this.contourCache.get(P,async(I,k)=>{const V=1<<e,ut=[];for(let q=n-1;q<=n+1;q++)for(let nt=i-1;nt<=i+1;nt++)ut.push(q<0||q>=V?void 0:this.fetchDem(e,(nt+V)%V,q,r,k,s));const pt=await Promise.all(ut);let X=$.combineNeighbors(pt);if(!X||B(k))return{arrayBuffer:new Uint8Array().buffer};const ot=s==null?void 0:s.marker("isoline");if(X.width>=C)X=X.materialize(2);else for(;X.width<C;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const R=x(c[0],X,d,h);ot==null||ot();const kt=De({extent:d,layers:{[f]:{features:Object.entries(R).map(([q,nt])=>{const _t=Number(q);return{type:ft.LINESTRING,geometry:nt,properties:{[w]:_t,[F]:Math.max(...c.map((bt,K)=>_t%bt===0?K:0))}}})}}});return ot==null||ot(),{arrayBuffer:kt.buffer}},l)}}const Q=typeof performance<"u"?performance:void 0,Ce=Q?Q.timeOrigin||new Date().getTime()-Q.now():new Date().getTime();function Pe(t){var e;return JSON.parse(JSON.stringify(((e=Q==null?void 0:Q.getEntriesByName)===null||e===void 0?void 0:e.call(Q,t))||[]))}function Ut(){return Q?Q.now():new Date().getTime()}function Oe(t){const e=[];for(const i of t)e.push(...i);return e}class Wt{constructor(e){this.marks={},this.urls=[],this.fetched=[],this.resources=[],this.tilesFetched=0,this.timeOrigin=Ce,this.finish=i=>{this.markFinish();const n=m=>{const h=this.marks[m]||[],d=Math.max(...h.map(w=>Math.max(...w))),f=Math.min(...h.map(w=>Math.min(...w)));return Number.isFinite(d)?d-f:void 0},r=n("main")||0,l=n("fetch"),s=n("decode"),c=n("isoline");return{url:i,tilesUsed:this.tilesFetched,origin:this.timeOrigin,marks:this.marks,resources:[...this.resources,...Oe(this.fetched.map(Pe))],duration:r,fetch:l,decode:s,process:c,wait:r-(l||0)-(s||0)-(c||0)}},this.error=i=>({...this.finish(i),error:!0}),this.marker=i=>{var n;this.marks[i]||(this.marks[i]=[]);const r=[Ut()];return(n=this.marks[i])===null||n===void 0||n.push(r),()=>r.push(Ut())},this.useTile=i=>{this.urls.indexOf(i)<0&&(this.urls.push(i),this.tilesFetched++)},this.fetchTile=i=>{this.fetched.indexOf(i)<0&&this.fetched.push(i)},this.addAll=i=>{var n;this.tilesFetched+=i.tilesUsed;const r=i.origin-this.timeOrigin;for(const l in i.marks){const s=l;(this.marks[s]||(this.marks[s]=[])).push(...((n=i.marks[s])===null||n===void 0?void 0:n.map(m=>m.map(h=>h+r)))||[])}this.resources.push(...i.resources.map(l=>Ie(l,r)))},this.markFinish=this.marker(e)}}const Me=/(Start$|End$|^start|^end)/;function Ie(t,e){const i={};for(const n in t)t[n]!==0&&Me.test(n)?i[n]=Number(t[n])+e:i[n]=t[n];return i}let Le=0;class Ge{constructor(e,i,n=2e4){this.callbacks={},this.cancels={},this.dest=e,this.timeoutMs=n,this.dest.onmessage=async({data:r})=>{const l=r;if(l.type==="cancel"){const s=this.cancels[l.id];delete this.cancels[l.id],s==null||s.abort()}else if(l.type==="response"){const s=this.callbacks[l.id];delete this.callbacks[l.id],s&&s(l.error?new Error(l.error):void 0,l.response,l.timings)}else if(l.type==="request"){const s=new Wt("worker"),c=i[l.name],m=new AbortController,h=c.apply(c,[...l.args,m,s]),d=`${l.name}_${l.id}`;if(l.id&&h){this.cancels[l.id]=m;try{const f=await h,w=f==null?void 0:f.transferrables;this.postMessage({id:l.id,type:"response",response:f,timings:s.finish(d)},w)}catch(f){this.postMessage({id:l.id,type:"response",error:(f==null?void 0:f.toString())||"error",timings:s.finish(d)})}delete this.cancels[l.id]}}}}postMessage(e,i){this.dest.postMessage(e,i||[])}send(e,i,n,r,...l){const s=++Le,c=new Promise((m,h)=>{this.postMessage({id:s,type:"request",name:e,args:l},i),this.callbacks[s]=(d,f,w)=>{r==null||r.addAll(w),d?h(d):m(f)}});return U(n,()=>{delete this.callbacks[s],this.postMessage({id:s,type:"cancel"})}),G(this.timeoutMs,c,n)}}o.A=Ge,o.H=$,o.L=Re,o.T=Wt,o.a=_,o.b=x,o.c=Et,o.d=It,o.e=A,o.f=M,o.g=b,o.p=D});Mt(["./shared"],function(o){const a=y=>Promise.reject(new Error(`No manager registered for ${y}`));class u{constructor(){this.managers={},this.init=(x,z)=>(this.managers[x.managerId]=new o.L(x.demUrlPattern,x.cacheSize,x.encoding,x.maxzoom,x.timeoutMs),Promise.resolve()),this.fetchTile=(x,z,S,O,A,_)=>{var p;return((p=this.managers[x])===null||p===void 0?void 0:p.fetchTile(z,S,O,A,_))||a(x)},this.fetchAndParseTile=(x,z,S,O,A,_)=>{var p;return o.p(((p=this.managers[x])===null||p===void 0?void 0:p.fetchAndParseTile(z,S,O,A,_))||a(x),!0)},this.fetchContourTile=(x,z,S,O,A,_,p)=>{var b;return o.f(((b=this.managers[x])===null||b===void 0?void 0:b.fetchContourTile(z,S,O,A,_,p))||a(x))}}}const g=typeof self<"u"?self:typeof window<"u"?window:global;g.actor=new o.A(g,new u)});Mt(["./shared"],function(o){const a={workerUrl:""};let u,g=0;class y{constructor(){this.decodeImage=(b,v,D)=>o.p(o.d(b,v,D),!1)}}function x(){if(!u){const p=new Worker(a.workerUrl),b=new y;u=new o.A(p,b)}return u}class z{constructor(b,v,D,M,j,mt){this.fetchTile=(H,G,U,B,E)=>this.actor.send("fetchTile",[],B,E,this.managerId,H,G,U),this.fetchAndParseTile=(H,G,U,B,E)=>this.actor.send("fetchAndParseTile",[],B,E,this.managerId,H,G,U),this.fetchContourTile=(H,G,U,B,E,Z)=>this.actor.send("fetchContourTile",[],E,Z,this.managerId,H,G,U,B);const tt=this.managerId=++g;this.actor=mt||x(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:v,demUrlPattern:b,encoding:D,maxzoom:M,managerId:tt,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((b,v)=>{const D=new FileReader;D.onload=M=>{var j;return b((j=M.target)===null||j===void 0?void 0:j.result)},D.onerror=v,D.readAsArrayBuffer(this)})});const S=p=>(b,v)=>{if(v instanceof AbortController)return p(b,v);{const D=new AbortController;return p(b,D).then(M=>v(void 0,M.data,M.cacheControl,M.expires),M=>v(M)),{cancel:()=>D.abort()}}},O=new Set;class A{constructor({url:b,cacheSize:v=100,id:D="dem",encoding:M="terrarium",maxzoom:j=12,worker:mt=!0,timeoutMs:tt=1e4,actor:H}){this.timingCallbacks=[],this.onTiming=E=>{this.timingCallbacks.push(E)},this.setupMaplibre=E=>{E.addProtocol(this.sharedDemProtocolId,this.sharedDemProtocol),E.addProtocol(this.contourProtocolId,this.contourProtocol)},this.sharedDemProtocolV4=async(E,Z)=>{const[Y,et,N]=this.parseUrl(E.url),it=new o.T("main");let at;try{const W=await this.manager.fetchTile(Y,et,N,Z,it);return at=it.finish(E.url),{data:await W.data.arrayBuffer(),cacheControl:W.cacheControl,expires:W.expires}}catch(W){throw at=it.error(E.url),W}finally{this.timingCallbacks.forEach(W=>W(at))}},this.contourProtocolV4=async(E,Z)=>{const Y=new o.T("main");let et;try{const[N,it,at]=this.parseUrl(E.url),W=o.a(E.url),xt=await this.manager.fetchContourTile(N,it,at,o.g(W,N),Z,Y);return et=Y.finish(E.url),{data:xt.arrayBuffer}}catch(N){throw et=Y.error(E.url),N}finally{this.timingCallbacks.forEach(N=>N(et))}},this.contourProtocol=S(this.contourProtocolV4),this.sharedDemProtocol=S(this.sharedDemProtocolV4),this.contourProtocolUrl=E=>`${this.contourProtocolUrlBase}?${o.e(E)}`;let G=D,U=1;for(;O.has(G);)G=D+U++;O.add(G),this.sharedDemProtocolId=`${G}-shared`,this.contourProtocolId=`${G}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=mt?z:o.L;this.manager=new B(b,v,M,j,tt,H)}getDemTile(b,v,D,M){return this.manager.fetchAndParseTile(b,v,D,M||new AbortController)}parseUrl(b){const[,v,D,M]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(b)||[];return[Number(v),Number(D),Number(M)]}}return{generateIsolines:o.b,DemSource:A,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){a.workerUrl=p},get workerUrl(){return a.workerUrl}}});var Be=Ot;function Xe(o){return o}function Ne(o){if(o==null)return Xe;var a,u,g=o.scale[0],y=o.scale[1],x=o.translate[0],z=o.translate[1];return function(S,O){O||(a=u=0);var A=2,_=S.length,p=new Array(_);for(p[0]=(a+=S[0])*g+x,p[1]=(u+=S[1])*y+z;A<_;)p[A]=S[A],++A;return p}}function Ve(o,a){for(var u,g=o.length,y=g-a;y<--g;)u=o[y],o[y++]=o[g],o[g]=u}function $t(o,a){return typeof a=="string"&&(a=o.objects[a]),a.type==="GeometryCollection"?{type:"FeatureCollection",features:a.geometries.map(function(u){return Yt(o,u)})}:Yt(o,a)}function Yt(o,a){var u=a.id,g=a.bbox,y=a.properties==null?{}:a.properties,x=Ue(o,a);return u==null&&g==null?{type:"Feature",properties:y,geometry:x}:g==null?{type:"Feature",id:u,properties:y,geometry:x}:{type:"Feature",id:u,bbox:g,properties:y,geometry:x}}function Ue(o,a){var u=Ne(o.transform),g=o.arcs;function y(_,p){p.length&&p.pop();for(var b=g[_<0?~_:_],v=0,D=b.length;v<D;++v)p.push(u(b[v],v));_<0&&Ve(p,D)}function x(_){return u(_)}function z(_){for(var p=[],b=0,v=_.length;b<v;++b)y(_[b],p);return p.length<2&&p.push(p[0]),p}function S(_){for(var p=z(_);p.length<4;)p.push(p[0]);return p}function O(_){return _.map(S)}function A(_){var p=_.type,b;switch(p){case"GeometryCollection":return{type:p,geometries:_.geometries.map(A)};case"Point":b=x(_.coordinates);break;case"MultiPoint":b=_.coordinates.map(x);break;case"LineString":b=z(_.arcs);break;case"MultiLineString":b=_.arcs.map(z);break;case"Polygon":b=O(_.arcs);break;case"MultiPolygon":b=_.arcs.map(O);break;default:return null}return{type:p,coordinates:b}}return A(a)}const We={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function je(){const o="navdata",a=We;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#F7F9FB","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":4,"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.6,8,.4]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#6600cc","text-halo-color":"#ffffff","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.5,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":6,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":"#fc9c02","fill-opacity":["interpolate",["linear"],["zoom"],10,.15,11.5,0]}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":"#f6bf65","line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-letter-spacing":.1,"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,filter:["all",["!=",["get","CODE_TYPE"],"CTA"],["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"fill-color":a.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.035,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1],"line-dasharray":[1,1.4]}},{id:"controlled-label",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-letter-spacing":.2,"text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.controlledStroke}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#E8A020",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-optional":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#3E4759"},`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jt=require("maplibre-gl");var vt,Ct,Ot;function Mt(o,a){if(!vt)vt=a;else if(!Ct)Ct=a;else{var u="var sharedChunk = {}; ("+vt+")(sharedChunk); ("+Ct+")(sharedChunk);",g={};vt(g),Ot=a(g),typeof window<"u"&&(Ot.workerUrl=window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})))}}Mt(["exports"],function(o){class a{constructor(e,i){this.start=e,this.end=i,this.points=[],this.append=this.append.bind(this),this.prepend=this.prepend.bind(this)}append(e,i){this.points.push(Math.round(e),Math.round(i))}prepend(e,i){this.points.splice(0,0,Math.round(e),Math.round(i))}lineString(){return this.toArray()}isEmpty(){return this.points.length<2}appendFragment(e){this.points.push(...e.points),this.end=e.end}toArray(){return this.points}}const u=[[],[[[1,2],[0,1]]],[[[2,1],[1,2]]],[[[2,1],[0,1]]],[[[1,0],[2,1]]],[[[1,2],[0,1]],[[1,0],[2,1]]],[[[1,0],[1,2]]],[[[1,0],[0,1]]],[[[0,1],[1,0]]],[[[1,2],[1,0]]],[[[0,1],[1,0]],[[2,1],[1,2]]],[[[2,1],[1,0]]],[[[0,1],[2,1]]],[[[1,2],[2,1]]],[[[0,1],[1,2]]],[]];function g(t,e,i,n){return e=e*2+n[0],i=i*2+n[1],e+i*(t+1)*2}function y(t,e,i){return(e-t)/(i-t)}function x(t,e,i=4096,n=1){if(!t)return{};const r=i/(e.width-1);let l,s,c,m,h,d;const f={},w=new Map,F=new Map;function C(P,I,k){P[0]===0?k(r*(d-1),r*(h-y(c,I,l))):P[0]===2?k(r*d,r*(h-y(m,I,s))):P[1]===0?k(r*(d-y(s,I,l)),r*(h-1)):k(r*(d-y(m,I,c)),r*h)}for(h=1-n;h<e.height+n;h++){s=e.get(0,h-1),m=e.get(0,h);let P=Math.min(s,m),I=Math.max(s,m);for(d=1-n;d<e.width+n;d++){l=s,c=m,s=e.get(d,h-1),m=e.get(d,h);const k=P,V=I;if(P=Math.min(s,m),I=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const ut=Math.min(k,P),pt=Math.max(V,I),X=Math.ceil(ut/t)*t,ot=Math.floor(pt/t)*t;for(let R=X;R<=ot;R+=t){const kt=l>R,q=s>R,nt=c>R,_t=m>R;for(const bt of u[(kt?8:0)|(q?4:0)|(_t?2:0)|(nt?1:0)]){let K=w.get(R);K||w.set(R,K=new Map);let lt=F.get(R);lt||F.set(R,lt=new Map);const Rt=bt[0],zt=bt[1],yt=g(e.width,d,h,Rt),st=g(e.width,d,h,zt);let L,Tt;if(L=lt.get(yt))if(lt.delete(yt),Tt=K.get(st))if(K.delete(st),L===Tt){if(C(zt,R,L.append),!L.isEmpty()){let rt=f[R];rt||(f[R]=rt=[]),rt.push(L.lineString())}}else L.appendFragment(Tt),lt.set(L.end=Tt.end,L);else C(zt,R,L.append),lt.set(L.end=st,L);else if(L=K.get(st))K.delete(st),C(Rt,R,L.prepend),K.set(L.start=yt,L);else{const rt=new a(yt,st);C(Rt,R,rt.append),C(zt,R,rt.append),K.set(yt,rt),lt.set(st,rt)}}}}}for(const[P,I]of w.entries()){let k=null;for(const V of I.values())V.isEmpty()||(k==null&&(k=f[P]||(f[P]=[])),k.push(V.lineString()))}return f}function z(t){const e=Object.entries(t);return e.sort(([i],[n])=>i<n?-1:i>n?1:0),e}function S(t){return z(t).map(([e,i])=>[e,...typeof i=="number"?[i]:i].join("*")).join("~")}function O(t){return Object.fromEntries(t.split("~").map(e=>e.split("*").map(Number)).map(([e,...i])=>[e,i]))}function A({thresholds:t,...e}){return z({thresholds:S(t),...e}).map(([i,n])=>`${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&")}function _(t){return Object.fromEntries(t.replace(/^.*\?/,"").split("&").map(e=>{const i=e.split("=").map(decodeURIComponent),n=i[0];let r=i[1];switch(n){case"thresholds":r=O(r);break;case"extent":case"multiplier":case"overzoom":case"buffer":r=Number(r)}return[n,r]}))}function p(t){return z(t).map(([e,i])=>`${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",")}function b(t,e){const{thresholds:i,...n}=t;let r=[],l=-1/0;return Object.entries(i).forEach(([s,c])=>{const m=Number(s);m<=e&&m>l&&(l=m,r=typeof c=="number"?[c]:c)}),{levels:r,...n}}function v(t){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}function D(t,e){return t.then(({data:i,...n})=>{let r=i;return e&&(r=new Float32Array(i.length),r.set(i)),{...n,data:r,transferrables:[r.buffer]}})}function M(t){return t.then(({arrayBuffer:e})=>{const i=v(e);return{arrayBuffer:i,transferrables:[i]}})}let j=null;function mt(){return j==null&&(j=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),j||!1}let tt=null;function H(){if(tt==null&&(tt=!1,mt()&&typeof VideoFrame<"u")){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let r=0;r<5*5;r++){const l=r*4;i.fillStyle=`rgb(${l},${l+1},${l+2})`,i.fillRect(r%5,Math.floor(r/5),1,1)}const n=i.getImageData(0,0,5,5).data;for(let r=0;r<5*5*4;r++)if(r%4!==3&&n[r]!==r){tt=!0;break}}}return tt||!1}function G(t,e,i){let n=()=>{};const r=setTimeout(()=>{n(new Error("timed out")),i==null||i.abort()},t);U(i,()=>{n(new Error("aborted")),clearTimeout(r)});const l=new Promise((s,c)=>{n=c});return Promise.race([l,e.finally(()=>clearTimeout(r))])}function U(t,e){e&&(t==null||t.signal.addEventListener("abort",e))}function B(t){var e;return!!(!((e=t==null?void 0:t.signal)===null||e===void 0)&&e.aborted)}let E=0;class Z{constructor(e=100){this.size=()=>this.items.size,this.get=(i,n,r)=>{let l=this.items.get(i);if(l)l.lastUsed=++E,l.waiting++;else{const h=new AbortController,d=n(i,h);l={abortController:h,item:d,lastUsed:++E,waiting:1},this.items.set(i,l),this.prune()}const s=this.items,c=l.item.then(h=>h,h=>(s.delete(i),Promise.reject(h)));let m=!1;return U(r,()=>{var h;l&&l.abortController&&!m&&(m=!0,--l.waiting<=0&&((h=l.abortController)===null||h===void 0||h.abort(),s.delete(i)))}),c},this.clear=()=>this.items.clear(),this.maxSize=e,this.items=new Map}prune(){if(this.items.size>this.maxSize){let e,i=1/0;this.items.forEach((n,r)=>{n.lastUsed<i&&(i=n.lastUsed,e=r)}),typeof e<"u"&&this.items.delete(e)}}}let Y,et,N,it;async function at(t,e,i){const n=await createImageBitmap(t);return B(i)?null:W(n,e)}function W(t,e){return Y||(Y=new OffscreenCanvas(t.width,t.height),et=Y.getContext("2d",{willReadFrequently:!0})),Lt(t,e,Y,et)}async function xt(t,e,i){var n,r,l;const s=await createImageBitmap(t);if(B(i))return null;const c=new VideoFrame(s,{timestamp:0});try{if(!(((n=c==null?void 0:c.format)===null||n===void 0?void 0:n.startsWith("BGR"))||((r=c==null?void 0:c.format)===null||r===void 0?void 0:r.startsWith("RGB"))))throw new Error(`Unrecognized format: ${c==null?void 0:c.format}`);const h=(l=c==null?void 0:c.format)===null||l===void 0?void 0:l.startsWith("BGR"),d=c.allocationSize(),f=new Uint8ClampedArray(d);if(await c.copyTo(f),h)for(let w=0;w<f.length;w+=4){const F=f[w];f[w]=f[w+2],f[w+2]=F}return Et(s.width,s.height,e,f)}catch{return B(i)?null:W(s,e)}finally{c.close()}}async function qt(t,e,i){N||(N=document.createElement("canvas"),it=N.getContext("2d",{willReadFrequently:!0}));const n=new Image;U(i,()=>n.src="");const r=await new Promise((l,s)=>{n.onload=()=>{B(i)||l(n),URL.revokeObjectURL(n.src),n.onload=null},n.onerror=()=>s(new Error("Could not load image.")),n.src=t.size?URL.createObjectURL(t):""});return Lt(r,e,N,it)}function te(t,e,i){return self.actor.send("decodeImage",[],i,void 0,t,e)}function ee(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const It=H()?xt:mt()?at:ee()?te:qt;function Lt(t,e,i,n){if(i.width=t.width,i.height=t.height,!n)throw new Error("failed to get context");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height).data;return Et(t.width,t.height,e,r)}function Et(t,e,i,n){const r=i==="mapbox"?(s,c,m)=>-1e4+(s*256*256+c*256+m)*.1:(s,c,m)=>s*256+c+m/256-32768,l=new Float32Array(t*e);for(let s=0;s<n.length;s+=4)l[s/4]=r(n[s],n[s+1],n[s+2]);return{width:t,height:e,data:l}}const ie=-12e3,oe=9e3;function re(t){return!isNaN(t)&&t>=ie&&t<=oe}class ${constructor(e,i,n){this.split=(r,l,s)=>{if(r===0)return this;const c=1<<r,m=l*this.width/c,h=s*this.height/c;return new $(this.width/c,this.height/c,(d,f)=>this.get(d+m,f+h))},this.subsamplePixelCenters=r=>{const l=(m,h,d)=>isNaN(m)?h:isNaN(h)?m:m+(h-m)*d;if(r<=1)return this;const s=.5-1/(2*r),c=(m,h)=>{const d=m/r-s,f=h/r-s,w=Math.floor(d),F=Math.floor(f),C=this.get(w,F),P=this.get(w+1,F),I=this.get(w,F+1),k=this.get(w+1,F+1),V=d-w,ut=f-F,pt=l(C,P,V),X=l(I,k,V);return l(pt,X,ut)};return new $(this.width*r,this.height*r,c)},this.averagePixelCentersToGrid=(r=1)=>new $(this.width+1,this.height+1,(l,s)=>{let c=0,m=0,h=0;for(let d=l-r;d<l+r;d++)for(let f=s-r;f<s+r;f++)isNaN(h=this.get(d,f))||(m++,c+=h);return m===0?NaN:c/m}),this.scaleElevation=r=>r===1?this:new $(this.width,this.height,(l,s)=>this.get(l,s)*r),this.materialize=(r=2)=>{const l=this.width+2*r,s=new Float32Array(l*(this.height+2*r));let c=0;for(let m=-r;m<this.height+r;m++)for(let h=-r;h<this.width+r;h++)s[c++]=this.get(h,m);return new $(this.width,this.height,(m,h)=>s[(h+r)*l+m+r])},this.get=n,this.width=e,this.height=i}static fromRawDem(e){return new $(e.width,e.height,(i,n)=>{const r=e.data[n*e.width+i];return re(r)?r:NaN})}static combineNeighbors(e){if(e.length!==9)throw new Error("Must include a tile plus 8 neighbors");const i=e[4];if(!i)return;const n=i.width,r=i.height;return new $(n,r,(l,s)=>{let c=0;s<0?s+=r:s<r?c+=3:(s-=r,c+=6),l<0?l+=n:l<n?c+=1:(l-=n,c+=2);const m=e[c];return m?m.get(l,s):NaN})}}function ae(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ft={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ft.read=function(t,e,i,n,r){var l,s,c=r*8-n-1,m=(1<<c)-1,h=m>>1,d=-7,f=i?r-1:0,w=i?-1:1,F=t[e+f];for(f+=w,l=F&(1<<-d)-1,F>>=-d,d+=c;d>0;l=l*256+t[e+f],f+=w,d-=8);for(s=l&(1<<-d)-1,l>>=-d,d+=n;d>0;s=s*256+t[e+f],f+=w,d-=8);if(l===0)l=1-h;else{if(l===m)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,n),l=l-h}return(F?-1:1)*s*Math.pow(2,l-n)},Ft.write=function(t,e,i,n,r,l){var s,c,m,h=l*8-r-1,d=(1<<h)-1,f=d>>1,w=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:l-1,C=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+f>=1?e+=w/m:e+=w*Math.pow(2,1-f),e*m>=2&&(s++,m/=2),s+f>=d?(c=0,s=d):s+f>=1?(c=(e*m-1)*Math.pow(2,r),s=s+f):(c=e*Math.pow(2,f-1)*Math.pow(2,r),s=0));r>=8;t[i+F]=c&255,F+=C,c/=256,r-=8);for(s=s<<r|c,h+=r;h>0;t[i+F]=s&255,F+=C,s/=256,h-=8);t[i+F-C]|=P*128};var ne=T,gt=Ft;function T(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}T.Varint=0,T.Fixed64=1,T.Bytes=2,T.Fixed32=5;var St=65536*65536,Gt=1/St,le=12,Bt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");T.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,l=this.pos;this.type=n&7,t(r,e,this),this.pos===l&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=wt(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Nt(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=wt(this.buf,this.pos)+wt(this.buf,this.pos+4)*St;return this.pos+=8,t},readSFixed64:function(){var t=wt(this.buf,this.pos)+Nt(this.buf,this.pos+4)*St;return this.pos+=8,t},readFloat:function(){var t=gt.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=gt.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,i,n;return n=e[this.pos++],i=n&127,n<128||(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,se(i,t,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=le&&Bt?ze(this.buf,e,t):be(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==T.Bytes)return t.push(this.readVarint(e));var i=J(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==T.Bytes)return t.push(this.readSVarint());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==T.Bytes)return t.push(this.readBoolean());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==T.Bytes)return t.push(this.readFloat());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==T.Bytes)return t.push(this.readDouble());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==T.Bytes)return t.push(this.readFixed32());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==T.Bytes)return t.push(this.readSFixed32());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==T.Bytes)return t.push(this.readFixed64());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==T.Bytes)return t.push(this.readSFixed64());var e=J(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===T.Varint)for(;this.buf[this.pos++]>127;);else if(e===T.Bytes)this.pos=this.readVarint()+this.pos;else if(e===T.Fixed32)this.pos+=4;else if(e===T.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),dt(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),dt(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),dt(this.buf,t&-1,this.pos),dt(this.buf,Math.floor(t*Gt),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),dt(this.buf,t&-1,this.pos),dt(this.buf,Math.floor(t*Gt),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){ce(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:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=Te(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Xt(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),gt.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),gt.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Xt(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,T.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,de,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,fe,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ye,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ue,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,pe,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,xe,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ge,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,we,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_e,e)},writeBytesField:function(t,e){this.writeTag(t,T.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,T.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,T.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,T.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,T.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,T.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,T.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,T.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,T.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,T.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function se(t,e,i){var n=i.buf,r,l;if(l=n[i.pos++],r=(l&112)>>4,l<128||(l=n[i.pos++],r|=(l&127)<<3,l<128)||(l=n[i.pos++],r|=(l&127)<<10,l<128)||(l=n[i.pos++],r|=(l&127)<<17,l<128)||(l=n[i.pos++],r|=(l&127)<<24,l<128)||(l=n[i.pos++],r|=(l&1)<<31,l<128))return ht(t,r,e);throw new Error("Expected varint not more than 10 bytes")}function J(t){return t.type===T.Bytes?t.readVarint()+t.pos:t.pos+1}function ht(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function ce(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),i^4294967295?i=i+1|0:(i=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),me(i,n,e),he(n,e)}function me(t,e,i){i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos++]=t&127|128,t>>>=7,i.buf[i.pos]=t&127}function he(t,e){var i=(t&7)<<4;e.buf[e.pos++]|=i|((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 Xt(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function de(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function fe(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function ue(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function pe(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function ye(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function xe(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function ge(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function we(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function _e(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function wt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function dt(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Nt(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function be(t,e,i){for(var n="",r=e;r<i;){var l=t[r],s=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;var m,h,d;c===1?l<128&&(s=l):c===2?(m=t[r+1],(m&192)===128&&(s=(l&31)<<6|m&63,s<=127&&(s=null))):c===3?(m=t[r+1],h=t[r+2],(m&192)===128&&(h&192)===128&&(s=(l&15)<<12|(m&63)<<6|h&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):c===4&&(m=t[r+1],h=t[r+2],d=t[r+3],(m&192)===128&&(h&192)===128&&(d&192)===128&&(s=(l&15)<<18|(m&63)<<12|(h&63)<<6|d&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,c=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),r+=c}return n}function ze(t,e,i){return Bt.decode(t.subarray(e,i))}function Te(t,e,i){for(var n=0,r,l;n<e.length;n++){if(r=e.charCodeAt(n),r>55295&&r<57344)if(l)if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,l=r;continue}else r=l-55296<<10|r-56320|65536,l=null;else{r>56319||n+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):l=r;continue}else l&&(t[i++]=239,t[i++]=191,t[i++]=189,l=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=r&63|128)}return i}var ve=ae(ne),ft;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.POINT=1]="POINT",t[t.LINESTRING=2]="LINESTRING",t[t.POLYGON=3]="POLYGON"})(ft||(ft={}));function De(t){const e=new ve;for(const i in t.layers){const n=t.layers[i];n.extent||(n.extent=t.extent),e.writeMessage(3,Ee,{...n,id:i})}return e.finish()}function Ee(t,e){if(!e)throw new Error("pbf undefined");e.writeVarintField(15,2),e.writeStringField(1,t.id||""),e.writeVarintField(5,t.extent||4096);const i={keys:[],values:[],keycache:{},valuecache:{}};for(const n of t.features)i.feature=n,e.writeMessage(2,Fe,i);for(const n of i.keys)e.writeStringField(3,n);for(const n of i.values)e.writeMessage(4,ke,n)}function Fe(t,e){const i=t.feature;if(!i||!e)throw new Error;e.writeMessage(2,Se,t),e.writeVarintField(3,i.type),e.writeMessage(4,Ae,i)}function Se(t,e){const i=t.feature;if(!i||!e)throw new Error;const n=t.keys,r=t.values,l=t.keycache,s=t.valuecache;for(const c in i.properties){let m=i.properties[c],h=l[c];if(m===null)continue;typeof h>"u"&&(n.push(c),h=n.length-1,l[c]=h),e.writeVarint(h);const d=typeof m;d!=="string"&&d!=="boolean"&&d!=="number"&&(m=JSON.stringify(m));const f=`${d}:${m}`;let w=s[f];typeof w>"u"&&(r.push(m),w=r.length-1,s[f]=w),e.writeVarint(w)}}function At(t,e){return(e<<3)+(t&7)}function Vt(t){return t<<1^t>>31}function Ae(t,e){if(!e)throw new Error;const i=t.geometry,n=t.type;let r=0,l=0;for(const s of i){let c=1;n===ft.POINT&&(c=s.length/2),e.writeVarint(At(1,c));const m=s.length/2,h=n===ft.POLYGON?m-1:m;for(let d=0;d<h;d++){d===1&&n!==1&&e.writeVarint(At(2,h-1));const f=s[d*2]-r,w=s[d*2+1]-l;e.writeVarint(Vt(f)),e.writeVarint(Vt(w)),r+=f,l+=w}n===ft.POLYGON&&e.writeVarint(At(7,1))}}function ke(t,e){if(!e)throw new Error;typeof t=="string"?e.writeStringField(1,t):typeof t=="boolean"?e.writeBooleanField(7,t):typeof t=="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class Re{constructor(e,i,n,r,l){this.loaded=Promise.resolve(),this.decodeImage=It,this.fetchAndParseTile=(s,c,m,h,d)=>{const f=this,w=this.demUrlPattern.replace("{z}",s.toString()).replace("{x}",c.toString()).replace("{y}",m.toString());return d==null||d.useTile(w),this.parsedCache.get(w,async(F,C)=>{const P=await f.fetchTile(s,c,m,C,d);if(B(C))throw new Error("canceled");const I=f.decodeImage(P.data,f.encoding,C),k=d==null?void 0:d.marker("decode"),V=await I;return k==null||k(),V},h)},this.tileCache=new Z(i),this.parsedCache=new Z(i),this.contourCache=new Z(i),this.timeoutMs=l,this.demUrlPattern=e,this.encoding=n,this.maxzoom=r}fetchTile(e,i,n,r,l){const s=this.demUrlPattern.replace("{z}",e.toString()).replace("{x}",i.toString()).replace("{y}",n.toString());return l==null||l.useTile(s),this.tileCache.get(s,(c,m)=>{const h={signal:m.signal};l==null||l.fetchTile(s);const d=l==null?void 0:l.marker("fetch");return G(this.timeoutMs,fetch(s,h).then(async f=>{if(d==null||d(),!f.ok)throw new Error(`Bad response: ${f.status} for ${s}`);return{data:await f.blob(),expires:f.headers.get("expires")||void 0,cacheControl:f.headers.get("cache-control")||void 0}}),m)},r)}async fetchDem(e,i,n,r,l,s){const c=Math.min(e-(r.overzoom||0),this.maxzoom),m=e-c,h=1<<m,d=Math.floor(i/h),f=Math.floor(n/h),w=await this.fetchAndParseTile(c,d,f,l,s);return $.fromRawDem(w).split(m,i%h,n%h)}fetchContourTile(e,i,n,r,l,s){const{levels:c,multiplier:m=1,buffer:h=1,extent:d=4096,contourLayer:f="contours",elevationKey:w="ele",levelKey:F="level",subsampleBelow:C=100}=r;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const P=[e,i,n,p(r)].join("/");return this.contourCache.get(P,async(I,k)=>{const V=1<<e,ut=[];for(let q=n-1;q<=n+1;q++)for(let nt=i-1;nt<=i+1;nt++)ut.push(q<0||q>=V?void 0:this.fetchDem(e,(nt+V)%V,q,r,k,s));const pt=await Promise.all(ut);let X=$.combineNeighbors(pt);if(!X||B(k))return{arrayBuffer:new Uint8Array().buffer};const ot=s==null?void 0:s.marker("isoline");if(X.width>=C)X=X.materialize(2);else for(;X.width<C;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const R=x(c[0],X,d,h);ot==null||ot();const kt=De({extent:d,layers:{[f]:{features:Object.entries(R).map(([q,nt])=>{const _t=Number(q);return{type:ft.LINESTRING,geometry:nt,properties:{[w]:_t,[F]:Math.max(...c.map((bt,K)=>_t%bt===0?K:0))}}})}}});return ot==null||ot(),{arrayBuffer:kt.buffer}},l)}}const Q=typeof performance<"u"?performance:void 0,Ce=Q?Q.timeOrigin||new Date().getTime()-Q.now():new Date().getTime();function Pe(t){var e;return JSON.parse(JSON.stringify(((e=Q==null?void 0:Q.getEntriesByName)===null||e===void 0?void 0:e.call(Q,t))||[]))}function Ut(){return Q?Q.now():new Date().getTime()}function Oe(t){const e=[];for(const i of t)e.push(...i);return e}class Wt{constructor(e){this.marks={},this.urls=[],this.fetched=[],this.resources=[],this.tilesFetched=0,this.timeOrigin=Ce,this.finish=i=>{this.markFinish();const n=m=>{const h=this.marks[m]||[],d=Math.max(...h.map(w=>Math.max(...w))),f=Math.min(...h.map(w=>Math.min(...w)));return Number.isFinite(d)?d-f:void 0},r=n("main")||0,l=n("fetch"),s=n("decode"),c=n("isoline");return{url:i,tilesUsed:this.tilesFetched,origin:this.timeOrigin,marks:this.marks,resources:[...this.resources,...Oe(this.fetched.map(Pe))],duration:r,fetch:l,decode:s,process:c,wait:r-(l||0)-(s||0)-(c||0)}},this.error=i=>({...this.finish(i),error:!0}),this.marker=i=>{var n;this.marks[i]||(this.marks[i]=[]);const r=[Ut()];return(n=this.marks[i])===null||n===void 0||n.push(r),()=>r.push(Ut())},this.useTile=i=>{this.urls.indexOf(i)<0&&(this.urls.push(i),this.tilesFetched++)},this.fetchTile=i=>{this.fetched.indexOf(i)<0&&this.fetched.push(i)},this.addAll=i=>{var n;this.tilesFetched+=i.tilesUsed;const r=i.origin-this.timeOrigin;for(const l in i.marks){const s=l;(this.marks[s]||(this.marks[s]=[])).push(...((n=i.marks[s])===null||n===void 0?void 0:n.map(m=>m.map(h=>h+r)))||[])}this.resources.push(...i.resources.map(l=>Ie(l,r)))},this.markFinish=this.marker(e)}}const Me=/(Start$|End$|^start|^end)/;function Ie(t,e){const i={};for(const n in t)t[n]!==0&&Me.test(n)?i[n]=Number(t[n])+e:i[n]=t[n];return i}let Le=0;class Ge{constructor(e,i,n=2e4){this.callbacks={},this.cancels={},this.dest=e,this.timeoutMs=n,this.dest.onmessage=async({data:r})=>{const l=r;if(l.type==="cancel"){const s=this.cancels[l.id];delete this.cancels[l.id],s==null||s.abort()}else if(l.type==="response"){const s=this.callbacks[l.id];delete this.callbacks[l.id],s&&s(l.error?new Error(l.error):void 0,l.response,l.timings)}else if(l.type==="request"){const s=new Wt("worker"),c=i[l.name],m=new AbortController,h=c.apply(c,[...l.args,m,s]),d=`${l.name}_${l.id}`;if(l.id&&h){this.cancels[l.id]=m;try{const f=await h,w=f==null?void 0:f.transferrables;this.postMessage({id:l.id,type:"response",response:f,timings:s.finish(d)},w)}catch(f){this.postMessage({id:l.id,type:"response",error:(f==null?void 0:f.toString())||"error",timings:s.finish(d)})}delete this.cancels[l.id]}}}}postMessage(e,i){this.dest.postMessage(e,i||[])}send(e,i,n,r,...l){const s=++Le,c=new Promise((m,h)=>{this.postMessage({id:s,type:"request",name:e,args:l},i),this.callbacks[s]=(d,f,w)=>{r==null||r.addAll(w),d?h(d):m(f)}});return U(n,()=>{delete this.callbacks[s],this.postMessage({id:s,type:"cancel"})}),G(this.timeoutMs,c,n)}}o.A=Ge,o.H=$,o.L=Re,o.T=Wt,o.a=_,o.b=x,o.c=Et,o.d=It,o.e=A,o.f=M,o.g=b,o.p=D});Mt(["./shared"],function(o){const a=y=>Promise.reject(new Error(`No manager registered for ${y}`));class u{constructor(){this.managers={},this.init=(x,z)=>(this.managers[x.managerId]=new o.L(x.demUrlPattern,x.cacheSize,x.encoding,x.maxzoom,x.timeoutMs),Promise.resolve()),this.fetchTile=(x,z,S,O,A,_)=>{var p;return((p=this.managers[x])===null||p===void 0?void 0:p.fetchTile(z,S,O,A,_))||a(x)},this.fetchAndParseTile=(x,z,S,O,A,_)=>{var p;return o.p(((p=this.managers[x])===null||p===void 0?void 0:p.fetchAndParseTile(z,S,O,A,_))||a(x),!0)},this.fetchContourTile=(x,z,S,O,A,_,p)=>{var b;return o.f(((b=this.managers[x])===null||b===void 0?void 0:b.fetchContourTile(z,S,O,A,_,p))||a(x))}}}const g=typeof self<"u"?self:typeof window<"u"?window:global;g.actor=new o.A(g,new u)});Mt(["./shared"],function(o){const a={workerUrl:""};let u,g=0;class y{constructor(){this.decodeImage=(b,v,D)=>o.p(o.d(b,v,D),!1)}}function x(){if(!u){const p=new Worker(a.workerUrl),b=new y;u=new o.A(p,b)}return u}class z{constructor(b,v,D,M,j,mt){this.fetchTile=(H,G,U,B,E)=>this.actor.send("fetchTile",[],B,E,this.managerId,H,G,U),this.fetchAndParseTile=(H,G,U,B,E)=>this.actor.send("fetchAndParseTile",[],B,E,this.managerId,H,G,U),this.fetchContourTile=(H,G,U,B,E,Z)=>this.actor.send("fetchContourTile",[],E,Z,this.managerId,H,G,U,B);const tt=this.managerId=++g;this.actor=mt||x(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:v,demUrlPattern:b,encoding:D,maxzoom:M,managerId:tt,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((b,v)=>{const D=new FileReader;D.onload=M=>{var j;return b((j=M.target)===null||j===void 0?void 0:j.result)},D.onerror=v,D.readAsArrayBuffer(this)})});const S=p=>(b,v)=>{if(v instanceof AbortController)return p(b,v);{const D=new AbortController;return p(b,D).then(M=>v(void 0,M.data,M.cacheControl,M.expires),M=>v(M)),{cancel:()=>D.abort()}}},O=new Set;class A{constructor({url:b,cacheSize:v=100,id:D="dem",encoding:M="terrarium",maxzoom:j=12,worker:mt=!0,timeoutMs:tt=1e4,actor:H}){this.timingCallbacks=[],this.onTiming=E=>{this.timingCallbacks.push(E)},this.setupMaplibre=E=>{E.addProtocol(this.sharedDemProtocolId,this.sharedDemProtocol),E.addProtocol(this.contourProtocolId,this.contourProtocol)},this.sharedDemProtocolV4=async(E,Z)=>{const[Y,et,N]=this.parseUrl(E.url),it=new o.T("main");let at;try{const W=await this.manager.fetchTile(Y,et,N,Z,it);return at=it.finish(E.url),{data:await W.data.arrayBuffer(),cacheControl:W.cacheControl,expires:W.expires}}catch(W){throw at=it.error(E.url),W}finally{this.timingCallbacks.forEach(W=>W(at))}},this.contourProtocolV4=async(E,Z)=>{const Y=new o.T("main");let et;try{const[N,it,at]=this.parseUrl(E.url),W=o.a(E.url),xt=await this.manager.fetchContourTile(N,it,at,o.g(W,N),Z,Y);return et=Y.finish(E.url),{data:xt.arrayBuffer}}catch(N){throw et=Y.error(E.url),N}finally{this.timingCallbacks.forEach(N=>N(et))}},this.contourProtocol=S(this.contourProtocolV4),this.sharedDemProtocol=S(this.sharedDemProtocolV4),this.contourProtocolUrl=E=>`${this.contourProtocolUrlBase}?${o.e(E)}`;let G=D,U=1;for(;O.has(G);)G=D+U++;O.add(G),this.sharedDemProtocolId=`${G}-shared`,this.contourProtocolId=`${G}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=mt?z:o.L;this.manager=new B(b,v,M,j,tt,H)}getDemTile(b,v,D,M){return this.manager.fetchAndParseTile(b,v,D,M||new AbortController)}parseUrl(b){const[,v,D,M]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(b)||[];return[Number(v),Number(D),Number(M)]}}return{generateIsolines:o.b,DemSource:A,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){a.workerUrl=p},get workerUrl(){return a.workerUrl}}});var Be=Ot;function Xe(o){return o}function Ne(o){if(o==null)return Xe;var a,u,g=o.scale[0],y=o.scale[1],x=o.translate[0],z=o.translate[1];return function(S,O){O||(a=u=0);var A=2,_=S.length,p=new Array(_);for(p[0]=(a+=S[0])*g+x,p[1]=(u+=S[1])*y+z;A<_;)p[A]=S[A],++A;return p}}function Ve(o,a){for(var u,g=o.length,y=g-a;y<--g;)u=o[y],o[y++]=o[g],o[g]=u}function $t(o,a){return typeof a=="string"&&(a=o.objects[a]),a.type==="GeometryCollection"?{type:"FeatureCollection",features:a.geometries.map(function(u){return Yt(o,u)})}:Yt(o,a)}function Yt(o,a){var u=a.id,g=a.bbox,y=a.properties==null?{}:a.properties,x=Ue(o,a);return u==null&&g==null?{type:"Feature",properties:y,geometry:x}:g==null?{type:"Feature",id:u,properties:y,geometry:x}:{type:"Feature",id:u,bbox:g,properties:y,geometry:x}}function Ue(o,a){var u=Ne(o.transform),g=o.arcs;function y(_,p){p.length&&p.pop();for(var b=g[_<0?~_:_],v=0,D=b.length;v<D;++v)p.push(u(b[v],v));_<0&&Ve(p,D)}function x(_){return u(_)}function z(_){for(var p=[],b=0,v=_.length;b<v;++b)y(_[b],p);return p.length<2&&p.push(p[0]),p}function S(_){for(var p=z(_);p.length<4;)p.push(p[0]);return p}function O(_){return _.map(S)}function A(_){var p=_.type,b;switch(p){case"GeometryCollection":return{type:p,geometries:_.geometries.map(A)};case"Point":b=x(_.coordinates);break;case"MultiPoint":b=_.coordinates.map(x);break;case"LineString":b=z(_.arcs);break;case"MultiLineString":b=_.arcs.map(z);break;case"Polygon":b=O(_.arcs);break;case"MultiPolygon":b=_.arcs.map(O);break;default:return null}return{type:p,coordinates:b}}return A(a)}const We={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function je(){const o="navdata",a=We;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#F7F9FB","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":4,"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.6,8,.4]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#6600cc","text-halo-color":"#ffffff","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.5,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":6,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":"##FAD7A0","fill-opacity":["interpolate",["linear"],["zoom"],10,.15,11.5,0]}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":"#f6bf65","line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-letter-spacing":.1,"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,filter:["all",["!=",["get","CODE_TYPE"],"CTA"],["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"fill-color":a.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.035,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1],"line-dasharray":[1,1.4]}},{id:"controlled-label",filter:["all",["!=",["get","CODE_TYPE"],"ARSA"],["!=",["get","CODE_TYPE"],"TCA"],["!=",["get","CODE_TYPE"],"TRSA"]],type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-letter-spacing":.2,"text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.controlledStroke}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#E8A020",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-optional":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#3E4759"},`
|
|
2
2
|
`,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#E8A020"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#ffffff","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#E8A020"},`
|
|
3
3
|
`,["case",["all",["has","TXT_DESIG_HIGH"],["!=",["get","TXT_DESIG_HIGH"],""]],["get","TXT_DESIG_HIGH"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":.95,"text-color":"#3E4759"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"text-halo-color":"#ffffff","text-halo-width":.1,"icon-color":a.segment,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3],"icon-opacity":["interpolate",["linear"],["zoom"],6,1,12,1,15,.3]}},{id:"segment-radial",type:"symbol",source:o,"source-layer":"segment-radial",minzoom:10,layout:{"text-field":["concat",["get","bearing"],"°"],"text-size":9,"text-rotate":["to-number",["get","line_angle"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0,"text-offset":[0,-.6],"text-justify":"auto"},paint:{"text-color":a.segment}},{id:"airport-circle",type:"symbol",source:o,minzoom:3,"source-layer":"airport",filter:["case",["<",["zoom"],6],["==",["get","level"],1],!0],layout:{"icon-image":["case",["==",["get","CODE_TYPE_MIL_OPS"],"MIL"],"airport-mil",["==",["get","CODE_TYPE_MIL_OPS"],"MILEXT"],"airport-milext","airport-civ"],"icon-size":["interpolate",["linear"],["zoom"],4,.5,10,.9],"symbol-z-order":"viewport-y","text-field":["get","codeId"],"text-letter-spacing":.05,"text-anchor":"bottom","text-justify":"center","text-size":["interpolate",["linear"],["zoom"],4,0,5,12],"text-offset":["interpolate",["linear"],["zoom"],4,["literal",[0,-1.2]],5,["literal",[0,-.6]]],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0,visibility:"none","icon-size":["interpolate",["linear"],["zoom"],5,.6,9,1.2,12,1.3]},paint:{"icon-color":["case",["has","has_amm"],"#4B2D6E",a.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2]}},{id:"airport-label",type:"symbol",source:o,"source-layer":"airport",minzoom:4,filter:["case",["<",["zoom"],8],["==",["get","level"],1],!0],layout:{"text-field":["get","CODE_ID"],"text-size":["interpolate",["linear"],["zoom"],4,9,8,11],"text-anchor":"top","text-offset":[0,1],"text-allow-overlap":!1,"text-ignore-placement":!1},paint:{"text-color":["case",["has","has_amm"],"#4B2D6E",a.airport]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,maxzoom:11,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,13,10]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,maxzoom:11,paint:{"line-color":a.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,4],"line-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"runway-label",type:"symbol",source:o,"source-layer":"runway",minzoom:10,layout:{"text-field":["concat",["to-string",["get","VAL_LEN"]],"×",["to-string",["get","VAL_WID"]],"m"],"text-size":10,"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":a.runway,"text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",minzoom:8,layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],8,.072,10,.072,11,.126,12,.18,13,.234,14,.288,15,.342,16,.396,17,.45,22,.45],"icon-rotate":["to-number",["get","VAL_MAG_VAR"],0],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,visibility:"none"},paint:{"icon-color":"#0b417a"}},{id:"vor-symbol-normal",minzoom:4,maxzoom:9,type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"v2:vor-normal","icon-size":["interpolate",["linear"],["zoom"],4,.7,8,1],"icon-rotation-alignment":"map","symbol-z-order":"viewport-y","text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"icon-color":"#3874cb","icon-opacity":["interpolate",["linear"],["zoom"],8,1,9,0]}},{id:"vor-label",type:"symbol",source:o,"source-layer":"vor",minzoom:5,layout:{"text-field":["get","CODE_ID"],"text-size":10,"text-anchor":"bottom","text-offset":[0,-.8]},paint:{"text-color":a.vor,"text-halo-color":"#ffffff","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"v2:ndb-normal","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["format",["get","CODE_ID"],{"text-color":a.ndb,"font-scale":1.1},"",{},["coalesce",["get","VAL_FREQ"],""],{"text-color":a.ndb,"font-scale":.95}],"text-size":10,"text-offset":[0,.5],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0,"text-anchor":"top"},paint:{"text-color":a.ndb,"text-halo-color":"#ffffff","text-halo-width":.5,"text-halo-blur":1,"icon-color":a.ndb,"text-opacity":["interpolate",["linear"],["zoom"],4,0,5.5,0,6,.6,8,1,10,.3,12,0],"icon-opacity":["interpolate",["linear"],["zoom"],4,0,5,.3,5.5,.8,8,1,12,1,14,.6]}},{id:"waypoint-symbol",type:"symbol",source:o,"source-layer":"waypoint",minzoom:5,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"waypoint-compusory","waypoint"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":10,"text-letter-spacing":.02,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto"},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-halo-color":"rgba(0,0,0,0)","icon-halo-width":0,"icon-opacity":["interpolate",["linear"],["zoom"],5,.5,12,1,15,.2],"text-halo-color":"#FFFFFF","text-halo-blur":0,"text-opacity":["interpolate",["linear"],["zoom"],6,1,12,.9,15,.15]}},{id:"waypoint-off-airway-symbol",type:"symbol",source:o,"source-layer":"waypoint-off-airway",minzoom:7,layout:{"icon-image":["case",["==",["get","report_type"],"C"],"designate_point_inway","designate_point_notinway"],"icon-size":.6,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":["get","CODE_ID"],"text-size":9,"text-variable-anchor-offset":["bottom",[0,-.6],"top",[0,.6],"right",[-.6,0],"left",[.6,0],"bottom-right",[-.4,-.4],"bottom-left",[.4,-.4],"top-right",[-.4,.4],"top-left",[.4,.4]],"text-justify":"auto","text-optional":!0},paint:{"icon-color":a.waypoint,"text-color":a.waypoint,"text-halo-color":"#ffffff","text-halo-width":1,"icon-opacity":["interpolate",["linear"],["zoom"],7,.5,12,1,15,.2],"text-opacity":["interpolate",["linear"],["zoom"],7,1,12,.9,15,.15]}}]}const $e={airspaceStroke:"#18C29C",restrictedStroke:"#f87171",controlledStroke:"#38bdf8",controlledFill:"#38bdf8",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function Ye(){const o="navdata",a=$e;return[{id:"landLaye",type:"fill",source:"land",layout:{visibility:"visible"},paint:{"fill-color":"#0A111A","fill-opacity":1}},{id:"boundary",type:"line",source:"boundary",minzoom:.5,paint:{"line-color":"#2A303C","line-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border"}},{id:"adiz-line",type:"line",source:o,"source-layer":"adiz",minzoom:3,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#a855f7","line-width":["interpolate",["linear"],["zoom"],3,3,7,6],"line-pattern":"normal:adiz","line-opacity":["interpolate",["linear"],["zoom"],3,.7,8,.5]}},{id:"adiz-label",type:"symbol",source:o,"source-layer":"adiz-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"text-max-width":10,"symbol-placement":"point"},paint:{"text-color":"#c084fc","text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"fir-line",type:"line",source:o,"source-layer":"fir",minzoom:2,layout:{"line-cap":"butt","line-join":"miter","line-miter-limit":0},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],2,0,2.7,.8,9,.8,10,.5],"line-width":.8,"line-dasharray":[4.2,4]}},{id:"fir_line_dash",type:"line",source:o,"source-layer":"fir",minzoom:5,layout:{"line-miter-limit":0,"line-cap":"butt","line-join":"miter"},paint:{"line-color":a.airspaceStroke,"line-opacity":["interpolate",["linear"],["zoom"],5,0,5.5,.8,9,.8,10,.5],"line-width":5,"line-dasharray":[.2,5]}},{id:"fir-label-lineside",type:"symbol",source:o,"source-layer":"fir",minzoom:4,layout:{"text-field":["concat",["get","TXT_NAME"],"/",["get","CODE_ID"],"/",["get","CODE_TYPE"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1],"text-letter-spacing":.05,"text-optional":!0},paint:{"text-color":a.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"fir-label",type:"symbol",source:o,"source-layer":"fir-centroid",minzoom:3,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":["interpolate",["linear"],["zoom"],3,12,17,16],"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.airspaceStroke,"text-halo-color":"#0f172a","text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],3,.85,8,.7,12,.5]}},{id:"restricted-fill",type:"fill",source:o,"source-layer":"restricted-fill",minzoom:4,paint:{"fill-color":["case",["==",["get","CODE_TYPE"],"P"],"#ef4444",["==",["get","CODE_TYPE"],"D"],"#f97316","#ef4444"],"fill-opacity":.04}},{id:"restricted-stroke",type:"line",source:o,"source-layer":"restricted",paint:{"line-color":a.restrictedStroke,"line-width":1,"line-dasharray":[2,2],"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1]}},{id:"restricted-label",type:"symbol",source:o,"source-layer":"restricted",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"line","text-max-width":8,"text-offset":[0,1]},paint:{"text-color":a.restrictedStroke,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,paint:{"fill-color":a.controlledFill,"fill-opacity":.03}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":a.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1],"line-dasharray":[2,2]}},{id:"controlled-label",type:"symbol",source:o,"source-layer":"controlled",minzoom:6,layout:{"text-field":["coalesce",["get","TXT_NAME"],["get","CODE_ID"]],"text-size":10,"symbol-placement":"point","text-max-width":8},paint:{"text-color":a.controlledStroke,"text-halo-color":"#0f172a","text-halo-width":1.5}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#fbbf24",a.segment],"line-width":["interpolate",["linear"],["zoom"],5,.2,8,.8],"line-blur":0,"line-opacity":["interpolate",["linear"],["zoom"],5,.3,6,1,8,1,12,.8,15,.2]}},{id:"segment-label",type:"symbol",source:o,"source-layer":"segment",minzoom:6,layout:{"icon-image":["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""],["!=",["get","TXT_DESIG"]," "],["!=",["get","TXT_DESIG"],null]],"segment-both",["all",["has","TXT_DESIG_FORWARD"]],"segment-right",["all",["has","TXT_DESIG_BACKWARD"]],"segment-left","segment-both"],"icon-anchor":"center","symbol-placement":"line","icon-text-fit":"width","icon-size":1,"text-allow-overlap":!1,"icon-allow-overlap":!1,"text-anchor":"center","text-justify":"center","text-line-height":1.3,"text-letter-spacing":.1,"text-field":["step",["zoom"],["format",["case",["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a"}],10,["format",["concat",["get","VAL_LEN"],"",["get","UOM_DIST"]],{"font-scale":.95,"text-color":"#cbd5e1"},`
|
|
4
4
|
`,["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""],""],{"font-scale":1,"text-color":"#FFFFFF"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""],""],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],["get","TXT_DESIG_FORWARD"],["all",["has","TXT_DESIG"],["!=",["get","TXT_DESIG"],""]],["get","TXT_DESIG"],["all",["has","TXT_DESIG_BACKWARD"],["!=",["get","TXT_DESIG_BACKWARD"],""]],["get","TXT_DESIG_BACKWARD"],"-"],{"font-scale":1,"text-color":"#0f172a","font-weight":"bold"},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]]," ",""]],{},["case",["all",["has","TXT_DESIG_FORWARD"],["!=",["get","TXT_DESIG_FORWARD"],""]],"",["case",["all",["has","TXT_DESIG_RNP"],["!=",["get","TXT_DESIG_RNP"],""]],["get","TXT_DESIG_RNP"],""]],{"font-scale":.85,"text-color":"#FFFFFF"},`
|
package/dist/index.js
CHANGED
|
@@ -142,16 +142,16 @@ Mt(["exports"], function(o) {
|
|
|
142
142
|
if (!t)
|
|
143
143
|
return {};
|
|
144
144
|
const r = i / (e.width - 1);
|
|
145
|
-
let l, s, c, m,
|
|
145
|
+
let l, s, c, m, h, f;
|
|
146
146
|
const d = {}, w = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
|
|
147
147
|
function C(P, I, k) {
|
|
148
|
-
P[0] === 0 ? k(r * (
|
|
148
|
+
P[0] === 0 ? k(r * (f - 1), r * (h - y(c, I, l))) : P[0] === 2 ? k(r * f, r * (h - y(m, I, s))) : P[1] === 0 ? k(r * (f - y(s, I, l)), r * (h - 1)) : k(r * (f - y(m, I, c)), r * h);
|
|
149
149
|
}
|
|
150
|
-
for (
|
|
151
|
-
s = e.get(0,
|
|
150
|
+
for (h = 1 - n; h < e.height + n; h++) {
|
|
151
|
+
s = e.get(0, h - 1), m = e.get(0, h);
|
|
152
152
|
let P = Math.min(s, m), I = Math.max(s, m);
|
|
153
|
-
for (
|
|
154
|
-
l = s, c = m, s = e.get(
|
|
153
|
+
for (f = 1 - n; f < e.width + n; f++) {
|
|
154
|
+
l = s, c = m, s = e.get(f, h - 1), m = e.get(f, h);
|
|
155
155
|
const k = P, V = I;
|
|
156
156
|
if (P = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
|
|
157
157
|
continue;
|
|
@@ -163,7 +163,7 @@ Mt(["exports"], function(o) {
|
|
|
163
163
|
Y || w.set(R, Y = /* @__PURE__ */ new Map());
|
|
164
164
|
let lt = F.get(R);
|
|
165
165
|
lt || F.set(R, lt = /* @__PURE__ */ new Map());
|
|
166
|
-
const kt = bt[0], zt = bt[1], yt = g(e.width,
|
|
166
|
+
const kt = bt[0], zt = bt[1], yt = g(e.width, f, h, kt), st = g(e.width, f, h, zt);
|
|
167
167
|
let L, Tt;
|
|
168
168
|
if (L = lt.get(yt))
|
|
169
169
|
if (lt.delete(yt), Tt = Y.get(st))
|
|
@@ -311,19 +311,19 @@ Mt(["exports"], function(o) {
|
|
|
311
311
|
if (l)
|
|
312
312
|
l.lastUsed = ++E, l.waiting++;
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
314
|
+
const h = new AbortController(), f = n(i, h);
|
|
315
315
|
l = {
|
|
316
|
-
abortController:
|
|
317
|
-
item:
|
|
316
|
+
abortController: h,
|
|
317
|
+
item: f,
|
|
318
318
|
lastUsed: ++E,
|
|
319
319
|
waiting: 1
|
|
320
320
|
}, this.items.set(i, l), this.prune();
|
|
321
321
|
}
|
|
322
|
-
const s = this.items, c = l.item.then((
|
|
322
|
+
const s = this.items, c = l.item.then((h) => h, (h) => (s.delete(i), Promise.reject(h)));
|
|
323
323
|
let m = !1;
|
|
324
324
|
return U(r, () => {
|
|
325
|
-
var
|
|
326
|
-
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((
|
|
325
|
+
var h;
|
|
326
|
+
l && l.abortController && !m && (m = !0, --l.waiting <= 0 && ((h = l.abortController) === null || h === void 0 || h.abort(), s.delete(i)));
|
|
327
327
|
}), c;
|
|
328
328
|
}, this.clear = () => this.items.clear(), this.maxSize = e, this.items = /* @__PURE__ */ new Map();
|
|
329
329
|
}
|
|
@@ -355,8 +355,8 @@ Mt(["exports"], function(o) {
|
|
|
355
355
|
try {
|
|
356
356
|
if (!(((n = c == null ? void 0 : c.format) === null || n === void 0 ? void 0 : n.startsWith("BGR")) || ((r = c == null ? void 0 : c.format) === null || r === void 0 ? void 0 : r.startsWith("RGB"))))
|
|
357
357
|
throw new Error(`Unrecognized format: ${c == null ? void 0 : c.format}`);
|
|
358
|
-
const
|
|
359
|
-
if (await c.copyTo(d),
|
|
358
|
+
const h = (l = c == null ? void 0 : c.format) === null || l === void 0 ? void 0 : l.startsWith("BGR"), f = c.allocationSize(), d = new Uint8ClampedArray(f);
|
|
359
|
+
if (await c.copyTo(d), h)
|
|
360
360
|
for (let w = 0; w < d.length; w += 4) {
|
|
361
361
|
const F = d[w];
|
|
362
362
|
d[w] = d[w + 2], d[w + 2] = F;
|
|
@@ -414,30 +414,30 @@ Mt(["exports"], function(o) {
|
|
|
414
414
|
this.split = (r, l, s) => {
|
|
415
415
|
if (r === 0)
|
|
416
416
|
return this;
|
|
417
|
-
const c = 1 << r, m = l * this.width / c,
|
|
418
|
-
return new $(this.width / c, this.height / c, (
|
|
417
|
+
const c = 1 << r, m = l * this.width / c, h = s * this.height / c;
|
|
418
|
+
return new $(this.width / c, this.height / c, (f, d) => this.get(f + m, d + h));
|
|
419
419
|
}, this.subsamplePixelCenters = (r) => {
|
|
420
|
-
const l = (m,
|
|
420
|
+
const l = (m, h, f) => isNaN(m) ? h : isNaN(h) ? m : m + (h - m) * f;
|
|
421
421
|
if (r <= 1)
|
|
422
422
|
return this;
|
|
423
|
-
const s = 0.5 - 1 / (2 * r), c = (m,
|
|
424
|
-
const
|
|
423
|
+
const s = 0.5 - 1 / (2 * r), c = (m, h) => {
|
|
424
|
+
const f = m / r - s, d = h / r - s, w = Math.floor(f), F = Math.floor(d), C = this.get(w, F), P = this.get(w + 1, F), I = this.get(w, F + 1), k = this.get(w + 1, F + 1), V = f - w, dt = d - F, pt = l(C, P, V), X = l(I, k, V);
|
|
425
425
|
return l(pt, X, dt);
|
|
426
426
|
};
|
|
427
427
|
return new $(this.width * r, this.height * r, c);
|
|
428
428
|
}, this.averagePixelCentersToGrid = (r = 1) => new $(this.width + 1, this.height + 1, (l, s) => {
|
|
429
|
-
let c = 0, m = 0,
|
|
430
|
-
for (let
|
|
429
|
+
let c = 0, m = 0, h = 0;
|
|
430
|
+
for (let f = l - r; f < l + r; f++)
|
|
431
431
|
for (let d = s - r; d < s + r; d++)
|
|
432
|
-
isNaN(
|
|
432
|
+
isNaN(h = this.get(f, d)) || (m++, c += h);
|
|
433
433
|
return m === 0 ? NaN : c / m;
|
|
434
434
|
}), this.scaleElevation = (r) => r === 1 ? this : new $(this.width, this.height, (l, s) => this.get(l, s) * r), this.materialize = (r = 2) => {
|
|
435
435
|
const l = this.width + 2 * r, s = new Float32Array(l * (this.height + 2 * r));
|
|
436
436
|
let c = 0;
|
|
437
437
|
for (let m = -r; m < this.height + r; m++)
|
|
438
|
-
for (let
|
|
439
|
-
s[c++] = this.get(
|
|
440
|
-
return new $(this.width, this.height, (m,
|
|
438
|
+
for (let h = -r; h < this.width + r; h++)
|
|
439
|
+
s[c++] = this.get(h, m);
|
|
440
|
+
return new $(this.width, this.height, (m, h) => s[(h + r) * l + m + r]);
|
|
441
441
|
}, this.get = n, this.width = e, this.height = i;
|
|
442
442
|
}
|
|
443
443
|
/** Construct a height tile from raw DEM pixel values */
|
|
@@ -474,24 +474,24 @@ Mt(["exports"], function(o) {
|
|
|
474
474
|
var Et = {};
|
|
475
475
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
476
476
|
Et.read = function(t, e, i, n, r) {
|
|
477
|
-
var l, s, c = r * 8 - n - 1, m = (1 << c) - 1,
|
|
478
|
-
for (d += w, l = F & (1 << -
|
|
477
|
+
var l, s, c = r * 8 - n - 1, m = (1 << c) - 1, h = m >> 1, f = -7, d = i ? r - 1 : 0, w = i ? -1 : 1, F = t[e + d];
|
|
478
|
+
for (d += w, l = F & (1 << -f) - 1, F >>= -f, f += c; f > 0; l = l * 256 + t[e + d], d += w, f -= 8)
|
|
479
479
|
;
|
|
480
|
-
for (s = l & (1 << -
|
|
480
|
+
for (s = l & (1 << -f) - 1, l >>= -f, f += n; f > 0; s = s * 256 + t[e + d], d += w, f -= 8)
|
|
481
481
|
;
|
|
482
482
|
if (l === 0)
|
|
483
|
-
l = 1 -
|
|
483
|
+
l = 1 - h;
|
|
484
484
|
else {
|
|
485
485
|
if (l === m)
|
|
486
486
|
return s ? NaN : (F ? -1 : 1) * (1 / 0);
|
|
487
|
-
s = s + Math.pow(2, n), l = l -
|
|
487
|
+
s = s + Math.pow(2, n), l = l - h;
|
|
488
488
|
}
|
|
489
489
|
return (F ? -1 : 1) * s * Math.pow(2, l - n);
|
|
490
490
|
}, Et.write = function(t, e, i, n, r, l) {
|
|
491
|
-
var s, c, m,
|
|
492
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s =
|
|
491
|
+
var s, c, m, h = l * 8 - r - 1, f = (1 << h) - 1, d = f >> 1, w = r === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, C = n ? 1 : -1, P = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
492
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s = f) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + d >= 1 ? e += w / m : e += w * Math.pow(2, 1 - d), e * m >= 2 && (s++, m /= 2), s + d >= f ? (c = 0, s = f) : s + d >= 1 ? (c = (e * m - 1) * Math.pow(2, r), s = s + d) : (c = e * Math.pow(2, d - 1) * Math.pow(2, r), s = 0)); r >= 8; t[i + F] = c & 255, F += C, c /= 256, r -= 8)
|
|
493
493
|
;
|
|
494
|
-
for (s = s << r | c,
|
|
494
|
+
for (s = s << r | c, h += r; h > 0; t[i + F] = s & 255, F += C, s /= 256, h -= 8)
|
|
495
495
|
;
|
|
496
496
|
t[i + F - C] |= P * 128;
|
|
497
497
|
};
|
|
@@ -642,16 +642,16 @@ Mt(["exports"], function(o) {
|
|
|
642
642
|
return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
|
|
643
643
|
},
|
|
644
644
|
writeFixed32: function(t) {
|
|
645
|
-
this.realloc(4),
|
|
645
|
+
this.realloc(4), ht(this.buf, t, this.pos), this.pos += 4;
|
|
646
646
|
},
|
|
647
647
|
writeSFixed32: function(t) {
|
|
648
|
-
this.realloc(4),
|
|
648
|
+
this.realloc(4), ht(this.buf, t, this.pos), this.pos += 4;
|
|
649
649
|
},
|
|
650
650
|
writeFixed64: function(t) {
|
|
651
|
-
this.realloc(8),
|
|
651
|
+
this.realloc(8), ht(this.buf, t & -1, this.pos), ht(this.buf, Math.floor(t * Gt), this.pos + 4), this.pos += 8;
|
|
652
652
|
},
|
|
653
653
|
writeSFixed64: function(t) {
|
|
654
|
-
this.realloc(8),
|
|
654
|
+
this.realloc(8), ht(this.buf, t & -1, this.pos), ht(this.buf, Math.floor(t * Gt), this.pos + 4), this.pos += 8;
|
|
655
655
|
},
|
|
656
656
|
writeVarint: function(t) {
|
|
657
657
|
if (t = +t || 0, t > 268435455 || t < 0) {
|
|
@@ -695,7 +695,7 @@ Mt(["exports"], function(o) {
|
|
|
695
695
|
this.writeTag(t, T.Bytes), this.writeRawMessage(e, i);
|
|
696
696
|
},
|
|
697
697
|
writePackedVarint: function(t, e) {
|
|
698
|
-
e.length && this.writeMessage(t,
|
|
698
|
+
e.length && this.writeMessage(t, fe, e);
|
|
699
699
|
},
|
|
700
700
|
writePackedSVarint: function(t, e) {
|
|
701
701
|
e.length && this.writeMessage(t, de, e);
|
|
@@ -770,12 +770,12 @@ Mt(["exports"], function(o) {
|
|
|
770
770
|
var i, n;
|
|
771
771
|
if (t >= 0 ? (i = t % 4294967296 | 0, n = t / 4294967296 | 0) : (i = ~(-t % 4294967296), n = ~(-t / 4294967296), i ^ 4294967295 ? i = i + 1 | 0 : (i = 0, n = n + 1 | 0)), t >= 18446744073709552e3 || t < -18446744073709552e3)
|
|
772
772
|
throw new Error("Given varint doesn't fit into 10 bytes");
|
|
773
|
-
e.realloc(10), me(i, n, e),
|
|
773
|
+
e.realloc(10), me(i, n, e), he(n, e);
|
|
774
774
|
}
|
|
775
775
|
function me(t, e, i) {
|
|
776
776
|
i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos++] = t & 127 | 128, t >>>= 7, i.buf[i.pos] = t & 127;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function he(t, e) {
|
|
779
779
|
var i = (t & 7) << 4;
|
|
780
780
|
e.buf[e.pos++] |= i | ((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)))));
|
|
781
781
|
}
|
|
@@ -784,7 +784,7 @@ Mt(["exports"], function(o) {
|
|
|
784
784
|
i.realloc(n);
|
|
785
785
|
for (var r = i.pos - 1; r >= t; r--) i.buf[r + n] = i.buf[r];
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function fe(t, e) {
|
|
788
788
|
for (var i = 0; i < t.length; i++) e.writeVarint(t[i]);
|
|
789
789
|
}
|
|
790
790
|
function de(t, e) {
|
|
@@ -814,7 +814,7 @@ Mt(["exports"], function(o) {
|
|
|
814
814
|
function wt(t, e) {
|
|
815
815
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + t[e + 3] * 16777216;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function ht(t, e, i) {
|
|
818
818
|
t[i] = e, t[i + 1] = e >>> 8, t[i + 2] = e >>> 16, t[i + 3] = e >>> 24;
|
|
819
819
|
}
|
|
820
820
|
function Nt(t, e) {
|
|
@@ -824,8 +824,8 @@ Mt(["exports"], function(o) {
|
|
|
824
824
|
for (var n = "", r = e; r < i; ) {
|
|
825
825
|
var l = t[r], s = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
|
|
826
826
|
if (r + c > i) break;
|
|
827
|
-
var m,
|
|
828
|
-
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[r + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[r + 1],
|
|
827
|
+
var m, h, f;
|
|
828
|
+
c === 1 ? l < 128 && (s = l) : c === 2 ? (m = t[r + 1], (m & 192) === 128 && (s = (l & 31) << 6 | m & 63, s <= 127 && (s = null))) : c === 3 ? (m = t[r + 1], h = t[r + 2], (m & 192) === 128 && (h & 192) === 128 && (s = (l & 15) << 12 | (m & 63) << 6 | h & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (m = t[r + 1], h = t[r + 2], f = t[r + 3], (m & 192) === 128 && (h & 192) === 128 && (f & 192) === 128 && (s = (l & 15) << 18 | (m & 63) << 12 | (h & 63) << 6 | f & 63, (s <= 65535 || s >= 1114112) && (s = null))), s === null ? (s = 65533, c = 1) : s > 65535 && (s -= 65536, n += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), n += String.fromCharCode(s), r += c;
|
|
829
829
|
}
|
|
830
830
|
return n;
|
|
831
831
|
}
|
|
@@ -850,10 +850,10 @@ Mt(["exports"], function(o) {
|
|
|
850
850
|
}
|
|
851
851
|
return i;
|
|
852
852
|
}
|
|
853
|
-
var ve = /* @__PURE__ */ ae(ne),
|
|
853
|
+
var ve = /* @__PURE__ */ ae(ne), ft;
|
|
854
854
|
(function(t) {
|
|
855
855
|
t[t.UNKNOWN = 0] = "UNKNOWN", t[t.POINT = 1] = "POINT", t[t.LINESTRING = 2] = "LINESTRING", t[t.POLYGON = 3] = "POLYGON";
|
|
856
|
-
})(
|
|
856
|
+
})(ft || (ft = {}));
|
|
857
857
|
function De(t) {
|
|
858
858
|
const e = new ve();
|
|
859
859
|
for (const i in t.layers) {
|
|
@@ -891,13 +891,13 @@ Mt(["exports"], function(o) {
|
|
|
891
891
|
throw new Error();
|
|
892
892
|
const n = t.keys, r = t.values, l = t.keycache, s = t.valuecache;
|
|
893
893
|
for (const c in i.properties) {
|
|
894
|
-
let m = i.properties[c],
|
|
894
|
+
let m = i.properties[c], h = l[c];
|
|
895
895
|
if (m === null)
|
|
896
896
|
continue;
|
|
897
|
-
typeof
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
const d = `${
|
|
897
|
+
typeof h > "u" && (n.push(c), h = n.length - 1, l[c] = h), e.writeVarint(h);
|
|
898
|
+
const f = typeof m;
|
|
899
|
+
f !== "string" && f !== "boolean" && f !== "number" && (m = JSON.stringify(m));
|
|
900
|
+
const d = `${f}:${m}`;
|
|
901
901
|
let w = s[d];
|
|
902
902
|
typeof w > "u" && (r.push(m), w = r.length - 1, s[d] = w), e.writeVarint(w);
|
|
903
903
|
}
|
|
@@ -915,14 +915,14 @@ Mt(["exports"], function(o) {
|
|
|
915
915
|
let r = 0, l = 0;
|
|
916
916
|
for (const s of i) {
|
|
917
917
|
let c = 1;
|
|
918
|
-
n ===
|
|
919
|
-
const m = s.length / 2,
|
|
920
|
-
for (let
|
|
921
|
-
|
|
922
|
-
const d = s[
|
|
918
|
+
n === ft.POINT && (c = s.length / 2), e.writeVarint(St(1, c));
|
|
919
|
+
const m = s.length / 2, h = n === ft.POLYGON ? m - 1 : m;
|
|
920
|
+
for (let f = 0; f < h; f++) {
|
|
921
|
+
f === 1 && n !== 1 && e.writeVarint(St(2, h - 1));
|
|
922
|
+
const d = s[f * 2] - r, w = s[f * 2 + 1] - l;
|
|
923
923
|
e.writeVarint(Vt(d)), e.writeVarint(Vt(w)), r += d, l += w;
|
|
924
924
|
}
|
|
925
|
-
n ===
|
|
925
|
+
n === ft.POLYGON && e.writeVarint(St(7, 1));
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
function ke(t, e) {
|
|
@@ -932,27 +932,27 @@ Mt(["exports"], function(o) {
|
|
|
932
932
|
}
|
|
933
933
|
class Re {
|
|
934
934
|
constructor(e, i, n, r, l) {
|
|
935
|
-
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m,
|
|
935
|
+
this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, h, f) => {
|
|
936
936
|
const d = this, w = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
|
|
937
|
-
return
|
|
938
|
-
const P = await d.fetchTile(s, c, m, C,
|
|
937
|
+
return f == null || f.useTile(w), this.parsedCache.get(w, async (F, C) => {
|
|
938
|
+
const P = await d.fetchTile(s, c, m, C, f);
|
|
939
939
|
if (B(C))
|
|
940
940
|
throw new Error("canceled");
|
|
941
|
-
const I = d.decodeImage(P.data, d.encoding, C), k =
|
|
941
|
+
const I = d.decodeImage(P.data, d.encoding, C), k = f == null ? void 0 : f.marker("decode"), V = await I;
|
|
942
942
|
return k == null || k(), V;
|
|
943
|
-
},
|
|
943
|
+
}, h);
|
|
944
944
|
}, this.tileCache = new Z(i), this.parsedCache = new Z(i), this.contourCache = new Z(i), this.timeoutMs = l, this.demUrlPattern = e, this.encoding = n, this.maxzoom = r;
|
|
945
945
|
}
|
|
946
946
|
fetchTile(e, i, n, r, l) {
|
|
947
947
|
const s = this.demUrlPattern.replace("{z}", e.toString()).replace("{x}", i.toString()).replace("{y}", n.toString());
|
|
948
948
|
return l == null || l.useTile(s), this.tileCache.get(s, (c, m) => {
|
|
949
|
-
const
|
|
949
|
+
const h = {
|
|
950
950
|
signal: m.signal
|
|
951
951
|
};
|
|
952
952
|
l == null || l.fetchTile(s);
|
|
953
|
-
const
|
|
954
|
-
return G(this.timeoutMs, fetch(s,
|
|
955
|
-
if (
|
|
953
|
+
const f = l == null ? void 0 : l.marker("fetch");
|
|
954
|
+
return G(this.timeoutMs, fetch(s, h).then(async (d) => {
|
|
955
|
+
if (f == null || f(), !d.ok)
|
|
956
956
|
throw new Error(`Bad response: ${d.status} for ${s}`);
|
|
957
957
|
return {
|
|
958
958
|
data: await d.blob(),
|
|
@@ -963,11 +963,11 @@ Mt(["exports"], function(o) {
|
|
|
963
963
|
}, r);
|
|
964
964
|
}
|
|
965
965
|
async fetchDem(e, i, n, r, l, s) {
|
|
966
|
-
const c = Math.min(e - (r.overzoom || 0), this.maxzoom), m = e - c,
|
|
967
|
-
return $.fromRawDem(w).split(m, i %
|
|
966
|
+
const c = Math.min(e - (r.overzoom || 0), this.maxzoom), m = e - c, h = 1 << m, f = Math.floor(i / h), d = Math.floor(n / h), w = await this.fetchAndParseTile(c, f, d, l, s);
|
|
967
|
+
return $.fromRawDem(w).split(m, i % h, n % h);
|
|
968
968
|
}
|
|
969
969
|
fetchContourTile(e, i, n, r, l, s) {
|
|
970
|
-
const { levels: c, multiplier: m = 1, buffer:
|
|
970
|
+
const { levels: c, multiplier: m = 1, buffer: h = 1, extent: f = 4096, contourLayer: d = "contours", elevationKey: w = "ele", levelKey: F = "level", subsampleBelow: C = 100 } = r;
|
|
971
971
|
if (!c || c.length === 0)
|
|
972
972
|
return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
|
|
973
973
|
const P = [e, i, n, p(r)].join("/");
|
|
@@ -987,16 +987,16 @@ Mt(["exports"], function(o) {
|
|
|
987
987
|
for (; X.width < C; )
|
|
988
988
|
X = X.subsamplePixelCenters(2).materialize(2);
|
|
989
989
|
X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
|
|
990
|
-
const R = x(c[0], X,
|
|
990
|
+
const R = x(c[0], X, f, h);
|
|
991
991
|
ot == null || ot();
|
|
992
992
|
const At = De({
|
|
993
|
-
extent:
|
|
993
|
+
extent: f,
|
|
994
994
|
layers: {
|
|
995
995
|
[d]: {
|
|
996
996
|
features: Object.entries(R).map(([q, nt]) => {
|
|
997
997
|
const _t = Number(q);
|
|
998
998
|
return {
|
|
999
|
-
type:
|
|
999
|
+
type: ft.LINESTRING,
|
|
1000
1000
|
geometry: nt,
|
|
1001
1001
|
properties: {
|
|
1002
1002
|
[w]: _t,
|
|
@@ -1030,8 +1030,8 @@ Mt(["exports"], function(o) {
|
|
|
1030
1030
|
this.marks = {}, this.urls = [], this.fetched = [], this.resources = [], this.tilesFetched = 0, this.timeOrigin = Ce, this.finish = (i) => {
|
|
1031
1031
|
this.markFinish();
|
|
1032
1032
|
const n = (m) => {
|
|
1033
|
-
const
|
|
1034
|
-
return Number.isFinite(
|
|
1033
|
+
const h = this.marks[m] || [], f = Math.max(...h.map((w) => Math.max(...w))), d = Math.min(...h.map((w) => Math.min(...w)));
|
|
1034
|
+
return Number.isFinite(f) ? f - d : void 0;
|
|
1035
1035
|
}, r = n("main") || 0, l = n("fetch"), s = n("decode"), c = n("isoline");
|
|
1036
1036
|
return {
|
|
1037
1037
|
url: i,
|
|
@@ -1063,7 +1063,7 @@ Mt(["exports"], function(o) {
|
|
|
1063
1063
|
const r = i.origin - this.timeOrigin;
|
|
1064
1064
|
for (const l in i.marks) {
|
|
1065
1065
|
const s = l;
|
|
1066
|
-
(this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((
|
|
1066
|
+
(this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((h) => h + r))) || []);
|
|
1067
1067
|
}
|
|
1068
1068
|
this.resources.push(...i.resources.map((l) => Ie(l, r)));
|
|
1069
1069
|
}, this.markFinish = this.marker(e);
|
|
@@ -1088,27 +1088,27 @@ Mt(["exports"], function(o) {
|
|
|
1088
1088
|
const s = this.callbacks[l.id];
|
|
1089
1089
|
delete this.callbacks[l.id], s && s(l.error ? new Error(l.error) : void 0, l.response, l.timings);
|
|
1090
1090
|
} else if (l.type === "request") {
|
|
1091
|
-
const s = new Wt("worker"), c = i[l.name], m = new AbortController(),
|
|
1091
|
+
const s = new Wt("worker"), c = i[l.name], m = new AbortController(), h = c.apply(c, [
|
|
1092
1092
|
...l.args,
|
|
1093
1093
|
m,
|
|
1094
1094
|
s
|
|
1095
|
-
]),
|
|
1096
|
-
if (l.id &&
|
|
1095
|
+
]), f = `${l.name}_${l.id}`;
|
|
1096
|
+
if (l.id && h) {
|
|
1097
1097
|
this.cancels[l.id] = m;
|
|
1098
1098
|
try {
|
|
1099
|
-
const d = await
|
|
1099
|
+
const d = await h, w = d == null ? void 0 : d.transferrables;
|
|
1100
1100
|
this.postMessage({
|
|
1101
1101
|
id: l.id,
|
|
1102
1102
|
type: "response",
|
|
1103
1103
|
response: d,
|
|
1104
|
-
timings: s.finish(
|
|
1104
|
+
timings: s.finish(f)
|
|
1105
1105
|
}, w);
|
|
1106
1106
|
} catch (d) {
|
|
1107
1107
|
this.postMessage({
|
|
1108
1108
|
id: l.id,
|
|
1109
1109
|
type: "response",
|
|
1110
1110
|
error: (d == null ? void 0 : d.toString()) || "error",
|
|
1111
|
-
timings: s.finish(
|
|
1111
|
+
timings: s.finish(f)
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
1114
|
delete this.cancels[l.id];
|
|
@@ -1121,9 +1121,9 @@ Mt(["exports"], function(o) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
/** Invokes a method by name with a set of arguments in the remote context. */
|
|
1123
1123
|
send(e, i, n, r, ...l) {
|
|
1124
|
-
const s = ++Le, c = new Promise((m,
|
|
1125
|
-
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (
|
|
1126
|
-
r == null || r.addAll(w),
|
|
1124
|
+
const s = ++Le, c = new Promise((m, h) => {
|
|
1125
|
+
this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (f, d, w) => {
|
|
1126
|
+
r == null || r.addAll(w), f ? h(f) : m(d);
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
1129
|
return U(n, () => {
|
|
@@ -1452,7 +1452,7 @@ function je() {
|
|
|
1452
1452
|
"source-layer": "restricted-fill",
|
|
1453
1453
|
minzoom: 4,
|
|
1454
1454
|
paint: {
|
|
1455
|
-
"fill-color": "
|
|
1455
|
+
"fill-color": "##FAD7A0",
|
|
1456
1456
|
// "fill-pattern": "normal:passline",
|
|
1457
1457
|
"fill-opacity": [
|
|
1458
1458
|
"interpolate",
|