@defra/interactive-map 0.0.31-alpha → 0.0.33-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/assets/images/bright-ofm-thumb.jpg +0 -0
- package/assets/images/dark-ofm-thumb.jpg +0 -0
- package/assets/images/road-ofm-thumb.jpg +0 -0
- package/assets/templates/add-polygons.njk +143 -0
- package/assets/templates/add-symbols.njk +119 -0
- package/assets/templates/{map.njk → basic-map.njk} +9 -17
- package/assets/templates/button-map.njk +56 -0
- package/assets/templates/draw-tools.njk +161 -0
- package/assets/templates/marker-panel.njk +91 -0
- package/assets/templates/place-marker.njk +104 -0
- package/assets/templates/search-control.njk +98 -0
- package/assets/templates/select-feature.njk +101 -0
- package/assets/templates/style-switcher.njk +87 -0
- package/assets/templates/toggle-marker-label.njk +74 -0
- package/dist/css/index.css +1 -1
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/docs/api/map-style-config.md +27 -3
- package/docs/api.md +55 -0
- package/docs/assets/css/docusaurus.scss +22 -6
- package/docs/assets/images/add-polygons.jpg +0 -0
- package/docs/assets/images/add-symbols.jpg +0 -0
- package/docs/assets/images/hero.png +0 -0
- package/docs/assets/images/place-marker.jpg +0 -0
- package/docs/assets/images/screenshot.jpg +0 -0
- package/docs/examples/add-marker-with-panel.mdx +1 -1
- package/docs/examples/add-polygons.mdx +225 -0
- package/docs/examples/add-symbols.mdx +177 -0
- package/docs/examples/{draw.mdx → draw-tools.mdx} +2 -2
- package/docs/examples/index.mdx +38 -2
- package/docs/examples/place-marker.mdx +151 -0
- package/docs/plugins/datasets.md +144 -96
- package/docs/plugins/interact.md +1 -4
- package/docusaurus.config.cjs +5 -2
- package/govuk-prototype-kit.config.json +52 -2
- package/package.json +1 -1
- package/plugins/beta/datasets/dist/css/index.css +1 -2
- package/plugins/beta/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
- package/plugins/beta/datasets/dist/esm/im-datasets-plugin.js +1 -1
- package/plugins/beta/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
- package/plugins/beta/datasets/dist/umd/im-datasets-plugin.js +1 -1
- package/plugins/beta/datasets/dist/umd/index.js +1 -1
- package/plugins/beta/datasets/src/adapters/maplibre/registry/mapLibreDataset.js +27 -9
- package/plugins/beta/datasets/src/adapters/maplibre/registry/mapLibreDataset.test.js +46 -4
- package/plugins/beta/datasets/src/api/setFeatureVisibility.js +10 -1
- package/plugins/beta/datasets/src/api/setFeatureVisibility.test.js +48 -6
- package/plugins/beta/datasets/src/components/LayersMenu/Layers.module.scss +12 -12
- package/plugins/beta/datasets/src/reducers/datasetsToMenu.js +11 -6
- package/plugins/beta/datasets/src/reducers/datasetsToMenu.test.js +49 -0
- package/plugins/beta/datasets/src/reducers/mappedDatasetsReducer.js +8 -1
- package/plugins/beta/datasets/src/reducers/pluginState.js +1 -1
- package/plugins/beta/datasets/src/registry/dataset.js +7 -3
- package/plugins/beta/datasets/src/registry/dataset.test.js +14 -0
- package/plugins/beta/datasets/src/registry/dynamicGeoJson.js +1 -1
- package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js +1 -1
- package/plugins/beta/draw-es/src/api/addFeature.js +12 -3
- package/plugins/beta/draw-es/src/events.js +8 -3
- package/plugins/beta/draw-es/src/events.test.js +2 -0
- package/plugins/beta/draw-es/src/graphic.js +26 -2
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/src/DrawInit.jsx +19 -0
- package/plugins/beta/draw-ml/src/api/newLine.js +1 -0
- package/plugins/beta/draw-ml/src/api/newPolygon.js +1 -0
- package/plugins/beta/draw-ml/src/modes/createDrawMode.js +52 -37
- package/plugins/beta/draw-ml/src/modes/editVertex/touchHandlers.js +1 -1
- package/plugins/beta/draw-ml/src/modes/editVertex/vertexOperations.js +5 -4
- package/plugins/beta/draw-ml/src/modes/editVertexMode.js +53 -21
- package/plugins/beta/draw-ol/dist/esm/DrawMode.js +1 -1
- package/plugins/beta/draw-ol/dist/esm/EditMode.js +1 -1
- package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +1 -1
- package/plugins/beta/draw-ol/src/core/OLDrawManager.js +3 -0
- package/plugins/beta/draw-ol/src/draw/DrawMode.js +57 -49
- package/plugins/beta/draw-ol/src/draw/drawInput.js +76 -32
- package/plugins/beta/draw-ol/src/edit/EditMode.js +4 -4
- package/plugins/beta/draw-ol/src/edit/keyboardHandler.js +4 -2
- package/plugins/beta/draw-ol/src/manifest.js +5 -1
- package/plugins/beta/draw-ol/src/reducer.js +1 -1
- package/plugins/beta/draw-ol/src/snap/snapEngine.js +75 -31
- package/plugins/beta/draw-ol/src/snap/snapGeometry.js +23 -46
- package/plugins/beta/draw-ol/src/snap/snapInteraction.js +30 -29
- package/plugins/beta/draw-ol/src/snap/snapManager.js +10 -1
- package/plugins/beta/draw-ol/src/utils/geometryHelpers.js +9 -3
- package/plugins/beta/draw-ol/src/utils/olCoords.js +2 -2
- package/plugins/beta/draw-ol/src/utils/spatial.js +4 -8
- package/plugins/beta/map-styles/src/mapStyles.scss +41 -41
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/index.js +1 -1
- package/plugins/interact/src/InteractInit.jsx +1 -3
- package/plugins/interact/src/InteractInit.test.js +0 -2
- package/plugins/interact/src/events.test.js +1 -1
- package/plugins/interact/src/hooks/useCrossHairVisibility.js +4 -10
- package/plugins/interact/src/hooks/useCrossHairVisibility.test.js +5 -10
- package/plugins/interact/src/hooks/useHighlightSync.js +1 -10
- package/plugins/interact/src/hooks/useHighlightSync.test.js +2 -21
- package/plugins/interact/src/hooks/useInteractionHandlers.js +5 -11
- package/plugins/interact/src/hooks/useInteractionHandlers.test.js +5 -25
- package/plugins/interact/src/reducer.js +4 -22
- package/plugins/interact/src/reducer.test.js +11 -39
- package/plugins/search/dist/css/index.css +5 -2
- package/plugins/search/src/components/Form/Form.module.scss +5 -2
- package/plugins/search/src/search.scss +4 -4
- package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -1
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +1 -1
- package/providers/beta/openlayers/dist/umd/index.js +1 -1
- package/providers/beta/openlayers/src/utils/tileLayers.js +29 -2
- package/providers/beta/openlayers/src/utils/tileLayers.test.js +53 -1
- package/src/App/components/CrossHair/CrossHair.module.scss +8 -8
- package/src/App/components/MapButton/MapButton.jsx +14 -10
- package/src/App/components/MapButton/MapButton.module.scss +1 -1
- package/src/App/components/MapButton/MapButton.test.jsx +1 -1
- package/src/App/components/PopupMenu/PopupMenu.test.jsx +79 -0
- package/src/App/components/PopupMenu/usePopupMenu.js +61 -12
- package/src/App/hooks/useLayoutMeasurements.js +10 -2
- package/src/App/hooks/useResizeObserver.js +4 -2
- package/src/InteractiveMap/InteractiveMap.js +4 -4
- package/src/InteractiveMap/InteractiveMap.test.js +3 -3
- package/src/InteractiveMap/behaviourController.js +3 -1
- package/src/InteractiveMap/behaviourController.test.js +6 -3
- package/src/InteractiveMap/domStateManager.js +2 -0
- package/src/config/events.js +21 -3
- package/src/types.js +12 -3
- package/src/utils/findNextTabStop.js +3 -3
- package/src/utils/findNextTabStop.test.js +25 -1
- package/webpack.dev.mjs +1 -0
- package/docs/assets/images/screens-blue.jpg +0 -0
- package/docs/assets/images/screens-white.jpg +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"ol/Map.js";import t from"ol/View.js";import{getCenter as r}from"ol/extent.js";import n from"ol/format/GeoJSON.js";import o from"ol/format/MVT.js";import"ol/has.js";import"ol/layer/Group.js";import"ol/layer/Layer.js";import a from"ol/layer/Tile.js";import i from"ol/layer/Vector.js";import s from"ol/layer/VectorTile.js";import"ol/loadingstrategy.js";import{transformExtent as l}from"ol/proj.js";import"ol/proj/Units.js";import"ol/source/Source.js";import"ol/source/TileJSON.js";import u from"ol/source/Vector.js";import p from"ol/source/VectorTile.js";import"ol/tilegrid.js";import c from"ol/tilegrid/TileGrid.js";import{distance as f}from"ol/coordinate.js";import{toPromise as d}from"ol/functions.js";import m from"ol/render/Feature.js";import y from"ol/style/Circle.js";import h from"ol/style/Fill.js";import g from"ol/style/Icon.js";import v from"ol/style/Stroke.js";import b from"ol/style/Style.js";import x from"ol/style/Text.js";import"ol/events/Event.js";import"ol/events/EventType.js";import w from"@babel/runtime/helpers/asyncToGenerator";import{defaults as k}from"ol/interaction/defaults.js";import M from"proj4";import{register as z}from"ol/proj/proj4.js";import S from"@babel/runtime/helpers/defineProperty";import j from"ol/source/XYZ.js";import A from"ol/source/OGCVectorTile.js";import _ from"ol/TileState.js";import{fromString as E}from"ol/color.js";import"ol/layer/Image.js";import"ol/source/Raster.js";import{checkedFonts as O}from"ol/render/canvas.js";import{getUid as P}from"ol/util.js";import C from"ol/Feature.js";var $=[896,448,224,112,56,28,14,7,3.5,1.75,.875,.4375,.21875,.109375],I=[156543.03392800014,78271.51696400007,39135.758482000034,19567.879241000017,9783.939620500008,4891.969810250004,2445.984905125002,1222.992452562501,611.4962262812505,305.74811314062526,152.87405657031263,76.43702828515632,38.21851414257816,19.10925707128908,9.55462853564454,4.77731426782227,2.388657133911135,1.1943285669555674,.5971642834777837,.29858214173889186,.14929107086944593,.07464553543472296,.03732276771736148,.01866138385868074],q=[-238375,1376256],T=300,N=2,D=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"],F="uk",L="world";var R=(e,t)=>{var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function G(e){var{map:t,view:r,emit:n,eventBus:o,events:a,on:i,debouncers:s}=e,l=!1,u=R(()=>{l=!1,n(a.MAP_MOVE_END)},500);s.push(u);var p,c,f,d=(p=()=>n(a.MAP_MOVE),c=10,f=0,function(){var e=Date.now();e-f>=c&&(f=e,p(...arguments))});i(r,"change",()=>{l||(l=!0,o.emit(a.MAP_MOVE_START)),u()}),i(t,"postrender",()=>{l&&d()})}function Z(e){var{map:t,source:r,events:n,eventBus:o,getZoom:a,getCenter:i,getBounds:s,getResolution:l}=e,u=!1,p=[],c=[],f=[],d=t.getView(),m=e=>{var t=(()=>{if(u)return null;var e=a();return{center:i(),bounds:s(),resolution:l(),zoom:e,isAtMaxZoom:e+.01>=d.getMaxZoom(),isAtMinZoom:e-.01<=d.getMinZoom()}})();t&&o.emit(e,t)},y=(e,t,r)=>{e.on(t,r),p.push([e,t,r])},h=(e,t,r)=>{e.on(t,r),c.push([e,t,r])},g=!1,v=()=>{g||(g=!0,o.emit(n.MAP_LOADED))},b=R(()=>m(n.MAP_DATA_CHANGE),500);f.push(b);var x=e=>{u||(c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c=[],h(e,"tileloadend",v),h(e,"tileloadend",b))};return G({map:t,view:t.getView(),emit:m,eventBus:o,events:n,on:y,debouncers:f}),x(r),t.once("rendercomplete",()=>m(n.MAP_FIRST_IDLE)),function(e){var{map:t,eventBus:r,events:n,on:o}=e,a=null;o(t,"pointerdown",e=>{a=e.pixel}),o(t,"click",e=>{if(a){var t=e.pixel[0]-a[0],o=e.pixel[1]-a[1];if(Math.hypot(t,o)>6)return}r.emit(n.MAP_CLICK,{point:{x:e.pixel[0],y:e.pixel[1]},coords:e.coordinate})})}({map:t,eventBus:o,events:n,on:y}),y(t,"postrender",()=>o.emit(n.MAP_RENDER)),{setSource:x,remove(){u=!0,f.forEach(e=>e.cancel()),p.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)})}}}var H={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const U=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function B(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return U.forEach(e=>{e in t&&(r[e]=t[e])}),r}class V extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class J{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new J(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const W={kind:"null"},X={kind:"number"},Y={kind:"string"},K={kind:"boolean"},Q={kind:"color"},ee={kind:"projectionDefinition"},te={kind:"object"},re={kind:"value"},ne={kind:"collator"},oe={kind:"formatted"},ae={kind:"padding"},ie={kind:"colorArray"},se={kind:"numberArray"},le={kind:"resolvedImage"},ue={kind:"variableAnchorOffsetCollection"};function pe(e,t){return{kind:"array",itemType:e,N:t}}function ce(e){if("array"===e.kind){const t=ce(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const fe=[W,X,Y,K,Q,ee,oe,te,pe(re),ae,se,ie,le,ue];function de(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!de(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of fe)if(!de(e,t))return null}return`Expected ${ce(e)} but found ${ce(t)} instead.`}function me(e,t){return t.some(t=>t.kind===e.kind)}function ye(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function he(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const ge=.96422,ve=.82521,be=4/29,xe=6/29,we=3*xe*xe,ke=xe*xe*xe,Me=Math.PI/180,ze=180/Math.PI;function Se(e){return(e%=360)<0&&(e+=360),e}function je([e,t,r,n]){let o,a;const i=_e((.2225045*(e=Ae(e))+.7168786*(t=Ae(t))+.0606169*(r=Ae(r)))/1);e===t&&t===r?o=a=i:(o=_e((.4360747*e+.3850649*t+.1430804*r)/ge),a=_e((.0139322*e+.0971045*t+.7141733*r)/ve));const s=116*i-16;return[s<0?0:s,500*(o-i),200*(i-a),n]}function Ae(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function _e(e){return e>ke?Math.pow(e,1/3):e/we+be}function Ee([e,t,r,n]){let o=(e+16)/116,a=isNaN(t)?o:o+t/500,i=isNaN(r)?o:o-r/200;return o=1*Pe(o),a=ge*Pe(a),i=ve*Pe(i),[Oe(3.1338561*a-1.6168667*o-.4906146*i),Oe(-.9787684*a+1.9161415*o+.033454*i),Oe(.0719453*a-.2289914*o+1.4052427*i),n]}function Oe(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Pe(e){return e>xe?e*e*e:we*(e-be)}const Ce=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function $e(e,t){return Ce(e,t)?e[t]:void 0}function Ie(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=$e(Fe,e);if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")){if(/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[qe(e.slice(r,r+=t)),qe(e.slice(r,r+=t)),qe(e.slice(r,r+=t)),qe(e.slice(r,r+t)||"ff")]}}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,o,a,i,s,l,u,p,c,f]=r,d=[o||" ",s||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,i,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[Ne(+t/r,0,1),Ne(+a/r,0,1),Ne(+l/r,0,1),c?Te(+c,f):1];if(De(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,o,a,i,s,l,u]=r,p=[n||" ",a||" ",s].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[+t,Ne(+o,0,100),Ne(+i,0,100),l?Te(+l,u):1];if(De(e))return function([e,t,r,n]){function o(n){const o=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(o-3,9-o,1))}return e=Se(e),t/=100,r/=100,[o(0),o(8),o(4),n]}(e)}}}function qe(e){return parseInt(e.padEnd(2,e),16)/255}function Te(e,t){return Ne(t?e/100:e,0,1)}function Ne(e,t,r){return Math.min(Math.max(t,e),r)}function De(e){return!e.some(Number.isNaN)}const Fe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Le(e,t,r){return e+r*(t-e)}function Re(e,t,r){return e.map((e,n)=>Le(e,t[n],r))}class Ge{constructor(e,t,r,n=1,o=!0){this.r=e,this.g=t,this.b=r,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Ge)return e;if("string"!=typeof e)return;const t=Ie(e);return t?new Ge(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,t/o,r/o,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,o]=je(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Se(Math.atan2(n,r)*ze):NaN,a,t,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",je(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,o,a,i]=Re(e.rgb,t.rgb,r);return new Ge(n,o,a,i,!1)}case"hcl":{const[n,o,a,i]=e.hcl,[s,l,u,p]=t.hcl;let c,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?c=NaN:(c=s,1!==a&&0!==a||(f=l)):(c=n,1!==u&&0!==u||(f=o));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),c=n+r*e}const[d,m,y,h]=function([e,t,r,n]){return e=isNaN(e)?0:e*Me,Ee([r,Math.cos(e)*t,Math.sin(e)*t,n])}([c,null!=f?f:Le(o,l,r),Le(a,u,r),Le(i,p,r)]);return new Ge(d,m,y,h,!1)}case"lab":{const[n,o,a,i]=Ee(Re(e.lab,t.lab,r));return new Ge(n,o,a,i,!1)}}}}Ge.black=new Ge(0,0,0,1),Ge.white=new Ge(1,1,1,1),Ge.transparent=new Ge(0,0,0,0),Ge.red=new Ge(1,0,0,1);class Ze{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const He=["bottom","center","top"];class Ue{constructor(e,t,r,n,o,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o,this.verticalAlign=a}}class Be{constructor(e){this.sections=e}static fromString(e){return new Be([new Ue(e,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof Be?e:Be.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class Ve{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ve)return e;if("number"==typeof e)return new Ve([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Ve(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Ve(Re(e.values,t.values,r))}}class Je{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Je)return e;if("number"==typeof e)return new Je([e]);if(Array.isArray(e)){for(const t of e)if("number"!=typeof t)return;return new Je(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Je(Re(e.values,t.values,r))}}class We{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof We)return e;if("string"==typeof e){const t=Ge.parse(e);if(!t)return;return new We([t])}if(!Array.isArray(e))return;const t=[];for(const r of e){if("string"!=typeof r)return;const e=Ge.parse(r);if(!e)return;t.push(e)}return new We(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,n="rgb"){const o=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(Ge.interpolate(e.values[a],t.values[a],r,n));return new We(o)}}class Xe extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Ye=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ke{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ke)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!Ye.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new Ke(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const n=e.values,o=t.values;if(n.length!==o.length)throw new Xe(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new Xe(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`);a.push(n[e]);const[t,i]=n[e+1],[s,l]=o[e+1];a.push([Le(t,s,r),Le(i,l,r)])}return new Ke(a)}}class Qe{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Qe({name:e,available:!1}):null}}class et{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new et(e,t,r)}static parse(e){return e instanceof et?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new et(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new et(e.from,e.to,e.transition):"string"==typeof e?new et(e,e,1):void 0}}function tt(e,t,r,n){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function rt(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof et||e instanceof Ge||e instanceof Ze||e instanceof Be||e instanceof Ve||e instanceof Je||e instanceof We||e instanceof Ke||e instanceof Qe)return!0;if(Array.isArray(e)){for(const t of e)if(!rt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!rt(e[t]))return!1;return!0}return!1}function nt(e){if(null===e)return W;if("string"==typeof e)return Y;if("boolean"==typeof e)return K;if("number"==typeof e)return X;if(e instanceof Ge)return Q;if(e instanceof et)return ee;if(e instanceof Ze)return ne;if(e instanceof Be)return oe;if(e instanceof Ve)return ae;if(e instanceof Je)return se;if(e instanceof We)return ie;if(e instanceof Ke)return ue;if(e instanceof Qe)return le;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=nt(t);if(r){if(r===e)continue;r=re;break}r=e}return pe(r||re,t)}return te}function ot(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ge||e instanceof et||e instanceof Be||e instanceof Ve||e instanceof Je||e instanceof We||e instanceof Ke||e instanceof Qe?e.toString():JSON.stringify(e)}class at{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!rt(e[1]))return t.error("invalid value");const r=e[1];let n=nt(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new at(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const it={string:Y,number:X,boolean:K,object:te};class st{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const o=e[0];if("array"===o){let o,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in it)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=it[r],n++}else o=re;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=pe(o,a)}else{if(!it[o])throw new Error(`Types doesn't contain name = ${o}`);r=it[o]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,re);if(!r)return null;a.push(r)}return new st(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!de(this.type,nt(r)))return r;if(t===this.args.length-1)throw new Xe(`Expected value to be of type ${ce(this.type)}, but found ${ce(nt(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const lt={"to-boolean":K,"to-color":Q,"to-number":X,"to-string":Y};class ut{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!lt[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=lt[r],o=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,re);if(!n)return null;o.push(n)}return new ut(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Ge)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:tt(t[0],t[1],t[2],t[3]),!r))return new Ge(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Xe(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=Ve.parse(t);if(n)return n}throw new Xe(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Je.parse(t);if(n)return n}throw new Xe(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=We.parse(t);if(n)return n}throw new Xe(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=Ke.parse(t);if(n)return n}throw new Xe(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new Xe(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Be.fromString(ot(this.args[0].evaluate(e)));case"resolvedImage":return Qe.fromString(ot(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ot(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const pt=["Unknown","Point","LineString","Polygon"];class ct{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?pt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=Ge.parse(e),this._parseColorCache.set(e,t)),t}}class ft{constructor(e,t,r=[],n,o=new J,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new st(t,[e]):"coerce"===r?new ut(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===e.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(o.kind))n=r(n,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof at)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new ct;try{n=new at(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new ft(this.registry,this._isConstant,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new V(r,e))}checkSubtype(e,t){const r=de(e,t);return r&&this.error(r),r}}class dt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const o=e[n];if("string"!=typeof o)return t.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const a=t.parse(e[n+1],n+1);if(!a)return null;r.push([o,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new dt(r,n):null}outputDefined(){return this.result.outputDefined()}}class mt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new mt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class yt{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,X),n=t.parse(e[2],2,pe(t.expectedType||re));if(!r||!n)return null;const o=n.type;return new yt(o.itemType,r,n)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Xe(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new Xe(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new Xe(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class ht{constructor(e,t){this.type=K,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,re),n=t.parse(e[2],2,re);return r&&n?me(r.type,[K,Y,X,W,re])?new ht(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${ce(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!ye(t,["boolean","string","number","null"]))throw new Xe(`Expected first argument to be of type boolean, string, number or null, but found ${ce(nt(t))} instead.`);if(!ye(r,["string","array"]))throw new Xe(`Expected second argument to be of type array or string, but found ${ce(nt(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class gt{constructor(e,t,r){this.type=X,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,re),n=t.parse(e[2],2,re);if(!r||!n)return null;if(!me(r.type,[K,Y,X,W,re]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${ce(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,X);return o?new gt(r,n,o):null}return new gt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ye(t,["boolean","string","number","null"]))throw new Xe(`Expected first argument to be of type boolean, string, number or null, but found ${ce(nt(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),ye(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(ye(r,["array"]))return r.indexOf(t,n);throw new Xe(`Expected second argument to be of type array or string, but found ${ce(nt(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class vt{constructor(e,t,r,n,o,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},a=[];for(let i=2;i<e.length-1;i+=2){let s=e[i];const l=e[i+1];Array.isArray(s)||(s=[s]);const u=t.concat(i);if(0===s.length)return u.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,nt(e)))return null}else r=nt(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=a.length}const p=t.parse(l,i,n);if(!p)return null;n=n||p.type,a.push(p)}const i=t.parse(e[1],1,re);if(!i)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==i.type.kind&&t.concat(1).checkSubtype(r,i.type)?null:new vt(r,n,i,o,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(nt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class bt{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,K);if(!a)return null;const i=t.parse(e[o+1],o+1,r);if(!i)return null;n.push([a,i]),r=r||i.type}const o=t.parse(e[e.length-1],e.length-1,r);if(!o)return null;if(!r)throw new Error("Can't infer output type");return new bt(r,n,o)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class xt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,re),n=t.parse(e[2],2,X);if(!r||!n)return null;if(!me(r.type,[pe(re),Y,re]))return t.error(`Expected first argument to be of type array or string, but found ${ce(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,X);return o?new xt(r.type,r,n,o):null}return new xt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),ye(t,["string"]))return[...t].slice(r,n).join("");if(ye(t,["array"]))return t.slice(r,n);throw new Xe(`Expected first argument to be of type array or string, but found ${ce(nt(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function wt(e,t){const r=e.length-1;let n,o,a=0,i=r,s=0;for(;a<=i;)if(s=Math.floor((a+i)/2),n=e[s],o=e[s+1],n<=t){if(s===r||t<o)return s;a=s+1}else{if(!(n>t))throw new Xe("Input is not a number.");i=s-1}return 0}class kt{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,X);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r<e.length;r+=2){const a=1===r?-1/0:e[r],i=e[r+1],s=r,l=r+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(i,l,o);if(!u)return null;o=o||u.type,n.push([a,u])}return new kt(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[wt(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Mt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zt,St;var jt=function(){if(St)return zt;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return St=1,zt=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}var i=0,s=1;for(r=e,n=0;n<20&&(o=this.sampleCurveX(r),!(Math.abs(o-e)<t));n++)e>o?i=r:s=r,r=.5*(s-i)+i;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},zt}(),At=Mt(jt);class _t{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=Et(t,e.base,r,n);else if("linear"===e.name)o=Et(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new At(a[0],a[1],a[2],a[3]).solve(Et(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,X),!o)return null;const i=[];let s=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==ie?t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType):s=Q;for(let e=0;e<a.length;e+=2){const r=a[e],n=a[e+1],o=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(i.length&&i[i.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,i.push([r,u])}return he(s,X)||he(s,ee)||he(s,Q)||he(s,ae)||he(s,se)||he(s,ie)||he(s,ue)||he(s,pe(X))?new _t(s,r,n,o,i):t.error(`Type ${ce(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const a=wt(t,n),i=t[a],s=t[a+1],l=_t.interpolationFactor(this.interpolation,n,i,s),u=r[a].evaluate(e),p=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Le(u,p,l);case"color":return Ge.interpolate(u,p,l);case"padding":return Ve.interpolate(u,p,l);case"colorArray":return We.interpolate(u,p,l);case"numberArray":return Je.interpolate(u,p,l);case"variableAnchorOffsetCollection":return Ke.interpolate(u,p,l);case"array":return Re(u,p,l);case"projectionDefinition":return et.interpolate(u,p,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return Ge.interpolate(u,p,l,"hcl");case"colorArray":return We.interpolate(u,p,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Ge.interpolate(u,p,l,"lab");case"colorArray":return We.interpolate(u,p,l,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Et(e,t,r,n){const o=n-r,a=e-r;return 0===o?0:1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1)}class Ot{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const o=[];for(const n of e.slice(1)){const e=t.parse(n,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,o.push(e)}if(!r)throw new Error("No output type");const a=n&&o.some(e=>de(n,e.type));return new Ot(a?re:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof Qe&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Pt(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Ct(e,t,r,n){return 0===n.compare(t,r)}function $t(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=K,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let a=t.parse(e[1],1,re);if(!a)return null;if(!Pt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${ce(a.type)}'.`);let i=t.parse(e[2],2,re);if(!i)return null;if(!Pt(r,i.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${ce(i.type)}'.`);if(a.type.kind!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error(`Cannot compare types '${ce(a.type)}' and '${ce(i.type)}'.`);n&&("value"===a.type.kind&&"value"!==i.type.kind?a=new st(i.type,[a]):"value"!==a.type.kind&&"value"===i.type.kind&&(i=new st(a.type,[i])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,ne),!s)return null}return new o(a,i,s)}evaluate(o){const a=this.lhs.evaluate(o),i=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=nt(a),r=nt(i);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Xe(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=nt(a),r=nt(i);if("string"!==e.kind||"string"!==r.kind)return t(o,a,i)}return this.collator?r(o,a,i,this.collator.evaluate(o)):t(o,a,i)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const It=$t("==",function(e,t,r){return t===r},Ct),qt=$t("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!Ct(0,t,r,n)}),Tt=$t("<",function(e,t,r){return t<r},function(e,t,r,n){return n.compare(t,r)<0}),Nt=$t(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),Dt=$t("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),Ft=$t(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});class Lt{constructor(e,t,r){this.type=ne,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,K);if(!n)return null;const o=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,K);if(!o)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,Y),!a)?null:new Lt(n,o,a)}evaluate(e){return new Ze(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Rt{constructor(e,t,r,n,o,a){this.type=Y,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,X);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,Y),!o))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,Y),!a))return null;let i=null;if(n.unit&&(i=t.parse(n.unit,1,Y),!i))return null;if(a&&i)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,X),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,X),!l)?null:new Rt(r,o,a,i,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Gt{constructor(e){this.type=oe,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const a=e[r];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,X),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,pe(Y)),!r))return null;let i=null;if(a["text-color"]&&(i=t.parse(a["text-color"],1,Q),!i))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!He.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=t.parse(a["vertical-align"],1,Y),!s)return null}const l=n[n.length-1];l.scale=e,l.font=r,l.textColor=i,l.verticalAlign=s}else{const a=t.parse(e[r],1,re);if(!a)return null;const i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i&&"resolvedImage"!==i)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Gt(n)}evaluate(e){return new Be(this.sections.map(t=>{const r=t.content.evaluate(e);return nt(r)===le?new Ue("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Ue(ot(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Zt{constructor(e){this.type=le,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Y);return r?new Zt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=Qe.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Ht{constructor(e){this.type=X,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${ce(r.type)} instead.`):new Ht(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new Xe(`Expected value to be of type string or array, but found ${ce(nt(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Ut=8192;function Bt(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const a=Math.pow(2,t.z);return[Math.round(r*a*Ut),Math.round(n*a*Ut)]}function Vt(e,t){const r=Math.pow(2,t.z),n=(e[0]/Ut+t.x)/r,o=(e[1]/Ut+t.y)/r;return[(i=n,360*i-180),(a=o,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,i}function Jt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Wt(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function Xt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Yt(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],a=e[0]-r[0],i=e[1]-r[1];return n*i-a*o===0&&n*a<=0&&o*i<=0}function Kt(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],a=[n[0]-r[0],n[1]-r[1]];return 0!==(i=a)[0]*(s=o)[1]-i[1]*s[0]&&!(!or(e,t,r,n)||!or(r,n,e,t));var i,s}function Qt(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(Kt(e,t,n[r],n[r+1]))return!0;return!1}function er(e,t,r=!1){let n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(Yt(e,o[t],o[t+1]))return r;Xt(e,o[t],o[t+1])&&(n=!n)}return n}function tr(e,t){for(const r of t)if(er(e,r))return!0;return!1}function rr(e,t){for(const r of e)if(!er(r,t))return!1;for(let r=0;r<e.length-1;++r)if(Qt(e[r],e[r+1],t))return!1;return!0}function nr(e,t){for(const r of t)if(rr(e,r))return!0;return!1}function or(e,t,r,n){const o=e[0]-r[0],a=e[1]-r[1],i=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],p=o*u-l*a,c=i*u-l*s;return p>0&&c<0||p<0&&c>0}function ar(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=[];for(let n=0;n<e[o].length;n++){const i=Bt(e[o][n],r);Jt(t,i),a.push(i)}n.push(a)}return n}function ir(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=ar(e[o],t,r);n.push(a)}return n}function sr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}Jt(t,e)}function lr(e,t,r,n){const o=Math.pow(2,n.z)*Ut,a=[n.x*Ut,n.y*Ut],i=[];for(const n of e)for(const e of n){const n=[e.x+a[0],e.y+a[1]];sr(n,t,r,o),i.push(n)}return i}function ur(e,t,r,n){const o=Math.pow(2,n.z)*Ut,a=[n.x*Ut,n.y*Ut],i=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];Jt(t,r),e.push(r)}i.push(e)}if(t[2]-t[0]<=o/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(const e of i)for(const n of e)sr(n,t,r,o)}return i}class pr{constructor(e,t){this.type=K,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(rt(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length){return new pr(t,{type:"MultiPolygon",coordinates:e})}}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new pr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new pr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=ar(t.coordinates,n,o),i=lr(e.geometry(),r,n,o);if(!Wt(r,n))return!1;for(const e of i)if(!er(e,a))return!1}if("MultiPolygon"===t.type){const a=ir(t.coordinates,n,o),i=lr(e.geometry(),r,n,o);if(!Wt(r,n))return!1;for(const e of i)if(!tr(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=ar(t.coordinates,n,o),i=ur(e.geometry(),r,n,o);if(!Wt(r,n))return!1;for(const e of i)if(!rr(e,a))return!1}if("MultiPolygon"===t.type){const a=ir(t.coordinates,n,o),i=ur(e.geometry(),r,n,o);if(!Wt(r,n))return!1;for(const e of i)if(!nr(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class cr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,a=t[o];if(r(n,a)>=0)break;t[e]=a,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],o)>=0)break;t[e]=t[n],e=n}t[e]=o}}function fr(e){let t=0;for(let r,n,o=0,a=e.length,i=a-1;o<a;i=o++)r=e[o],n=e[i],t+=(n.x-r.x)*(r.y+n.y);return t}const dr=1/298.257223563,mr=dr*(2-dr),yr=Math.PI/180;class hr{constructor(e){const t=6378.137*yr*1e3,r=Math.cos(e*yr),n=1/(1-mr*(1-r*r)),o=Math.sqrt(n);this.kx=t*o*r,this.ky=t*o*n*(1-mr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,o,a,i=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],p=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-u)*this.ky,f=0;0===p&&0===c||(f=(this.wrap(t[0]-l)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c),f>1?(l=e[s+1][0],u=e[s+1][1]):f>0&&(l+=p/this.kx*f,u+=c/this.ky*f)),p=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;const d=p*p+c*c;d<i&&(i=d,r=l,n=u,o=s,a=f)}return{point:[r,n],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function gr(e,t){return t[0]-e[0]}function vr(e){return e[1]-e[0]+1}function br(e,t){return e[1]>=e[0]&&e[1]<t}function xr(e,t){if(e[0]>e[1])return[null,null];const r=vr(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function wr(e,t){if(!br(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Jt(r,e[n]);return r}function kr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)Jt(t,e);return t}function Mr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function zr(e,t,r){if(!Mr(e)||!Mr(t))return NaN;let n=0,o=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),r.distance([0,0],[n,o])}function Sr(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function jr(e,t,r,n,o){const a=Math.min(Sr(e,[r,n],o),Sr(t,[r,n],o)),i=Math.min(Sr(r,[e,t],o),Sr(n,[e,t],o));return Math.min(a,i)}function Ar(e,t,r,n,o){if(!(br(t,e.length)&&br(n,r.length)))return 1/0;let a=1/0;for(let i=t[0];i<t[1];++i){const t=e[i],s=e[i+1];for(let e=n[0];e<n[1];++e){const n=r[e],i=r[e+1];if(Kt(t,s,n,i))return 0;a=Math.min(a,jr(t,s,n,i,o))}}return a}function _r(e,t,r,n,o){if(!(br(t,e.length)&&br(n,r.length)))return NaN;let a=1/0;for(let i=t[0];i<=t[1];++i)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,o.distance(e[i],r[t])),0===a)return a;return a}function Er(e,t,r){if(er(e,t,!0))return 0;let n=1/0;for(const o of t){const t=o[0],a=o[o.length-1];if(t!==a&&(n=Math.min(n,Sr(e,[a,t],r)),0===n))return n;const i=r.pointOnLine(o,e);if(n=Math.min(n,r.distance(e,i.point)),0===n)return n}return n}function Or(e,t,r,n){if(!br(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(er(e[n],r,!0))return 0;let o=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],i=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(Kt(t,i,a,l))return 0;o=Math.min(o,jr(t,i,a,l,n))}}return o}function Pr(e,t){for(const r of e)for(const e of r)if(er(e,t,!0))return!0;return!1}function Cr(e,t,r,n=1/0){const o=kr(e),a=kr(t);if(n!==1/0&&zr(o,a,r)>=n)return n;if(Wt(o,a)){if(Pr(e,t))return 0}else if(Pr(t,e))return 0;let i=1/0;for(const n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[a],s=n[e];for(const e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){const n=e[a],l=e[t];if(Kt(o,s,n,l))return 0;i=Math.min(i,jr(o,s,n,l,r))}}return i}function $r(e,t,r,n,o,a){if(!a)return;const i=zr(wr(n,a),o,r);i<t&&e.push([i,a,[0,0]])}function Ir(e,t,r,n,o,a,i){if(!a||!i)return;const s=zr(wr(n,a),wr(o,i),r);s<t&&e.push([s,a,i])}function qr(e,t,r,n,o=1/0){let a=Math.min(n.distance(e[0],r[0][0]),o);if(0===a)return a;const i=new cr([[0,[0,e.length-1],[0,0]]],gr),s=kr(r);for(;i.length>0;){const o=i.pop();if(o[0]>=a)continue;const l=o[1],u=t?50:100;if(vr(l)<=u){if(!br(l,e.length))return NaN;if(t){const t=Or(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const o=Er(e[t],r,n);if(a=Math.min(a,o),0===a)return 0}}else{const r=xr(l,t);$r(i,a,n,e,s,r[0]),$r(i,a,n,e,s,r[1])}}return a}function Tr(e,t,r,n,o,a=1/0){let i=Math.min(a,o.distance(e[0],r[0]));if(0===i)return i;const s=new cr([[0,[0,e.length-1],[0,r.length-1]]],gr);for(;s.length>0;){const a=s.pop();if(a[0]>=i)continue;const l=a[1],u=a[2],p=t?50:100,c=n?50:100;if(vr(l)<=p&&vr(u)<=c){if(!br(l,e.length)&&br(u,r.length))return NaN;let a;if(t&&n)a=Ar(e,l,r,u,o),i=Math.min(i,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(a=Sr(r[e],t,o),i=Math.min(i,a),0===i)return i}else if(!t&&n){const t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Sr(e[r],t,o),i=Math.min(i,a),0===i)return i}else a=_r(e,l,r,u,o),i=Math.min(i,a)}else{const a=xr(l,t),p=xr(u,n);Ir(s,i,o,e,r,a[0],p[0]),Ir(s,i,o,e,r,a[0],p[1]),Ir(s,i,o,e,r,a[1],p[0]),Ir(s,i,o,e,r,a[1],p[1])}}return i}function Nr(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const o of e){const e=fr(o);0!==e&&(o.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[o]):r.push(o))}return r&&t.push(r),t}(r).map(t=>t.map(t=>t.map(t=>Vt([t.x,t.y],e.canonical)))),o=new hr(n[0][0][0][1]);let a=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":a=Math.min(a,qr([e.coordinates],!1,t,o,a));break;case"LineString":a=Math.min(a,qr(e.coordinates,!0,t,o,a));break;case"Polygon":a=Math.min(a,Cr(t,e.coordinates,o,a))}if(0===a)return a}return a}function Dr(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}class Fr{constructor(e,t){this.type=X,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(rt(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Fr(t,t.features.map(e=>Dr(e.geometry)).flat());if("Feature"===t.type)return new Fr(t,Dr(t.geometry));if("type"in t&&"coordinates"in t)return new Fr(t,Dr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Vt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new hr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Tr(n,!1,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Tr(n,!1,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,qr(n,!1,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Vt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new hr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Tr(n,!0,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Tr(n,!0,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,qr(n,!0,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return Nr(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Lr{constructor(e){this.type=re,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Lr(r)}evaluate(e){var t;const r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?$e(r,this.key):null}eachChild(){}outputDefined(){return!1}}const Rr={"==":It,"!=":qt,">":Nt,"<":Tt,">=":Ft,"<=":Dt,array:st,at:yt,boolean:st,case:bt,coalesce:Ot,collator:Lt,format:Gt,image:Zt,in:ht,"index-of":gt,interpolate:_t,"interpolate-hcl":_t,"interpolate-lab":_t,length:Ht,let:dt,literal:at,match:vt,number:st,"number-format":Rt,object:st,slice:xt,step:kt,string:st,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,var:mt,within:pr,distance:Fr,"global-state":Lr};class Gr{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=Gr.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,i=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1);let s=null;for(const[n,a]of i){s=new ft(t.registry,Vr,t.path,null,t.scope);const i=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],o=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+i.length,o);if(!a){l=!0;break}i.push(a)}if(!l)if(Array.isArray(n)&&n.length!==i.length)s.error(`Expected ${n.length} arguments, but found ${i.length} instead.`);else{for(let e=0;e<i.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=i[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Gr(r,o,a,i)}}if(1===i.length)t.errors.push(...s.errors);else{const r=(i.length?i:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(ce).join(", ")})`:`(${ce(t.type)}...)`;var t}).join(" | "),n=[];for(let r=1;r<e.length;r++){const o=t.parse(e[r],1+n.length);if(!o)return null;n.push(ce(o.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Gr.definitions=t;for(const r in t)e[r]=Gr}}function Zr(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const a=o?o.evaluate(e):1,i=tt(t,r,n,a);if(i)throw new Xe(i);return new Ge(t/255,r/255,n/255,a,!1)}function Hr(e,t){return e in t}function Ur(e,t){const r=t[e];return void 0===r?null:r}function Br(e){return{type:e}}function Vr(e){if(e instanceof mt)return Vr(e.boundExpression);if(e instanceof Gr&&"error"===e.name)return!1;if(e instanceof Lt)return!1;if(e instanceof pr)return!1;if(e instanceof Fr)return!1;if(e instanceof Lr)return!1;const t=e instanceof ut||e instanceof st;let r=!0;return e.eachChild(e=>{r=t?r&&Vr(e):r&&e instanceof at}),!!r&&(Jr(e)&&Xr(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function Jr(e){if(e instanceof Gr){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof pr)return!1;if(e instanceof Fr)return!1;let t=!0;return e.eachChild(e=>{t&&!Jr(e)&&(t=!1)}),t}function Wr(e){if(e instanceof Gr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!Wr(e)&&(t=!1)}),t}function Xr(e,t){if(e instanceof Gr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!Xr(e,t)&&(r=!1)}),r}function Yr(e){return{result:"success",value:e}}function Kr(e){return{result:"error",value:e}}function Qr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&nt(e)===te}Gr.register(Rr,{error:[{kind:"error"},[Y],(e,[t])=>{throw new Xe(t.evaluate(e))}],typeof:[Y,[re],(e,[t])=>ce(nt(t.evaluate(e)))],"to-rgba":[pe(X,4),[Q],(e,[t])=>{const[r,n,o,a]=t.evaluate(e).rgb;return[255*r,255*n,255*o,a]}],rgb:[Q,[X,X,X],Zr],rgba:[Q,[X,X,X,X],Zr],has:{type:K,overloads:[[[Y],(e,[t])=>Hr(t.evaluate(e),e.properties())],[[Y,te],(e,[t,r])=>Hr(t.evaluate(e),r.evaluate(e))]]},get:{type:re,overloads:[[[Y],(e,[t])=>Ur(t.evaluate(e),e.properties())],[[Y,te],(e,[t,r])=>Ur(t.evaluate(e),r.evaluate(e))]]},"feature-state":[re,[Y],(e,[t])=>Ur(t.evaluate(e),e.featureState||{})],properties:[te,[],e=>e.properties()],"geometry-type":[Y,[],e=>e.geometryType()],id:[re,[],e=>e.id()],zoom:[X,[],e=>e.globals.zoom],"heatmap-density":[X,[],e=>e.globals.heatmapDensity||0],elevation:[X,[],e=>e.globals.elevation||0],"line-progress":[X,[],e=>e.globals.lineProgress||0],accumulated:[re,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[X,Br(X),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[X,Br(X),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:X,overloads:[[[X,X],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[X],(e,[t])=>-t.evaluate(e)]]},"/":[X,[X,X],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[X,[X,X],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[X,[],()=>Math.LN2],pi:[X,[],()=>Math.PI],e:[X,[],()=>Math.E],"^":[X,[X,X],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[X,[X],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[X,[X],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[X,[X],(e,[t])=>Math.log(t.evaluate(e))],log2:[X,[X],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[X,[X],(e,[t])=>Math.sin(t.evaluate(e))],cos:[X,[X],(e,[t])=>Math.cos(t.evaluate(e))],tan:[X,[X],(e,[t])=>Math.tan(t.evaluate(e))],asin:[X,[X],(e,[t])=>Math.asin(t.evaluate(e))],acos:[X,[X],(e,[t])=>Math.acos(t.evaluate(e))],atan:[X,[X],(e,[t])=>Math.atan(t.evaluate(e))],min:[X,Br(X),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[X,Br(X),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[X,[X],(e,[t])=>Math.abs(t.evaluate(e))],round:[X,[X],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[X,[X],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[X,[X],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[K,[Y,re],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[K,[re],(e,[t])=>e.id()===t.value],"filter-type-==":[K,[Y],(e,[t])=>e.geometryType()===t.value],"filter-<":[K,[Y,re],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[K,[re],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[K,[Y,re],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[K,[re],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[K,[Y,re],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[K,[re],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[K,[Y,re],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[K,[re],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[K,[re],(e,[t])=>t.value in e.properties()],"filter-has-id":[K,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[K,[pe(Y)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[K,[pe(re)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[K,[Y,pe(re)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[K,[Y,pe(re)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:K,overloads:[[[K,K],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Br(K),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:K,overloads:[[[K,K],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Br(K),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[K,[K],(e,[t])=>!t.evaluate(e)],"is-supported-script":[K,[Y],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[Y,[Y],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Y,[Y],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Y,Br(re),(e,t)=>t.map(t=>ot(t.evaluate(e))).join("")],split:[pe(Y),[Y,Y],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[Y,[pe(Y),Y],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[Y,[ne],(e,[t])=>t.evaluate(e).resolvedLocale()]});class en{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new ct,this._defaultValue=t?function(e){if("color"===e.type&&Qr(e.default))return new Ge(0,0,0,0);switch(e.type){case"color":return Ge.parse(e.default)||null;case"padding":return Ve.parse(e.default)||null;case"numberArray":return Je.parse(e.default)||null;case"colorArray":return We.parse(e.default)||null;case"variableAnchorOffsetCollection":return Ke.parse(e.default)||null;case"projectionDefinition":return et.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=un(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,a){this._globalState&&(e=un(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Xe(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function tn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Rr}function rn(e,t,r){const n=new ft(Rr,Vr,[],t?function(e){const t={color:Q,string:Y,number:X,enum:Y,boolean:K,formatted:oe,padding:ae,numberArray:se,colorArray:ie,projectionDefinition:ee,resolvedImage:le,variableAnchorOffsetCollection:ue};if("array"===e.type)return pe(t[e.value]||re,e.length);return t[e.type]}(t):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Yr(new en(o,t,r)):Kr(n.errors)}class nn{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Wr(t.expression),this.globalStateRefs=ln(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=un(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=un(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}}class on{constructor(e,t,r,n,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Wr(t.expression),this.globalStateRefs=ln(t.expression),this.interpolationType=n,this._globalState=o}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=un(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=un(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}interpolationFactor(e,t,r){return this.interpolationType?_t.interpolationFactor(this.interpolationType,e,t,r):0}}function an(e,t,r){const n=rn(e,t,r);if("error"===n.result)return n;const o=n.value.expression,a=Jr(o);if(!a&&("data-driven"!==(i=t)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return Kr([new V("","data expressions not supported")]);var i;const s=Xr(o,["zoom"]);if(!s&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return Kr([new V("","zoom expressions not supported")]);const l=sn(o);if(!l&&!s)return Kr([new V("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof V)return Kr([l]);if(l instanceof _t&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return Kr([new V("",'"interpolate" expressions cannot be used with this property')]);if(!l)return Yr(new nn(a?"constant":"source",n.value,r));const u=l instanceof _t?l.interpolation:void 0;return Yr(new on(a?"camera":"composite",n.value,l.labels,u,r))}function sn(e){let t=null;if(e instanceof dt)t=sn(e.result);else if(e instanceof Ot){for(const r of e.args)if(t=sn(r),t)break}else(e instanceof kt||e instanceof _t)&&e.input instanceof Gr&&"zoom"===e.input.name&&(t=e);return t instanceof V||e.eachChild(e=>{const r=sn(e);r instanceof V?t=r:!t&&r?t=new V("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new V("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function ln(e,t=new Set){return e instanceof Lr&&t.add(e.key),e.eachChild(e=>{ln(e,t)}),t}function un(e,t){const{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s}=null!=e?e:{};return{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s,globalState:t}}function pn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!pn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const cn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function fn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};pn(e)||(e=yn(e));const r=rn(e,cn,t);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:mn(e),getGlobalStateRefs:()=>ln(r.value.expression)}}function dn(e,t){return e<t?-1:e>t?1:0}function mn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(mn(e[t]))return!0;return!1}function yn(e){if(!e)return!0;const t=e[0];if(e.length<=1)return"any"!==t;var r;return"=="===t?hn(e[1],e[2],"=="):"!="===t?bn(hn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?hn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(yn))):"all"===t?["all"].concat(e.slice(1).map(yn)):"none"===t?["all"].concat(e.slice(1).map(yn).map(bn)):"in"===t?gn(e[1],e.slice(2)):"!in"===t?bn(gn(e[1],e.slice(2))):"has"===t?vn(e[1]):"!has"!==t||bn(vn(e[1]))}function hn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function gn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(dn)]]:["filter-in-small",e,["literal",t]]}}function vn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function bn(e){return["!",e]}function xn(e){return"object"==typeof e?["literal",e]:e}function wn(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,xn(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,a=n||!o;return r=r.map(e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],_n(e[1])]:[e[0],xn(e[1])]),n?function(e,t,r){const n={},o={},a=[];for(let t=0;t<r.length;t++){const i=r[t],s=i[0].zoom;void 0===n[s]&&(n[s]={zoom:s,type:e.type,property:e.property,default:e.default},o[s]=[],a.push(s)),o[s].push([i[0].value,i[1]])}const i=An({},t);if("exponential"===i){const r=[kn(e),["linear"],["zoom"]];for(const e of a){jn(r,e,zn(n[e],t,o[e]),!1)}return r}{const e=["step",["zoom"]];for(const r of a){jn(e,r,zn(n[r],t,o[r]),!0)}return Sn(e),e}}(e,t,r):a?function(e,t,r,n=["zoom"]){const o=An(e,t);let a,i=!1;if("interval"===o)a=["step",n],i=!0;else{if("exponential"!==o)throw new Error(`Unknown zoom function type "${o}"`);{const t=void 0!==e.base?e.base:1;a=[kn(e),1===t?["linear"]:["exponential",t],n]}}for(const e of r)jn(a,e[0],e[1],i);return Sn(a),a}(e,t,r):zn(e,t,r)}function kn(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Mn(e,t){const r=xn((n=e.default,o=t.default,void 0!==n?n:void 0!==o?o:void 0));var n,o;return void 0===r&&"resolvedImage"===t.type?"":r}function zn(e,t,r){const n=An(e,t),o=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",o,e[0]],e[1]);return n.push(Mn(e,t)),n}if("categorical"===n){const n=["match",o];for(const e of r)jn(n,e[0],e[1],!1);return n.push(Mn(e,t)),n}if("interval"===n){const t=["step",["number",o]];for(const e of r)jn(t,e[0],e[1],!0);return Sn(t),void 0===e.default?t:["case",["==",["typeof",o],"number"],t,xn(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[kn(e),1===t?["linear"]:["exponential",t],["number",o]];for(const e of r)jn(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",o],"number"],n,xn(e.default)]}throw new Error(`Unknown property function type ${n}`)}function Sn(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function jn(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function An(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function _n(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const a=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,a.length>0&&t.push(a),t.push(["get",o[1]])}if(1===t.length)return e;if(n<e.length)t.push(e.slice(n));else if(2===t.length)return["to-string",t[1]];return t}const En=H;function On(e,t){const r=t[0].evaluate(e),n=t[1].evaluate(e),o=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return Ge.parse(`hsla(${r}, ${n}%, ${o}%, ${a})`)}function Pn(e){if(Array.isArray(e)){if(0===e.length)return e;const t=e[0];if("literal"===t)return e;if("image"===t&&3===e.length&&"object"==typeof e[2]&&null!==e[2]&&!Array.isArray(e[2])){return["image-config",Pn(e[1]),["literal",e[2]]]}const r=e.length;for(let n=1;n<r;++n){const o=e[n],a=Pn(o);if(a!==o){const o=[t];for(let t=1;t<n;++t)o.push(e[t]);o.push(a);for(let t=n+1;t<r;++t)o.push(Pn(e[t]));return o}}}return e}const Cn={},$n={zoom:0,distanceFromCenter:0};Gr.register(Rr,{...Gr.definitions,pitch:[{kind:"number"},[],e=>$n.pitch||0],"distance-from-center":[{kind:"number"},[],e=>$n.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(e,[t])=>function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,r,n),i=Math.min(t,r,n),s=(a+i)/2;let l,u;if(a===i)l=0,u=0;else{const e=a-i;switch(u=s>.5?e/(2-a-i):e/(a+i),a){case t:l=(r-n)/e+(r<n?6:0);break;case r:l=(n-t)/e+2;break;case n:l=(t-r)/e+4;break;default:l=0}l/=6}return[360*l,100*u,100*s,o]}(E(t.evaluate(e)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],On],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],On],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(e,[t,r])=>t.evaluate(e)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(e,[t])=>{const r=Cn[t.evaluate(e)];return void 0===r?{}:r}]});var In={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},qn=" ",Tn=/(italic|oblique)$/i,Nn={};function Dn(e,t,r){var n=Nn[e];if(!n){Array.isArray(e)||(e=[e]);for(var o,a,i=400,s="normal",l=[],u=0,p=e.length;u<p;++u){var c=e[u].split(" "),f=c[c.length-1].toLowerCase();for(var d in"normal"==f||"italic"==f||"oblique"==f?(s=a?s:f,a=!0,c.pop(),f=c[c.length-1].toLowerCase()):Tn.test(f)&&(f=f.replace(Tn,""),s=a?s:c[c.length-1].replace(f,""),a=!0),In){var m=c.length>1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){i=o?i:In[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(i=f,o=!0);var y=c.join(qn).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==y.indexOf(qn)&&(y='"'+y+'"'),l.push(y)}n=Nn[e]=[s,i,l]}return n[0]+qn+n[1]+qn+t+"px"+(r?"/"+r:"")+qn+n[2]}const Fn=Object.freeze({}),Ln={},Rn={};let Gn=0;function Zn(e){return e.id||(e.id=Gn++),e.id}function Hn(e){return e*Math.PI/180}const Un=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Bn(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function Vn(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],a=Bn(o[0],o[1]),i=a.getContext("2d");i.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=i.getImageData(0,0,o[0],o[1]);i.globalCompositeOperation="destination-over",i.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e<n;++e)for(let o=0,a=s.height;o<a;++o){l[4*(o*n+e)+3]>0&&i.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return i.fill(),a}function Jn(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function Wn(e,t,r){const n=Bn(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const a=o.getImageData(0,0,t.width,t.height),i=a.data;for(let e=0,t=a.width;e<t;++e)for(let n=0,o=a.height;n<o;++n){const o=4*(n*t+e),a=.75,s=.1,l=Jn(a-s,a+s,i[o+3]/255);l>0?(i[o+0]=Math.round(255*r.r*l),i[o+1]=Math.round(255*r.g*l),i[o+2]=Math.round(255*r.b*l),i[o+3]=Math.round(255*l)):i[o+3]=0}return o.putImageData(a,0,0),n}const Xn=Array(256).join(" ");function Yn(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=Xn.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e<t;++e)e>0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let Kn;function Qn(){return Kn||(Kn=Bn(1,1).getContext("2d")),Kn}function eo(e,t){return Qn().measureText(e).width+(e.length-1)*t}const to={};function ro(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),a=[];for(let e=0,i=o.length;e<i;++e)a.push(ro(o[e],t,r,n));return a.join("\n")}const o=r+","+t+","+e+","+n;let a=to[o];if(!a){const i=e.split(" ");if(i.length>1){const e=Qn();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=i.length;e<t;++e){const t=i[e],r=s+(s?" ":"")+t;eo(r,n)<=o?s=r:(s&&l.push(s),s=t)}s&&l.push(s);for(let e=0,t=l.length;e<t&&t>1;++e){const r=l[e];if(eo(r,n)<.35*o){const o=e>0?eo(l[e-1],n):1/0,a=e<t-1?eo(l[e+1],n):1/0;l.splice(e,1),t-=1,o<a?(l[e-1]+=" "+r,e-=1):l[e]=r+" "+l[e]}}for(let e=0,t=l.length-1;e<t;++e){const r=l[e],a=l[e+1];if(eo(r,n)>.7*o&&eo(a,n)<.6*o){const i=r.split(" "),s=i.pop();eo(s,n)<.2*o&&(l[e]=i.join(" "),l[e+1]=s+" "+a),t-=1}}a=l.join("\n")}else a=e;a=Yn(a,n),to[o]=a}return a}O.on("propertychange",()=>{for(const e in to)delete to[e]});const no={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},oo={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},ao=function(e,t){let r=an(e,t);if("error"===r.result){const n=Pn(e);n!==e&&(r=an(n,t))}if("error"===r.result){const n=r.value[0];return console.error("Error parsing expression:",e,n.key,n.message),{evaluate:()=>t.default}}return r.value};let io,so;function lo(e,t,r,n,o,a){const i=e.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[i]||(o[i]={});const s=o[i];if(!s[r]){let n=(e[t]||Fn)[r];const o=En[`${t}_${e.type}`]&&En[`${t}_${e.type}`][r];void 0===n&&o&&(n=o.default);let a=tn(n);if(!a&&Qr(n)&&(n=wn(n,o),a=!0),a){const e=ao(n,o);s[r]=e.evaluate.bind(e)}else{const e=o?o.type:typeof n;"color"!==e&&"colorArray"!==e||(n=Ge.parse(n));let t=!1;if("array"===e)for(let e=0;e<n.length;++e){const r=n[e];if(tn(r)||Qr(r)){t=!0;break}}if(t){const e=Object.assign({},o,{type:o.value}),t=[];for(let r=0;r<n.length;++r){let o=n[r];if(!tn(o)&&Qr(o)&&(o=wn(o,e)),tn(o)){const r=ao(o,e);t.push(r.evaluate.bind(r))}else t.push(function(){return o})}s[r]=function(e,r,n){const o=[];for(let a=0;a<t.length;++a)o[a]=t[a](e,r,n);return o}}else s[r]=function(){return n}}}return s[r]($n,n,a)}function uo(e,t,r,n){if(!lo(e,"layout",`${r}-allow-overlap`,t,n))return"declutter";return lo(e,"layout",`${r}-ignore-placement`,t,n)?"none":"obstacle"}function po(e,t,r,n){if(n||console.warn("No filterCache provided to evaluateFilter()"),!(e in n))try{n[e]=fn(t).filter}catch(t){console.warn("Filter will evaluate to false: "+t.message),n[e]=function(){return!1}}return n[e]($n,r)}function co(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const fo=/\{[^{}}]*\}/g;function mo(e,t){return e.replace(fo,function(e){return t[e.slice(1,-1)]||""})}function yo(e,t){let r=e.split(":")[0];return r===e&&(r="default"),t[r]}let ho=!1;const go={};function vo(t,n,o,a=Un,i=void 0,s=void 0,l=void 0,u=void 0){if("string"==typeof n&&(n=JSON.parse(n)),n.schema)for(const e in n.schema){const t=n.schema[e];"default"in t&&(Cn[e]=t.default)}if(8!=n.version)throw new Error("glStyle version 8 required.");go[function(e,t){return Zn(e)+"."+P(t)}(n,t)]=Array.from(arguments);const p={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const e in s){const r=s[e];d(()=>r).then(async r=>{let n;if("undefined"!=typeof Image){const o=new Image;if("string"==typeof r)o.crossOrigin="anonymous",o.src=r;else{let e;r instanceof Request?e=await fetch(r):r instanceof Response&&(e=r);const t=await e.blob();n=URL.createObjectURL(t),o.src=n}o.addEventListener("load",function r(){o.removeEventListener("load",r),p[e]={image:o,size:[o.width,o.height]},t.changed(),n&&URL.revokeObjectURL(n)}),o.addEventListener("error",function e(){URL.revokeObjectURL(n),o.removeEventListener("error",e)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:r}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(p[e]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const c=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=B(e[r],t[e[r].ref]));return e}(n.layers),w={},k=[],M={},z={},S=function(e){let t=Ln[e.id];return t||(t={},Ln[Zn(e)]=t),t}(n),j=function(e){let t=Rn[e.id];return t||(t={},Rn[Zn(e)]=t),t}(n);let A;for(let e=0,t=c.length;e<t;++e){const t=c[e],r=t.id;if("string"==typeof o&&t.source==o||Array.isArray(o)&&-1!==o.indexOf(r)){const o=t["source-layer"];if(A){if(t.source!==A)throw new Error(`Layer "${r}" does not use source "${A}`)}else{A=t.source;const e=n.sources[A];if(!e)throw new Error(`Source "${A}" is not defined`);const r=e.type;if("vector"!==r&&"geojson"!==r)throw new Error(`Source "${A}" is not of type "vector" or "geojson", but "${r}"`)}let a=w[o];a||(a=[],w[o]=a),a.push({layer:t,index:e}),k.push(r)}}const _=[],E=function(o,s,c){const d=t.getSource?.()?.format_?.layerName_??"mvt:layer",k=o.getProperties(),A=w[k[d]];if(!A)return;let E=a.indexOf(s);-1==E&&(E=function(e,t){let r=0;const n=t.length;for(;r<n;++r)if(t[r]<e&&r+1<n){const n=t[r]/t[r+1];return r+Math.log(t[r]/e)/Math.log(n)}return n-1}(s,a)),$n.zoom=E,$n.distanceFromCenter=0;const O=o.getGeometry(),P=no[O.getType()],C=t.get("map");if(C&&C instanceof e&&1===P){const e=C.getSize();if(e){const t=C.getView().getCenter(),n=r(O.getExtent());$n.distanceFromCenter=f(t,n)/s/e[1]}}const $={id:o.getId(),properties:k,type:P},I=t.get("mapbox-featurestate")[o.getId()];let q,T=-1;for(let e=0,r=A.length;e<r;++e){const r=A[e],a=r.layer,f=a.id;if(void 0!==c&&c!==f)continue;const d=a.layout||Fn,w=a.paint||Fn;if("none"===lo(a,"layout","visibility",$,S,I)||"minzoom"in a&&E<a.minzoom||"maxzoom"in a&&E>=a.maxzoom)continue;const O=a.filter;if(!O||po(f,O,$,j)){let e,c,f,j,A,E;q=a;const O=r.index;if(3==P&&("fill"==a.type||"fill-extrusion"==a.type))if(c=lo(a,"paint",a.type+"-opacity",$,S,I),a.type+"-pattern"in w){const e=lo(a,"paint",a.type+"-pattern",$,S,I);if(e){const t="string"==typeof e?mo(e,k):e.toString(),r=yo(t,p);if(i&&i[t]&&r){++T,E=_[T],E&&E.getFill()&&!E.getStroke()&&!E.getText()||(E=new b({fill:new h}),_[T]=E),f=E.getFill(),E.setZIndex(O);const e=t+"."+c;let n=z[e];if(!n){const o=i[t],a=Bn(o.width,o.height),s=a.getContext("2d");s.globalAlpha=c,s.drawImage(r.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=s.createPattern(a,"repeat"),z[e]=n}f.setColor(n)}}}else if(e=co(lo(a,"paint",a.type+"-color",$,S,I),c),a.type+"-outline-color"in w&&(A=co(lo(a,"paint",a.type+"-outline-color",$,S,I),c)),A||(A=e),e||A){if(++T,E=_[T],(!E||e&&!E.getFill()||!e&&E.getFill()||A&&!E.getStroke()||!A&&E.getStroke()||E.getText())&&(E=new b({fill:e?new h:void 0,stroke:A?new v:void 0}),_[T]=E),e&&(f=E.getFill(),f.setColor(e)),"fill-extrusion"===a.type){const e=lo(a,"paint","fill-extrusion-height",$,S,I);if(e>0){const t=Math.max(.1,.9-Math.min(e,225)/280);if(A&&"transparent"!==A){const e=Ge.parse(A);A=`rgba(${Math.round(255*e.r*t)},${Math.round(255*e.g*t)},${Math.round(255*e.b*t)},${e.a})`}}}A&&(j=E.getStroke(),j.setColor(A),j.setWidth(.5)),E.setZIndex(O)}if(1!=P&&"line"==a.type){e="line-pattern"in w?void 0:co(lo(a,"paint","line-color",$,S,I),lo(a,"paint","line-opacity",$,S,I));const t=lo(a,"paint","line-width",$,S,I);e&&t>0&&(++T,E=_[T],E&&E.getStroke()&&!E.getFill()&&!E.getText()||(E=new b({stroke:new v}),_[T]=E),j=E.getStroke(),j.setLineCap(lo(a,"layout","line-cap",$,S,I)),j.setLineJoin(lo(a,"layout","line-join",$,S,I)),j.setMiterLimit(lo(a,"layout","line-miter-limit",$,S,I)),j.setColor(e),j.setWidth(t),j.setLineDash(w["line-dasharray"]?lo(a,"paint","line-dasharray",$,S,I).map(function(e){return e*t}):null),"function"==typeof j.setOffset&&j.setOffset(lo(a,"paint","line-offset",$,S,I)),E.setZIndex(O))}let C,N,D,F,L,R,G,Z,H,U=!1,B=null,V=0;if((1==P||2==P)&&"icon-image"in d){const e=lo(a,"layout","icon-image",$,S,I);if(e){let r;C="string"==typeof e?mo(e,k):e.toString();const n=u?u(t,C):void 0,l=yo(C,p);if(i&&i[C]&&l||n){const e=lo(a,"layout","icon-rotation-alignment",$,S,I);if(2==P){const t=o.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const n=t.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();so||(io=[NaN,NaN],so=new m("Point",io,[],2,{},void 0)),r=so,io[0]=n[0],io[1]=n[1];if("line"===lo(a,"layout","symbol-placement",$,S,I)&&"map"===e){const e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,o=r.length-e;t<o;t+=e){const o=r[t],a=r[t+1],i=r[t+e],s=r[t+e+1],l=Math.min(o,i),u=Math.max(o,i),p=n[0],c=(s-a)*(p-o)-(i-o)*(n[1]-a);if(Math.abs(c)<.001&&p<=u&&p>=l){V=Math.atan2(a-s,i-o);break}}}}}}if(2!==P||r){const t=lo(a,"layout","icon-size",$,S,I),o=void 0!==w["icon-color"]?lo(a,"paint","icon-color",$,S,I):null;if(!o||0!==o.a){const r=lo(a,"paint","icon-halo-color",$,S,I),s=lo(a,"paint","icon-halo-width",$,S,I);let u=`${C}.${t}.${s}.${r}`;if(null!==o&&(u+=`.${o}`),N=M[u],!N){const p=uo(a,$,"icon",S);let c;"icon-offset"in d&&(c=lo(a,"layout","icon-offset",$,S,I).slice(0),c[0]*=t,c[1]*=-t);let f=o?[255*o.r,255*o.g,255*o.b,o.a]:void 0;if(n){const r={color:f,rotateWithView:"map"===e,displacement:c,declutterMode:p,scale:t};"string"==typeof n?r.src=n:(r.img=n,r.imgSize=[n.width,n.height]),N=new g(r)}else{const n=i[C];let a,u,d;if(s)n.sdf?(a=Vn(Wn(l.image,n,o||[0,0,0,1]),{x:0,y:0,width:n.width,height:n.height,pixelRatio:n.pixelRatio},s,r),f=void 0):a=Vn(l.image,n,s,r);else{if(n.sdf&&!l.unSDFed){const e=Wn(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1});l.image=e,l.unSDFed=!0}a=l.image,u=[n.width,n.height],d=[n.x,n.y]}N=new g({color:f,img:a,imgSize:l.size,size:u,offset:d,rotateWithView:"map"===e,scale:t/n.pixelRatio,displacement:c,declutterMode:p})}M[u]=N}}N&&(++T,E=_[T],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E),E.setGeometry(r),N.setRotation(V+Hn(lo(a,"layout","icon-rotate",$,S,I))),N.setOpacity(lo(a,"paint","icon-opacity",$,S,I)),N.setAnchor(oo[lo(a,"layout","icon-anchor",$,S,I)]),E.setImage(N),B=E.getText(),E.setText(void 0),E.setZIndex(O),U=!0,D=!1)}else D=!0}}}if(1==P&&"circle"===a.type){++T,E=_[T],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E);const e="circle-radius"in w?lo(a,"paint","circle-radius",$,S,I):5,t=co(lo(a,"paint","circle-stroke-color",$,S,I),lo(a,"paint","circle-stroke-opacity",$,S,I)),r=lo(a,"paint","circle-translate",$,S,I),n=co(lo(a,"paint","circle-color",$,S,I),lo(a,"paint","circle-opacity",$,S,I)),o=lo(a,"paint","circle-stroke-width",$,S,I),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];N=M[i],N||(N=new y({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new v({width:o,color:t}):void 0,fill:n?new h({color:n}):void 0,declutterMode:"none"}),M[i]=N),E.setImage(N),B=E.getText(),E.setText(void 0),E.setGeometry(void 0),E.setZIndex(O),U=!0}if("text-field"in d){G=Math.round(lo(a,"layout","text-size",$,S,I));const e=lo(a,"layout","text-font",$,S,I);R=lo(a,"layout","text-line-height",$,S,I),L=Dn(l?l(e,n.metadata?n.metadata["ol:webfonts"]:void 0):e,G,R),L.includes("sans-serif")||(L+=",sans-serif"),Z=lo(a,"layout","text-letter-spacing",$,S,I),H=lo(a,"layout","text-max-width",$,S,I);const t=lo(a,"layout","text-field",$,S,I);F="object"==typeof t&&t.sections?1===t.sections.length?t.toString():t.sections.reduce((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,a=Dn(l?l(o):o,G*(r.scale||1),R);let i=r.text;if("\n"===i)return t.push("\n",""),t;if(2==P)return t.push(Yn(i,Z),a),t;i=ro(i,a,H,Z).split("\n");for(let e=0,r=i.length;e<r;++e)e>0&&t.push("\n",""),t.push(i[e],a);return t},[]):mo(t,k).trim(),c=lo(a,"paint","text-opacity",$,S,I)}if(F&&c&&!D){U||(++T,E=_[T],E&&E.getText()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E),E.setImage(void 0),E.setGeometry(void 0));const e=uo(a,$,"text",S);E.getText()||E.setText(B),B=E.getText(),(!B||"getDeclutterMode"in B&&B.getDeclutterMode()!==e)&&(B=new x({padding:[2,2,2,2],declutterMode:e}),E.setText(B));const t=lo(a,"layout","text-transform",$,S,I);"uppercase"==t?F=Array.isArray(F)?F.map((e,t)=>t%2?e:e.toUpperCase()):F.toUpperCase():"lowercase"==t&&(F=Array.isArray(F)?F.map((e,t)=>t%2?e:e.toLowerCase()):F.toLowerCase());const r=Array.isArray(F)?F:2==P?Yn(F,Z):ro(F,L,H,Z);if(B.setText(r),B.setFont(L),B.setRotation(Hn(lo(a,"layout","text-rotate",$,S,I))),"function"==typeof B.setKeepUpright){const e=lo(a,"layout","text-keep-upright",$,S,I);B.setKeepUpright(e)}const n=lo(a,"layout","text-anchor",$,S,I),o=U||1==P?"point":lo(a,"layout","symbol-placement",$,S,I);let i;if("line-center"===o?(B.setPlacement("line"),i="center"):B.setPlacement(o),"line"===o&&"function"==typeof B.setRepeat){const e=lo(a,"layout","symbol-spacing",$,S,I);B.setRepeat(2*e)}B.setOverflow("point"===o);let s=lo(a,"paint","text-halo-width",$,S,I);const l=lo(a,"layout","text-offset",$,S,I),u=lo(a,"paint","text-translate",$,S,I);let p=0,f=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",f=s):-1!==n.indexOf("right")&&(i="right",f=-s);const e=lo(a,"layout","text-rotation-alignment",$,S,I);B.setRotateWithView("map"==e)}else B.setMaxAngle(Hn(lo(a,"layout","text-max-angle",$,S,I))*F.length/r.length),B.setRotateWithView(!1);B.setTextAlign(i);let d="middle";0==n.indexOf("bottom")?(d="bottom",p=-s-.5*(R-1)*G):0==n.indexOf("top")&&(d="top",p=s+.5*(R-1)*G),B.setTextBaseline(d);const m=lo(a,"layout","text-justify",$,S,I);B.setJustify("auto"===m?void 0:m),B.setOffsetX(l[0]*G+f+u[0]),B.setOffsetY(l[1]*G+p+u[1]);const y=B.getFill()||new h;y.setColor(co(lo(a,"paint","text-color",$,S,I),c)),B.setFill(y);const g=co(lo(a,"paint","text-halo-color",$,S,I),c);if(g&&s>0){const e=B.getStroke()||new v;e.setColor(g),s*=2;const t=.5*G;e.setWidth(s<=t?s:t),B.setStroke(e)}else B.setStroke(void 0);const w=lo(a,"layout","text-padding",$,S,I),k=B.getPadding();w!==k[0]&&(k[0]=w,k[1]=w,k[2]=w,k[3]=w),E.setZIndex(O)}}}return T>-1?(_.length=T+1,ho&&("set"in o?o.set("mapbox-layer",q):o.getProperties()["mapbox-layer"]=q),_):void 0};return t.setStyle(E),t.set("mapbox-layers",k),t.set("mapbox-source",A),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),E}function bo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function xo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}Ge.parse("#000000"),Ge.parse("#FFFFFF"),Ge.parse("#000000"),function(e=!1){ho=e}(!0);var wo="EPSG:27700";function ko(e,t,r){var n=r&&r(e,t)||{};return fetch(n.url||e,{headers:n.headers||{}})}var Mo=e=>(t,r)=>{var n=e(r,"Tile")||{},o=n.url||r,a=n.headers||{};fetch(o,{headers:a}).then(e=>e.blob()).then(e=>{t.getImage().src=URL.createObjectURL(e)}).catch(()=>t.setState(_.ERROR))};function zo(e,t){return So.apply(this,arguments)}function So(){return So=w(function*(e,t){if("raster"===e.type){var r=function(e,t){var r=new c({resolutions:$,origin:q,tileSize:256});return new j({projection:wo,tileGrid:r,tileUrlFunction:t=>{var[r,n,o]=t;return e.replace("{z}",r).replace("{x}",n).replace("{y}",o)},tileLoadFunction:t?Mo(t):void 0})}(e.url,t);return{layer:new a({source:r}),source:r}}return"ogc-vt"===e.type?function(e,t){return _o.apply(this,arguments)}(e.url,t,e):function(e,t){return Ao.apply(this,arguments)}(e.url,t,e)}),So.apply(this,arguments)}function jo(e,t){var r=e.indexOf("?"),[n,o]=r>=0?[e.slice(0,r),e.slice(r)]:[e,""],a="".concat(n,".json").concat(o),i="".concat(n,".png").concat(o);return{jsonUrl:a,pngUrl:i,fetch:()=>ko(a,"SpriteJSON",t).then(e=>e.json())}}function Ao(){return Ao=w(function*(e,t){var{renderMode:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yield ko(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=yield ko(i,"Source",t).then(e=>e.json()),u=[l.fullExtent.xmin,l.fullExtent.ymin,l.fullExtent.xmax,l.fullExtent.ymax],f=[l.tileInfo.origin.x,l.tileInfo.origin.y],d=l.tileInfo.lods.map(e=>e.resolution).slice(0,16),m=l.tileInfo.rows,y=l.tiles[0],h=jo(n.sprite,t),g=yield h.fetch();!function(e){e.layers.forEach(e=>{var t;null!==(t=e.paint)&&void 0!==t&&t["icon-color"]&&(e.paint["icon-color"]=e.paint["icon-color"].replace(",0)",",1)"))})}(n);var v=new c({extent:u,origin:f,resolutions:d,tileSize:m}),b=new p({format:new o,url:y,projection:wo,tileGrid:v}),x=new s(xo({source:b,declutter:!0},r&&{renderMode:r}));return vo(x,n,a,d,g,h.pngUrl),{layer:x,source:b}}),Ao.apply(this,arguments)}function _o(){return _o=w(function*(e,t){var r,{renderMode:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=yield ko(e,"Style",t).then(e=>e.json()),i=Object.keys(a.sources)[0],l=a.sources[i].url,u=jo(a.sprite,t),p=null===(r=(yield ko(l,"Source",t).then(e=>e.json())).links)||void 0===r?void 0:r.find(e=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===e.rel),[f,d]=yield Promise.all([ko(p.href,"Source",t).then(e=>e.json()),u.fetch()]),m=f.tileMatrices.map(e=>e.cellSize),y=f.tileMatrices[0].pointOfOrigin,h=[f.tileMatrices[0].tileHeight,f.tileMatrices[0].tileWidth],g=new o;g.supportedMediaTypes.push("application/octet-stream");var v=new c({resolutions:m,origin:y,tileSize:h}),b=new A({url:l,format:g,tileGrid:v,projection:wo}),x=new s(xo({source:b,declutter:!0},n&&{renderMode:n}));return vo(x,a,i,m,d,u.pngUrl),{layer:x,source:b}}),_o.apply(this,arguments)}function Eo(e,t,r){if(null!==e)for(var n,o,a,i,s,l,u,p,c=0,f=0,d=e.type,m="FeatureCollection"===d,y="Feature"===d,h=m?e.features.length:1,g=0;g<h;g++){s=(p=!!(u=m?e.features[g].geometry:y?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var b=0,x=0;if(null!==(i=p?u.geometries[v]:u)){l=i.coordinates;var w=i.type;switch(c=0,w){case null:break;case"Point":if(!1===t(l,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-c;o++){if(!1===t(l[n][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-c;a++){if(!1===t(l[n][o][a],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===Eo(i.geometries[n],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var Oo=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return Eo(e,e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r},Po=e=>{var t=e/1609.344;if(t<.5)return"".concat(Math.round(e),"m");if(t<10){var r=Number.parseFloat(t.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(t);return"".concat(o," miles")},Co=(e,t,r)=>{var n=r.getTargetElement().getBoundingClientRect();if(!n.width||!n.height)return!1;var o=r.getViewport().getBoundingClientRect(),a=o.width/n.width,i=o.height/n.height,[s,l,u,p]=(e=>Oo(e))(e),c=[[s,l],[s,p],[u,l],[u,p]].map(e=>r.getPixelFromCoordinate(e)).filter(Boolean);if(!c.length)return!1;var f=n.left+Math.min(...c.map(e=>e[0]))*a,d=n.left+Math.max(...c.map(e=>e[0]))*a,m=n.top+Math.min(...c.map(e=>e[1]))*i,y=n.top+Math.max(...c.map(e=>e[1]))*i;return f<t.right&&d>t.left&&m<t.bottom&&y>t.top},$o=(e,t,r)=>{for(var n=[],o=t;o<r;o+=2)n.push([e[o],e[o+1]]);return n},Io=e=>{var t=e.getType(),r=e.getFlatCoordinates();if("Point"===t)return{type:"Point",coordinates:[r[0],r[1]]};if("LineString"===t)return{type:"LineString",coordinates:$o(r,0,r.length)};if("Polygon"===t){var n=e.getEnds(),o=0;return{type:"Polygon",coordinates:n.map(e=>{var t=$o(r,o,e);return o=e,t})}}if("MultiPolygon"===t){var a=e.getEndss(),i=0,s=a.map(e=>{var t=i,n=e.map(e=>{var n=$o(r,t,e);return t=e,n});return i=e[e.length-1],n});return{type:"MultiPolygon",coordinates:s}}return{type:t,coordinates:$o(r,0,r.length)}},qo=(e,t,r,n)=>{var o=[];return e.getLayers().forEach(e=>{if(e instanceof s){var a=e.getSource(),i=null==a?void 0:a.sourceTiles_;i&&Object.values(i).forEach(e=>{e.getState()===_.LOADED&&e.getFeatures().forEach(e=>{var a;if((null===(a=e.get("mapbox-layer"))||void 0===a?void 0:a.id)===t){var i=n?e.get(n):e.getId();String(i)===String(r)&&o.push(Io(e))}})})}}),o};function To(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function No(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?To(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):To(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Do="EPSG:27700",Fo=new n({dataProjection:Do,featureProjection:Do}),Lo="_highlight",Ro=999,Go=(e,t)=>{if(!e)return[];var{stroke:r,selectionStroke:n,fill:o,strokeWidth:a,activeStrokeWidth:i}=e;if(t)return[new b({stroke:new v({color:r,width:i}),zIndex:Ro}),new b({stroke:new v({color:n,width:a}),zIndex:1e3})];var s=[new b({stroke:new v({color:n,width:a}),zIndex:Ro})];return o&&"transparent"!==o&&s.push(new b({fill:new h({color:o}),zIndex:Ro})),s},Zo=e=>{var t=new Set,r={};for(var{layerId:n,featureId:o,idProperty:a}of null!=e?e:[])t.add("".concat(n,":").concat(o)),a&&(r[n]=a);return{keys:t,idProps:r}},Ho=(e,t,r,n)=>{for(var{layerId:o,geometry:a}of null!=t?t:[])if(a){var i=Go(null==n?void 0:n[o],r);if(i.length){var s=new C({geometry:Fo.readGeometry(a)});s.setStyle(i),e.addFeature(s)}}},Uo=(e,t)=>{var{type:r,coordinates:n}=e,o=e=>{var[r,n]=e;return t(r,n)},a=e=>e.forEach(o);"Point"===r?o(n):"MultiPoint"===r||"LineString"===r?n.forEach(o):"MultiLineString"===r||"Polygon"===r?n.forEach(a):"MultiPolygon"===r&&n.forEach(e=>e.forEach(a))},Bo=(e,t,r,n)=>{if(!e)return null;var o=new Set;e.getLayers().forEach(e=>{if(e instanceof i&&!e.get(Lo)){var t=e.get("layerId");t&&o.add(t)}});var{keys:a,idProps:l}=Zo(t),{keys:p,idProps:c}=Zo(r),f=No(No({},l),c);((e,t,r,n,o)=>{e.getLayers().forEach(e=>{if(e instanceof s)if(t.size>0||r.size>0){e._highlightOriginalStyle||(e._highlightOriginalStyle=e.getStyleFunction());var a=e._highlightOriginalStyle;e.setStyle((e,i)=>{var s,l=a(e,i),u=null===(s=e.get("mapbox-layer"))||void 0===s?void 0:s.id;if(!u)return l;var p=n[u],c=p?e.get(p):e.getId(),f="".concat(u,":").concat(c),d=r.has(f),m=!d&&t.has(f);if(!d&&!m)return l;var y=Go(null==o?void 0:o[u],d);return y.length?[...l?Array.isArray(l)?l:[l]:[],...y]:l})}else e._highlightOriginalStyle&&(e.setStyle(e._highlightOriginalStyle),delete e._highlightOriginalStyle)})})(e,a,p,f,n);var d=(e=>{var t=null;return e.getLayers().forEach(e=>{e.get(Lo)&&(t=e)}),t||((t=new i({source:new u,zIndex:1001})).set(Lo,!0),e.addLayer(t)),t})(e),m=d.getSource();m.clear();var y=(null!=t?t:[]).filter(e=>o.has(e.layerId)),h=(null!=r?r:[]).filter(e=>o.has(e.layerId));Ho(m,h,!0,n),Ho(m,y,!1,n);var g=(null!=t?t:[]).flatMap(t=>((e,t)=>{var{layerId:r,featureId:n,idProperty:o,geometry:a}=t;if(null!=n){var i=qo(e,r,n,o);if(i.length>0)return i}return a?[a]:[]})(e,t));return(e=>{if(!e.length)return null;var t=1/0,r=1/0,n=-1/0,o=-1/0;for(var a of e)Uo(a,(e,a)=>{e<t&&(t=e),a<r&&(r=a),e>n&&(n=e),a>o&&(o=a)});return t===1/0?null:[t,r,n,o]})(g)};function Vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var Jo="EPSG:27700",Wo=new n({dataProjection:Jo,featureProjection:Jo}),Xo=e=>{var t=e.getId();if(null!=t)return t;var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e.getProperties());return delete r["mapbox-layer"],JSON.stringify(r)},Yo=(e,t,r)=>{var n=e.getViewport();if(r&&e.un("pointermove",r),null==t||!t.length)return n.style.cursor="",null;var o=new Set(t),a=null,l=t=>{var r;if("mouse"===(null===(r=t.originalEvent)||void 0===r?void 0:r.pointerType)){var l=t.pixel;null!==a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{a=null;var t=e.forEachFeatureAtPixel(l,(e,t)=>((e,t,r)=>{if(t instanceof s){var n,o=null===(n=e.get("mapbox-layer"))||void 0===n?void 0:n.id;return Boolean(o&&r.has(o))}if(t instanceof i&&!t.get("_highlight")){var a=t.get("layerId");return Boolean(a&&r.has(a))}return!1})(e,t,o),{hitTolerance:8});n.style.cursor=t?"pointer":""})}};return e.on("pointermove",l),l};function Ko(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Qo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ko(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ko(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}(()=>{if("undefined"!=typeof HTMLCanvasElement){var e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return e.call(this,t,"2d"===t?Qo(Qo({},r),{},{willReadFrequently:!0}):r,...o)}}})();var ea="EPSG:27700",ta=e=>{if(e){var{top:t=0,right:r=0,bottom:n=0,left:o=0}=e;return[t,r,n,o]}};M.defs(ea,"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),z(M);class ra{constructor(e){var{mapProviderConfig:t={},events:r,eventBus:n}=e;this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:D,supportsMapSizes:!0},Object.assign(this,t)}get name(){return"OpenLayersProvider"}initMap(r){var n=this;return w(function*(){var o,{container:a,padding:i,mapStyle:s,mapSize:l,center:u,zoom:p,bounds:c,minZoom:f,maxZoom:d,transformRequest:m,pixelRatio:y}=r;n.mapStyleId=null==s?void 0:s.id,n.mapSize=l;var{events:h,eventBus:g}=n,{layer:v,source:b}=yield zo(s,m),x=(null!==(o=n.zoomAlignment)&&void 0!==o?o:F)===L?{resolutions:I,defaultMinZoom:6,maxZoom:20}:{resolutions:$,defaultMinZoom:0,maxZoom:$.length-1},M=new t({projection:ea,center:u,zoom:null!=p?p:x.defaultMinZoom,minZoom:Math.max(null!=f?f:x.defaultMinZoom,x.defaultMinZoom),maxZoom:null!=d?d:x.maxZoom,resolutions:x.resolutions,constrainResolution:!1,padding:ta(i)}),z=new e({target:a,layers:[v],view:M,controls:[],interactions:k({doubleClickZoom:!1}),pixelRatio:y});c&&z.once("rendercomplete",()=>{M.fit(c,{size:z.getSize(),duration:0})}),n.mapEventHandles=Z({map:z,source:b,events:h,eventBus:g,getZoom:n.getZoom.bind(n),getCenter:n.getCenter.bind(n),getBounds:n.getBounds.bind(n),getResolution:n.getResolution.bind(n)}),n.appEventHandles=function(e){var{mapProvider:t,transformRequest:r,events:n,eventBus:o,map:a,onBaseSourceChange:i}=e,s=function(){var e=w(function*(e){var{layer:s,source:l}=yield zo(e,r);a.getLayers().setAt(0,s),i(l),o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:e.id}),t.reapplyHighlights()});return function(t){return e.apply(this,arguments)}}(),l=e=>{a.setPixelRatio(e)},u=e=>{var{mapSize:r}=e;t.mapSize=r};return o.on(n.MAP_SET_STYLE,s),o.on(n.MAP_SET_PIXEL_RATIO,l),o.on(n.MAP_SIZE_CHANGE,u),{remove(){o.off(n.MAP_SET_STYLE,s),o.off(n.MAP_SET_PIXEL_RATIO,l),o.off(n.MAP_SIZE_CHANGE,u)}}}({mapProvider:n,transformRequest:m,events:h,eventBus:g,map:z,onBaseSourceChange:n.mapEventHandles.setSource})||[],n.map=z,n.view=M,g.emit(h.MAP_READY,{map:n.map,mapStyleId:n.mapStyleId,mapSize:n.mapSize,crs:n.crs})})()}destroyMap(){var e,t;null===(e=this.mapEventHandles)||void 0===e||e.remove(),null===(t=this.appEventHandles)||void 0===t||t.remove(),this.mapEventHandles=null,this.appEventHandles=null,this.map&&(this._onHoverMove&&(this.map.un("pointermove",this._onHoverMove),this._onHoverMove=null),this.map.setTarget(null),this.map=null),this.view=null}setView(e){var{center:t,zoom:r}=e;this.view.animate({center:null!=t?t:this.view.getCenter(),zoom:null!=r?r:this.view.getZoom(),duration:T})}zoomIn(e){this.view.animate({zoom:this.view.getZoom()+e,duration:T})}zoomOut(e){this.view.animate({zoom:this.view.getZoom()-e,duration:T})}panBy(e){var t=this.view.getCenter(),r=this.view.getResolution();this.view.animate({center:[t[0]+e[0]*r,t[1]-e[1]*r],duration:T})}fitToBounds(e){var t,r=Array.isArray(e)?e:(t=Oo(e),l(t,"EPSG:4326","EPSG:27700"));this.view.fit(r,{duration:T})}setPadding(e){this.view.padding=ta(e)}getCenter(){var e=this.view.getCenter(),t=N;return[Math.round(e[0]*Math.pow(10,t))/Math.pow(10,t),Math.round(e[1]*Math.pow(10,t))/Math.pow(10,t)]}getZoom(){return this.view.getZoom()}getBounds(){return this.view.calculateExtent(this.map.getSize()).map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return[];var{radius:n=10}=r,o=[t.x,t.y],a=[],l=new Set;return e.forEachFeatureAtPixel(o,(e,t)=>{if(t instanceof s){var r=e.get("mapbox-layer"),n=null==r?void 0:r.id;if(!n||"background"===(null==r?void 0:r.type))return;var o="".concat(n,":").concat(Xo(e));if(l.has(o))return;l.add(o),a.push({id:e.getId(),layer:{id:n},geometry:Io(e),properties:e.getProperties()})}else if(t instanceof i){var u=t.get("layerId");if(!u||t.get("_highlight"))return;var p=e.getId(),c="".concat(u,":").concat(p);if(l.has(c))return;l.add(c),a.push({id:p,layer:{id:u},geometry:Wo.writeGeometryObject(e.getGeometry()),properties:e.getProperties()})}},{hitTolerance:n}),a}(this.map,e,t)}getFeatureGeometry(e,t,r){var n=qo(this.map,e,t,r);return 0===n.length?null:1===n.length?n[0]:{type:"MultiPolygon",coordinates:n.flatMap(e=>"MultiPolygon"===e.type?e.coordinates:[e.coordinates])}}setHoverCursor(e){this.map&&(this._onHoverMove=Yo(this.map,e,this._onHoverMove))}getVisibleFeatures(e){return[]}updateHighlightedFeatures(e,t,r){return this._lastHighlightArgs={selectedFeatures:e,activeFeatures:t,stylesMap:r},Bo(this.map,e,t,r)}reapplyHighlights(){if(this._lastHighlightArgs){var{selectedFeatures:e,activeFeatures:t,stylesMap:r}=this._lastHighlightArgs;Bo(this.map,e,t,r)}}getAreaDimensions(){return(e=>{if(!e)return"";var[t,r,n,o]=e,a=n-t;return"".concat(Po(o-r)," by ").concat(Po(a))})((e=>{var t=e.getSize(),r=e.getView().padding||[0,0,0,0],[n,o,a,i]=r,s=[i,t[1]-a],l=[t[0]-o,n],u=e.getCoordinateFromPixel(s),p=e.getCoordinateFromPixel(l);return u&&p?[u[0],u[1],p[0],p[1]]:null})(this.map))}getCardinalMove(e,t){return((e,t)=>{var r=t[0]-e[0],n=t[1]-e[1],o=[];return Math.abs(n)>1&&o.push("".concat(n>0?"north":"south"," ").concat(Po(Math.abs(n)))),Math.abs(r)>1&&o.push("".concat(r>0?"east":"west"," ").concat(Po(Math.abs(r)))),o.join(", ")})(e,t)}getResolution(){return this.view.getResolution()}mapToScreen(e){if(!this.map)return{x:0,y:0};var t=this.map.getPixelFromCoordinate(e);return t?{x:t[0],y:t[1]}:{x:0,y:0}}screenToMap(e){return this.map.getCoordinateFromPixel([e.x,e.y])}isGeometryObscured(e,t){return Co(e,t,this.map)}}export{ra as default};
|
|
1
|
+
import e from"ol/Map.js";import t from"ol/View.js";import{getCenter as r}from"ol/extent.js";import n from"ol/format/GeoJSON.js";import o from"ol/format/MVT.js";import"ol/has.js";import"ol/layer/Group.js";import"ol/layer/Layer.js";import a from"ol/layer/Tile.js";import i from"ol/layer/Vector.js";import s from"ol/layer/VectorTile.js";import"ol/loadingstrategy.js";import{transformExtent as l}from"ol/proj.js";import"ol/proj/Units.js";import"ol/source/Source.js";import"ol/source/TileJSON.js";import u from"ol/source/Vector.js";import p from"ol/source/VectorTile.js";import"ol/tilegrid.js";import c from"ol/tilegrid/TileGrid.js";import{distance as f}from"ol/coordinate.js";import{toPromise as d}from"ol/functions.js";import m from"ol/render/Feature.js";import y from"ol/style/Circle.js";import h from"ol/style/Fill.js";import g from"ol/style/Icon.js";import v from"ol/style/Stroke.js";import b from"ol/style/Style.js";import x from"ol/style/Text.js";import"ol/events/Event.js";import"ol/events/EventType.js";import w from"@babel/runtime/helpers/asyncToGenerator";import{defaults as k}from"ol/interaction/defaults.js";import M from"proj4";import{register as z}from"ol/proj/proj4.js";import S from"@babel/runtime/helpers/defineProperty";import j from"ol/source/XYZ.js";import A from"ol/source/TileWMS.js";import _ from"ol/source/OGCVectorTile.js";import E from"ol/TileState.js";import{fromString as O}from"ol/color.js";import"ol/layer/Image.js";import"ol/source/Raster.js";import{checkedFonts as P}from"ol/render/canvas.js";import{getUid as C}from"ol/util.js";import $ from"ol/Feature.js";var I=[896,448,224,112,56,28,14,7,3.5,1.75,.875,.4375,.21875,.109375],q=[156543.03392800014,78271.51696400007,39135.758482000034,19567.879241000017,9783.939620500008,4891.969810250004,2445.984905125002,1222.992452562501,611.4962262812505,305.74811314062526,152.87405657031263,76.43702828515632,38.21851414257816,19.10925707128908,9.55462853564454,4.77731426782227,2.388657133911135,1.1943285669555674,.5971642834777837,.29858214173889186,.14929107086944593,.07464553543472296,.03732276771736148,.01866138385868074],T=[-238375,1376256],N=300,F=2,D=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"],L="uk",R="world";var G=(e,t)=>{var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function Z(e){var{map:t,view:r,emit:n,eventBus:o,events:a,on:i,debouncers:s}=e,l=!1,u=G(()=>{l=!1,n(a.MAP_MOVE_END)},500);s.push(u);var p,c,f,d=(p=()=>n(a.MAP_MOVE),c=10,f=0,function(){var e=Date.now();e-f>=c&&(f=e,p(...arguments))});i(r,"change",()=>{l||(l=!0,o.emit(a.MAP_MOVE_START)),u()}),i(t,"postrender",()=>{l&&d()})}function H(e){var{map:t,source:r,events:n,eventBus:o,getZoom:a,getCenter:i,getBounds:s,getResolution:l}=e,u=!1,p=[],c=[],f=[],d=t.getView(),m=e=>{var t=(()=>{if(u)return null;var e=a();return{center:i(),bounds:s(),resolution:l(),zoom:e,isAtMaxZoom:e+.01>=d.getMaxZoom(),isAtMinZoom:e-.01<=d.getMinZoom()}})();t&&o.emit(e,t)},y=(e,t,r)=>{e.on(t,r),p.push([e,t,r])},h=(e,t,r)=>{e.on(t,r),c.push([e,t,r])},g=!1,v=()=>{g||(g=!0,o.emit(n.MAP_LOADED))},b=G(()=>m(n.MAP_DATA_CHANGE),500);f.push(b);var x=e=>{u||(c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c=[],h(e,"tileloadend",v),h(e,"tileloadend",b))};return Z({map:t,view:t.getView(),emit:m,eventBus:o,events:n,on:y,debouncers:f}),x(r),t.once("rendercomplete",()=>m(n.MAP_FIRST_IDLE)),function(e){var{map:t,eventBus:r,events:n,on:o}=e,a=null;o(t,"pointerdown",e=>{a=e.pixel}),o(t,"click",e=>{if(a){var t=e.pixel[0]-a[0],o=e.pixel[1]-a[1];if(Math.hypot(t,o)>6)return}r.emit(n.MAP_CLICK,{point:{x:e.pixel[0],y:e.pixel[1]},coords:e.coordinate})})}({map:t,eventBus:o,events:n,on:y}),y(t,"postrender",()=>o.emit(n.MAP_RENDER)),{setSource:x,remove(){u=!0,f.forEach(e=>e.cancel()),p.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)})}}}var U={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const B=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function V(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return B.forEach(e=>{e in t&&(r[e]=t[e])}),r}class W extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class J{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new J(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const X={kind:"null"},Y={kind:"number"},K={kind:"string"},Q={kind:"boolean"},ee={kind:"color"},te={kind:"projectionDefinition"},re={kind:"object"},ne={kind:"value"},oe={kind:"collator"},ae={kind:"formatted"},ie={kind:"padding"},se={kind:"colorArray"},le={kind:"numberArray"},ue={kind:"resolvedImage"},pe={kind:"variableAnchorOffsetCollection"};function ce(e,t){return{kind:"array",itemType:e,N:t}}function fe(e){if("array"===e.kind){const t=fe(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const de=[X,Y,K,Q,ee,te,ae,re,ce(ne),ie,le,se,ue,pe];function me(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!me(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of de)if(!me(e,t))return null}return`Expected ${fe(e)} but found ${fe(t)} instead.`}function ye(e,t){return t.some(t=>t.kind===e.kind)}function he(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function ge(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const ve=.96422,be=.82521,xe=4/29,we=6/29,ke=3*we*we,Me=we*we*we,ze=Math.PI/180,Se=180/Math.PI;function je(e){return(e%=360)<0&&(e+=360),e}function Ae([e,t,r,n]){let o,a;const i=Ee((.2225045*(e=_e(e))+.7168786*(t=_e(t))+.0606169*(r=_e(r)))/1);e===t&&t===r?o=a=i:(o=Ee((.4360747*e+.3850649*t+.1430804*r)/ve),a=Ee((.0139322*e+.0971045*t+.7141733*r)/be));const s=116*i-16;return[s<0?0:s,500*(o-i),200*(i-a),n]}function _e(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ee(e){return e>Me?Math.pow(e,1/3):e/ke+xe}function Oe([e,t,r,n]){let o=(e+16)/116,a=isNaN(t)?o:o+t/500,i=isNaN(r)?o:o-r/200;return o=1*Ce(o),a=ve*Ce(a),i=be*Ce(i),[Pe(3.1338561*a-1.6168667*o-.4906146*i),Pe(-.9787684*a+1.9161415*o+.033454*i),Pe(.0719453*a-.2289914*o+1.4052427*i),n]}function Pe(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Ce(e){return e>we?e*e*e:ke*(e-xe)}const $e=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Ie(e,t){return $e(e,t)?e[t]:void 0}function qe(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=Ie(Le,e);if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")){if(/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[Te(e.slice(r,r+=t)),Te(e.slice(r,r+=t)),Te(e.slice(r,r+=t)),Te(e.slice(r,r+t)||"ff")]}}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,o,a,i,s,l,u,p,c,f]=r,d=[o||" ",s||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,i,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[Fe(+t/r,0,1),Fe(+a/r,0,1),Fe(+l/r,0,1),c?Ne(+c,f):1];if(De(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,o,a,i,s,l,u]=r,p=[n||" ",a||" ",s].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[+t,Fe(+o,0,100),Fe(+i,0,100),l?Ne(+l,u):1];if(De(e))return function([e,t,r,n]){function o(n){const o=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(o-3,9-o,1))}return e=je(e),t/=100,r/=100,[o(0),o(8),o(4),n]}(e)}}}function Te(e){return parseInt(e.padEnd(2,e),16)/255}function Ne(e,t){return Fe(t?e/100:e,0,1)}function Fe(e,t,r){return Math.min(Math.max(t,e),r)}function De(e){return!e.some(Number.isNaN)}const Le={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Re(e,t,r){return e+r*(t-e)}function Ge(e,t,r){return e.map((e,n)=>Re(e,t[n],r))}class Ze{constructor(e,t,r,n=1,o=!0){this.r=e,this.g=t,this.b=r,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Ze)return e;if("string"!=typeof e)return;const t=qe(e);return t?new Ze(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,t/o,r/o,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,o]=Ae(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?je(Math.atan2(n,r)*Se):NaN,a,t,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ae(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,o,a,i]=Ge(e.rgb,t.rgb,r);return new Ze(n,o,a,i,!1)}case"hcl":{const[n,o,a,i]=e.hcl,[s,l,u,p]=t.hcl;let c,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?c=NaN:(c=s,1!==a&&0!==a||(f=l)):(c=n,1!==u&&0!==u||(f=o));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),c=n+r*e}const[d,m,y,h]=function([e,t,r,n]){return e=isNaN(e)?0:e*ze,Oe([r,Math.cos(e)*t,Math.sin(e)*t,n])}([c,null!=f?f:Re(o,l,r),Re(a,u,r),Re(i,p,r)]);return new Ze(d,m,y,h,!1)}case"lab":{const[n,o,a,i]=Oe(Ge(e.lab,t.lab,r));return new Ze(n,o,a,i,!1)}}}}Ze.black=new Ze(0,0,0,1),Ze.white=new Ze(1,1,1,1),Ze.transparent=new Ze(0,0,0,0),Ze.red=new Ze(1,0,0,1);class He{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Ue=["bottom","center","top"];class Be{constructor(e,t,r,n,o,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o,this.verticalAlign=a}}class Ve{constructor(e){this.sections=e}static fromString(e){return new Ve([new Be(e,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof Ve?e:Ve.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class We{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof We)return e;if("number"==typeof e)return new We([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new We(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new We(Ge(e.values,t.values,r))}}class Je{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Je)return e;if("number"==typeof e)return new Je([e]);if(Array.isArray(e)){for(const t of e)if("number"!=typeof t)return;return new Je(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Je(Ge(e.values,t.values,r))}}class Xe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xe)return e;if("string"==typeof e){const t=Ze.parse(e);if(!t)return;return new Xe([t])}if(!Array.isArray(e))return;const t=[];for(const r of e){if("string"!=typeof r)return;const e=Ze.parse(r);if(!e)return;t.push(e)}return new Xe(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,n="rgb"){const o=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(Ze.interpolate(e.values[a],t.values[a],r,n));return new Xe(o)}}class Ye extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Ke=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Qe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qe)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!Ke.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new Qe(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const n=e.values,o=t.values;if(n.length!==o.length)throw new Ye(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new Ye(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`);a.push(n[e]);const[t,i]=n[e+1],[s,l]=o[e+1];a.push([Re(t,s,r),Re(i,l,r)])}return new Qe(a)}}class et{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new et({name:e,available:!1}):null}}class tt{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new tt(e,t,r)}static parse(e){return e instanceof tt?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new tt(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new tt(e.from,e.to,e.transition):"string"==typeof e?new tt(e,e,1):void 0}}function rt(e,t,r,n){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function nt(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof tt||e instanceof Ze||e instanceof He||e instanceof Ve||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Qe||e instanceof et)return!0;if(Array.isArray(e)){for(const t of e)if(!nt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!nt(e[t]))return!1;return!0}return!1}function ot(e){if(null===e)return X;if("string"==typeof e)return K;if("boolean"==typeof e)return Q;if("number"==typeof e)return Y;if(e instanceof Ze)return ee;if(e instanceof tt)return te;if(e instanceof He)return oe;if(e instanceof Ve)return ae;if(e instanceof We)return ie;if(e instanceof Je)return le;if(e instanceof Xe)return se;if(e instanceof Qe)return pe;if(e instanceof et)return ue;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=ot(t);if(r){if(r===e)continue;r=ne;break}r=e}return ce(r||ne,t)}return re}function at(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ze||e instanceof tt||e instanceof Ve||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Qe||e instanceof et?e.toString():JSON.stringify(e)}class it{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!nt(e[1]))return t.error("invalid value");const r=e[1];let n=ot(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new it(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const st={string:K,number:Y,boolean:Q,object:re};class lt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const o=e[0];if("array"===o){let o,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in st)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=st[r],n++}else o=ne;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=ce(o,a)}else{if(!st[o])throw new Error(`Types doesn't contain name = ${o}`);r=st[o]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,ne);if(!r)return null;a.push(r)}return new lt(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!me(this.type,ot(r)))return r;if(t===this.args.length-1)throw new Ye(`Expected value to be of type ${fe(this.type)}, but found ${fe(ot(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ut={"to-boolean":Q,"to-color":ee,"to-number":Y,"to-string":K};class pt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!ut[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=ut[r],o=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,ne);if(!n)return null;o.push(n)}return new pt(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Ze)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:rt(t[0],t[1],t[2],t[3]),!r))return new Ze(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ye(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=We.parse(t);if(n)return n}throw new Ye(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Je.parse(t);if(n)return n}throw new Ye(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Xe.parse(t);if(n)return n}throw new Ye(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=Qe.parse(t);if(n)return n}throw new Ye(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new Ye(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Ve.fromString(at(this.args[0].evaluate(e)));case"resolvedImage":return et.fromString(at(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return at(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ct=["Unknown","Point","LineString","Polygon"];class ft{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ct[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=Ze.parse(e),this._parseColorCache.set(e,t)),t}}class dt{constructor(e,t,r=[],n,o=new J,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new lt(t,[e]):"coerce"===r?new pt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===e.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(o.kind))n=r(n,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof it)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new ft;try{n=new it(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new dt(this.registry,this._isConstant,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new W(r,e))}checkSubtype(e,t){const r=me(e,t);return r&&this.error(r),r}}class mt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const o=e[n];if("string"!=typeof o)return t.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const a=t.parse(e[n+1],n+1);if(!a)return null;r.push([o,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new mt(r,n):null}outputDefined(){return this.result.outputDefined()}}class yt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new yt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class ht{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Y),n=t.parse(e[2],2,ce(t.expectedType||ne));if(!r||!n)return null;const o=n.type;return new ht(o.itemType,r,n)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ye(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new Ye(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new Ye(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class gt{constructor(e,t){this.type=Q,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,ne);return r&&n?ye(r.type,[Q,K,Y,X,ne])?new gt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${fe(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!he(t,["boolean","string","number","null"]))throw new Ye(`Expected first argument to be of type boolean, string, number or null, but found ${fe(ot(t))} instead.`);if(!he(r,["string","array"]))throw new Ye(`Expected second argument to be of type array or string, but found ${fe(ot(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class vt{constructor(e,t,r){this.type=Y,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,ne);if(!r||!n)return null;if(!ye(r.type,[Q,K,Y,X,ne]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${fe(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,Y);return o?new vt(r,n,o):null}return new vt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!he(t,["boolean","string","number","null"]))throw new Ye(`Expected first argument to be of type boolean, string, number or null, but found ${fe(ot(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),he(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(he(r,["array"]))return r.indexOf(t,n);throw new Ye(`Expected second argument to be of type array or string, but found ${fe(ot(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class bt{constructor(e,t,r,n,o,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},a=[];for(let i=2;i<e.length-1;i+=2){let s=e[i];const l=e[i+1];Array.isArray(s)||(s=[s]);const u=t.concat(i);if(0===s.length)return u.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ot(e)))return null}else r=ot(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=a.length}const p=t.parse(l,i,n);if(!p)return null;n=n||p.type,a.push(p)}const i=t.parse(e[1],1,ne);if(!i)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==i.type.kind&&t.concat(1).checkSubtype(r,i.type)?null:new bt(r,n,i,o,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(ot(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class xt{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,Q);if(!a)return null;const i=t.parse(e[o+1],o+1,r);if(!i)return null;n.push([a,i]),r=r||i.type}const o=t.parse(e[e.length-1],e.length-1,r);if(!o)return null;if(!r)throw new Error("Can't infer output type");return new xt(r,n,o)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class wt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ne),n=t.parse(e[2],2,Y);if(!r||!n)return null;if(!ye(r.type,[ce(ne),K,ne]))return t.error(`Expected first argument to be of type array or string, but found ${fe(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,Y);return o?new wt(r.type,r,n,o):null}return new wt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),he(t,["string"]))return[...t].slice(r,n).join("");if(he(t,["array"]))return t.slice(r,n);throw new Ye(`Expected first argument to be of type array or string, but found ${fe(ot(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function kt(e,t){const r=e.length-1;let n,o,a=0,i=r,s=0;for(;a<=i;)if(s=Math.floor((a+i)/2),n=e[s],o=e[s+1],n<=t){if(s===r||t<o)return s;a=s+1}else{if(!(n>t))throw new Ye("Input is not a number.");i=s-1}return 0}class Mt{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,Y);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r<e.length;r+=2){const a=1===r?-1/0:e[r],i=e[r+1],s=r,l=r+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(i,l,o);if(!u)return null;o=o||u.type,n.push([a,u])}return new Mt(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[kt(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function zt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var St,jt;var At=function(){if(jt)return St;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return jt=1,St=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}var i=0,s=1;for(r=e,n=0;n<20&&(o=this.sampleCurveX(r),!(Math.abs(o-e)<t));n++)e>o?i=r:s=r,r=.5*(s-i)+i;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},St}(),_t=zt(At);class Et{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=Ot(t,e.base,r,n);else if("linear"===e.name)o=Ot(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new _t(a[0],a[1],a[2],a[3]).solve(Ot(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,Y),!o)return null;const i=[];let s=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==se?t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType):s=ee;for(let e=0;e<a.length;e+=2){const r=a[e],n=a[e+1],o=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(i.length&&i[i.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,i.push([r,u])}return ge(s,Y)||ge(s,te)||ge(s,ee)||ge(s,ie)||ge(s,le)||ge(s,se)||ge(s,pe)||ge(s,ce(Y))?new Et(s,r,n,o,i):t.error(`Type ${fe(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const a=kt(t,n),i=t[a],s=t[a+1],l=Et.interpolationFactor(this.interpolation,n,i,s),u=r[a].evaluate(e),p=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Re(u,p,l);case"color":return Ze.interpolate(u,p,l);case"padding":return We.interpolate(u,p,l);case"colorArray":return Xe.interpolate(u,p,l);case"numberArray":return Je.interpolate(u,p,l);case"variableAnchorOffsetCollection":return Qe.interpolate(u,p,l);case"array":return Ge(u,p,l);case"projectionDefinition":return tt.interpolate(u,p,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return Ze.interpolate(u,p,l,"hcl");case"colorArray":return Xe.interpolate(u,p,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Ze.interpolate(u,p,l,"lab");case"colorArray":return Xe.interpolate(u,p,l,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ot(e,t,r,n){const o=n-r,a=e-r;return 0===o?0:1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1)}class Pt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const o=[];for(const n of e.slice(1)){const e=t.parse(n,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,o.push(e)}if(!r)throw new Error("No output type");const a=n&&o.some(e=>me(n,e.type));return new Pt(a?ne:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof et&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Ct(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function $t(e,t,r,n){return 0===n.compare(t,r)}function It(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=Q,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let a=t.parse(e[1],1,ne);if(!a)return null;if(!Ct(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${fe(a.type)}'.`);let i=t.parse(e[2],2,ne);if(!i)return null;if(!Ct(r,i.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${fe(i.type)}'.`);if(a.type.kind!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error(`Cannot compare types '${fe(a.type)}' and '${fe(i.type)}'.`);n&&("value"===a.type.kind&&"value"!==i.type.kind?a=new lt(i.type,[a]):"value"!==a.type.kind&&"value"===i.type.kind&&(i=new lt(a.type,[i])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,oe),!s)return null}return new o(a,i,s)}evaluate(o){const a=this.lhs.evaluate(o),i=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=ot(a),r=ot(i);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ye(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=ot(a),r=ot(i);if("string"!==e.kind||"string"!==r.kind)return t(o,a,i)}return this.collator?r(o,a,i,this.collator.evaluate(o)):t(o,a,i)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const qt=It("==",function(e,t,r){return t===r},$t),Tt=It("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!$t(0,t,r,n)}),Nt=It("<",function(e,t,r){return t<r},function(e,t,r,n){return n.compare(t,r)<0}),Ft=It(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),Dt=It("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),Lt=It(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});class Rt{constructor(e,t,r){this.type=oe,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Q);if(!n)return null;const o=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Q);if(!o)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,K),!a)?null:new Rt(n,o,a)}evaluate(e){return new He(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Gt{constructor(e,t,r,n,o,a){this.type=K,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Y);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,K),!o))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,K),!a))return null;let i=null;if(n.unit&&(i=t.parse(n.unit,1,K),!i))return null;if(a&&i)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,Y),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,Y),!l)?null:new Gt(r,o,a,i,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Zt{constructor(e){this.type=ae,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const a=e[r];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,Y),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,ce(K)),!r))return null;let i=null;if(a["text-color"]&&(i=t.parse(a["text-color"],1,ee),!i))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!Ue.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=t.parse(a["vertical-align"],1,K),!s)return null}const l=n[n.length-1];l.scale=e,l.font=r,l.textColor=i,l.verticalAlign=s}else{const a=t.parse(e[r],1,ne);if(!a)return null;const i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i&&"resolvedImage"!==i)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Zt(n)}evaluate(e){return new Ve(this.sections.map(t=>{const r=t.content.evaluate(e);return ot(r)===ue?new Be("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Be(at(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Ht{constructor(e){this.type=ue,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,K);return r?new Ht(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=et.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Ut{constructor(e){this.type=Y,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${fe(r.type)} instead.`):new Ut(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new Ye(`Expected value to be of type string or array, but found ${fe(ot(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Bt=8192;function Vt(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const a=Math.pow(2,t.z);return[Math.round(r*a*Bt),Math.round(n*a*Bt)]}function Wt(e,t){const r=Math.pow(2,t.z),n=(e[0]/Bt+t.x)/r,o=(e[1]/Bt+t.y)/r;return[(i=n,360*i-180),(a=o,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,i}function Jt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Xt(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function Yt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Kt(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],a=e[0]-r[0],i=e[1]-r[1];return n*i-a*o===0&&n*a<=0&&o*i<=0}function Qt(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],a=[n[0]-r[0],n[1]-r[1]];return 0!==(i=a)[0]*(s=o)[1]-i[1]*s[0]&&!(!ar(e,t,r,n)||!ar(r,n,e,t));var i,s}function er(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(Qt(e,t,n[r],n[r+1]))return!0;return!1}function tr(e,t,r=!1){let n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(Kt(e,o[t],o[t+1]))return r;Yt(e,o[t],o[t+1])&&(n=!n)}return n}function rr(e,t){for(const r of t)if(tr(e,r))return!0;return!1}function nr(e,t){for(const r of e)if(!tr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(er(e[r],e[r+1],t))return!1;return!0}function or(e,t){for(const r of t)if(nr(e,r))return!0;return!1}function ar(e,t,r,n){const o=e[0]-r[0],a=e[1]-r[1],i=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],p=o*u-l*a,c=i*u-l*s;return p>0&&c<0||p<0&&c>0}function ir(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=[];for(let n=0;n<e[o].length;n++){const i=Vt(e[o][n],r);Jt(t,i),a.push(i)}n.push(a)}return n}function sr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=ir(e[o],t,r);n.push(a)}return n}function lr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}Jt(t,e)}function ur(e,t,r,n){const o=Math.pow(2,n.z)*Bt,a=[n.x*Bt,n.y*Bt],i=[];for(const n of e)for(const e of n){const n=[e.x+a[0],e.y+a[1]];lr(n,t,r,o),i.push(n)}return i}function pr(e,t,r,n){const o=Math.pow(2,n.z)*Bt,a=[n.x*Bt,n.y*Bt],i=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];Jt(t,r),e.push(r)}i.push(e)}if(t[2]-t[0]<=o/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(const e of i)for(const n of e)lr(n,t,r,o)}return i}class cr{constructor(e,t){this.type=Q,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(nt(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length){return new cr(t,{type:"MultiPolygon",coordinates:e})}}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new cr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new cr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=ir(t.coordinates,n,o),i=ur(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!tr(e,a))return!1}if("MultiPolygon"===t.type){const a=sr(t.coordinates,n,o),i=ur(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!rr(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=ir(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!nr(e,a))return!1}if("MultiPolygon"===t.type){const a=sr(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Xt(r,n))return!1;for(const e of i)if(!or(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class fr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,a=t[o];if(r(n,a)>=0)break;t[e]=a,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],o)>=0)break;t[e]=t[n],e=n}t[e]=o}}function dr(e){let t=0;for(let r,n,o=0,a=e.length,i=a-1;o<a;i=o++)r=e[o],n=e[i],t+=(n.x-r.x)*(r.y+n.y);return t}const mr=1/298.257223563,yr=mr*(2-mr),hr=Math.PI/180;class gr{constructor(e){const t=6378.137*hr*1e3,r=Math.cos(e*hr),n=1/(1-yr*(1-r*r)),o=Math.sqrt(n);this.kx=t*o*r,this.ky=t*o*n*(1-yr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,o,a,i=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],p=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-u)*this.ky,f=0;0===p&&0===c||(f=(this.wrap(t[0]-l)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c),f>1?(l=e[s+1][0],u=e[s+1][1]):f>0&&(l+=p/this.kx*f,u+=c/this.ky*f)),p=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;const d=p*p+c*c;d<i&&(i=d,r=l,n=u,o=s,a=f)}return{point:[r,n],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function vr(e,t){return t[0]-e[0]}function br(e){return e[1]-e[0]+1}function xr(e,t){return e[1]>=e[0]&&e[1]<t}function wr(e,t){if(e[0]>e[1])return[null,null];const r=br(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function kr(e,t){if(!xr(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Jt(r,e[n]);return r}function Mr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)Jt(t,e);return t}function zr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Sr(e,t,r){if(!zr(e)||!zr(t))return NaN;let n=0,o=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),r.distance([0,0],[n,o])}function jr(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function Ar(e,t,r,n,o){const a=Math.min(jr(e,[r,n],o),jr(t,[r,n],o)),i=Math.min(jr(r,[e,t],o),jr(n,[e,t],o));return Math.min(a,i)}function _r(e,t,r,n,o){if(!(xr(t,e.length)&&xr(n,r.length)))return 1/0;let a=1/0;for(let i=t[0];i<t[1];++i){const t=e[i],s=e[i+1];for(let e=n[0];e<n[1];++e){const n=r[e],i=r[e+1];if(Qt(t,s,n,i))return 0;a=Math.min(a,Ar(t,s,n,i,o))}}return a}function Er(e,t,r,n,o){if(!(xr(t,e.length)&&xr(n,r.length)))return NaN;let a=1/0;for(let i=t[0];i<=t[1];++i)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,o.distance(e[i],r[t])),0===a)return a;return a}function Or(e,t,r){if(tr(e,t,!0))return 0;let n=1/0;for(const o of t){const t=o[0],a=o[o.length-1];if(t!==a&&(n=Math.min(n,jr(e,[a,t],r)),0===n))return n;const i=r.pointOnLine(o,e);if(n=Math.min(n,r.distance(e,i.point)),0===n)return n}return n}function Pr(e,t,r,n){if(!xr(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(tr(e[n],r,!0))return 0;let o=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],i=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(Qt(t,i,a,l))return 0;o=Math.min(o,Ar(t,i,a,l,n))}}return o}function Cr(e,t){for(const r of e)for(const e of r)if(tr(e,t,!0))return!0;return!1}function $r(e,t,r,n=1/0){const o=Mr(e),a=Mr(t);if(n!==1/0&&Sr(o,a,r)>=n)return n;if(Xt(o,a)){if(Cr(e,t))return 0}else if(Cr(t,e))return 0;let i=1/0;for(const n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[a],s=n[e];for(const e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){const n=e[a],l=e[t];if(Qt(o,s,n,l))return 0;i=Math.min(i,Ar(o,s,n,l,r))}}return i}function Ir(e,t,r,n,o,a){if(!a)return;const i=Sr(kr(n,a),o,r);i<t&&e.push([i,a,[0,0]])}function qr(e,t,r,n,o,a,i){if(!a||!i)return;const s=Sr(kr(n,a),kr(o,i),r);s<t&&e.push([s,a,i])}function Tr(e,t,r,n,o=1/0){let a=Math.min(n.distance(e[0],r[0][0]),o);if(0===a)return a;const i=new fr([[0,[0,e.length-1],[0,0]]],vr),s=Mr(r);for(;i.length>0;){const o=i.pop();if(o[0]>=a)continue;const l=o[1],u=t?50:100;if(br(l)<=u){if(!xr(l,e.length))return NaN;if(t){const t=Pr(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const o=Or(e[t],r,n);if(a=Math.min(a,o),0===a)return 0}}else{const r=wr(l,t);Ir(i,a,n,e,s,r[0]),Ir(i,a,n,e,s,r[1])}}return a}function Nr(e,t,r,n,o,a=1/0){let i=Math.min(a,o.distance(e[0],r[0]));if(0===i)return i;const s=new fr([[0,[0,e.length-1],[0,r.length-1]]],vr);for(;s.length>0;){const a=s.pop();if(a[0]>=i)continue;const l=a[1],u=a[2],p=t?50:100,c=n?50:100;if(br(l)<=p&&br(u)<=c){if(!xr(l,e.length)&&xr(u,r.length))return NaN;let a;if(t&&n)a=_r(e,l,r,u,o),i=Math.min(i,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(a=jr(r[e],t,o),i=Math.min(i,a),0===i)return i}else if(!t&&n){const t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=jr(e[r],t,o),i=Math.min(i,a),0===i)return i}else a=Er(e,l,r,u,o),i=Math.min(i,a)}else{const a=wr(l,t),p=wr(u,n);qr(s,i,o,e,r,a[0],p[0]),qr(s,i,o,e,r,a[0],p[1]),qr(s,i,o,e,r,a[1],p[0]),qr(s,i,o,e,r,a[1],p[1])}}return i}function Fr(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const o of e){const e=dr(o);0!==e&&(o.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[o]):r.push(o))}return r&&t.push(r),t}(r).map(t=>t.map(t=>t.map(t=>Wt([t.x,t.y],e.canonical)))),o=new gr(n[0][0][0][1]);let a=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":a=Math.min(a,Tr([e.coordinates],!1,t,o,a));break;case"LineString":a=Math.min(a,Tr(e.coordinates,!0,t,o,a));break;case"Polygon":a=Math.min(a,$r(t,e.coordinates,o,a))}if(0===a)return a}return a}function Dr(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}class Lr{constructor(e,t){this.type=Y,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(nt(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Lr(t,t.features.map(e=>Dr(e.geometry)).flat());if("Feature"===t.type)return new Lr(t,Dr(t.geometry));if("type"in t&&"coordinates"in t)return new Lr(t,Dr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Wt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new gr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Nr(n,!1,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Nr(n,!1,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Tr(n,!1,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Wt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new gr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Nr(n,!0,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Nr(n,!0,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Tr(n,!0,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return Fr(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Rr{constructor(e){this.type=ne,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Rr(r)}evaluate(e){var t;const r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?Ie(r,this.key):null}eachChild(){}outputDefined(){return!1}}const Gr={"==":qt,"!=":Tt,">":Ft,"<":Nt,">=":Lt,"<=":Dt,array:lt,at:ht,boolean:lt,case:xt,coalesce:Pt,collator:Rt,format:Zt,image:Ht,in:gt,"index-of":vt,interpolate:Et,"interpolate-hcl":Et,"interpolate-lab":Et,length:Ut,let:mt,literal:it,match:bt,number:lt,"number-format":Gt,object:lt,slice:wt,step:Mt,string:lt,"to-boolean":pt,"to-color":pt,"to-number":pt,"to-string":pt,var:yt,within:cr,distance:Lr,"global-state":Rr};class Zr{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=Zr.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,i=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1);let s=null;for(const[n,a]of i){s=new dt(t.registry,Wr,t.path,null,t.scope);const i=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],o=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+i.length,o);if(!a){l=!0;break}i.push(a)}if(!l)if(Array.isArray(n)&&n.length!==i.length)s.error(`Expected ${n.length} arguments, but found ${i.length} instead.`);else{for(let e=0;e<i.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=i[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Zr(r,o,a,i)}}if(1===i.length)t.errors.push(...s.errors);else{const r=(i.length?i:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(fe).join(", ")})`:`(${fe(t.type)}...)`;var t}).join(" | "),n=[];for(let r=1;r<e.length;r++){const o=t.parse(e[r],1+n.length);if(!o)return null;n.push(fe(o.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Zr.definitions=t;for(const r in t)e[r]=Zr}}function Hr(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const a=o?o.evaluate(e):1,i=rt(t,r,n,a);if(i)throw new Ye(i);return new Ze(t/255,r/255,n/255,a,!1)}function Ur(e,t){return e in t}function Br(e,t){const r=t[e];return void 0===r?null:r}function Vr(e){return{type:e}}function Wr(e){if(e instanceof yt)return Wr(e.boundExpression);if(e instanceof Zr&&"error"===e.name)return!1;if(e instanceof Rt)return!1;if(e instanceof cr)return!1;if(e instanceof Lr)return!1;if(e instanceof Rr)return!1;const t=e instanceof pt||e instanceof lt;let r=!0;return e.eachChild(e=>{r=t?r&&Wr(e):r&&e instanceof it}),!!r&&(Jr(e)&&Yr(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function Jr(e){if(e instanceof Zr){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof cr)return!1;if(e instanceof Lr)return!1;let t=!0;return e.eachChild(e=>{t&&!Jr(e)&&(t=!1)}),t}function Xr(e){if(e instanceof Zr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!Xr(e)&&(t=!1)}),t}function Yr(e,t){if(e instanceof Zr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!Yr(e,t)&&(r=!1)}),r}function Kr(e){return{result:"success",value:e}}function Qr(e){return{result:"error",value:e}}function en(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&ot(e)===re}Zr.register(Gr,{error:[{kind:"error"},[K],(e,[t])=>{throw new Ye(t.evaluate(e))}],typeof:[K,[ne],(e,[t])=>fe(ot(t.evaluate(e)))],"to-rgba":[ce(Y,4),[ee],(e,[t])=>{const[r,n,o,a]=t.evaluate(e).rgb;return[255*r,255*n,255*o,a]}],rgb:[ee,[Y,Y,Y],Hr],rgba:[ee,[Y,Y,Y,Y],Hr],has:{type:Q,overloads:[[[K],(e,[t])=>Ur(t.evaluate(e),e.properties())],[[K,re],(e,[t,r])=>Ur(t.evaluate(e),r.evaluate(e))]]},get:{type:ne,overloads:[[[K],(e,[t])=>Br(t.evaluate(e),e.properties())],[[K,re],(e,[t,r])=>Br(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ne,[K],(e,[t])=>Br(t.evaluate(e),e.featureState||{})],properties:[re,[],e=>e.properties()],"geometry-type":[K,[],e=>e.geometryType()],id:[ne,[],e=>e.id()],zoom:[Y,[],e=>e.globals.zoom],"heatmap-density":[Y,[],e=>e.globals.heatmapDensity||0],elevation:[Y,[],e=>e.globals.elevation||0],"line-progress":[Y,[],e=>e.globals.lineProgress||0],accumulated:[ne,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Y,Vr(Y),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[Y,Vr(Y),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:Y,overloads:[[[Y,Y],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Y],(e,[t])=>-t.evaluate(e)]]},"/":[Y,[Y,Y],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Y,[Y,Y],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Y,[],()=>Math.LN2],pi:[Y,[],()=>Math.PI],e:[Y,[],()=>Math.E],"^":[Y,[Y,Y],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Y,[Y],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))],log2:[Y,[Y],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Y,[Y],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Y,[Y],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Y,[Y],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Y,[Y],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Y,[Y],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Y,[Y],(e,[t])=>Math.atan(t.evaluate(e))],min:[Y,Vr(Y),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[Y,Vr(Y),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[Y,[Y],(e,[t])=>Math.abs(t.evaluate(e))],round:[Y,[Y],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Y,[Y],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Y,[Y],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[Q,[K,ne],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[Q,[ne],(e,[t])=>e.id()===t.value],"filter-type-==":[Q,[K],(e,[t])=>e.geometryType()===t.value],"filter-<":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[Q,[K,ne],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[Q,[ne],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[Q,[ne],(e,[t])=>t.value in e.properties()],"filter-has-id":[Q,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[Q,[ce(K)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[Q,[ce(ne)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[Q,[K,ce(ne)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[Q,[K,ce(ne)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Q,overloads:[[[Q,Q],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Vr(Q),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:Q,overloads:[[[Q,Q],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Vr(Q),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[Q,[Q],(e,[t])=>!t.evaluate(e)],"is-supported-script":[Q,[K],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[K,[K],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[K,[K],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[K,Vr(ne),(e,t)=>t.map(t=>at(t.evaluate(e))).join("")],split:[ce(K),[K,K],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[K,[ce(K),K],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[K,[oe],(e,[t])=>t.evaluate(e).resolvedLocale()]});class tn{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new ft,this._defaultValue=t?function(e){if("color"===e.type&&en(e.default))return new Ze(0,0,0,0);switch(e.type){case"color":return Ze.parse(e.default)||null;case"padding":return We.parse(e.default)||null;case"numberArray":return Je.parse(e.default)||null;case"colorArray":return Xe.parse(e.default)||null;case"variableAnchorOffsetCollection":return Qe.parse(e.default)||null;case"projectionDefinition":return tt.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,a){this._globalState&&(e=pn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ye(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function rn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Gr}function nn(e,t,r){const n=new dt(Gr,Wr,[],t?function(e){const t={color:ee,string:K,number:Y,enum:K,boolean:Q,formatted:ae,padding:ie,numberArray:le,colorArray:se,projectionDefinition:te,resolvedImage:ue,variableAnchorOffsetCollection:pe};if("array"===e.type)return ce(t[e.value]||ne,e.length);return t[e.type]}(t):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Kr(new tn(o,t,r)):Qr(n.errors)}class on{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Xr(t.expression),this.globalStateRefs=un(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}}class an{constructor(e,t,r,n,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Xr(t.expression),this.globalStateRefs=un(t.expression),this.interpolationType=n,this._globalState=o}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=pn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}interpolationFactor(e,t,r){return this.interpolationType?Et.interpolationFactor(this.interpolationType,e,t,r):0}}function sn(e,t,r){const n=nn(e,t,r);if("error"===n.result)return n;const o=n.value.expression,a=Jr(o);if(!a&&("data-driven"!==(i=t)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return Qr([new W("","data expressions not supported")]);var i;const s=Yr(o,["zoom"]);if(!s&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return Qr([new W("","zoom expressions not supported")]);const l=ln(o);if(!l&&!s)return Qr([new W("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof W)return Qr([l]);if(l instanceof Et&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return Qr([new W("",'"interpolate" expressions cannot be used with this property')]);if(!l)return Kr(new on(a?"constant":"source",n.value,r));const u=l instanceof Et?l.interpolation:void 0;return Kr(new an(a?"camera":"composite",n.value,l.labels,u,r))}function ln(e){let t=null;if(e instanceof mt)t=ln(e.result);else if(e instanceof Pt){for(const r of e.args)if(t=ln(r),t)break}else(e instanceof Mt||e instanceof Et)&&e.input instanceof Zr&&"zoom"===e.input.name&&(t=e);return t instanceof W||e.eachChild(e=>{const r=ln(e);r instanceof W?t=r:!t&&r?t=new W("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new W("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function un(e,t=new Set){return e instanceof Rr&&t.add(e.key),e.eachChild(e=>{un(e,t)}),t}function pn(e,t){const{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s}=null!=e?e:{};return{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s,globalState:t}}function cn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!cn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const fn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function dn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};cn(e)||(e=hn(e));const r=nn(e,fn,t);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:yn(e),getGlobalStateRefs:()=>un(r.value.expression)}}function mn(e,t){return e<t?-1:e>t?1:0}function yn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(yn(e[t]))return!0;return!1}function hn(e){if(!e)return!0;const t=e[0];if(e.length<=1)return"any"!==t;var r;return"=="===t?gn(e[1],e[2],"=="):"!="===t?xn(gn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?gn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(hn))):"all"===t?["all"].concat(e.slice(1).map(hn)):"none"===t?["all"].concat(e.slice(1).map(hn).map(xn)):"in"===t?vn(e[1],e.slice(2)):"!in"===t?xn(vn(e[1],e.slice(2))):"has"===t?bn(e[1]):"!has"!==t||xn(bn(e[1]))}function gn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function vn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(mn)]]:["filter-in-small",e,["literal",t]]}}function bn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function xn(e){return["!",e]}function wn(e){return"object"==typeof e?["literal",e]:e}function kn(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,wn(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,a=n||!o;return r=r.map(e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],En(e[1])]:[e[0],wn(e[1])]),n?function(e,t,r){const n={},o={},a=[];for(let t=0;t<r.length;t++){const i=r[t],s=i[0].zoom;void 0===n[s]&&(n[s]={zoom:s,type:e.type,property:e.property,default:e.default},o[s]=[],a.push(s)),o[s].push([i[0].value,i[1]])}const i=_n({},t);if("exponential"===i){const r=[Mn(e),["linear"],["zoom"]];for(const e of a){An(r,e,Sn(n[e],t,o[e]),!1)}return r}{const e=["step",["zoom"]];for(const r of a){An(e,r,Sn(n[r],t,o[r]),!0)}return jn(e),e}}(e,t,r):a?function(e,t,r,n=["zoom"]){const o=_n(e,t);let a,i=!1;if("interval"===o)a=["step",n],i=!0;else{if("exponential"!==o)throw new Error(`Unknown zoom function type "${o}"`);{const t=void 0!==e.base?e.base:1;a=[Mn(e),1===t?["linear"]:["exponential",t],n]}}for(const e of r)An(a,e[0],e[1],i);return jn(a),a}(e,t,r):Sn(e,t,r)}function Mn(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function zn(e,t){const r=wn((n=e.default,o=t.default,void 0!==n?n:void 0!==o?o:void 0));var n,o;return void 0===r&&"resolvedImage"===t.type?"":r}function Sn(e,t,r){const n=_n(e,t),o=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",o,e[0]],e[1]);return n.push(zn(e,t)),n}if("categorical"===n){const n=["match",o];for(const e of r)An(n,e[0],e[1],!1);return n.push(zn(e,t)),n}if("interval"===n){const t=["step",["number",o]];for(const e of r)An(t,e[0],e[1],!0);return jn(t),void 0===e.default?t:["case",["==",["typeof",o],"number"],t,wn(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[Mn(e),1===t?["linear"]:["exponential",t],["number",o]];for(const e of r)An(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",o],"number"],n,wn(e.default)]}throw new Error(`Unknown property function type ${n}`)}function jn(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function An(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function _n(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function En(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const a=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,a.length>0&&t.push(a),t.push(["get",o[1]])}if(1===t.length)return e;if(n<e.length)t.push(e.slice(n));else if(2===t.length)return["to-string",t[1]];return t}const On=U;function Pn(e,t){const r=t[0].evaluate(e),n=t[1].evaluate(e),o=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return Ze.parse(`hsla(${r}, ${n}%, ${o}%, ${a})`)}function Cn(e){if(Array.isArray(e)){if(0===e.length)return e;const t=e[0];if("literal"===t)return e;if("image"===t&&3===e.length&&"object"==typeof e[2]&&null!==e[2]&&!Array.isArray(e[2])){return["image-config",Cn(e[1]),["literal",e[2]]]}const r=e.length;for(let n=1;n<r;++n){const o=e[n],a=Cn(o);if(a!==o){const o=[t];for(let t=1;t<n;++t)o.push(e[t]);o.push(a);for(let t=n+1;t<r;++t)o.push(Cn(e[t]));return o}}}return e}const $n={},In={zoom:0,distanceFromCenter:0};Zr.register(Gr,{...Zr.definitions,pitch:[{kind:"number"},[],e=>In.pitch||0],"distance-from-center":[{kind:"number"},[],e=>In.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(e,[t])=>function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,r,n),i=Math.min(t,r,n),s=(a+i)/2;let l,u;if(a===i)l=0,u=0;else{const e=a-i;switch(u=s>.5?e/(2-a-i):e/(a+i),a){case t:l=(r-n)/e+(r<n?6:0);break;case r:l=(n-t)/e+2;break;case n:l=(t-r)/e+4;break;default:l=0}l/=6}return[360*l,100*u,100*s,o]}(O(t.evaluate(e)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],Pn],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],Pn],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(e,[t,r])=>t.evaluate(e)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(e,[t])=>{const r=$n[t.evaluate(e)];return void 0===r?{}:r}]});var qn={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},Tn=" ",Nn=/(italic|oblique)$/i,Fn={};function Dn(e,t,r){var n=Fn[e];if(!n){Array.isArray(e)||(e=[e]);for(var o,a,i=400,s="normal",l=[],u=0,p=e.length;u<p;++u){var c=e[u].split(" "),f=c[c.length-1].toLowerCase();for(var d in"normal"==f||"italic"==f||"oblique"==f?(s=a?s:f,a=!0,c.pop(),f=c[c.length-1].toLowerCase()):Nn.test(f)&&(f=f.replace(Nn,""),s=a?s:c[c.length-1].replace(f,""),a=!0),qn){var m=c.length>1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){i=o?i:qn[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(i=f,o=!0);var y=c.join(Tn).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==y.indexOf(Tn)&&(y='"'+y+'"'),l.push(y)}n=Fn[e]=[s,i,l]}return n[0]+Tn+n[1]+Tn+t+"px"+(r?"/"+r:"")+Tn+n[2]}const Ln=Object.freeze({}),Rn={},Gn={};let Zn=0;function Hn(e){return e.id||(e.id=Zn++),e.id}function Un(e){return e*Math.PI/180}const Bn=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Vn(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function Wn(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],a=Vn(o[0],o[1]),i=a.getContext("2d");i.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=i.getImageData(0,0,o[0],o[1]);i.globalCompositeOperation="destination-over",i.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e<n;++e)for(let o=0,a=s.height;o<a;++o){l[4*(o*n+e)+3]>0&&i.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return i.fill(),a}function Jn(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function Xn(e,t,r){const n=Vn(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const a=o.getImageData(0,0,t.width,t.height),i=a.data;for(let e=0,t=a.width;e<t;++e)for(let n=0,o=a.height;n<o;++n){const o=4*(n*t+e),a=.75,s=.1,l=Jn(a-s,a+s,i[o+3]/255);l>0?(i[o+0]=Math.round(255*r.r*l),i[o+1]=Math.round(255*r.g*l),i[o+2]=Math.round(255*r.b*l),i[o+3]=Math.round(255*l)):i[o+3]=0}return o.putImageData(a,0,0),n}const Yn=Array(256).join(" ");function Kn(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=Yn.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e<t;++e)e>0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let Qn;function eo(){return Qn||(Qn=Vn(1,1).getContext("2d")),Qn}function to(e,t){return eo().measureText(e).width+(e.length-1)*t}const ro={};function no(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),a=[];for(let e=0,i=o.length;e<i;++e)a.push(no(o[e],t,r,n));return a.join("\n")}const o=r+","+t+","+e+","+n;let a=ro[o];if(!a){const i=e.split(" ");if(i.length>1){const e=eo();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=i.length;e<t;++e){const t=i[e],r=s+(s?" ":"")+t;to(r,n)<=o?s=r:(s&&l.push(s),s=t)}s&&l.push(s);for(let e=0,t=l.length;e<t&&t>1;++e){const r=l[e];if(to(r,n)<.35*o){const o=e>0?to(l[e-1],n):1/0,a=e<t-1?to(l[e+1],n):1/0;l.splice(e,1),t-=1,o<a?(l[e-1]+=" "+r,e-=1):l[e]=r+" "+l[e]}}for(let e=0,t=l.length-1;e<t;++e){const r=l[e],a=l[e+1];if(to(r,n)>.7*o&&to(a,n)<.6*o){const i=r.split(" "),s=i.pop();to(s,n)<.2*o&&(l[e]=i.join(" "),l[e+1]=s+" "+a),t-=1}}a=l.join("\n")}else a=e;a=Kn(a,n),ro[o]=a}return a}P.on("propertychange",()=>{for(const e in ro)delete ro[e]});const oo={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},ao={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},io=function(e,t){let r=sn(e,t);if("error"===r.result){const n=Cn(e);n!==e&&(r=sn(n,t))}if("error"===r.result){const n=r.value[0];return console.error("Error parsing expression:",e,n.key,n.message),{evaluate:()=>t.default}}return r.value};let so,lo;function uo(e,t,r,n,o,a){const i=e.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[i]||(o[i]={});const s=o[i];if(!s[r]){let n=(e[t]||Ln)[r];const o=On[`${t}_${e.type}`]&&On[`${t}_${e.type}`][r];void 0===n&&o&&(n=o.default);let a=rn(n);if(!a&&en(n)&&(n=kn(n,o),a=!0),a){const e=io(n,o);s[r]=e.evaluate.bind(e)}else{const e=o?o.type:typeof n;"color"!==e&&"colorArray"!==e||(n=Ze.parse(n));let t=!1;if("array"===e)for(let e=0;e<n.length;++e){const r=n[e];if(rn(r)||en(r)){t=!0;break}}if(t){const e=Object.assign({},o,{type:o.value}),t=[];for(let r=0;r<n.length;++r){let o=n[r];if(!rn(o)&&en(o)&&(o=kn(o,e)),rn(o)){const r=io(o,e);t.push(r.evaluate.bind(r))}else t.push(function(){return o})}s[r]=function(e,r,n){const o=[];for(let a=0;a<t.length;++a)o[a]=t[a](e,r,n);return o}}else s[r]=function(){return n}}}return s[r](In,n,a)}function po(e,t,r,n){if(!uo(e,"layout",`${r}-allow-overlap`,t,n))return"declutter";return uo(e,"layout",`${r}-ignore-placement`,t,n)?"none":"obstacle"}function co(e,t,r,n){if(n||console.warn("No filterCache provided to evaluateFilter()"),!(e in n))try{n[e]=dn(t).filter}catch(t){console.warn("Filter will evaluate to false: "+t.message),n[e]=function(){return!1}}return n[e](In,r)}function fo(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const mo=/\{[^{}}]*\}/g;function yo(e,t){return e.replace(mo,function(e){return t[e.slice(1,-1)]||""})}function ho(e,t){let r=e.split(":")[0];return r===e&&(r="default"),t[r]}let go=!1;const vo={};function bo(t,n,o,a=Bn,i=void 0,s=void 0,l=void 0,u=void 0){if("string"==typeof n&&(n=JSON.parse(n)),n.schema)for(const e in n.schema){const t=n.schema[e];"default"in t&&($n[e]=t.default)}if(8!=n.version)throw new Error("glStyle version 8 required.");vo[function(e,t){return Hn(e)+"."+C(t)}(n,t)]=Array.from(arguments);const p={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const e in s){const r=s[e];d(()=>r).then(async r=>{let n;if("undefined"!=typeof Image){const o=new Image;if("string"==typeof r)o.crossOrigin="anonymous",o.src=r;else{let e;r instanceof Request?e=await fetch(r):r instanceof Response&&(e=r);const t=await e.blob();n=URL.createObjectURL(t),o.src=n}o.addEventListener("load",function r(){o.removeEventListener("load",r),p[e]={image:o,size:[o.width,o.height]},t.changed(),n&&URL.revokeObjectURL(n)}),o.addEventListener("error",function e(){URL.revokeObjectURL(n),o.removeEventListener("error",e)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:r}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(p[e]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const c=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=V(e[r],t[e[r].ref]));return e}(n.layers),w={},k=[],M={},z={},S=function(e){let t=Rn[e.id];return t||(t={},Rn[Hn(e)]=t),t}(n),j=function(e){let t=Gn[e.id];return t||(t={},Gn[Hn(e)]=t),t}(n);let A;for(let e=0,t=c.length;e<t;++e){const t=c[e],r=t.id;if("string"==typeof o&&t.source==o||Array.isArray(o)&&-1!==o.indexOf(r)){const o=t["source-layer"];if(A){if(t.source!==A)throw new Error(`Layer "${r}" does not use source "${A}`)}else{A=t.source;const e=n.sources[A];if(!e)throw new Error(`Source "${A}" is not defined`);const r=e.type;if("vector"!==r&&"geojson"!==r)throw new Error(`Source "${A}" is not of type "vector" or "geojson", but "${r}"`)}let a=w[o];a||(a=[],w[o]=a),a.push({layer:t,index:e}),k.push(r)}}const _=[],E=function(o,s,c){const d=t.getSource?.()?.format_?.layerName_??"mvt:layer",k=o.getProperties(),A=w[k[d]];if(!A)return;let E=a.indexOf(s);-1==E&&(E=function(e,t){let r=0;const n=t.length;for(;r<n;++r)if(t[r]<e&&r+1<n){const n=t[r]/t[r+1];return r+Math.log(t[r]/e)/Math.log(n)}return n-1}(s,a)),In.zoom=E,In.distanceFromCenter=0;const O=o.getGeometry(),P=oo[O.getType()],C=t.get("map");if(C&&C instanceof e&&1===P){const e=C.getSize();if(e){const t=C.getView().getCenter(),n=r(O.getExtent());In.distanceFromCenter=f(t,n)/s/e[1]}}const $={id:o.getId(),properties:k,type:P},I=t.get("mapbox-featurestate")[o.getId()];let q,T=-1;for(let e=0,r=A.length;e<r;++e){const r=A[e],a=r.layer,f=a.id;if(void 0!==c&&c!==f)continue;const d=a.layout||Ln,w=a.paint||Ln;if("none"===uo(a,"layout","visibility",$,S,I)||"minzoom"in a&&E<a.minzoom||"maxzoom"in a&&E>=a.maxzoom)continue;const O=a.filter;if(!O||co(f,O,$,j)){let e,c,f,j,A,E;q=a;const O=r.index;if(3==P&&("fill"==a.type||"fill-extrusion"==a.type))if(c=uo(a,"paint",a.type+"-opacity",$,S,I),a.type+"-pattern"in w){const e=uo(a,"paint",a.type+"-pattern",$,S,I);if(e){const t="string"==typeof e?yo(e,k):e.toString(),r=ho(t,p);if(i&&i[t]&&r){++T,E=_[T],E&&E.getFill()&&!E.getStroke()&&!E.getText()||(E=new b({fill:new h}),_[T]=E),f=E.getFill(),E.setZIndex(O);const e=t+"."+c;let n=z[e];if(!n){const o=i[t],a=Vn(o.width,o.height),s=a.getContext("2d");s.globalAlpha=c,s.drawImage(r.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=s.createPattern(a,"repeat"),z[e]=n}f.setColor(n)}}}else if(e=fo(uo(a,"paint",a.type+"-color",$,S,I),c),a.type+"-outline-color"in w&&(A=fo(uo(a,"paint",a.type+"-outline-color",$,S,I),c)),A||(A=e),e||A){if(++T,E=_[T],(!E||e&&!E.getFill()||!e&&E.getFill()||A&&!E.getStroke()||!A&&E.getStroke()||E.getText())&&(E=new b({fill:e?new h:void 0,stroke:A?new v:void 0}),_[T]=E),e&&(f=E.getFill(),f.setColor(e)),"fill-extrusion"===a.type){const e=uo(a,"paint","fill-extrusion-height",$,S,I);if(e>0){const t=Math.max(.1,.9-Math.min(e,225)/280);if(A&&"transparent"!==A){const e=Ze.parse(A);A=`rgba(${Math.round(255*e.r*t)},${Math.round(255*e.g*t)},${Math.round(255*e.b*t)},${e.a})`}}}A&&(j=E.getStroke(),j.setColor(A),j.setWidth(.5)),E.setZIndex(O)}if(1!=P&&"line"==a.type){e="line-pattern"in w?void 0:fo(uo(a,"paint","line-color",$,S,I),uo(a,"paint","line-opacity",$,S,I));const t=uo(a,"paint","line-width",$,S,I);e&&t>0&&(++T,E=_[T],E&&E.getStroke()&&!E.getFill()&&!E.getText()||(E=new b({stroke:new v}),_[T]=E),j=E.getStroke(),j.setLineCap(uo(a,"layout","line-cap",$,S,I)),j.setLineJoin(uo(a,"layout","line-join",$,S,I)),j.setMiterLimit(uo(a,"layout","line-miter-limit",$,S,I)),j.setColor(e),j.setWidth(t),j.setLineDash(w["line-dasharray"]?uo(a,"paint","line-dasharray",$,S,I).map(function(e){return e*t}):null),"function"==typeof j.setOffset&&j.setOffset(uo(a,"paint","line-offset",$,S,I)),E.setZIndex(O))}let C,N,F,D,L,R,G,Z,H,U=!1,B=null,V=0;if((1==P||2==P)&&"icon-image"in d){const e=uo(a,"layout","icon-image",$,S,I);if(e){let r;C="string"==typeof e?yo(e,k):e.toString();const n=u?u(t,C):void 0,l=ho(C,p);if(i&&i[C]&&l||n){const e=uo(a,"layout","icon-rotation-alignment",$,S,I);if(2==P){const t=o.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const n=t.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();lo||(so=[NaN,NaN],lo=new m("Point",so,[],2,{},void 0)),r=lo,so[0]=n[0],so[1]=n[1];if("line"===uo(a,"layout","symbol-placement",$,S,I)&&"map"===e){const e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,o=r.length-e;t<o;t+=e){const o=r[t],a=r[t+1],i=r[t+e],s=r[t+e+1],l=Math.min(o,i),u=Math.max(o,i),p=n[0],c=(s-a)*(p-o)-(i-o)*(n[1]-a);if(Math.abs(c)<.001&&p<=u&&p>=l){V=Math.atan2(a-s,i-o);break}}}}}}if(2!==P||r){const t=uo(a,"layout","icon-size",$,S,I),o=void 0!==w["icon-color"]?uo(a,"paint","icon-color",$,S,I):null;if(!o||0!==o.a){const r=uo(a,"paint","icon-halo-color",$,S,I),s=uo(a,"paint","icon-halo-width",$,S,I);let u=`${C}.${t}.${s}.${r}`;if(null!==o&&(u+=`.${o}`),N=M[u],!N){const p=po(a,$,"icon",S);let c;"icon-offset"in d&&(c=uo(a,"layout","icon-offset",$,S,I).slice(0),c[0]*=t,c[1]*=-t);let f=o?[255*o.r,255*o.g,255*o.b,o.a]:void 0;if(n){const r={color:f,rotateWithView:"map"===e,displacement:c,declutterMode:p,scale:t};"string"==typeof n?r.src=n:(r.img=n,r.imgSize=[n.width,n.height]),N=new g(r)}else{const n=i[C];let a,u,d;if(s)n.sdf?(a=Wn(Xn(l.image,n,o||[0,0,0,1]),{x:0,y:0,width:n.width,height:n.height,pixelRatio:n.pixelRatio},s,r),f=void 0):a=Wn(l.image,n,s,r);else{if(n.sdf&&!l.unSDFed){const e=Xn(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1});l.image=e,l.unSDFed=!0}a=l.image,u=[n.width,n.height],d=[n.x,n.y]}N=new g({color:f,img:a,imgSize:l.size,size:u,offset:d,rotateWithView:"map"===e,scale:t/n.pixelRatio,displacement:c,declutterMode:p})}M[u]=N}}N&&(++T,E=_[T],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E),E.setGeometry(r),N.setRotation(V+Un(uo(a,"layout","icon-rotate",$,S,I))),N.setOpacity(uo(a,"paint","icon-opacity",$,S,I)),N.setAnchor(ao[uo(a,"layout","icon-anchor",$,S,I)]),E.setImage(N),B=E.getText(),E.setText(void 0),E.setZIndex(O),U=!0,F=!1)}else F=!0}}}if(1==P&&"circle"===a.type){++T,E=_[T],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E);const e="circle-radius"in w?uo(a,"paint","circle-radius",$,S,I):5,t=fo(uo(a,"paint","circle-stroke-color",$,S,I),uo(a,"paint","circle-stroke-opacity",$,S,I)),r=uo(a,"paint","circle-translate",$,S,I),n=fo(uo(a,"paint","circle-color",$,S,I),uo(a,"paint","circle-opacity",$,S,I)),o=uo(a,"paint","circle-stroke-width",$,S,I),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];N=M[i],N||(N=new y({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new v({width:o,color:t}):void 0,fill:n?new h({color:n}):void 0,declutterMode:"none"}),M[i]=N),E.setImage(N),B=E.getText(),E.setText(void 0),E.setGeometry(void 0),E.setZIndex(O),U=!0}if("text-field"in d){G=Math.round(uo(a,"layout","text-size",$,S,I));const e=uo(a,"layout","text-font",$,S,I);R=uo(a,"layout","text-line-height",$,S,I),L=Dn(l?l(e,n.metadata?n.metadata["ol:webfonts"]:void 0):e,G,R),L.includes("sans-serif")||(L+=",sans-serif"),Z=uo(a,"layout","text-letter-spacing",$,S,I),H=uo(a,"layout","text-max-width",$,S,I);const t=uo(a,"layout","text-field",$,S,I);D="object"==typeof t&&t.sections?1===t.sections.length?t.toString():t.sections.reduce((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,a=Dn(l?l(o):o,G*(r.scale||1),R);let i=r.text;if("\n"===i)return t.push("\n",""),t;if(2==P)return t.push(Kn(i,Z),a),t;i=no(i,a,H,Z).split("\n");for(let e=0,r=i.length;e<r;++e)e>0&&t.push("\n",""),t.push(i[e],a);return t},[]):yo(t,k).trim(),c=uo(a,"paint","text-opacity",$,S,I)}if(D&&c&&!F){U||(++T,E=_[T],E&&E.getText()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E),E.setImage(void 0),E.setGeometry(void 0));const e=po(a,$,"text",S);E.getText()||E.setText(B),B=E.getText(),(!B||"getDeclutterMode"in B&&B.getDeclutterMode()!==e)&&(B=new x({padding:[2,2,2,2],declutterMode:e}),E.setText(B));const t=uo(a,"layout","text-transform",$,S,I);"uppercase"==t?D=Array.isArray(D)?D.map((e,t)=>t%2?e:e.toUpperCase()):D.toUpperCase():"lowercase"==t&&(D=Array.isArray(D)?D.map((e,t)=>t%2?e:e.toLowerCase()):D.toLowerCase());const r=Array.isArray(D)?D:2==P?Kn(D,Z):no(D,L,H,Z);if(B.setText(r),B.setFont(L),B.setRotation(Un(uo(a,"layout","text-rotate",$,S,I))),"function"==typeof B.setKeepUpright){const e=uo(a,"layout","text-keep-upright",$,S,I);B.setKeepUpright(e)}const n=uo(a,"layout","text-anchor",$,S,I),o=U||1==P?"point":uo(a,"layout","symbol-placement",$,S,I);let i;if("line-center"===o?(B.setPlacement("line"),i="center"):B.setPlacement(o),"line"===o&&"function"==typeof B.setRepeat){const e=uo(a,"layout","symbol-spacing",$,S,I);B.setRepeat(2*e)}B.setOverflow("point"===o);let s=uo(a,"paint","text-halo-width",$,S,I);const l=uo(a,"layout","text-offset",$,S,I),u=uo(a,"paint","text-translate",$,S,I);let p=0,f=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",f=s):-1!==n.indexOf("right")&&(i="right",f=-s);const e=uo(a,"layout","text-rotation-alignment",$,S,I);B.setRotateWithView("map"==e)}else B.setMaxAngle(Un(uo(a,"layout","text-max-angle",$,S,I))*D.length/r.length),B.setRotateWithView(!1);B.setTextAlign(i);let d="middle";0==n.indexOf("bottom")?(d="bottom",p=-s-.5*(R-1)*G):0==n.indexOf("top")&&(d="top",p=s+.5*(R-1)*G),B.setTextBaseline(d);const m=uo(a,"layout","text-justify",$,S,I);B.setJustify("auto"===m?void 0:m),B.setOffsetX(l[0]*G+f+u[0]),B.setOffsetY(l[1]*G+p+u[1]);const y=B.getFill()||new h;y.setColor(fo(uo(a,"paint","text-color",$,S,I),c)),B.setFill(y);const g=fo(uo(a,"paint","text-halo-color",$,S,I),c);if(g&&s>0){const e=B.getStroke()||new v;e.setColor(g),s*=2;const t=.5*G;e.setWidth(s<=t?s:t),B.setStroke(e)}else B.setStroke(void 0);const w=uo(a,"layout","text-padding",$,S,I),k=B.getPadding();w!==k[0]&&(k[0]=w,k[1]=w,k[2]=w,k[3]=w),E.setZIndex(O)}}}return T>-1?(_.length=T+1,go&&("set"in o?o.set("mapbox-layer",q):o.getProperties()["mapbox-layer"]=q),_):void 0};return t.setStyle(E),t.set("mapbox-layers",k),t.set("mapbox-source",A),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),E}function xo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}Ze.parse("#000000"),Ze.parse("#FFFFFF"),Ze.parse("#000000"),function(e=!1){go=e}(!0);var ko="EPSG:27700",Mo=["vector","raster","wms","ogc-vt"];function zo(e,t,r){var n=r&&r(e,t)||{};return fetch(n.url||e,{headers:n.headers||{}})}var So=e=>(t,r)=>{var n=e(r,"Tile")||{},o=n.url||r,a=n.headers||{};fetch(o,{headers:a}).then(e=>e.blob()).then(e=>{t.getImage().src=URL.createObjectURL(e)}).catch(()=>t.setState(E.ERROR))};function jo(){return new c({resolutions:I,origin:T,tileSize:256})}function Ao(e,t){return _o.apply(this,arguments)}function _o(){return _o=w(function*(e,t){if(e.type&&!Mo.includes(e.type))throw new Error("Unsupported map style type: '".concat(e.type,"'"));if("wms"===e.type){var r=function(e,t,r){var n=jo();return new A({url:e,params:t,projection:ko,tileGrid:n,tileLoadFunction:r?So(r):void 0})}(e.url,e.params||{},t);return{layer:new a({source:r}),source:r}}if("raster"===e.type){var n=function(e,t){var r=jo();return new j({projection:ko,tileGrid:r,tileUrlFunction:t=>{var[r,n,o]=t;return e.replace("{z}",r).replace("{x}",n).replace("{y}",o)},tileLoadFunction:t?So(t):void 0})}(e.url,t);return{layer:new a({source:n}),source:n}}return"ogc-vt"===e.type?function(e,t){return Po.apply(this,arguments)}(e.url,t,e):function(e,t){return Oo.apply(this,arguments)}(e.url,t,e)}),_o.apply(this,arguments)}function Eo(e,t){var r=e.indexOf("?"),[n,o]=r>=0?[e.slice(0,r),e.slice(r)]:[e,""],a="".concat(n,".json").concat(o),i="".concat(n,".png").concat(o);return{jsonUrl:a,pngUrl:i,fetch:()=>zo(a,"SpriteJSON",t).then(e=>e.json())}}function Oo(){return Oo=w(function*(e,t){var{renderMode:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yield zo(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=yield zo(i,"Source",t).then(e=>e.json()),u=[l.fullExtent.xmin,l.fullExtent.ymin,l.fullExtent.xmax,l.fullExtent.ymax],f=[l.tileInfo.origin.x,l.tileInfo.origin.y],d=l.tileInfo.lods.map(e=>e.resolution).slice(0,16),m=l.tileInfo.rows,y=l.tiles[0],h=Eo(n.sprite,t),g=yield h.fetch();!function(e){e.layers.forEach(e=>{var t;null!==(t=e.paint)&&void 0!==t&&t["icon-color"]&&(e.paint["icon-color"]=e.paint["icon-color"].replace(",0)",",1)"))})}(n);var v=new c({extent:u,origin:f,resolutions:d,tileSize:m}),b=new p({format:new o,url:y,projection:ko,tileGrid:v}),x=new s(wo({source:b,declutter:!0},r&&{renderMode:r}));return bo(x,n,a,d,g,h.pngUrl),{layer:x,source:b}}),Oo.apply(this,arguments)}function Po(){return Po=w(function*(e,t){var r,{renderMode:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=yield zo(e,"Style",t).then(e=>e.json()),i=Object.keys(a.sources)[0],l=a.sources[i].url,u=Eo(a.sprite,t),p=null===(r=(yield zo(l,"Source",t).then(e=>e.json())).links)||void 0===r?void 0:r.find(e=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===e.rel),[f,d]=yield Promise.all([zo(p.href,"Source",t).then(e=>e.json()),u.fetch()]),m=f.tileMatrices.map(e=>e.cellSize),y=f.tileMatrices[0].pointOfOrigin,h=[f.tileMatrices[0].tileHeight,f.tileMatrices[0].tileWidth],g=new o;g.supportedMediaTypes.push("application/octet-stream");var v=new c({resolutions:m,origin:y,tileSize:h}),b=new _({url:l,format:g,tileGrid:v,projection:ko}),x=new s(wo({source:b,declutter:!0},n&&{renderMode:n}));return bo(x,a,i,m,d,u.pngUrl),{layer:x,source:b}}),Po.apply(this,arguments)}function Co(e,t,r){if(null!==e)for(var n,o,a,i,s,l,u,p,c=0,f=0,d=e.type,m="FeatureCollection"===d,y="Feature"===d,h=m?e.features.length:1,g=0;g<h;g++){s=(p=!!(u=m?e.features[g].geometry:y?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var b=0,x=0;if(null!==(i=p?u.geometries[v]:u)){l=i.coordinates;var w=i.type;switch(c=0,w){case null:break;case"Point":if(!1===t(l,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-c;o++){if(!1===t(l[n][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-c;a++){if(!1===t(l[n][o][a],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===Co(i.geometries[n],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var $o=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return Co(e,e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r},Io=e=>{var t=e/1609.344;if(t<.5)return"".concat(Math.round(e),"m");if(t<10){var r=Number.parseFloat(t.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(t);return"".concat(o," miles")},qo=(e,t,r)=>{var n=r.getTargetElement().getBoundingClientRect();if(!n.width||!n.height)return!1;var o=r.getViewport().getBoundingClientRect(),a=o.width/n.width,i=o.height/n.height,[s,l,u,p]=(e=>$o(e))(e),c=[[s,l],[s,p],[u,l],[u,p]].map(e=>r.getPixelFromCoordinate(e)).filter(Boolean);if(!c.length)return!1;var f=n.left+Math.min(...c.map(e=>e[0]))*a,d=n.left+Math.max(...c.map(e=>e[0]))*a,m=n.top+Math.min(...c.map(e=>e[1]))*i,y=n.top+Math.max(...c.map(e=>e[1]))*i;return f<t.right&&d>t.left&&m<t.bottom&&y>t.top},To=(e,t,r)=>{for(var n=[],o=t;o<r;o+=2)n.push([e[o],e[o+1]]);return n},No=e=>{var t=e.getType(),r=e.getFlatCoordinates();if("Point"===t)return{type:"Point",coordinates:[r[0],r[1]]};if("LineString"===t)return{type:"LineString",coordinates:To(r,0,r.length)};if("Polygon"===t){var n=e.getEnds(),o=0;return{type:"Polygon",coordinates:n.map(e=>{var t=To(r,o,e);return o=e,t})}}if("MultiPolygon"===t){var a=e.getEndss(),i=0,s=a.map(e=>{var t=i,n=e.map(e=>{var n=To(r,t,e);return t=e,n});return i=e[e.length-1],n});return{type:"MultiPolygon",coordinates:s}}return{type:t,coordinates:To(r,0,r.length)}},Fo=(e,t,r,n)=>{var o=[];return e.getLayers().forEach(e=>{if(e instanceof s){var a=e.getSource(),i=null==a?void 0:a.sourceTiles_;i&&Object.values(i).forEach(e=>{e.getState()===E.LOADED&&e.getFeatures().forEach(e=>{var a;if((null===(a=e.get("mapbox-layer"))||void 0===a?void 0:a.id)===t){var i=n?e.get(n):e.getId();String(i)===String(r)&&o.push(No(e))}})})}}),o};function Do(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Lo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Do(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Do(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Ro="EPSG:27700",Go=new n({dataProjection:Ro,featureProjection:Ro}),Zo="_highlight",Ho=999,Uo=(e,t)=>{if(!e)return[];var{stroke:r,selectionStroke:n,fill:o,strokeWidth:a,activeStrokeWidth:i}=e;if(t)return[new b({stroke:new v({color:r,width:i}),zIndex:Ho}),new b({stroke:new v({color:n,width:a}),zIndex:1e3})];var s=[new b({stroke:new v({color:n,width:a}),zIndex:Ho})];return o&&"transparent"!==o&&s.push(new b({fill:new h({color:o}),zIndex:Ho})),s},Bo=e=>{var t=new Set,r={};for(var{layerId:n,featureId:o,idProperty:a}of null!=e?e:[])t.add("".concat(n,":").concat(o)),a&&(r[n]=a);return{keys:t,idProps:r}},Vo=(e,t,r,n)=>{for(var{layerId:o,geometry:a}of null!=t?t:[])if(a){var i=Uo(null==n?void 0:n[o],r);if(i.length){var s=new $({geometry:Go.readGeometry(a)});s.setStyle(i),e.addFeature(s)}}},Wo=(e,t)=>{var{type:r,coordinates:n}=e,o=e=>{var[r,n]=e;return t(r,n)},a=e=>e.forEach(o);"Point"===r?o(n):"MultiPoint"===r||"LineString"===r?n.forEach(o):"MultiLineString"===r||"Polygon"===r?n.forEach(a):"MultiPolygon"===r&&n.forEach(e=>e.forEach(a))},Jo=(e,t,r,n)=>{if(!e)return null;var o=new Set;e.getLayers().forEach(e=>{if(e instanceof i&&!e.get(Zo)){var t=e.get("layerId");t&&o.add(t)}});var{keys:a,idProps:l}=Bo(t),{keys:p,idProps:c}=Bo(r),f=Lo(Lo({},l),c);((e,t,r,n,o)=>{e.getLayers().forEach(e=>{if(e instanceof s)if(t.size>0||r.size>0){e._highlightOriginalStyle||(e._highlightOriginalStyle=e.getStyleFunction());var a=e._highlightOriginalStyle;e.setStyle((e,i)=>{var s,l=a(e,i),u=null===(s=e.get("mapbox-layer"))||void 0===s?void 0:s.id;if(!u)return l;var p=n[u],c=p?e.get(p):e.getId(),f="".concat(u,":").concat(c),d=r.has(f),m=!d&&t.has(f);if(!d&&!m)return l;var y=Uo(null==o?void 0:o[u],d);return y.length?[...l?Array.isArray(l)?l:[l]:[],...y]:l})}else e._highlightOriginalStyle&&(e.setStyle(e._highlightOriginalStyle),delete e._highlightOriginalStyle)})})(e,a,p,f,n);var d=(e=>{var t=null;return e.getLayers().forEach(e=>{e.get(Zo)&&(t=e)}),t||((t=new i({source:new u,zIndex:1001})).set(Zo,!0),e.addLayer(t)),t})(e),m=d.getSource();m.clear();var y=(null!=t?t:[]).filter(e=>o.has(e.layerId)),h=(null!=r?r:[]).filter(e=>o.has(e.layerId));Vo(m,h,!0,n),Vo(m,y,!1,n);var g=(null!=t?t:[]).flatMap(t=>((e,t)=>{var{layerId:r,featureId:n,idProperty:o,geometry:a}=t;if(null!=n){var i=Fo(e,r,n,o);if(i.length>0)return i}return a?[a]:[]})(e,t));return(e=>{if(!e.length)return null;var t=1/0,r=1/0,n=-1/0,o=-1/0;for(var a of e)Wo(a,(e,a)=>{e<t&&(t=e),a<r&&(r=a),e>n&&(n=e),a>o&&(o=a)});return t===1/0?null:[t,r,n,o]})(g)};function Xo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var Yo="EPSG:27700",Ko=new n({dataProjection:Yo,featureProjection:Yo}),Qo=e=>{var t=e.getId();if(null!=t)return t;var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e.getProperties());return delete r["mapbox-layer"],JSON.stringify(r)},ea=(e,t,r)=>{var n=e.getViewport();if(r&&e.un("pointermove",r),null==t||!t.length)return n.style.cursor="",null;var o=new Set(t),a=null,l=t=>{var r;if("mouse"===(null===(r=t.originalEvent)||void 0===r?void 0:r.pointerType)){var l=t.pixel;null!==a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{a=null;var t=e.forEachFeatureAtPixel(l,(e,t)=>((e,t,r)=>{if(t instanceof s){var n,o=null===(n=e.get("mapbox-layer"))||void 0===n?void 0:n.id;return Boolean(o&&r.has(o))}if(t instanceof i&&!t.get("_highlight")){var a=t.get("layerId");return Boolean(a&&r.has(a))}return!1})(e,t,o),{hitTolerance:8});n.style.cursor=t?"pointer":""})}};return e.on("pointermove",l),l};function ta(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ra(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ta(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}(()=>{if("undefined"!=typeof HTMLCanvasElement){var e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return e.call(this,t,"2d"===t?ra(ra({},r),{},{willReadFrequently:!0}):r,...o)}}})();var na="EPSG:27700",oa=e=>{if(e){var{top:t=0,right:r=0,bottom:n=0,left:o=0}=e;return[t,r,n,o]}};M.defs(na,"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),z(M);class aa{constructor(e){var{mapProviderConfig:t={},events:r,eventBus:n}=e;this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:D,supportsMapSizes:!0},Object.assign(this,t)}get name(){return"OpenLayersProvider"}initMap(r){var n=this;return w(function*(){var o,{container:a,padding:i,mapStyle:s,mapSize:l,center:u,zoom:p,bounds:c,minZoom:f,maxZoom:d,transformRequest:m,pixelRatio:y}=r;n.mapStyleId=null==s?void 0:s.id,n.mapSize=l;var{events:h,eventBus:g}=n,{layer:v,source:b}=yield Ao(s,m),x=(null!==(o=n.zoomAlignment)&&void 0!==o?o:L)===R?{resolutions:q,defaultMinZoom:6,maxZoom:20}:{resolutions:I,defaultMinZoom:0,maxZoom:I.length-1},M=new t({projection:na,center:u,zoom:null!=p?p:x.defaultMinZoom,minZoom:Math.max(null!=f?f:x.defaultMinZoom,x.defaultMinZoom),maxZoom:null!=d?d:x.maxZoom,resolutions:x.resolutions,constrainResolution:!1,padding:oa(i)}),z=new e({target:a,layers:[v],view:M,controls:[],interactions:k({doubleClickZoom:!1}),pixelRatio:y});c&&z.once("rendercomplete",()=>{M.fit(c,{size:z.getSize(),duration:0})}),n.mapEventHandles=H({map:z,source:b,events:h,eventBus:g,getZoom:n.getZoom.bind(n),getCenter:n.getCenter.bind(n),getBounds:n.getBounds.bind(n),getResolution:n.getResolution.bind(n)}),n.appEventHandles=function(e){var{mapProvider:t,transformRequest:r,events:n,eventBus:o,map:a,onBaseSourceChange:i}=e,s=function(){var e=w(function*(e){var{layer:s,source:l}=yield Ao(e,r);a.getLayers().setAt(0,s),i(l),o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:e.id}),t.reapplyHighlights()});return function(t){return e.apply(this,arguments)}}(),l=e=>{a.setPixelRatio(e)},u=e=>{var{mapSize:r}=e;t.mapSize=r};return o.on(n.MAP_SET_STYLE,s),o.on(n.MAP_SET_PIXEL_RATIO,l),o.on(n.MAP_SIZE_CHANGE,u),{remove(){o.off(n.MAP_SET_STYLE,s),o.off(n.MAP_SET_PIXEL_RATIO,l),o.off(n.MAP_SIZE_CHANGE,u)}}}({mapProvider:n,transformRequest:m,events:h,eventBus:g,map:z,onBaseSourceChange:n.mapEventHandles.setSource})||[],n.map=z,n.view=M,g.emit(h.MAP_READY,{map:n.map,mapStyleId:n.mapStyleId,mapSize:n.mapSize,crs:n.crs})})()}destroyMap(){var e,t;null===(e=this.mapEventHandles)||void 0===e||e.remove(),null===(t=this.appEventHandles)||void 0===t||t.remove(),this.mapEventHandles=null,this.appEventHandles=null,this.map&&(this._onHoverMove&&(this.map.un("pointermove",this._onHoverMove),this._onHoverMove=null),this.map.setTarget(null),this.map=null),this.view=null}setView(e){var{center:t,zoom:r}=e;this.view.animate({center:null!=t?t:this.view.getCenter(),zoom:null!=r?r:this.view.getZoom(),duration:N})}zoomIn(e){this.view.animate({zoom:this.view.getZoom()+e,duration:N})}zoomOut(e){this.view.animate({zoom:this.view.getZoom()-e,duration:N})}panBy(e){var t=this.view.getCenter(),r=this.view.getResolution();this.view.animate({center:[t[0]+e[0]*r,t[1]-e[1]*r],duration:N})}fitToBounds(e){var t,r=Array.isArray(e)?e:(t=$o(e),l(t,"EPSG:4326","EPSG:27700"));this.view.fit(r,{duration:N})}setPadding(e){this.view.padding=oa(e)}getCenter(){var e=this.view.getCenter(),t=F;return[Math.round(e[0]*Math.pow(10,t))/Math.pow(10,t),Math.round(e[1]*Math.pow(10,t))/Math.pow(10,t)]}getZoom(){return this.view.getZoom()}getBounds(){return this.view.calculateExtent(this.map.getSize()).map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return[];var{radius:n=10}=r,o=[t.x,t.y],a=[],l=new Set;return e.forEachFeatureAtPixel(o,(e,t)=>{if(t instanceof s){var r=e.get("mapbox-layer"),n=null==r?void 0:r.id;if(!n||"background"===(null==r?void 0:r.type))return;var o="".concat(n,":").concat(Qo(e));if(l.has(o))return;l.add(o),a.push({id:e.getId(),layer:{id:n},geometry:No(e),properties:e.getProperties()})}else if(t instanceof i){var u=t.get("layerId");if(!u||t.get("_highlight"))return;var p=e.getId(),c="".concat(u,":").concat(p);if(l.has(c))return;l.add(c),a.push({id:p,layer:{id:u},geometry:Ko.writeGeometryObject(e.getGeometry()),properties:e.getProperties()})}},{hitTolerance:n}),a}(this.map,e,t)}getFeatureGeometry(e,t,r){var n=Fo(this.map,e,t,r);return 0===n.length?null:1===n.length?n[0]:{type:"MultiPolygon",coordinates:n.flatMap(e=>"MultiPolygon"===e.type?e.coordinates:[e.coordinates])}}setHoverCursor(e){this.map&&(this._onHoverMove=ea(this.map,e,this._onHoverMove))}getVisibleFeatures(e){return[]}updateHighlightedFeatures(e,t,r){return this._lastHighlightArgs={selectedFeatures:e,activeFeatures:t,stylesMap:r},Jo(this.map,e,t,r)}reapplyHighlights(){if(this._lastHighlightArgs){var{selectedFeatures:e,activeFeatures:t,stylesMap:r}=this._lastHighlightArgs;Jo(this.map,e,t,r)}}getAreaDimensions(){return(e=>{if(!e)return"";var[t,r,n,o]=e,a=n-t;return"".concat(Io(o-r)," by ").concat(Io(a))})((e=>{var t=e.getSize(),r=e.getView().padding||[0,0,0,0],[n,o,a,i]=r,s=[i,t[1]-a],l=[t[0]-o,n],u=e.getCoordinateFromPixel(s),p=e.getCoordinateFromPixel(l);return u&&p?[u[0],u[1],p[0],p[1]]:null})(this.map))}getCardinalMove(e,t){return((e,t)=>{var r=t[0]-e[0],n=t[1]-e[1],o=[];return Math.abs(n)>1&&o.push("".concat(n>0?"north":"south"," ").concat(Io(Math.abs(n)))),Math.abs(r)>1&&o.push("".concat(r>0?"east":"west"," ").concat(Io(Math.abs(r)))),o.join(", ")})(e,t)}getResolution(){return this.view.getResolution()}mapToScreen(e){if(!this.map)return{x:0,y:0};var t=this.map.getPixelFromCoordinate(e);return t?{x:t[0],y:t[1]}:{x:0,y:0}}screenToMap(e){return this.map.getCoordinateFromPixel([e.x,e.y])}isGeometryObscured(e,t){return qo(e,t,this.map)}}export{aa as default};
|