aviation-chart 0.1.35 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGES.md +0 -0
  2. package/README.md +286 -0
  3. package/dist/MapSDK.d.ts +128 -0
  4. package/dist/apis/index.d.ts +60 -0
  5. package/dist/constants/aviation-sources.d.ts +28 -0
  6. package/dist/constants/builtin-layers.d.ts +3 -0
  7. package/dist/index.d.ts +21 -0
  8. package/dist/layericons/Airport-Civil-Selected.png +0 -0
  9. package/dist/layericons/Airport-Joint-Selected.png +0 -0
  10. package/dist/layericons/Airport-Military-Selected.png +0 -0
  11. package/dist/layericons/NDB-Mandatory-Selected.png +0 -0
  12. package/dist/layericons/NDB-Optional-Selected.png +0 -0
  13. package/dist/layericons/VOR-Mandatory-S-Selected.png +0 -0
  14. package/dist/layericons/VOR-Optional-S-Selected.png +0 -0
  15. package/dist/layericons/Waypoint-Mandatory-Selected.png +0 -0
  16. package/dist/layericons/Waypoint-Optional-Selected.png +0 -0
  17. package/dist/layericons/adsb-airplane.png +0 -0
  18. package/dist/layericons/air-label-left1.png +0 -0
  19. package/dist/layericons/air-label-none1.png +0 -0
  20. package/dist/layericons/air-label-right1.png +0 -0
  21. package/dist/layericons/airport-civ.png +0 -0
  22. package/dist/layericons/airport-mil.png +0 -0
  23. package/dist/layericons/airport-milext.png +0 -0
  24. package/dist/layericons/airport-userfoc.png +0 -0
  25. package/dist/layericons/airspace-line.png +0 -0
  26. package/dist/layericons/border.png +0 -0
  27. package/dist/layericons/controlled copy.png +0 -0
  28. package/dist/layericons/controlled-line.png +0 -0
  29. package/dist/layericons/controlled.png +0 -0
  30. package/dist/layericons/designate_point_inway.png +0 -0
  31. package/dist/layericons/designate_point_notinway.png +0 -0
  32. package/dist/layericons/line-blue-pattenr.png +0 -0
  33. package/dist/layericons/line-blue-pattern.png +0 -0
  34. package/dist/layericons/ndb-inway.png +0 -0
  35. package/dist/layericons/ndb-notinway.png +0 -0
  36. package/dist/layericons/notam-fill.png +0 -0
  37. package/dist/layericons/place-label.png +0 -0
  38. package/dist/layericons/re-text-bg.png +0 -0
  39. package/dist/layericons/restricted-line.png +0 -0
  40. package/dist/layericons/restricted.png +0 -0
  41. package/dist/layericons/segment-both.png +0 -0
  42. package/dist/layericons/segment-left.png +0 -0
  43. package/dist/layericons/segment-right.png +0 -0
  44. package/dist/layericons/sprite.json +352 -0
  45. package/dist/layericons/sprite.png +0 -0
  46. package/dist/layericons/sprite@2x.json +352 -0
  47. package/dist/layericons/sprite@2x.png +0 -0
  48. package/dist/layericons/taix-text-bg.png +0 -0
  49. package/dist/layericons/text-bg-orange.png +0 -0
  50. package/dist/layericons/text-bg-t.png +0 -0
  51. package/dist/layericons/text-bg.png +0 -0
  52. package/dist/layericons/vor-inway.png +0 -0
  53. package/dist/layericons/vor-notinway.png +0 -0
  54. package/dist/managers/ADSBManager.d.ts +39 -0
  55. package/dist/managers/ClickManager.d.ts +15 -0
  56. package/dist/managers/ErrorManager.d.ts +25 -0
  57. package/dist/managers/GeoJSONManager.d.ts +29 -0
  58. package/dist/managers/GlobalConfigManager.d.ts +48 -0
  59. package/dist/managers/Graticule.d.ts +41 -0
  60. package/dist/managers/HoverManage.d.ts +26 -0
  61. package/dist/managers/LayerManager.d.ts +33 -0
  62. package/dist/managers/LineLabelOptimizer.d.ts +38 -0
  63. package/dist/managers/NotamManager.d.ts +40 -0
  64. package/dist/managers/PerformanceManager.d.ts +40 -0
  65. package/dist/managers/PluginManager.d.ts +17 -0
  66. package/dist/managers/PopupManager.d.ts +2 -0
  67. package/dist/managers/RasterManager.d.ts +16 -0
  68. package/dist/managers/SelectFeature.d.ts +34 -0
  69. package/dist/managers/ThemeManage.d.ts +11 -0
  70. package/dist/managers/WindManager.d.ts +21 -0
  71. package/dist/nav-sdk.cjs +27061 -0
  72. package/dist/nav-sdk.d.ts +3228 -0
  73. package/dist/nav-sdk.esm.js +27037 -0
  74. package/dist/nav-sdk.min.js +1 -0
  75. package/dist/nav-sdk.umd.js +27067 -0
  76. package/dist/plugins/DrawPlugin.d.ts +14 -0
  77. package/dist/plugins/MeasurePlugin.d.ts +26 -0
  78. package/dist/sdk.style.css +696 -0
  79. package/dist/style/amm-chart.d.ts +439 -0
  80. package/dist/style/aviation-chart.d.ts +2354 -0
  81. package/dist/types/index.d.ts +212 -0
  82. package/package.json +64 -21
  83. package/dist/aviation-chart.umd.js +0 -6
  84. package/dist/index.cjs +0 -6
  85. package/dist/index.js +0 -3571
  86. package/preview.html +0 -48
@@ -0,0 +1,212 @@
1
+ import type { StyleSpecification, GeoJSONSourceSpecification, LayerSpecification } from "maplibre-gl";
2
+ import type { GeoJSON } from "geojson";
3
+ import type { GraticuleConfig } from '../managers/Graticule';
4
+ export interface IMapSDK {
5
+ setCenter(center: [number, number]): void;
6
+ setZoom(zoom: number): void;
7
+ setPitch(pitch: number): void;
8
+ setBearing(bearing: number): void;
9
+ fitBounds(bounds: [[number, number], [number, number]], options?: any): void;
10
+ addBuiltInLayer(layerName: string, zindex?: string | undefined): Promise<void>;
11
+ removeBuiltInLayer(layerName: string): void;
12
+ toggleBuiltInLayer(layerName: string): void;
13
+ getBuiltInLayers(): Object;
14
+ updateLayerStyle(layerId: string, style: StyleConfig): void;
15
+ setMapStyle(style: string | StyleSpecification, options?: {
16
+ diff?: boolean;
17
+ }): Promise<void>;
18
+ setTheme(theme: "light" | "dark"): void;
19
+ addPoint(coordinates: [number, number], properties?: Record<string, any>, style?: StyleConfig): string;
20
+ addLine(coordinates: [number, number][], properties?: Record<string, any>, style?: StyleConfig): string;
21
+ addPolygon(coordinates: [number, number][][], properties?: Record<string, any>, style?: StyleConfig): string;
22
+ addGeoJSON(sourceId: string, geojson?: GeoJSON | string | null | undefined, props?: GeoJSONSourceSpecification | null | undefined): any;
23
+ showLayers(layerIds: string[]): void;
24
+ hideLayers(layerIds: string[]): void;
25
+ on(event: string, listener: Function): void;
26
+ off(event: string, listener: Function): void;
27
+ getCenter(): [number, number];
28
+ getZoom(): number;
29
+ getBounds(): [[number, number], [number, number]];
30
+ destroy(): void;
31
+ use(plugin: IPlugin): void;
32
+ getPlugin<T extends IPlugin>(name: string): T | undefined;
33
+ setPeriod(period: string): void;
34
+ getPeriod(): string | undefined;
35
+ generateCurrentPeriod(): Promise<string>;
36
+ showGraticule(): void;
37
+ hideGraticule(): void;
38
+ toggleGraticule(): void;
39
+ updateGraticuleConfig(config: Partial<GraticuleConfig>): void;
40
+ isGraticuleVisible(): boolean;
41
+ }
42
+ export interface ILayerManager {
43
+ addLayer(config: LayerConfig): string;
44
+ removeLayer(id: string): boolean;
45
+ updateLayer(id: string, updates: Partial<LayerConfig>): boolean;
46
+ showLayer(id: string): boolean;
47
+ hideLayer(id: string): boolean;
48
+ toggleLayer(id: string): boolean;
49
+ getLayer(id: string): LayerConfig | undefined;
50
+ getAllLayers(): LayerConfig[];
51
+ batchShowLayers(ids: string[]): void;
52
+ batchHideLayers(ids: string[]): void;
53
+ batchUpdateLayers(updates: Array<{
54
+ id: string;
55
+ updates: Partial<LayerConfig>;
56
+ }>): void;
57
+ addBuiltInLayer(name: string, zindex?: string | undefined): Promise<void>;
58
+ removeBuiltInLayer(name: string): boolean;
59
+ getBuiltInLayers(): Record<string, string[]>;
60
+ isBuiltInLayerVisible(id: string): boolean;
61
+ setLODEnabled(enabled: boolean): void;
62
+ setLayerLODConfig(layerId: string, config: LODConfig): void;
63
+ }
64
+ export interface IGeoJSONManager {
65
+ addPoint(coordinates: [number, number], properties?: Record<string, any>, style?: StyleConfig, id?: string): string;
66
+ addLine(coordinates: [number, number][], properties?: Record<string, any>, style?: StyleConfig, id?: string): string;
67
+ addPolygon(coordinates: [number, number][][], properties?: Record<string, any>, style?: StyleConfig, id?: string): string;
68
+ addGeoJSON(sourceId: string, geojson?: GeoJSON | string | null | undefined, props?: GeoJSONSourceSpecification | null | undefined): any;
69
+ removeFeature(id: string): boolean;
70
+ updateFeature(id: string, updates: Partial<GeoJSONFeature>): boolean;
71
+ clearAllFeatures(): void;
72
+ getFeature(id: string): GeoJSONFeature | undefined;
73
+ getAllFeatures(): GeoJSONFeature[];
74
+ setClusteringEnabled(enabled: boolean): void;
75
+ setClusteringConfig(layerId: string, config: ClusteringConfig): void;
76
+ }
77
+ export interface IPlugin {
78
+ name: string;
79
+ version: string;
80
+ install(sdk: IMapSDK): void;
81
+ uninstall?(sdk: IMapSDK): void;
82
+ }
83
+ export interface SDKError extends Error {
84
+ code: string;
85
+ details?: any;
86
+ recoverable: boolean;
87
+ }
88
+ export type ErrorHandler = (error: SDKError) => void | Promise<void>;
89
+ export interface LODConfig {
90
+ minZoom: number;
91
+ maxZoom: number;
92
+ minPixelSize: number;
93
+ maxPixelSize: number;
94
+ cullingEnabled: boolean;
95
+ }
96
+ export interface ClusteringConfig {
97
+ enabled: boolean;
98
+ radius: number;
99
+ maxZoom: number;
100
+ minPoints: number;
101
+ }
102
+ export interface MapSDKOptions {
103
+ container: string | HTMLElement;
104
+ style?: string | object;
105
+ center?: [number, number];
106
+ zoom?: number;
107
+ minZoom?: number;
108
+ maxZoom?: number;
109
+ pitch?: number;
110
+ bearing?: number;
111
+ interactive?: boolean;
112
+ preserveDrawingBuffer?: boolean;
113
+ errorHandler?: ErrorHandler;
114
+ performance?: {
115
+ lodEnabled?: boolean;
116
+ clusteringEnabled?: boolean;
117
+ lazyLoadingEnabled?: boolean;
118
+ };
119
+ plugins?: IPlugin[];
120
+ apiKey?: string;
121
+ period?: string;
122
+ version?: string;
123
+ baseUrl?: string;
124
+ staticUrl?: string;
125
+ apiUrl?: string;
126
+ spriteUrl?: string;
127
+ terrainUrl?: string;
128
+ layers?: Record<string, boolean>;
129
+ enableAIP?: boolean;
130
+ enableNOTAM?: boolean;
131
+ enableADSB?: boolean;
132
+ theme?: 'light' | 'dark';
133
+ language?: 'zh-CN' | 'en-US';
134
+ switchDay?: number;
135
+ graticule?: {
136
+ enabled?: boolean;
137
+ interval?: number;
138
+ lineColor?: string;
139
+ lineWidth?: number;
140
+ lineOpacity?: number;
141
+ lineDasharray?: number[];
142
+ labelColor?: string;
143
+ labelSize?: number;
144
+ labelOffset?: [number, number];
145
+ showLabels?: boolean;
146
+ labelFormat?: 'decimal' | 'dms';
147
+ };
148
+ }
149
+ export interface LayerConfig {
150
+ id: string;
151
+ name: string;
152
+ description?: string;
153
+ category: "base" | "overlay" | "label" | "custom";
154
+ type: "background" | "fill" | "line" | "symbol" | "raster" | "hillshade" | "circle" | "custom";
155
+ source: string;
156
+ sourceLayer?: string;
157
+ defaultVisible: boolean;
158
+ paint?: any;
159
+ layout?: any;
160
+ filter?: any[];
161
+ lod?: LODConfig;
162
+ lazyLoad?: boolean;
163
+ maxzoom?: number;
164
+ minzoom?: number;
165
+ "source-layer"?: string;
166
+ }
167
+ export interface BuiltInLayer extends LayerConfig {
168
+ builtin: true;
169
+ }
170
+ export interface GeoJSONFeature {
171
+ id: string;
172
+ type: "Feature";
173
+ geometry: {
174
+ type: "Point" | "LineString" | "Polygon" | "MultiPoint" | "MultiLineString" | "MultiPolygon";
175
+ coordinates: any;
176
+ };
177
+ properties: Record<string, any>;
178
+ style?: StyleConfig;
179
+ }
180
+ export interface GeoJSONCollection {
181
+ type: "FeatureCollection";
182
+ features: GeoJSONFeature[];
183
+ }
184
+ export interface StyleConfig {
185
+ paint?: any;
186
+ layout?: any;
187
+ filter?: any[];
188
+ }
189
+ export interface MapEvent {
190
+ type: string;
191
+ target: any;
192
+ [key: string]: any;
193
+ }
194
+ export type EventListener = (event: MapEvent) => void;
195
+ export interface HookContext {
196
+ sdk: IMapSDK;
197
+ [key: string]: any;
198
+ }
199
+ export type HookCallback = (context: HookContext) => void | Promise<void>;
200
+ export interface HookRegistry {
201
+ [hookName: string]: HookCallback[];
202
+ }
203
+ export type StyleImageMetadata = {
204
+ pixelRatio: number;
205
+ sdf: boolean;
206
+ usvg: boolean;
207
+ stretchX?: Array<[number, number]>;
208
+ stretchY?: Array<[number, number]>;
209
+ content?: [number, number, number, number];
210
+ };
211
+ export type LayerRef = string | Array<string> | RegExp | ((arg0: LayerSpecification) => boolean);
212
+ export type HtmlFunction = (feature: any, popup: any) => string | Promise<string>;
package/package.json CHANGED
@@ -1,35 +1,78 @@
1
1
  {
2
2
  "name": "aviation-chart",
3
- "version": "0.1.35",
4
- "description": "CASC aviation chart SDK",
5
- "type": "module",
6
- "main": "./dist/index.cjs",
7
- "module": "./dist/index.js",
8
- "unpkg": "./dist/aviation-chart.umd.js",
9
- "jsdelivr": "./dist/aviation-chart.umd.js",
3
+ "version": "0.2.0",
4
+ "description": "KunYu aviation map SDK",
5
+ "main": "dist/nav-sdk.cjs",
6
+ "module": "dist/nav-sdk.esm.js",
7
+ "types": "dist/nav-sdk.d.ts",
8
+ "unpkg": "dist/nav-sdk.min.js",
9
+ "jsdelivr": "dist/nav-sdk.min.js",
10
10
  "exports": {
11
11
  ".": {
12
- "import": "./dist/index.js",
13
- "require": "./dist/index.cjs"
12
+ "types": "./dist/nav-sdk.d.ts",
13
+ "import": "./dist/nav-sdk.esm.js",
14
+ "require": "./dist/nav-sdk.cjs"
14
15
  }
15
16
  },
17
+ "type": "module",
16
18
  "files": [
17
- "dist",
18
- "preview.html"
19
+ "dist"
19
20
  ],
20
21
  "scripts": {
21
- "build": "vite build",
22
- "dev": "vite build --watch"
22
+ "dev": "vite",
23
+ "build:dev": "rollup -c --environment NODE_ENV:development && node scripts/version-dist.mjs",
24
+ "build:prod": "rollup -c --environment NODE_ENV:production && node scripts/version-dist.mjs",
25
+ "type-check": "tsc --noEmit",
26
+ "lint": "eslint src --ext .ts",
27
+ "clean": "rimraf dist",
28
+ "docs:init": "npx typedoc",
29
+ "docs:build": "vitepress build doc",
30
+ "docs:dev": "vitepress dev doc"
23
31
  },
24
- "peerDependencies": {
25
- "maplibre-gl": ">=4.0.0"
32
+ "keywords": [
33
+ "map",
34
+ "sdk",
35
+ "geojson",
36
+ "layers",
37
+ "navigation"
38
+ ],
39
+ "author": "anmouren",
40
+ "license": "MIT",
41
+ "devDependencies": {
42
+ "@rollup/plugin-commonjs": "^25.0.0",
43
+ "@rollup/plugin-node-resolve": "^15.0.0",
44
+ "@rollup/plugin-replace": "^6.0.3",
45
+ "@rollup/plugin-strip": "^3.0.4",
46
+ "@rollup/plugin-terser": "^0.4.0",
47
+ "@rollup/plugin-typescript": "^11.0.0",
48
+ "@rollup/plugin-url": "^8.0.2",
49
+ "@types/geojson": "^7946.0.15",
50
+ "@types/lodash": "^4.17.21",
51
+ "@types/node": "^20.0.0",
52
+ "@types/topojson-client": "^3.1.5",
53
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
54
+ "@typescript-eslint/parser": "^6.0.0",
55
+ "eslint": "^8.0.0",
56
+ "rimraf": "^5.0.0",
57
+ "rollup": "^3.0.0",
58
+ "rollup-plugin-copy-assets": "^2.0.3",
59
+ "rollup-plugin-dts": "^5.0.0",
60
+ "rollup-plugin-obfuscator": "^1.1.0",
61
+ "tslib": "^2.8.1",
62
+ "typedoc": "^0.28.15",
63
+ "typedoc-plugin-markdown": "^4.9.0",
64
+ "typescript": "^5.0.0",
65
+ "vite": "^4.0.0"
26
66
  },
27
67
  "dependencies": {
28
- "maplibre-contour": "^0.0.6",
29
- "topojson-client": "^3.1.0"
30
- },
31
- "devDependencies": {
32
- "maplibre-gl": "^5.0.0",
33
- "vite": "^5.0.0"
68
+ "@geoman-io/maplibre-geoman-free": "^0.4.8",
69
+ "@turf/circle": "^6.5.0",
70
+ "@turf/length": "^6.5.0",
71
+ "documentation": "^14.0.3",
72
+ "lodash": "^4.17.21",
73
+ "maplibre-gl": "^5.24.0",
74
+ "proj4": "^2.20.2",
75
+ "topojson-client": "^3.1.0",
76
+ "vitepress": "^1.6.4"
34
77
  }
35
78
  }
@@ -1,6 +0,0 @@
1
- (function(K,ht){typeof exports=="object"&&typeof module<"u"?ht(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],ht):(K=typeof globalThis<"u"?globalThis:K||self,ht(K.AviationChart={},K.maplibregl))})(this,function(K,ht){"use strict";var wt,St,At;function kt(o,r){if(!wt)wt=r;else if(!St)St=r;else{var d="var sharedChunk = {}; ("+wt+")(sharedChunk); ("+St+")(sharedChunk);",y={};wt(y),At=r(y),typeof window<"u"&&(At.workerUrl=window.URL.createObjectURL(new Blob([d],{type:"text/javascript"})))}}kt(["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 g(t,e,i){return(e-t)/(i-t)}function w(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,F=new Map;function M(P,L,R){P[0]===0?R(n*(f-1),n*(h-g(c,L,l))):P[0]===2?R(n*f,n*(h-g(m,L,s))):P[1]===0?R(n*(f-g(s,L,l)),n*(h-1)):R(n*(f-g(m,L,c)),n*h)}for(h=1-a;h<e.height+a;h++){s=e.get(0,h-1),m=e.get(0,h);let P=Math.min(s,m),L=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 R=P,V=L;if(P=Math.min(s,m),L=Math.max(s,m),isNaN(l)||isNaN(s)||isNaN(m)||isNaN(c))continue;const yt=Math.min(R,P),xt=Math.max(V,L),X=Math.ceil(yt/t)*t,rt=Math.floor(xt/t)*t;for(let C=X;C<=rt;C+=t){const Lt=l>C,tt=s>C,st=c>C,vt=m>C;for(const Dt of d[(Lt?8:0)|(tt?4:0)|(vt?2:0)|(st?1:0)]){let Y=_.get(C);Y||_.set(C,Y=new Map);let ct=F.get(C);ct||F.set(C,ct=new Map);const Gt=Dt[0],Et=Dt[1],gt=y(e.width,f,h,Gt),mt=y(e.width,f,h,Et);let G,Ft;if(G=ct.get(gt))if(ct.delete(gt),Ft=Y.get(mt))if(Y.delete(mt),G===Ft){if(M(Et,C,G.append),!G.isEmpty()){let nt=u[C];nt||(u[C]=nt=[]),nt.push(G.lineString())}}else G.appendFragment(Ft),ct.set(G.end=Ft.end,G);else M(Et,C,G.append),ct.set(G.end=mt,G);else if(G=Y.get(mt))Y.delete(mt),M(Gt,C,G.prepend),Y.set(G.start=gt,G);else{const nt=new r(gt,mt);M(Gt,C,nt.append),M(Et,C,nt.append),Y.set(gt,nt),ct.set(mt,nt)}}}}}for(const[P,L]of _.entries()){let R=null;for(const V of L.values())V.isEmpty()||(R==null&&(R=u[P]||(u[P]=[])),R.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 S(t){return b(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 k({thresholds:t,...e}){return b({thresholds:S(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=O(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 x(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 D(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 A(t){return t.then(({arrayBuffer:e})=>{const i=T(e);return{arrayBuffer:i,transferrables:[i]}})}let j=null;function ft(){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,ft()&&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){et=!0;break}}}return et||!1}function I(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 E=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=++E,l.waiting++;else{const h=new AbortController,f=a(i,h);l={abortController:h,item:f,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(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 H,it,N,ot;async function lt(t,e,i){const a=await createImageBitmap(t);return B(i)?null:W(a,e)}function W(t,e){return H||(H=new OffscreenCanvas(t.width,t.height),it=H.getContext("2d",{willReadFrequently:!0})),$t(t,e,H,it)}async function bt(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 F=u[_];u[_]=u[_+2],u[_+2]=F}return Ct(s.width,s.height,e,u)}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 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 $t(n,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:ft()?lt:be()?_e:we;function $t(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 Ct(t.width,t.height,e,n)}function Ct(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 ze=-12e3,Te=9e3;function ve(t){return!isNaN(t)&&t>=ze&&t<=Te}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),F=Math.floor(u),M=this.get(_,F),P=this.get(_+1,F),L=this.get(_,F+1),R=this.get(_+1,F+1),V=f-_,yt=u-F,xt=l(M,P,V),X=l(L,R,V);return l(xt,X,yt)};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 ve(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 De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mt={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Mt.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,F=t[e+u];for(u+=_,l=F&(1<<-f)-1,F>>=-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:(F?-1:1)*(1/0);s=s+Math.pow(2,a),l=l-h}return(F?-1:1)*s*Math.pow(2,l-a)},Mt.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,F=a?0:l-1,M=a?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=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+F]=c&255,F+=M,c/=256,n-=8);for(s=s<<n|c,h+=n;h>0;t[i+F]=s&255,F+=M,s/=256,h-=8);t[i+F-M]|=P*128};var Ee=v,zt=Mt;function v(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}v.Varint=0,v.Fixed64=1,v.Bytes=2,v.Fixed32=5;var Pt=65536*65536,Kt=1/Pt,Fe=12,Ht=typeof TextDecoder>"u"?null:new TextDecoder("utf8");v.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=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)*Pt;return this.pos+=8,t},readSFixed64:function(){var t=Tt(this.buf,this.pos)+Zt(this.buf,this.pos+4)*Pt;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,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,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&&Ht?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!==v.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!==v.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!==v.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!==v.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!==v.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!==v.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!==v.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!==v.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!==v.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===v.Varint)for(;this.buf[this.pos++]>127;);else if(e===v.Bytes)this.pos=this.readVarint()+this.pos;else if(e===v.Fixed32)this.pos+=4;else if(e===v.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*Kt),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*Kt),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&&Yt(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 a=this.pos-i;a>=128&&Yt(i,a,this),this.pos=i-1,this.writeVarint(a),this.pos+=a},writeMessage:function(t,e,i){this.writeTag(t,v.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,Me,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Le,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Pe,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Oe,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ge,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ie,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,v.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,v.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,v.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,v.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,v.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,v.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,v.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,v.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,v.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,v.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function Se(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 dt(t,n,e);throw new Error("Expected varint not more than 10 bytes")}function Q(t){return t.type===v.Bytes?t.readVarint()+t.pos:t.pos+1}function dt(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Ae(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),ke(i,a,e),Re(a,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 Yt(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 Ce(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Me(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 Oe(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Le(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 Ie(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 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 Ve(t,e,i){return Ht.decode(t.subarray(e,i))}function Ue(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 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 a=t.layers[i];a.extent||(a.extent=t.extent),e.writeMessage(3,$e,{...a,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 a of t.features)i.feature=a,e.writeMessage(2,Ke,i);for(const a of i.keys)e.writeStringField(3,a);for(const a of i.values)e.writeMessage(4,Ze,a)}function Ke(t,e){const i=t.feature;if(!i||!e)throw new Error;e.writeMessage(2,He,t),e.writeVarintField(3,i.type),e.writeMessage(4,Ye,i)}function He(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 Ot(t,e){return(e<<3)+(t&7)}function Jt(t){return t<<1^t>>31}function Ye(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===pt.POINT&&(c=s.length/2),e.writeVarint(Ot(1,c));const m=s.length/2,h=a===pt.POLYGON?m-1:m;for(let f=0;f<h;f++){f===1&&a!==1&&e.writeVarint(Ot(2,h-1));const u=s[f*2]-n,_=s[f*2+1]-l;e.writeVarint(Jt(u)),e.writeVarint(Jt(_)),n+=u,l+=_}a===pt.POLYGON&&e.writeVarint(Ot(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,a,n,l){this.loaded=Promise.resolve(),this.decodeImage=jt,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(F,M)=>{const P=await u.fetchTile(s,c,m,M,f);if(B(M))throw new Error("canceled");const L=u.decodeImage(P.data,u.encoding,M),R=f==null?void 0:f.marker("decode"),V=await L;return R==null||R(),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 I(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:F="level",subsampleBelow:M=100}=n;if(!c||c.length===0)return Promise.resolve({arrayBuffer:new ArrayBuffer(0)});const P=[e,i,a,p(n)].join("/");return this.contourCache.get(P,async(L,R)=>{const V=1<<e,yt=[];for(let tt=a-1;tt<=a+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,n,R,s));const xt=await Promise.all(yt);let X=$.combineNeighbors(xt);if(!X||B(R))return{arrayBuffer:new Uint8Array().buffer};const rt=s==null?void 0:s.marker("isoline");if(X.width>=M)X=X.materialize(2);else for(;X.width<M;)X=X.subsamplePixelCenters(2).materialize(2);X=X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);const C=w(c[0],X,f,h);rt==null||rt();const Lt=je({extent:f,layers:{[u]:{features:Object.entries(C).map(([tt,st])=>{const vt=Number(tt);return{type:pt.LINESTRING,geometry:st,properties:{[_]:vt,[F]:Math.max(...c.map((Dt,Y)=>vt%Dt===0?Y:0))}}})}}});return rt==null||rt(),{arrayBuffer:Lt.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 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,...ti(this.fetched.map(qe))],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=[Qt()];return(a=this.marks[i])===null||a===void 0||a.push(n),()=>n.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 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=>ii(l,n)))},this.markFinish=this.marker(e)}}const ei=/(Start$|End$|^start|^end)/;function ii(t,e){const i={};for(const a in t)t[a]!==0&&ei.test(a)?i[a]=Number(t[a])+e:i[a]=t[a];return i}let oi=0;class ri{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 qt("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=++oi,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"})}),I(this.timeoutMs,c,a)}}o.A=ri,o.H=$,o.L=Je,o.T=qt,o.a=z,o.b=w,o.c=Ct,o.d=jt,o.e=k,o.f=A,o.g=x,o.p=D}),kt(["./shared"],function(o){const r=g=>Promise.reject(new Error(`No manager registered for ${g}`));class d{constructor(){this.managers={},this.init=(w,b)=>(this.managers[w.managerId]=new o.L(w.demUrlPattern,w.cacheSize,w.encoding,w.maxzoom,w.timeoutMs),Promise.resolve()),this.fetchTile=(w,b,S,O,k,z)=>{var p;return((p=this.managers[w])===null||p===void 0?void 0:p.fetchTile(b,S,O,k,z))||r(w)},this.fetchAndParseTile=(w,b,S,O,k,z)=>{var p;return o.p(((p=this.managers[w])===null||p===void 0?void 0:p.fetchAndParseTile(b,S,O,k,z))||r(w),!0)},this.fetchContourTile=(w,b,S,O,k,z,p)=>{var x;return o.f(((x=this.managers[w])===null||x===void 0?void 0:x.fetchContourTile(b,S,O,k,z,p))||r(w))}}}const y=typeof self<"u"?self:typeof window<"u"?window:global;y.actor=new o.A(y,new d)}),kt(["./shared"],function(o){const r={workerUrl:""};let d,y=0;class g{constructor(){this.decodeImage=(x,T,D)=>o.p(o.d(x,T,D),!1)}}function w(){if(!d){const p=new Worker(r.workerUrl),x=new g;d=new o.A(p,x)}return d}class b{constructor(x,T,D,A,j,ft){this.fetchTile=(Z,I,U,B,E)=>this.actor.send("fetchTile",[],B,E,this.managerId,Z,I,U),this.fetchAndParseTile=(Z,I,U,B,E)=>this.actor.send("fetchAndParseTile",[],B,E,this.managerId,Z,I,U),this.fetchContourTile=(Z,I,U,B,E,J)=>this.actor.send("fetchContourTile",[],E,J,this.managerId,Z,I,U,B);const et=this.managerId=++y;this.actor=ft||w(),this.loaded=this.actor.send("init",[],new AbortController,void 0,{cacheSize:T,demUrlPattern:x,encoding:D,maxzoom:A,managerId:et,timeoutMs:j})}}Blob.prototype.arrayBuffer||(Blob.prototype.arrayBuffer=function(){return new Promise((x,T)=>{const D=new FileReader;D.onload=A=>{var j;return x((j=A.target)===null||j===void 0?void 0:j.result)},D.onerror=T,D.readAsArrayBuffer(this)})});const S=p=>(x,T)=>{if(T instanceof AbortController)return p(x,T);{const D=new AbortController;return p(x,D).then(A=>T(void 0,A.data,A.cacheControl,A.expires),A=>T(A)),{cancel:()=>D.abort()}}},O=new Set;class k{constructor({url:x,cacheSize:T=100,id:D="dem",encoding:A="terrarium",maxzoom:j=12,worker:ft=!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[H,it,N]=this.parseUrl(E.url),ot=new o.T("main");let lt;try{const W=await this.manager.fetchTile(H,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 H=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,H);return it=H.finish(E.url),{data:bt.arrayBuffer}}catch(N){throw it=H.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 I=D,U=1;for(;O.has(I);)I=D+U++;O.add(I),this.sharedDemProtocolId=`${I}-shared`,this.contourProtocolId=`${I}-contour`,this.sharedDemProtocolUrl=`${this.sharedDemProtocolId}://{z}/{x}/{y}`,this.contourProtocolUrlBase=`${this.contourProtocolId}://{z}/{x}/{y}`;const B=ft?b:o.L;this.manager=new B(x,T,A,j,et,Z)}getDemTile(x,T,D,A){return this.manager.fetchAndParseTile(x,T,D,A||new AbortController)}parseUrl(x){const[,T,D,A]=/\/\/(\d+)\/(\d+)\/(\d+)/.exec(x)||[];return[Number(T),Number(D),Number(A)]}}return{generateIsolines:o.b,DemSource:k,HeightTile:o.H,LocalDemManager:o.L,decodeParsedImage:o.c,set workerUrl(p){r.workerUrl=p},get workerUrl(){return r.workerUrl}}});var te=At;function ee(o){return o}function ie(o){if(o==null)return ee;var r,d,y=o.scale[0],g=o.scale[1],w=o.translate[0],b=o.translate[1];return function(S,O){O||(r=d=0);var k=2,z=S.length,p=new Array(z);for(p[0]=(r+=S[0])*y+w,p[1]=(d+=S[1])*g+b;k<z;)p[k]=S[k],++k;return p}}function oe(o,r){for(var d,y=o.length,g=y-r;g<--y;)d=o[g],o[g++]=o[y],o[y]=d}function It(o,r){return typeof r=="string"&&(r=o.objects[r]),r.type==="GeometryCollection"?{type:"FeatureCollection",features:r.geometries.map(function(d){return Bt(o,d)})}:Bt(o,r)}function Bt(o,r){var d=r.id,y=r.bbox,g=r.properties==null?{}:r.properties,w=re(o,r);return d==null&&y==null?{type:"Feature",properties:g,geometry:w}:y==null?{type:"Feature",id:d,properties:g,geometry:w}:{type:"Feature",id:d,bbox:y,properties:g,geometry:w}}function re(o,r){var d=ie(o.transform),y=o.arcs;function g(z,p){p.length&&p.pop();for(var x=y[z<0?~z:z],T=0,D=x.length;T<D;++T)p.push(d(x[T],T));z<0&&oe(p,D)}function w(z){return d(z)}function b(z){for(var p=[],x=0,T=z.length;x<T;++x)g(z[x],p);return p.length<2&&p.push(p[0]),p}function S(z){for(var p=b(z);p.length<4;)p.push(p[0]);return p}function O(z){return z.map(S)}function k(z){var p=z.type,x;switch(p){case"GeometryCollection":return{type:p,geometries:z.geometries.map(k)};case"Point":x=w(z.coordinates);break;case"MultiPoint":x=z.coordinates.map(w);break;case"LineString":x=b(z.arcs);break;case"MultiLineString":x=z.arcs.map(b);break;case"Polygon":x=O(z.arcs);break;case"MultiPolygon":x=z.arcs.map(O);break;default:return null}return{type:p,coordinates:x}}return k(r)}const ne={airspaceStroke:"#AAB7B8",restrictedStroke:"#D35400",controlledStroke:"#10B981",controlledFill:"#10B981",segment:"#2E4053",waypoint:"#1C2526",vor:"#00008B",ndb:"#0066CC",airport:"#006400",runway:"#333333"};function ae(){const o="navdata",r=ne;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 le={airspaceStroke:"#18C29C",restrictedStroke:"#CC7722",controlledStroke:"#22C55E",controlledFill:"#22C55E",segment:"#40C4FF",waypoint:"#74cdde",vor:"#72aae5",ndb:"#62d6ef",airport:"#73ccdd",runway:"#64748b"};function se(){const o="navdata",r=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-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-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 at={light:{id:"light",label:"日间",background:"#EAF2F8",build:ae},dark:{id:"dark",label:"夜间",background:"#000000",build:se}};function Xt(o="light"){return(at[o]??at.light).build()}const _t={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"]},ce={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 me(o="amm"){const r=ce;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 he={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 fe(o="amm"){const r=he;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 de={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 ue(o="amm"){const r=de,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 Nt(o="amm",r="light"){return r==="dark"?fe(o):r==="neutral"?ue(o):me(o)}const pe={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"]},ye="https://aips.siniswift.com",xe=["interpolate",["linear"],["elevation"],0,"#a8c98a",600,"#cdd98a",1200,"#e8d79a",2400,"#c79a5b",3600,"#9c6b3f",4500,"#f2efe9"],Rt=["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"],Vt=["terrain-color","terrain-hillshade"],Ut=["contour-line","contour-label"];async function Wt(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 g=r.body.pipeThrough(new DecompressionStream("gzip"));return new Response(g).json()}class ge{constructor(r={}){const{container:d,theme:y="light",apiUrl:g=ye,spriteUrl:w,period:b=null,layers:S={},center:O=[104,36],zoom:k=4,terrainUrl:z=null}=r;return this._apiUrl=g.replace(/\/$/,""),this._spriteUrl=(w??g).replace(/\/$/,""),this._terrainUrl=z??`${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`,this._theme=y,this._period=b,this._center=O,this._zoom=k,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,...S},this._initMap(d),new Proxy(this,{get(p,x){if(typeof x=="symbol"||Reflect.has(p,x)){const A=p[x];return typeof A=="function"?A.bind(p):A}const T=p._map;if(!T)return;const D=T[x];return typeof D=="function"?D.bind(T):D},set(p,x,T){return typeof x=="symbol"||Reflect.has(p,x)||!p._map?p[x]=T:x in p._map?p._map[x]=T:p[x]=T,!0},has(p,x){return Reflect.has(p,x)||(p._map?x in p._map:!1)}})}_initMap(r){const d=at[this._theme]??at.light;this._map=new ht.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 te.DemSource({url:this._terrainUrl,encoding:"mapbox",maxzoom:8,worker:!0});r.setupMaplibre(ht),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,g;try{const[w,b]=await Promise.all([Wt(`${this._apiUrl}/topjson/land.topojson.gz`),Wt(`${this._apiUrl}/topjson/boundary.topojson.gz`)]);(r=w==null?void 0:w.objects)!=null&&r.land?(d=this._map.getSource("land"))==null||d.setData(It(w,w.objects.land)):console.warn("[AviationChart] land topojson missing objects.land"),(y=b==null?void 0:b.objects)!=null&&y.boundary?(g=this._map.getSource("boundary"))==null||g.setData(It(b,b.objects.boundary)):console.warn("[AviationChart] boundary topojson missing objects.boundary")}catch(w){console.error("[AviationChart] loadBaseData failed:",w)}}_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":xe}}),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 Xt(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 Nt("amm",this._theme))this._map.getLayer(y.id)||this._map.addLayer(y,"fir-line")}_applyVisibility(){for(const[g,w]of Object.entries(_t)){const b=this._layerVisible[g]!==!1?"visible":"none";for(const S of w)this._map.getLayer(S)&&this._map.setLayoutProperty(S,"visibility",b)}const r=this._layerVisible.amm!==!1?"visible":"none";for(const g of Rt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",r);const d=this._layerVisible.terrain?"visible":"none";for(const g of Vt)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",d);const y=this._layerVisible.contour?"visible":"none";for(const g of Ut)this._map.getLayer(g)&&this._map.setLayoutProperty(g,"visibility",y)}get map(){return this._map}get theme(){return this._theme}get period(){return this._period}setTheme(r){if(r===this._theme)return;this._theme=r;const d=at[r]??at.light;this._map.setPaintProperty("background","background-color",d.background);const y=["landLaye","boundary",...Object.values(_t).flat(),...Rt];for(const g of y)this._map.getLayer(g)&&this._map.removeLayer(g);for(const g of Xt(this._theme))this._map.addLayer(g);for(const g of Nt("amm",this._theme))this._map.getLayer(g.id)||this._map.addLayer(g,"fir-line");this._applyVisibility()}setLayerVisible(r,d){if(this._layerVisible[r]=d,r==="terrain"){const w=d?"visible":"none";for(const b of Vt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);this._map.setTerrain(d?{source:"terrain",exaggeration:4}:null);return}if(r==="contour"){const w=d?"visible":"none";for(const b of Ut)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}if(r==="amm"){const w=d?"visible":"none";for(const b of Rt)this._map.getLayer(b)&&this._map.setLayoutProperty(b,"visibility",w);return}const y=_t[r];if(!y){console.warn(`[AviationChart] Unknown layer key: "${r}"`);return}const g=d?"visible":"none";for(const w of y)this._map.getLayer(w)&&this._map.setLayoutProperty(w,"visibility",g)}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)}}K.AMM_LAYER_GROUPS=pe,K.AviationChart=ge,K.CHART_THEMES=at,K.LAYER_GROUPS=_t,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});