aviation-chart 0.1.36 → 0.2.1
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/CHANGES.md +0 -0
- package/README.md +170 -0
- package/dist/MapSDK.d.ts +128 -0
- package/dist/apis/index.d.ts +60 -0
- package/dist/constants/aviation-sources.d.ts +28 -0
- package/dist/constants/builtin-layers.d.ts +3 -0
- package/dist/index.d.ts +21 -0
- package/dist/layericons/Airport-Civil-Selected.png +0 -0
- package/dist/layericons/Airport-Joint-Selected.png +0 -0
- package/dist/layericons/Airport-Military-Selected.png +0 -0
- package/dist/layericons/NDB-Mandatory-Selected.png +0 -0
- package/dist/layericons/NDB-Optional-Selected.png +0 -0
- package/dist/layericons/VOR-Mandatory-S-Selected.png +0 -0
- package/dist/layericons/VOR-Optional-S-Selected.png +0 -0
- package/dist/layericons/Waypoint-Mandatory-Selected.png +0 -0
- package/dist/layericons/Waypoint-Optional-Selected.png +0 -0
- package/dist/layericons/adsb-airplane.png +0 -0
- package/dist/layericons/air-label-left1.png +0 -0
- package/dist/layericons/air-label-none1.png +0 -0
- package/dist/layericons/air-label-right1.png +0 -0
- package/dist/layericons/airport-civ.png +0 -0
- package/dist/layericons/airport-mil.png +0 -0
- package/dist/layericons/airport-milext.png +0 -0
- package/dist/layericons/airport-userfoc.png +0 -0
- package/dist/layericons/airspace-line.png +0 -0
- package/dist/layericons/border.png +0 -0
- package/dist/layericons/controlled copy.png +0 -0
- package/dist/layericons/controlled-line.png +0 -0
- package/dist/layericons/controlled.png +0 -0
- package/dist/layericons/designate_point_inway.png +0 -0
- package/dist/layericons/designate_point_notinway.png +0 -0
- package/dist/layericons/line-blue-pattenr.png +0 -0
- package/dist/layericons/line-blue-pattern.png +0 -0
- package/dist/layericons/ndb-inway.png +0 -0
- package/dist/layericons/ndb-notinway.png +0 -0
- package/dist/layericons/notam-fill.png +0 -0
- package/dist/layericons/place-label.png +0 -0
- package/dist/layericons/re-text-bg.png +0 -0
- package/dist/layericons/restricted-line.png +0 -0
- package/dist/layericons/restricted.png +0 -0
- package/dist/layericons/segment-both.png +0 -0
- package/dist/layericons/segment-left.png +0 -0
- package/dist/layericons/segment-right.png +0 -0
- package/dist/layericons/sprite.json +352 -0
- package/dist/layericons/sprite.png +0 -0
- package/dist/layericons/sprite@2x.json +352 -0
- package/dist/layericons/sprite@2x.png +0 -0
- package/dist/layericons/taix-text-bg.png +0 -0
- package/dist/layericons/text-bg-orange.png +0 -0
- package/dist/layericons/text-bg-t.png +0 -0
- package/dist/layericons/text-bg.png +0 -0
- package/dist/layericons/vor-inway.png +0 -0
- package/dist/layericons/vor-notinway.png +0 -0
- package/dist/managers/ADSBManager.d.ts +39 -0
- package/dist/managers/ClickManager.d.ts +15 -0
- package/dist/managers/ErrorManager.d.ts +25 -0
- package/dist/managers/GeoJSONManager.d.ts +29 -0
- package/dist/managers/GlobalConfigManager.d.ts +48 -0
- package/dist/managers/Graticule.d.ts +41 -0
- package/dist/managers/HoverManage.d.ts +26 -0
- package/dist/managers/LayerManager.d.ts +33 -0
- package/dist/managers/LineLabelOptimizer.d.ts +38 -0
- package/dist/managers/NotamManager.d.ts +40 -0
- package/dist/managers/PerformanceManager.d.ts +40 -0
- package/dist/managers/PluginManager.d.ts +17 -0
- package/dist/managers/PopupManager.d.ts +2 -0
- package/dist/managers/RasterManager.d.ts +16 -0
- package/dist/managers/SelectFeature.d.ts +34 -0
- package/dist/managers/ThemeManage.d.ts +11 -0
- package/dist/managers/WindManager.d.ts +21 -0
- package/dist/nav-sdk.cjs +27061 -0
- package/dist/nav-sdk.d.ts +3228 -0
- package/dist/nav-sdk.esm.js +27037 -0
- package/dist/nav-sdk.min.js +1 -0
- package/dist/nav-sdk.umd.js +27067 -0
- package/dist/nav-sdk@0.2.1.cjs +27061 -0
- package/dist/nav-sdk@0.2.1.d.ts +3228 -0
- package/dist/nav-sdk@0.2.1.esm.js +27037 -0
- package/dist/nav-sdk@0.2.1.min.js +1 -0
- package/dist/nav-sdk@0.2.1.umd.js +27067 -0
- package/dist/plugins/DrawPlugin.d.ts +14 -0
- package/dist/plugins/MeasurePlugin.d.ts +26 -0
- package/dist/sdk.style.css +696 -0
- package/dist/style/amm-chart.d.ts +439 -0
- package/dist/style/aviation-chart.d.ts +2354 -0
- package/dist/types/index.d.ts +212 -0
- package/package.json +64 -21
- package/dist/aviation-chart.umd.js +0 -6
- package/dist/index.cjs +0 -6
- package/dist/index.js +0 -3610
- package/preview.html +0 -48
package/dist/index.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Kt=require("maplibre-gl");var vt,Ct,Ot;function It(o,r){if(!vt)vt=r;else if(!Ct)Ct=r;else{var d="var sharedChunk = {}; ("+vt+")(sharedChunk); ("+Ct+")(sharedChunk);",y={};vt(y),Ot=r(y),typeof window<"u"&&(Ot.workerUrl=window.URL.createObjectURL(new Blob([d],{type:"text/javascript"})))}}It(["exports"],function(o){class r{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 d=[[],[[[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 y(t,e,i,a){return e=e*2+a[0],i=i*2+a[1],e+i*(t+1)*2}function w(t,e,i){return(e-t)/(i-t)}function x(t,e,i=4096,a=1){if(!t)return{};const n=i/(e.width-1);let l,s,c,m,h,f;const u={},_=new Map,k=new Map;function P(O,G,C){O[0]===0?C(n*(f-1),n*(h-w(c,G,l))):O[0]===2?C(n*f,n*(h-w(m,G,s))):O[1]===0?C(n*(f-w(s,G,l)),n*(h-1)):C(n*(f-w(m,G,c)),n*h)}for(h=1-a;h<e.height+a;h++){s=e.get(0,h-1),m=e.get(0,h);let O=Math.min(s,m),G=Math.max(s,m);for(f=1-a;f<e.width+a;f++){l=s,c=m,s=e.get(f,h-1),m=e.get(f,h);const C=O,V=G;if(O=Math.min(s,m),G=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const ut=Math.min(C,O),pt=Math.max(V,G),X=Math.ceil(ut/t)*t,ot=Math.floor(pt/t)*t;for(let M=X;M<=ot;M+=t){const At=l>M,q=s>M,at=c>M,bt=m>M;for(const _t of d[(At?8:0)|(q?4:0)|(bt?2:0)|(at?1:0)]){let H=_.get(M);H||_.set(M,H=new Map);let lt=k.get(M);lt||k.set(M,lt=new Map);const Rt=_t[0],zt=_t[1],yt=y(e.width,f,h,Rt),st=y(e.width,f,h,zt);let I,Tt;if(I=lt.get(yt))if(lt.delete(yt),Tt=H.get(st))if(H.delete(st),I===Tt){if(P(zt,M,I.append),!I.isEmpty()){let rt=u[M];rt||(u[M]=rt=[]),rt.push(I.lineString())}}else I.appendFragment(Tt),lt.set(I.end=Tt.end,I);else P(zt,M,I.append),lt.set(I.end=st,I);else if(I=H.get(st))H.delete(st),P(Rt,M,I.prepend),H.set(I.start=yt,I);else{const rt=new r(yt,st);P(Rt,M,rt.append),P(zt,M,rt.append),H.set(yt,rt),lt.set(st,rt)}}}}}for(const[O,G]of _.entries()){let C=null;for(const V of G.values())V.isEmpty()||(C==null&&(C=u[O]||(u[O]=[])),C.push(V.lineString()))}return u}function b(t){const e=Object.entries(t);return e.sort(([i],[a])=>i<a?-1:i>a?1:0),e}function v(t){return b(t).map(([e,i])=>[e,...typeof i=="number"?[i]:i].join("*")).join("~")}function F(t){return Object.fromEntries(t.split("~").map(e=>e.split("*").map(Number)).map(([e,...i])=>[e,i]))}function A({thresholds:t,...e}){return b({thresholds:v(t),...e}).map(([i,a])=>`${encodeURIComponent(i)}=${encodeURIComponent(a)}`).join("&")}function z(t){return Object.fromEntries(t.replace(/^.*\?/,"").split("&").map(e=>{const i=e.split("=").map(decodeURIComponent),a=i[0];let n=i[1];switch(a){case"thresholds":n=F(n);break;case"extent":case"multiplier":case"overzoom":case"buffer":n=Number(n)}return[a,n]}))}function p(t){return b(t).map(([e,i])=>`${encodeURIComponent(e)}=${encodeURIComponent(i)}`).join(",")}function g(t,e){const{thresholds:i,...a}=t;let n=[],l=-1/0;return Object.entries(i).forEach(([s,c])=>{const m=Number(s);m<=e&&m>l&&(l=m,n=typeof c=="number"?[c]:c)}),{levels:n,...a}}function T(t){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}function E(t,e){return t.then(({data:i,...a})=>{let n=i;return e&&(n=new Float32Array(i.length),n.set(i)),{...a,data:n,transferrables:[n.buffer]}})}function R(t){return t.then(({arrayBuffer:e})=>{const i=T(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 Y(){if(tt==null&&(tt=!1,mt()&&typeof VideoFrame<"u")){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let n=0;n<5*5;n++){const l=n*4;i.fillStyle=`rgb(${l},${l+1},${l+2})`,i.fillRect(n%5,Math.floor(n/5),1,1)}const a=i.getImageData(0,0,5,5).data;for(let n=0;n<5*5*4;n++)if(n%4!==3&&a[n]!==n){tt=!0;break}}}return tt||!1}function L(t,e,i){let a=()=>{};const n=setTimeout(()=>{a(new Error("timed out")),i==null||i.abort()},t);U(i,()=>{a(new Error("aborted")),clearTimeout(n)});const l=new Promise((s,c)=>{a=c});return Promise.race([l,e.finally(()=>clearTimeout(n))])}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 S=0;class J{constructor(e=100){this.size=()=>this.items.size,this.get=(i,a,n)=>{let l=this.items.get(i);if(l)l.lastUsed=++S,l.waiting++;else{const h=new AbortController,f=a(i,h);l={abortController:h,item:f,lastUsed:++S,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(n,()=>{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((a,n)=>{a.lastUsed<i&&(i=a.lastUsed,e=n)}),typeof e<"u"&&this.items.delete(e)}}}let K,et,N,it;async function nt(t,e,i){const a=await createImageBitmap(t);return B(i)?null:W(a,e)}function W(t,e){return K||(K=new OffscreenCanvas(t.width,t.height),et=K.getContext("2d",{willReadFrequently:!0})),Bt(t,e,K,et)}async function xt(t,e,i){var a,n,l;const s=await createImageBitmap(t);if(B(i))return null;const c=new VideoFrame(s,{timestamp:0});try{if(!(((a=c==null?void 0:c.format)===null||a===void 0?void 0:a.startsWith("BGR"))||((n=c==null?void 0:c.format)===null||n===void 0?void 0:n.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"),f=c.allocationSize(),u=new Uint8ClampedArray(f);if(await c.copyTo(u),h)for(let _=0;_<u.length;_+=4){const k=u[_];u[_]=u[_+2],u[_+2]=k}return Et(s.width,s.height,e,u)}catch{return B(i)?null:W(s,e)}finally{c.close()}}async function te(t,e,i){N||(N=document.createElement("canvas"),it=N.getContext("2d",{willReadFrequently:!0}));const a=new Image;U(i,()=>a.src="");const n=await new Promise((l,s)=>{a.onload=()=>{B(i)||l(a),URL.revokeObjectURL(a.src),a.onload=null},a.onerror=()=>s(new Error("Could not load image.")),a.src=t.size?URL.createObjectURL(t):""});return Bt(n,e,N,it)}function ee(t,e,i){return self.actor.send("decodeImage",[],i,void 0,t,e)}function ie(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}const Lt=Y()?xt:mt()?nt:ie()?ee:te;function Bt(t,e,i,a){if(i.width=t.width,i.height=t.height,!a)throw new Error("failed to get context");a.drawImage(t,0,0,t.width,t.height);const n=a.getImageData(0,0,t.width,t.height).data;return Et(t.width,t.height,e,n)}function Et(t,e,i,a){const n=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<a.length;s+=4)l[s/4]=n(a[s],a[s+1],a[s+2]);return{width:t,height:e,data:l}}const oe=-12e3,re=9e3;function ne(t){return!isNaN(t)&&t>=oe&&t<=re}class ${constructor(e,i,a){this.split=(n,l,s)=>{if(n===0)return this;const c=1<<n,m=l*this.width/c,h=s*this.height/c;return new $(this.width/c,this.height/c,(f,u)=>this.get(f+m,u+h))},this.subsamplePixelCenters=n=>{const l=(m,h,f)=>isNaN(m)?h:isNaN(h)?m:m+(h-m)*f;if(n<=1)return this;const s=.5-1/(2*n),c=(m,h)=>{const f=m/n-s,u=h/n-s,_=Math.floor(f),k=Math.floor(u),P=this.get(_,k),O=this.get(_+1,k),G=this.get(_,k+1),C=this.get(_+1,k+1),V=f-_,ut=u-k,pt=l(P,O,V),X=l(G,C,V);return l(pt,X,ut)};return new $(this.width*n,this.height*n,c)},this.averagePixelCentersToGrid=(n=1)=>new $(this.width+1,this.height+1,(l,s)=>{let c=0,m=0,h=0;for(let f=l-n;f<l+n;f++)for(let u=s-n;u<s+n;u++)isNaN(h=this.get(f,u))||(m++,c+=h);return m===0?NaN:c/m}),this.scaleElevation=n=>n===1?this:new $(this.width,this.height,(l,s)=>this.get(l,s)*n),this.materialize=(n=2)=>{const l=this.width+2*n,s=new Float32Array(l*(this.height+2*n));let c=0;for(let m=-n;m<this.height+n;m++)for(let h=-n;h<this.width+n;h++)s[c++]=this.get(h,m);return new $(this.width,this.height,(m,h)=>s[(h+n)*l+m+n])},this.get=a,this.width=e,this.height=i}static fromRawDem(e){return new $(e.width,e.height,(i,a)=>{const n=e.data[a*e.width+i];return ne(n)?n: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 a=i.width,n=i.height;return new $(a,n,(l,s)=>{let c=0;s<0?s+=n:s<n?c+=3:(s-=n,c+=6),l<0?l+=a:l<a?c+=1:(l-=a,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,a,n){var l,s,c=n*8-a-1,m=(1<<c)-1,h=m>>1,f=-7,u=i?n-1:0,_=i?-1:1,k=t[e+u];for(u+=_,l=k&(1<<-f)-1,k>>=-f,f+=c;f>0;l=l*256+t[e+u],u+=_,f-=8);for(s=l&(1<<-f)-1,l>>=-f,f+=a;f>0;s=s*256+t[e+u],u+=_,f-=8);if(l===0)l=1-h;else{if(l===m)return s?NaN:(k?-1:1)*(1/0);s=s+Math.pow(2,a),l=l-h}return(k?-1:1)*s*Math.pow(2,l-a)},Ft.write=function(t,e,i,a,n,l){var s,c,m,h=l*8-n-1,f=(1<<h)-1,u=f>>1,_=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=a?0:l-1,P=a?1:-1,O=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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-s))<1&&(s--,m*=2),s+u>=1?e+=_/m:e+=_*Math.pow(2,1-u),e*m>=2&&(s++,m/=2),s+u>=f?(c=0,s=f):s+u>=1?(c=(e*m-1)*Math.pow(2,n),s=s+u):(c=e*Math.pow(2,u-1)*Math.pow(2,n),s=0));n>=8;t[i+k]=c&255,k+=P,c/=256,n-=8);for(s=s<<n|c,h+=n;h>0;t[i+k]=s&255,k+=P,s/=256,h-=8);t[i+k-P]|=O*128};var le=D,gt=Ft;function D(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}D.Varint=0,D.Fixed64=1,D.Bytes=2,D.Fixed32=5;var St=65536*65536,Xt=1/St,se=12,Nt=typeof TextDecoder>"u"?null:new TextDecoder("utf8");D.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var a=this.readVarint(),n=a>>3,l=this.pos;this.type=a&7,t(n,e,this),this.pos===l&&this.skip(a)}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=Ut(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)+Ut(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,a;return a=e[this.pos++],i=a&127,a<128||(a=e[this.pos++],i|=(a&127)<<7,a<128)||(a=e[this.pos++],i|=(a&127)<<14,a<128)||(a=e[this.pos++],i|=(a&127)<<21,a<128)?i:(a=e[this.pos],i|=(a&15)<<28,ce(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>=se&&Nt?Te(this.buf,e,t):ze(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!==D.Bytes)return t.push(this.readVarint(e));var i=Z(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==D.Bytes)return t.push(this.readSVarint());var e=Z(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==D.Bytes)return t.push(this.readBoolean());var e=Z(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==D.Bytes)return t.push(this.readFloat());var e=Z(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==D.Bytes)return t.push(this.readDouble());var e=Z(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==D.Bytes)return t.push(this.readFixed32());var e=Z(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==D.Bytes)return t.push(this.readSFixed32());var e=Z(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==D.Bytes)return t.push(this.readFixed64());var e=Z(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==D.Bytes)return t.push(this.readSFixed64());var e=Z(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===D.Varint)for(;this.buf[this.pos++]>127;);else if(e===D.Bytes)this.pos=this.readVarint()+this.pos;else if(e===D.Fixed32)this.pos+=4;else if(e===D.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),ft(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ft(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ft(this.buf,t&-1,this.pos),ft(this.buf,Math.floor(t*Xt),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ft(this.buf,t&-1,this.pos),ft(this.buf,Math.floor(t*Xt),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){me(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=ve(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Vt(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 a=this.pos-i;a>=128&&Vt(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(t,e,i){this.writeTag(t,D.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,ue,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,xe,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,pe,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ye,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ge,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,we,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,be,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,_e,e)},writeBytesField:function(t,e){this.writeTag(t,D.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,D.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,D.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,D.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,D.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,D.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,D.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,D.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,D.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,D.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function ce(t,e,i){var a=i.buf,n,l;if(l=a[i.pos++],n=(l&112)>>4,l<128||(l=a[i.pos++],n|=(l&127)<<3,l<128)||(l=a[i.pos++],n|=(l&127)<<10,l<128)||(l=a[i.pos++],n|=(l&127)<<17,l<128)||(l=a[i.pos++],n|=(l&127)<<24,l<128)||(l=a[i.pos++],n|=(l&1)<<31,l<128))return ht(t,n,e);throw new Error("Expected varint not more than 10 bytes")}function Z(t){return t.type===D.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 me(t,e){var i,a;if(t>=0?(i=t%4294967296|0,a=t/4294967296|0):(i=~(-t%4294967296),a=~(-t/4294967296),i^4294967295?i=i+1|0:(i=0,a=a+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),he(i,a,e),fe(a,e)}function he(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 fe(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 Vt(t,e,i){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));i.realloc(a);for(var n=i.pos-1;n>=t;n--)i.buf[n+a]=i.buf[n]}function de(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function ue(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function pe(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function ye(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function xe(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function ge(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function we(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 _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 ft(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Ut(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function ze(t,e,i){for(var a="",n=e;n<i;){var l=t[n],s=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>i)break;var m,h,f;c===1?l<128&&(s=l):c===2?(m=t[n+1],(m&192)===128&&(s=(l&31)<<6|m&63,s<=127&&(s=null))):c===3?(m=t[n+1],h=t[n+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[n+1],h=t[n+2],f=t[n+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,a+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),a+=String.fromCharCode(s),n+=c}return a}function Te(t,e,i){return Nt.decode(t.subarray(e,i))}function ve(t,e,i){for(var a=0,n,l;a<e.length;a++){if(n=e.charCodeAt(a),n>55295&&n<57344)if(l)if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,l=n;continue}else n=l-55296<<10|n-56320|65536,l=null;else{n>56319||a+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):l=n;continue}else l&&(t[i++]=239,t[i++]=191,t[i++]=189,l=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=n&63|128)}return i}var De=ae(le),dt;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.POINT=1]="POINT",t[t.LINESTRING=2]="LINESTRING",t[t.POLYGON=3]="POLYGON"})(dt||(dt={}));function Ee(t){const e=new De;for(const i in t.layers){const a=t.layers[i];a.extent||(a.extent=t.extent),e.writeMessage(3,Fe,{...a,id:i})}return e.finish()}function Fe(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 a of t.features)i.feature=a,e.writeMessage(2,Se,i);for(const a of i.keys)e.writeStringField(3,a);for(const a of i.values)e.writeMessage(4,Re,a)}function Se(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,Ae,i)}function ke(t,e){const i=t.feature;if(!i||!e)throw new Error;const a=t.keys,n=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"&&(a.push(c),h=a.length-1,l[c]=h),e.writeVarint(h);const f=typeof m;f!=="string"&&f!=="boolean"&&f!=="number"&&(m=JSON.stringify(m));const u=`${f}:${m}`;let _=s[u];typeof _>"u"&&(n.push(m),_=n.length-1,s[u]=_),e.writeVarint(_)}}function kt(t,e){return(e<<3)+(t&7)}function Wt(t){return t<<1^t>>31}function Ae(t,e){if(!e)throw new Error;const i=t.geometry,a=t.type;let n=0,l=0;for(const s of i){let c=1;a===dt.POINT&&(c=s.length/2),e.writeVarint(kt(1,c));const m=s.length/2,h=a===dt.POLYGON?m-1:m;for(let f=0;f<h;f++){f===1&&a!==1&&e.writeVarint(kt(2,h-1));const u=s[f*2]-n,_=s[f*2+1]-l;e.writeVarint(Wt(u)),e.writeVarint(Wt(_)),n+=u,l+=_}a===dt.POLYGON&&e.writeVarint(kt(7,1))}}function Re(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 Ce{constructor(e,i,a,n,l){this.loaded=Promise.resolve(),this.decodeImage=Lt,this.fetchAndParseTile=(s,c,m,h,f)=>{const u=this,_=this.demUrlPattern.replace("{z}",s.toString()).replace("{x}",c.toString()).replace("{y}",m.toString());return f==null||f.useTile(_),this.parsedCache.get(_,async(k,P)=>{const O=await u.fetchTile(s,c,m,P,f);if(B(P))throw new Error("canceled");const G=u.decodeImage(O.data,u.encoding,P),C=f==null?void 0:f.marker("decode"),V=await G;return C==null||C(),V},h)},this.tileCache=new J(i),this.parsedCache=new J(i),this.contourCache=new J(i),this.timeoutMs=l,this.demUrlPattern=e,this.encoding=a,this.maxzoom=n}fetchTile(e,i,a,n,l){const s=this.demUrlPattern.replace("{z}",e.toString()).replace("{x}",i.toString()).replace("{y}",a.toString());return l==null||l.useTile(s),this.tileCache.get(s,(c,m)=>{const h={signal:m.signal};l==null||l.fetchTile(s);const f=l==null?void 0:l.marker("fetch");return L(this.timeoutMs,fetch(s,h).then(async u=>{if(f==null||f(),!u.ok)throw new Error(`Bad response: ${u.status} for ${s}`);return{data:await u.blob(),expires:u.headers.get("expires")||void 0,cacheControl:u.headers.get("cache-control")||void 0}}),m)},n)}async fetchDem(e,i,a,n,l,s){const c=Math.min(e-(n.overzoom||0),this.maxzoom),m=e-c,h=1<<m,f=Math.floor(i/h),u=Math.floor(a/h),_=await this.fetchAndParseTile(c,f,u,l,s);return $.fromRawDem(_).split(m,i%h,a%h)}fetchContourTile(e,i,a,n,l,s){const{levels:c,multiplier:m=1,buffer:h=1,extent:f=4096,contourLayer:u="contours",elevationKey:_="ele",levelKey:k="level",subsampleBelow:P=100}=n;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const O=[e,i,a,p(n)].join("/");return this.contourCache.get(O,async(G,C)=>{const V=1<<e,ut=[];for(let q=a-1;q<=a+1;q++)for(let at=i-1;at<=i+1;at++)ut.push(q<0||q>=V?void 0:this.fetchDem(e,(at+V)%V,q,n,C,s));const pt=await Promise.all(ut);let X=$.combineNeighbors(pt);if(!X||B(C))return{arrayBuffer:new Uint8Array().buffer};const ot=s==null?void 0:s.marker("isoline");if(X.width>=P)X=X.materialize(2);else for(;X.width<P;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const M=x(c[0],X,f,h);ot==null||ot();const At=Ee({extent:f,layers:{[u]:{features:Object.entries(M).map(([q,at])=>{const bt=Number(q);return{type:dt.LINESTRING,geometry:at,properties:{[_]:bt,[k]:Math.max(...c.map((_t,H)=>bt%_t===0?H:0))}}})}}});return ot==null||ot(),{arrayBuffer:At.buffer}},l)}}const Q=typeof performance<"u"?performance:void 0,Me=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 jt(){return Q?Q.now():new Date().getTime()}function Oe(t){const e=[];for(const i of t)e.push(...i);return e}class $t{constructor(e){this.marks={},this.urls=[],this.fetched=[],this.resources=[],this.tilesFetched=0,this.timeOrigin=Me,this.finish=i=>{this.markFinish();const a=m=>{const h=this.marks[m]||[],f=Math.max(...h.map(_=>Math.max(..._))),u=Math.min(...h.map(_=>Math.min(..._)));return Number.isFinite(f)?f-u:void 0},n=a("main")||0,l=a("fetch"),s=a("decode"),c=a("isoline");return{url:i,tilesUsed:this.tilesFetched,origin:this.timeOrigin,marks:this.marks,resources:[...this.resources,...Oe(this.fetched.map(Pe))],duration:n,fetch:l,decode:s,process:c,wait:n-(l||0)-(s||0)-(c||0)}},this.error=i=>({...this.finish(i),error:!0}),this.marker=i=>{var a;this.marks[i]||(this.marks[i]=[]);const n=[jt()];return(a=this.marks[i])===null||a===void 0||a.push(n),()=>n.push(jt())},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 a;this.tilesFetched+=i.tilesUsed;const n=i.origin-this.timeOrigin;for(const l in i.marks){const s=l;(this.marks[s]||(this.marks[s]=[])).push(...((a=i.marks[s])===null||a===void 0?void 0:a.map(m=>m.map(h=>h+n)))||[])}this.resources.push(...i.resources.map(l=>Ie(l,n)))},this.markFinish=this.marker(e)}}const Ge=/(Start$|End$|^start|^end)/;function Ie(t,e){const i={};for(const a in t)t[a]!==0&&Ge.test(a)?i[a]=Number(t[a])+e:i[a]=t[a];return i}let Le=0;class Be{constructor(e,i,a=2e4){this.callbacks={},this.cancels={},this.dest=e,this.timeoutMs=a,this.dest.onmessage=async({data:n})=>{const l=n;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 $t("worker"),c=i[l.name],m=new AbortController,h=c.apply(c,[...l.args,m,s]),f=`${l.name}_${l.id}`;if(l.id&&h){this.cancels[l.id]=m;try{const u=await h,_=u==null?void 0:u.transferrables;this.postMessage({id:l.id,type:"response",response:u,timings:s.finish(f)},_)}catch(u){this.postMessage({id:l.id,type:"response",error:(u==null?void 0:u.toString())||"error",timings:s.finish(f)})}delete this.cancels[l.id]}}}}postMessage(e,i){this.dest.postMessage(e,i||[])}send(e,i,a,n,...l){const s=++Le,c=new Promise((m,h)=>{this.postMessage({id:s,type:"request",name:e,args:l},i),this.callbacks[s]=(f,u,_)=>{n==null||n.addAll(_),f?h(f):m(u)}});return U(a,()=>{delete this.callbacks[s],this.postMessage({id:s,type:"cancel"})}),L(this.timeoutMs,c,a)}}o.A=Be,o.H=$,o.L=Ce,o.T=$t,o.a=z,o.b=x,o.c=Et,o.d=Lt,o.e=A,o.f=R,o.g=g,o.p=E});It(["./shared"],function(o){const r=w=>Promise.reject(new Error(`No manager registered for ${w}`));class d{constructor(){this.managers={},this.init=(x,b)=>(this.managers[x.managerId]=new o.L(x.demUrlPattern,x.cacheSize,x.encoding,x.maxzoom,x.timeoutMs),Promise.resolve()),this.fetchTile=(x,b,v,F,A,z)=>{var p;return((p=this.managers[x])===null||p===void 0?void 0:p.fetchTile(b,v,F,A,z))||r(x)},this.fetchAndParseTile=(x,b,v,F,A,z)=>{var p;return o.p(((p=this.managers[x])===null||p===void 0?void 0:p.fetchAndParseTile(b,v,F,A,z))||r(x),!0)},this.fetchContourTile=(x,b,v,F,A,z,p)=>{var g;return o.f(((g=this.managers[x])===null||g===void 0?void 0:g.fetchContourTile(b,v,F,A,z,p))||r(x))}}}const y=typeof self<"u"?self:typeof window<"u"?window:global;y.actor=new o.A(y,new d)});It(["./shared"],function(o){const r={workerUrl:""};let d,y=0;class w{constructor(){this.decodeImage=(g,T,E)=>o.p(o.d(g,T,E),!1)}}function x(){if(!d){const p=new Worker(r.workerUrl),g=new w;d=new o.A(p,g)}return d}class b{constructor(g,T,E,R,j,mt){this.fetchTile=(Y,L,U,B,S)=>this.actor.send("fetchTile",[],B,S,this.managerId,Y,L,U),this.fetchAndParseTile=(Y,L,U,B,S)=>this.actor.send("fetchAndParseTile",[],B,S,this.managerId,Y,L,U),this.fetchContourTile=(Y,L,U,B,S,J)=>this.actor.send("fetchContourTile",[],S,J,this.managerId,Y,L,U,B);const tt=this.managerId=++y;this.actor=mt||x(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:T,demUrlPattern:g,encoding:E,maxzoom:R,managerId:tt,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((g,T)=>{const E=new FileReader;E.onload=R=>{var j;return g((j=R.target)===null||j===void 0?void 0:j.result)},E.onerror=T,E.readAsArrayBuffer(this)})});const v=p=>(g,T)=>{if(T instanceof AbortController)return p(g,T);{const E=new AbortController;return p(g,E).then(R=>T(void 0,R.data,R.cacheControl,R.expires),R=>T(R)),{cancel:()=>E.abort()}}},F=new Set;class A{constructor({url:g,cacheSize:T=100,id:E="dem",encoding:R="terrarium",maxzoom:j=12,worker:mt=!0,timeoutMs:tt=1e4,actor:Y}){this.timingCallbacks=[],this.onTiming=S=>{this.timingCallbacks.push(S)},this.setupMaplibre=S=>{S.addProtocol(this.sharedDemProtocolId,this.sharedDemProtocol),S.addProtocol(this.contourProtocolId,this.contourProtocol)},this.sharedDemProtocolV4=async(S,J)=>{const[K,et,N]=this.parseUrl(S.url),it=new o.T("main");let nt;try{const W=await this.manager.fetchTile(K,et,N,J,it);return nt=it.finish(S.url),{data:await W.data.arrayBuffer(),cacheControl:W.cacheControl,expires:W.expires}}catch(W){throw nt=it.error(S.url),W}finally{this.timingCallbacks.forEach(W=>W(nt))}},this.contourProtocolV4=async(S,J)=>{const K=new o.T("main");let et;try{const[N,it,nt]=this.parseUrl(S.url),W=o.a(S.url),xt=await this.manager.fetchContourTile(N,it,nt,o.g(W,N),J,K);return et=K.finish(S.url),{data:xt.arrayBuffer}}catch(N){throw et=K.error(S.url),N}finally{this.timingCallbacks.forEach(N=>N(et))}},this.contourProtocol=v(this.contourProtocolV4),this.sharedDemProtocol=v(this.sharedDemProtocolV4),this.contourProtocolUrl=S=>`${this.contourProtocolUrlBase}?${o.e(S)}`;let L=E,U=1;for(;F.has(L);)L=E+U++;F.add(L),this.sharedDemProtocolId=`${L}-shared`,this.contourProtocolId=`${L}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=mt?b:o.L;this.manager=new B(g,T,R,j,tt,Y)}getDemTile(g,T,E,R){return this.manager.fetchAndParseTile(g,T,E,R||new AbortController)}parseUrl(g){const[,T,E,R]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(g)||[];return[Number(T),Number(E),Number(R)]}}return{generateIsolines:o.b,DemSource:A,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){r.workerUrl=p},get workerUrl(){return r.workerUrl}}});var Xe=Ot;function Ne(o){return o}function Ve(o){if(o==null)return Ne;var r,d,y=o.scale[0],w=o.scale[1],x=o.translate[0],b=o.translate[1];return function(v,F){F||(r=d=0);var A=2,z=v.length,p=new Array(z);for(p[0]=(r+=v[0])*y+x,p[1]=(d+=v[1])*w+b;A<z;)p[A]=v[A],++A;return p}}function Ue(o,r){for(var d,y=o.length,w=y-r;w<--y;)d=o[w],o[w++]=o[y],o[y]=d}function Ht(o,r){return typeof r=="string"&&(r=o.objects[r]),r.type==="GeometryCollection"?{type:"FeatureCollection",features:r.geometries.map(function(d){return Yt(o,d)})}:Yt(o,r)}function Yt(o,r){var d=r.id,y=r.bbox,w=r.properties==null?{}:r.properties,x=We(o,r);return d==null&&y==null?{type:"Feature",properties:w,geometry:x}:y==null?{type:"Feature",id:d,properties:w,geometry:x}:{type:"Feature",id:d,bbox:y,properties:w,geometry:x}}function We(o,r){var d=Ve(o.transform),y=o.arcs;function w(z,p){p.length&&p.pop();for(var g=y[z<0?~z:z],T=0,E=g.length;T<E;++T)p.push(d(g[T],T));z<0&&Ue(p,E)}function x(z){return d(z)}function b(z){for(var p=[],g=0,T=z.length;g<T;++g)w(z[g],p);return p.length<2&&p.push(p[0]),p}function v(z){for(var p=b(z);p.length<4;)p.push(p[0]);return p}function F(z){return z.map(v)}function A(z){var p=z.type,g;switch(p){case"GeometryCollection":return{type:p,geometries:z.geometries.map(A)};case"Point":g=x(z.coordinates);break;case"MultiPoint":g=z.coordinates.map(x);break;case"LineString":g=b(z.arcs);break;case"MultiLineString":g=z.arcs.map(b);break;case"Polygon":g=F(z.arcs);break;case"MultiPolygon":g=z.arcs.map(F);break;default:return null}return{type:p,coordinates:g}}return A(r)}const je={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function $e(){const o="navdata",r=je;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":r.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":r.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":r.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":r.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":r.restrictedStroke}},{id:"controlled-fill",type:"fill",source:o,"source-layer":"controlled-fill",minzoom:4,paint:{"fill-color":r.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.035,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":r.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.5,8,1],"line-dasharray":[1,1.4]}},{id:"controlled-label",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":r.controlledStroke}},{id:"segment-line",type:"line",source:o,"source-layer":"segment",minzoom:5,paint:{"line-color":["case",["==",["get","HAS_REMARK"],1],"#E8A020",r.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
|
-
`,["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
|
-
`,["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":r.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":r.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-field":["get","CODE_ID"],"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",r.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2],"text-color":["case",["has","has_amm"],"#4B2D6E",r.airport],"text-opacity":["interpolate",["linear"],["zoom"],4,.95,5,1,9,1,11,.2]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,maxzoom:11,paint:{"line-color":r.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":r.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":r.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":r.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":r.ndb,"font-scale":1.1},"",{},["coalesce",["get","VAL_FREQ"],""],{"text-color":r.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":r.ndb,"text-halo-color":"#ffffff","text-halo-width":.5,"text-halo-blur":1,"icon-color":r.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":r.waypoint,"text-color":r.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":r.waypoint,"text-color":r.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 Ke={airspaceStroke:"#18C29C",restrictedStroke:"#CC7722",controlledStroke:"#22C55E",controlledFill:"#22C55E",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function He(){const o="navdata",r=Ke;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-width":["interpolate",["linear"],["zoom"],0,1,7,4],"line-opacity":1,"line-pattern":"normal:national-border-dark"}},{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":r.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":r.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":r.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":r.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":r.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":r.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":r.controlledFill,"fill-opacity":["interpolate",["linear"],["zoom"],10,.04,11.5,0]}},{id:"controlled-stroke",type:"line",source:o,"source-layer":"controlled",paint:{"line-color":r.controlledStroke,"line-width":1,"line-opacity":["interpolate",["linear"],["zoom"],4,.6,8,1],"line-dasharray":[4,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":r.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",r.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
|
-
`,["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"},`
|
|
5
|
-
`,["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":"#cbd5e1"}]],"text-size":["interpolate",["linear"],["zoom"],6,9,10,10],"icon-text-fit-padding":[0,3,0,3]},paint:{"icon-color":r.segment}},{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,-1]},paint:{"text-color":r.segment,"text-halo-color":"#0f172a","text-halo-width":1}},{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-field":["get","CODE_ID"],"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",r.airport],"icon-opacity":["interpolate",["linear"],["zoom"],2,.75,3,.95,5,1,9,1,11,.2],"text-color":["case",["has","has_amm"],"#4B2D6E","#E0F7FA"],"text-opacity":["interpolate",["linear"],["zoom"],4,.95,5,1,9,1,11,.2]}},{id:"runway-line",type:"line",source:o,"source-layer":"runway",filter:["!",["has","has_amm"]],minzoom:4,paint:{"line-color":r.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,3]}},{id:"runway-line-amm",type:"line",source:o,"source-layer":"runway",filter:["has","has_amm"],minzoom:4,paint:{"line-color":r.runway,"line-width":["interpolate",["linear"],["zoom"],4,1,10,3],"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,"text-font":["Noto Sans Regular"],"symbol-placement":"line-center","text-rotation-alignment":"map","text-optional":!0},paint:{"text-color":r.runway,"text-halo-color":"#0f172a","text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],10.5,1,11,0]}},{id:"vor-symbol",type:"symbol",source:o,"source-layer":"vor",layout:{"icon-image":"vor_dial","icon-size":["interpolate",["linear"],["zoom"],5,.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":"#38bdf8"}},{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":"#38bdf8","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":r.vor,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"ndb-symbol",type:"symbol",source:o,minzoom:4,"source-layer":"ndb",layout:{"icon-image":"ndb-inway","icon-size":["interpolate",["linear"],["zoom"],6,.5,10,1],"symbol-z-order":"viewport-y","text-field":["concat",["get","CODE_ID"],`
|
|
6
|
-
`,["get","VAL_FREQ"],"kHz"],"text-size":10,"text-offset":[0,1.4],"text-letter-spacing":.05,"text-optional":!0,"icon-allow-overlap":!0},paint:{"text-color":r.ndb,"text-halo-color":"#0f172a","text-halo-width":1,"icon-color":r.ndb}},{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":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":r.waypoint,"text-color":r.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}},{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":r.waypoint,"text-color":r.waypoint,"text-halo-color":"#0f172a","text-halo-width":1}}]}const ct={light:{id:"light",label:"日间",background:"#EAF2F8",build:$e},dark:{id:"dark",label:"夜间",background:"#000000",build:He}};function Mt(o="light"){return(ct[o]??ct.light).build()}const Gt={adiz:["adiz-line","adiz-label"],airspace:["fir-line","fir_line_dash","fir-label","fir-label-lineside"],restricted:["restricted-fill","restricted-stroke","restricted-label"],controlled:["controlled-fill","controlled-stroke","controlled-label"],airline:["segment-radial","segment-line","segment-label","waypoint-symbol"],waypointOffAirway:["waypoint-off-airway-symbol"],vor:["vor-symbol","vor-label","vor-symbol-normal"],ndb:["ndb-symbol"],airport:["airport-circle"],runway:["runway-line","runway-line-amm","runway-label"]},Ye={airport:"#e2e8f0",runway:"#94a3b8",apron:"#cbd5e1",taxiway:"#e2e8f0",taxiwayLine:"#f59e0b",holding:"#b91c1c",stand:"#1e293b",runwayMarking:"#ffffff",runwayCenterline:"#ffffff",standLine:"#64748b",restricted:"#b91c1c",hotspot:"#ea580c"};function Je(o="amm"){const r=Ye;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.4}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":r.airport,"line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.runway,"fill-opacity":.9}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":r.apron,"fill-opacity":.6}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#94a3b8","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":r.taxiway,"fill-opacity":.7}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#FFF","icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.9}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.08}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.restricted,"line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":r.hotspot,"fill-opacity":.1}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.5}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#f8fafc","text-halo-color":"#334155","text-halo-width":2.5}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#fff","icon-color":"#b91c1c"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":r.standLine}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.35}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#ca8a04","line-width":1.5,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#b45309","circle-radius":4,"circle-stroke-color":"#ffffff","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.8}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#d97706","line-width":1.5,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#92400e","text-halo-color":"#ffffff","text-halo-width":1}}]}const Ze={airport:"#334155",runway:"#475569",apron:"#1e293b",taxiway:"#334155",taxiwayLine:"#fbbf24",holding:"#ef4444",stand:"#34d399",runwayMarking:"#cbd5e1",runwayCenterline:"#94a3b8",standLine:"#64748b",restricted:"#f87171",hotspot:"#fb923c"};function Qe(o="amm"){const r=Ze;return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#475569","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#64748b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":r.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#334155","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":r.taxiway,"fill-opacity":.8}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":"#0f172a","icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.8}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.12}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":r.hotspot,"fill-opacity":.15}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e2e8f0","text-halo-color":"#0f172a","text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":"#ef4444"}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":r.stand,"text-halo-color":"#0f172a","text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.15}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":"#0f172a","circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":"#0f172a","text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":"#0f172a","text-halo-width":1}}]}const qe={airport:"#4b5563",runway:"#71717a",apron:"#27272a",taxiway:"#3f3f46",taxiwayLine:"#eab308",holding:"#ef4444",stand:"#10b981",runwayMarking:"#e4e4e7",runwayCenterline:"#d4d4d8",standLine:"#6b7280",threshold:"#f97316",restricted:"#f87171",hotspot:"#fb923c"};function ti(o="amm"){const r=qe,d="#1f1f23";return[{id:"amm-airport-fill",type:"fill",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"fill-color":r.airport,"fill-opacity":.3}},{id:"amm-airport-stroke",type:"line",source:o,"source-layer":"amm-airport",minzoom:11,paint:{"line-color":"#52525b","line-width":1}},{id:"amm-runway-fill",type:"fill",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"fill-color":r.runway,"fill-opacity":1}},{id:"amm-runway-stroke",type:"line",source:o,"source-layer":"amm-runway",minzoom:11,paint:{"line-color":"#52525b","line-width":.5}},{id:"amm-apron-fill",type:"fill",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"fill-color":r.apron,"fill-opacity":1}},{id:"amm-apron-stroke",type:"line",source:o,"source-layer":"amm-apron",minzoom:11,paint:{"line-color":"#3f3f46","line-width":.5}},{id:"amm-taxiway-fill",type:"fill",source:o,"source-layer":"amm-taxiway",minzoom:11,paint:{"fill-color":r.taxiway,"fill-opacity":.9}},{id:"amm-taxiway-line",type:"line",source:o,"source-layer":"amm-taxiway-line",minzoom:11,paint:{"line-color":r.taxiwayLine,"line-width":["interpolate",["linear"],["zoom"],15,.8,18,2]}},{id:"amm-taxiway-label",type:"symbol",source:o,"source-layer":"amm-taxiway-line",minzoom:14,layout:{"text-field":["get","idlin"],"text-size":10,"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"symbol-placement":"line","text-keep-upright":!0,"text-allow-overlap":!1},paint:{"text-color":d,"icon-color":r.taxiwayLine}},{id:"amm-holding",type:"line",source:o,"source-layer":"amm-holding",minzoom:11,paint:{"line-color":r.holding,"line-width":1.5}},{id:"amm-runway-marking",type:"fill",source:o,"source-layer":"amm-runway-marking",minzoom:13,paint:{"fill-color":r.runwayMarking,"fill-opacity":.85}},{id:"amm-restricted-fill",type:"fill",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"fill-color":r.restricted,"fill-opacity":.1}},{id:"amm-restricted-stroke",type:"line",source:o,"source-layer":"amm-restricted",minzoom:11,paint:{"line-color":r.restricted,"line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-hotspot-fill",type:"fill",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"fill-color":r.hotspot,"fill-opacity":.12}},{id:"amm-hotspot-stroke",type:"line",source:o,"source-layer":"amm-hotspot",minzoom:11,paint:{"line-color":r.hotspot,"line-width":1.2}},{id:"amm-runway-centerline",type:"line",source:o,"source-layer":"amm-runway-centerline",minzoom:11,paint:{"line-color":r.runwayCenterline,"line-width":1,"line-dasharray":[6,3]}},{id:"amm-runway-info",type:"symbol",source:o,"source-layer":"amm-runway-label",minzoom:13,layout:{"text-field":["concat",["coalesce",["get","length"],""],"×",["coalesce",["get","width"],""],"m"],"text-size":["interpolate",["exponential",1.5],["zoom"],13,10,16,13],"symbol-placement":"point","text-rotate":["coalesce",["get","bearing"],0],"text-rotation-alignment":"map","text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#e4e4e7","text-halo-color":d,"text-halo-width":2}},{id:"amm-stand-line",type:"line",source:o,"source-layer":"amm-stand-line",minzoom:13,paint:{"line-color":r.standLine,"line-width":1}},{id:"amm-runway-threshold-label",type:"symbol",source:o,"source-layer":"amm-runway-threshold",minzoom:12,layout:{"icon-image":"text_bg","icon-text-fit":"both","icon-text-fit-padding":[1,2,1,2],"text-field":["get","idthr"],"text-size":14,"text-allow-overlap":!0,"text-rotation-alignment":"map","icon-rotation-alignment":"map"},paint:{"text-color":"#ffffff","icon-color":r.threshold}},{id:"amm-stand",type:"circle",source:o,"source-layer":"amm-stand",minzoom:12,paint:{"circle-color":r.stand,"circle-radius":1.5}},{id:"amm-stand-label",type:"symbol",source:o,"source-layer":"amm-stand",minzoom:14,layout:{"text-field":["get","idstd"],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":r.stand,"text-halo-color":d,"text-halo-width":1}},{id:"amm-obstacle-region-fill",type:"fill",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"fill-color":"#fef08a","fill-opacity":.1}},{id:"amm-obstacle-region-stroke",type:"line",source:o,"source-layer":"amm-obstacle-region",minzoom:11,paint:{"line-color":"#eab308","line-width":1.2,"line-dasharray":[1.5,1]}},{id:"amm-obstacle-point",type:"circle",source:o,"source-layer":"amm-obstacle-point",minzoom:11,paint:{"circle-color":"#f97316","circle-radius":4,"circle-stroke-color":d,"circle-stroke-width":1}},{id:"amm-obstacle-point-label",type:"symbol",source:o,"source-layer":"amm-obstacle-point",minzoom:14,layout:{"text-field":["coalesce",["get","ident"],["get","LABEL"]],"text-size":9,"text-anchor":"bottom","text-offset":[0,-.5],"text-allow-overlap":!1},paint:{"text-color":"#fdba74","text-halo-color":d,"text-halo-width":1.2}},{id:"amm-construction-fill",type:"fill",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"fill-pattern":"normal:passline","fill-opacity":.6}},{id:"amm-construction-stroke",type:"line",source:o,"source-layer":"amm-construction",minzoom:11,paint:{"line-color":"#ea580c","line-width":1.2,"line-dasharray":[4,2]}},{id:"amm-construction-label",type:"symbol",source:o,"source-layer":"amm-construction",minzoom:13,layout:{"text-field":["get","text"],"text-size":9,"text-anchor":"center","symbol-placement":"point","text-allow-overlap":!1},paint:{"text-color":"#f97316","text-halo-color":d,"text-halo-width":1}}]}function Pt(o="amm",r="light"){return r==="dark"?Qe(o):r==="neutral"?ti(o):Je(o)}const ei={ammAirport:["amm-airport-fill","amm-airport-stroke"],ammRunway:["amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold","amm-runway-threshold-label"],ammApron:["amm-apron-fill","amm-apron-stroke"],ammTaxiway:["amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label"],ammHolding:["amm-holding"],ammStand:["amm-stand","amm-stand-label","amm-stand-line"],ammRestricted:["amm-restricted-fill","amm-restricted-stroke"],ammHotspot:["amm-hotspot-fill","amm-hotspot-stroke"],ammObstacle:["amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label"],ammConstruction:["amm-construction-fill","amm-construction-stroke","amm-construction-label"]},ii="https://aips.siniswift.com",oi=["interpolate",["linear"],["elevation"],0,"#a8c98a",600,"#cdd98a",1200,"#e8d79a",2400,"#c79a5b",3600,"#9c6b3f",4500,"#f2efe9"],Jt=["amm-airport-fill","amm-airport-stroke","amm-runway-fill","amm-runway-stroke","amm-runway-info","amm-runway-marking","amm-runway-centerline","amm-runway-threshold-label","amm-apron-fill","amm-apron-stroke","amm-taxiway-fill","amm-taxiway-line","amm-taxiway-label","amm-holding","amm-stand","amm-stand-label","amm-stand-line","amm-restricted-fill","amm-restricted-stroke","amm-hotspot-fill","amm-hotspot-stroke","amm-obstacle-region-fill","amm-obstacle-region-stroke","amm-obstacle-point","amm-obstacle-point-label","amm-construction-fill","amm-construction-stroke","amm-construction-label"],Zt=["terrain-color","terrain-hillshade"],Qt=["contour-line","contour-label"];async function qt(o){const r=await fetch(o);if(!r.ok)throw new Error(`fetch ${o} → ${r.status}`);const d=r.headers.get("Content-Encoding"),y=r.headers.get("Content-Type")||"";if(d==="gzip"||y.includes("json"))return r.json();const w=r.body.pipeThrough(new DecompressionStream("gzip"));return new Response(w).json()}function Dt(o){const r={};for(const d of o)r[d.id]=d;return r}class ri{constructor(r={}){const{container:d,theme:y="light",apiUrl:w=ii,spriteUrl:x,period:b=null,layers:v={},center:F=[104,36],zoom:A=4,terrainUrl:z=null}=r;return this._apiUrl=w.replace(/\/$/,""),this._spriteUrl=(x??w).replace(/\/$/,""),this._terrainUrl=z??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=y,this._period=b,this._center=F,this._zoom=A,this._ready=!1,this._layerVisible={adiz:!0,fir:!0,restricted:!0,controlled:!0,segment:!0,waypoint:!0,waypointOffAirway:!0,vor:!0,ndb:!0,airport:!0,runway:!0,amm:!0,terrain:!1,contour:!1,...v},this._initMap(d),new Proxy(this,{get(p,g){if(typeof g=="symbol"||Reflect.has(p,g)){const R=p[g];return typeof R=="function"?R.bind(p):R}const T=p._map;if(!T)return;const E=T[g];return typeof E=="function"?E.bind(T):E},set(p,g,T){return typeof g=="symbol"||Reflect.has(p,g)||!p._map?p[g]=T:g in p._map?p._map[g]=T:p[g]=T,!0},has(p,g){return Reflect.has(p,g)||(p._map?g in p._map:!1)}})}_initMap(r){const d=ct[this._theme]??ct.light;this._map=new Kt.Map({container:r,style:{version:8,glyphs:"https://aips.siniswift.com/mapsdk/glyphs/{fontstack}/{range}.pbf",sprite:[{id:"normal",url:`${this._spriteUrl}/sprites/sprite-color`},{id:"default",url:`${this._spriteUrl}/sprites/sprite`},{id:"v2",url:`${this._spriteUrl}/sprites/sprite-v2`},{id:"plane",url:`${this._spriteUrl}/sprites/sprite-plane`}],sources:{land:{type:"geojson",data:{type:"FeatureCollection",features:[]}},boundary:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"background",type:"background",paint:{"background-color":d.background}}]},center:this._center,zoom:this._zoom,minZoom:0,maxZoom:17.5,crossSourceCollisions:!1,maxTileCacheSize:512,prefetchZoomDelta:1,fadeDuration:0,attributionControl:!1}),this._map.on("load",async()=>{await this._initSources(),this._initLayers(),this._applyVisibility(),this._ready=!0,this._map.fire("aviation:ready")})}async _initSources(){if(!this._period)try{const y=await(await fetch(`${this._apiUrl}/api/periods`)).json();this._period=y[y.length-1]}catch(d){console.warn("[AviationChart] fetchPeriods failed:",d),this._period="latest"}this._map.addSource("navdata",{type:"vector",tiles:[`${this._apiUrl}/api/tiles/${this._period}/{z}/{x}/{y}.pbf`],minzoom:.5,maxzoom:18}),this._map.addSource("amm",{type:"vector",tiles:[`${this._apiUrl}/api/amm/{z}/{x}/{y}.pbf`],minzoom:11,maxzoom:18}),this._map.addSource("terrain",{type:"raster-dem",tiles:[this._terrainUrl],tileSize:256,encoding:"mapbox",maxzoom:8});const r=new Xe.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});r.setupMaplibre(Kt),this._map.addSource("contour",{type:"vector",tiles:[r.contourProtocolUrl({thresholds:{5:[250,1e3],7:[125,500],9:[100,500],11:[50,500],13:[25,500]},elevationKey:"ele",levelKey:"level",contourLayer:"contours"})],maxzoom:13}),await this._loadBaseData()}async _loadBaseData(){var r,d,y,w;try{const[x,b]=await Promise.all([qt(`${this._apiUrl}/topjson/land.topojson.gz`),qt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(r=x==null?void 0:x.objects)!=null&&r.land?(d=this._map.getSource("land"))==null||d.setData(Ht(x,x.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(y=b==null?void 0:b.objects)!=null&&y.boundary?(w=this._map.getSource("boundary"))==null||w.setData(Ht(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(x){console.error("[AviationChart] loadBaseData failed:",x)}}_initLayers(){const r=this._layerVisible.terrain?"visible":"none",d=this._layerVisible.contour?"visible":"none";this._map.addLayer({id:"terrain-color",type:"color-relief",source:"terrain",layout:{visibility:r},paint:{"color-relief-color":oi}}),this._map.addLayer({id:"terrain-hillshade",type:"hillshade",source:"terrain",layout:{visibility:r},paint:{"hillshade-shadow-color":"rgba(74,59,42,0.35)","hillshade-highlight-color":"rgba(255,246,230,0.25)","hillshade-accent-color":"rgba(74,59,42,0.2)","hillshade-exaggeration":.45,"hillshade-illumination-direction":315,"hillshade-illumination-anchor":"viewport"}}),this._map.addLayer({id:"contour-line",type:"line",source:"contour","source-layer":"contours",layout:{visibility:d},paint:{"line-color":["case",["==",["get","level"],1],"rgba(100,70,40,0.40)","rgba(120,90,60,0.18)"],"line-width":["case",["==",["get","level"],1],1,.5]}}),this._map.addLayer({id:"contour-label",type:"symbol",source:"contour","source-layer":"contours",filter:["==",["get","level"],1],layout:{visibility:d,"symbol-placement":"line","text-field":["concat",["to-string",["get","ele"]],"m"],"text-size":10,"text-font":["Open Sans Regular"],"text-allow-overlap":!0,"text-keep-upright":!0},paint:{"text-color":"rgba(100,70,40,0.55)","text-halo-color":"rgba(255,255,255,0.6)","text-halo-width":1}}),this._layerVisible.terrain&&this._map.setTerrain({source:"terrain",exaggeration:4});for(const y of Mt(this._theme))this._map.getLayer(y.id)||this._map.addLayer(y);for(const y of["terrain-color","terrain-hillshade","contour-line","contour-label"])this._map.getLayer(y)&&this._map.getLayer("boundary")&&this._map.moveLayer(y,"boundary");for(const y of Pt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line")}_applyVisibility(){for(const[w,x]of Object.entries(Gt)){const b=this._layerVisible[w]!==!1?"visible":"none";for(const v of x)this._map.getLayer(v)&&this._map.setLayoutProperty(v,"visibility",b)}const r=this._layerVisible.amm!==!1?"visible":"none";for(const w of Jt)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",r);const d=this._layerVisible.terrain?"visible":"none";for(const w of Zt)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",d);const y=this._layerVisible.contour?"visible":"none";for(const w of Qt)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",y)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(r){if(r===this._theme)return;const d=this._theme;this._theme=r;const y=ct[r]??ct.light;this._map.setPaintProperty("background","background-color",y.background);const w=Dt(Mt(r)),x=Dt(Mt(d)),b=Dt(Pt("amm",r)),v=Dt(Pt("amm",d));Object.assign(w,b),Object.assign(x,v);for(const F of Object.keys(w))this._map.getLayer(F)&&this._applyThemedProps(F,x[F],w[F]);this._applyVisibility()}_applyThemedProps(r,d,y){const w=this._map,x={paint:(b,v)=>w.setPaintProperty(r,b,v),layout:(b,v)=>w.setLayoutProperty(r,b,v)};for(const b of["paint","layout"]){const v=d&&d[b]||{},F=y&&y[b]||{},A=new Set([...Object.keys(v),...Object.keys(F)]);for(const z of A){if(b==="layout"&&z==="visibility")continue;const p=F[z],g=v[z];JSON.stringify(p)!==JSON.stringify(g)&&x[b](z,p)}}}setLayerVisible(r,d){if(this._layerVisible[r]=d,r==="terrain"){const x=d?"visible":"none";for(const b of Zt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);this._map.setTerrain(d?{source:"terrain",exaggeration:4}:null);return}if(r==="contour"){const x=d?"visible":"none";for(const b of Qt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}if(r==="amm"){const x=d?"visible":"none";for(const b of Jt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",x);return}const y=Gt[r];if(!y){console.warn(`[AviationChart] Unknown layer key: "${r}"`);return}const w=d?"visible":"none";for(const x of y)this._map.getLayer(x)&&this._map.setLayoutProperty(x,"visibility",w)}setPeriod(r){var y;this._period=r;const d=(y=this._map)==null?void 0:y.getSource("navdata");d&&d.setTiles([`${this._apiUrl}/api/tiles/${r}/{z}/{x}/{y}.pbf`])}on(r,d,y){return typeof d=="string"?this._map.on(r,d,y):this._map.on(r,d??y),this}off(r,d,y){return typeof d=="string"?this._map.off(r,d,y):this._map.off(r,d??y),this}once(r,d,y){return typeof d=="string"?this._map.once(r,d,y):this._map.once(r,d??y),this}destroy(){this._map&&(this._map.remove(),this._map=null)}}exports.AMM_LAYER_GROUPS=ei;exports.AviationChart=ri;exports.CHART_THEMES=ct;exports.LAYER_GROUPS=Gt;
|