PageSourceSearch

https://www.arcnet.com/assets/maplibre-BOGZE8_b.js

js arcnet.com collected 2026-10-02 19:10:04 UTC 782,018 bytes, 581 lines download raw bytes

1import{r as We,a as Ah,g as Tp,c as Ip}from"./vendor-BS2D_vZZ.js";function Ap(Q,ee){for(var ae=0;ae<ee.length;ae++){const oe=ee[ae];if(typeof oe!="string"&&!Array.isArray(oe)){for(const ne in oe)if(ne!=="default"&&!(ne in Q)){const me=Object.getOwnPropertyDescriptor(oe,ne);me&&Object.defineProperty(Q,ne,me.get?me:{enumerable:!0,get:()=>oe[ne]})}}}return Object.freeze(Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}))}const Ep="modulepreload",Mp=function(Q){return"/"+Q},gh={},Jp=function(ee,ae,oe){let ne=Promise.resolve();if(ae&&ae.length>0){document.getElementsByTagName("link");const xe=document.querySelector("meta[property=csp-nonce]"),c=xe?.nonce||xe?.getAttribute("nonce");ne=Promise.allSettled(ae.map(Fe=>{if(Fe=Mp(Fe),Fe in gh)return;gh[Fe]=!0;const K=Fe.endsWith(".css"),Ke=K?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${Fe}"]${Ke}`))return;const lt=document.createElement("link");if(lt.rel=K?"stylesheet":Ep,K||(lt.as="script"),lt.crossOrigin="",lt.href=Fe,c&&lt.setAttribute("nonce",c),document.head.appendChild(lt),K)return new Promise((ke,Wt)=>{lt.addEventListener("load",ke),lt.addEventListener("error",()=>Wt(new Error(`Unable to preload CSS for ${Fe}`)))})}))}function me(xe){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=xe,window.dispatchEvent(c),!c.defaultPrevented)throw xe}return ne.then(xe=>{for(const c of xe||[])c.status==="rejected"&&me(c.reason);return ee().catch(me)})},Cp=We.createContext(null);function Pp(Q,ee){const ae=Array.isArray(Q)?Q[0]:Q?Q.x:0,oe=Array.isArray(Q)?Q[1]:Q?Q.y:0,ne=Array.isArray(ee)?ee[0]:ee?ee.x:0,me=Array.isArray(ee)?ee[1]:ee?ee.y:0;return ae===ne&&oe===me}function ws(Q,ee){if(Q===ee)return!0;if(!Q||!ee)return!1;if(Array.isArray(Q)){if(!Array.isArray(ee)||Q.length!==ee.length)return!1;for(let ae=0;ae<Q.length;ae++)if(!ws(Q[ae],ee[ae]))return!1;return!0}else if(Array.isArray(ee))return!1;if(typeof Q=="object"&&typeof ee=="object"){const ae=Object.keys(Q),oe=Object.keys(ee);if(ae.length!==oe.length)return!1;for(const ne of ae)if(!ee.hasOwnProperty(ne)||!ws(Q[ne],ee[ne]))return!1;return!0}return!1}function kp(Q){const ee=Q.clone();return ee.pixelsToGLUnits=Q.pixelsToGLUnits,ee}function _h(Q,ee){if(!Q.getProjection)return;const ae=Q.getProjection(),oe=ee.getProjection();ws(ae,oe)||ee.setProjection(ae)}function yh(Q){return{longitude:Q.center.lng,latitude:Q.center.lat,zoom:Q.zoom,pitch:Q.pitch,bearing:Q.bearing,padding:Q.padding}}function xh(Q,ee){const ae=ee.viewState||ee;let oe=!1;if("zoom"in ae){const ne=Q.zoom;Q.zoom=ae.zoom,oe=oe||ne!==Q.zoom}if("bearing"in ae){const ne=Q.bearing;Q.bearing=ae.bearing,oe=oe||ne!==Q.bearing}if("pitch"in ae){const ne=Q.pitch;Q.pitch=ae.pitch,oe=oe||ne!==Q.pitch}if(ae.padding&&!Q.isPaddingEqual(ae.padding)&&(oe=!0,Q.padding=ae.padding),"longitude"in ae&&"latitude"in ae){const ne=Q.center;Q.center=new ne.constructor(ae.longitude,ae.latitude),oe=oe||ne!==Q.center}return oe}const zp=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function vh(Q){if(!Q)return null;if(typeof Q=="string"||("toJS"in Q&&(Q=Q.toJS()),!Q.layers))return Q;const ee={};for(const oe of Q.layers)ee[oe.id]=oe;const ae=Q.layers.map(oe=>{let ne=null;"interactive"in oe&&(ne=Object.assign({},oe),delete ne.interactive);const me=ee[oe.ref];if(me){ne=ne||Object.assign({},oe),delete ne.ref;for(const xe of zp)xe in me&&(ne[xe]=me[xe])}return ne||oe});return{...Q,layers:ae}}var bh={};const wh={version:8,sources:{},layers:[]},Sh={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Rc={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},Th={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",
1styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},Dp=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Lp=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class hn{constructor(ee,ae,oe){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=ne=>{const me=this.props[Th[ne.type]];me?me(ne):ne.type==="error"&&console.error(ne.error)},this._onPointerEvent=ne=>{(ne.type==="mousemove"||ne.type==="mouseout")&&this._updateHover(ne);const me=this.props[Sh[ne.type]];me&&(this.props.interactiveLayerIds&&ne.type!=="mouseover"&&ne.type!=="mouseout"&&(ne.features=this._hoveredFeatures||this._queryRenderedFeatures(ne.point)),me(ne),delete ne.features)},this._onCameraEvent=ne=>{if(!this._internalUpdate){const me=this.props[Rc[ne.type]];me&&me(ne)}ne.type in this._deferredEvents&&(this._deferredEvents[ne.type]=!1)},this._MapClass=ee,this.props=ae,this._initialize(oe)}get map(){return this._map}get transform(){return this._renderTransform}setProps(ee){const ae=this.props;this.props=ee;const oe=this._updateSettings(ee,ae);oe&&this._createShadowTransform(this._map);const ne=this._updateSize(ee),me=this._updateViewState(ee,!0);this._updateStyle(ee,ae),this._updateStyleComponents(ee,ae),this._updateHandlers(ee,ae),(oe||ne||me&&!this._map.isMoving())&&this.redraw()}static reuse(ee,ae){const oe=hn.savedMaps.pop();if(!oe)return null;const ne=oe.map,me=ne.getContainer();for(ae.className=me.className;me.childNodes.length>0;)ae.appendChild(me.childNodes[0]);ne._container=ae;const xe=ne._resizeObserver;xe&&(xe.disconnect(),xe.observe(ae)),oe.setProps({...ee,styleDiffing:!1}),ne.resize();const{initialViewState:c}=ee;return c&&(c.bounds?ne.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):oe._updateViewState(c,!1)),ne.isStyleLoaded()?ne.fire("load"):ne.once("styledata",()=>ne.fire("load")),ne._update(),oe}_initialize(ee){const{props:ae}=this,{mapStyle:oe=wh}=ae,ne={...ae,...ae.initialViewState,accessToken:ae.mapboxAccessToken||Rp()||null,container:ee,style:vh(oe)},me=ne.initialViewState||ne.viewState||ne;if(Object.assign(ne,{center:[me.longitude||0,me.latitude||0],zoom:me.zoom||0,pitch:me.pitch||0,bearing:me.bearing||0}),ae.gl){const Ke=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=Ke,ae.gl)}const xe=new this._MapClass(ne);me.padding&&xe.setPadding(me.padding),ae.cursor&&(xe.getCanvas().style.cursor=ae.cursor),this._createShadowTransform(xe);const c=xe._render;xe._render=Ke=>{this._inRender=!0,c.call(xe,Ke),this._inRender=!1};const Fe=xe._renderTaskQueue.run;xe._renderTaskQueue.run=Ke=>{Fe.call(xe._renderTaskQueue,Ke),this._onBeforeRepaint()},xe.on("render",()=>this._onAfterRepaint());const K=xe.fire;xe.fire=this._fireEvent.bind(this,K),xe.on("resize",()=>{this._renderTransform.resize(xe.transform.width,xe.transform.height)}),xe.on("styledata",()=>{this._updateStyleComponents(this.props,{}),_h(xe.transform,this._renderTransform)}),xe.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const Ke in Sh)xe.on(Ke,this._onPointerEvent);for(const Ke in Rc)xe.on(Ke,this._onCameraEvent);for(const Ke in Th)xe.on(Ke,this._onEvent);this._map=xe}recycle(){const ae=this.map.getContainer().querySelector("[mapboxgl-children]");ae?.remove(),hn.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const ee=this._map;!this._inRender&&ee.style&&(ee._frame&&(ee._frame.cancel(),ee._frame=null),ee._render())}_createShadowTransform(ee){const ae=kp(ee.transform);ee.painter.transform=ae,this._renderTransform=ae}_updateSize(ee){const{viewState:ae}=ee;if(ae){const oe=this._map;if(ae.width!==oe.transform.width||ae.height!==oe.transform.height)return oe.resize(),!0}return!1}_updateViewState(ee,ae){if(this._internalUpdate)return!1;const oe=this._map,ne=this._renderTransform,{zoom:me,pitch:xe,bearing:c}=ne,Fe=oe.isMoving();Fe&&(ne.cameraElevationReference="sea");const K=xh(ne,{...yh(oe.transform),...ee});if(Fe&&(ne.cameraElevationReference="ground"),K&&ae){const Ke=this._deferredEvents;Ke.move=!0,Ke.zoom||(Ke.zoom=me!==ne.zoom),Ke.rotate||(Ke.rotate=c!==ne.bearing),Ke.pitch||(Ke.pitch=xe!==ne.pitch)}return Fe||xh(oe.transform,ee),K}_updateSettings(ee,ae){const oe=this._map;let ne=!1;for(const me of Dp)if(me in ee&&!ws(ee[me],ae[me])){ne=!0;const xe=oe[`set${me[0].toUpperCase()}${me.slice(1)}`];xe?.call(oe,ee[me])}return ne}_updateStyle(ee,ae){if(ee.cursor!==ae.cursor&&(this._map.getCanvas().style.cursor=ee.cursor||""),ee.mapStyle!==ae.mapStyle){const{mapStyle:oe=wh,styleDiffing:ne=!0}=ee,me={diff:ne};return"localIdeographFontFamily"in ee&&(me.localIdeographFontFamily=ee.localIdeographFontFamily),this._map.setStyle(vh(oe),me),!0}return!1}_updateStyleComponents(ee,ae){const oe=this._map;let ne=!1;return oe.isStyleLoaded()&&("light"in ee&&oe.setLight&&!ws(ee.light,ae.light)&&(ne=!0,oe.setLight(ee.light)),"fog"in ee&&oe.setFog&&!ws(ee.fog,ae.fog)&&(ne=!0,oe.setFog(ee.fog)),"terrain"in ee&&oe.setTerrain&&!ws(ee.terrain,ae.terrain)&&(!ee.terrain||oe.getSource(ee.terrain.source))&&(ne=!0,oe.setTerrain(ee.terrain))),ne}_updateHandlers(ee,ae){var oe,ne;const me=this._map;let xe=!1;for(const c of Lp){const Fe=(oe=ee[c])!==null&&oe!==void 0?oe:!0,K=(ne=ae[c])!==null&&ne!==void 0?ne:!0;ws(Fe,K)||(xe=!0,Fe?me[c].enable(Fe):me[c].disable())}return xe}_queryRenderedFeatures(ee){const ae=this._map,oe=ae.transform,{interactiveLayerIds:ne=[]}=this.props;try{return ae.transform=this._renderTransform,ae.queryRenderedFeatures(ee,{layers:ne.filter(ae.getLayer.bind(ae))})}catch{return[]}finally{ae.transform=oe}}_updateHover(ee){var ae;const{props:oe}=this;if(oe.interactiveLayerIds&&(oe.onMouseMove||oe.onMouseEnter||oe.onMouseLeave)){const me=ee.type,xe=((ae=this._hoveredFeatures)===null||ae===void 0?void 0:ae.length)>0,c=this._queryRenderedFeatures(ee.point),Fe=c.length>0;!Fe&&xe&&(ee.type="mouseleave",this._onPointerEvent(ee)),this._hoveredFeatures=c,Fe&&!xe&&(ee.type="mouseenter",this._onPointerEvent(ee)),ee.type=me}else this._hoveredFeatures=null}_fireEvent(ee,ae,oe){const ne=this._map,me=ne.transform,xe=typeof ae=="string"?ae:ae.type;return xe==="move"&&this._updateViewState(this.props,!1),xe in Rc&&(typeof ae=="object"&&(ae.viewState=yh(me)),this._map.isMoving())?(ne.transform=this._renderTransform,ee.call(ne,ae,oe),ne.transform=me,ne):(ee.call(ne,ae,oe),ne)}_onBeforeRepaint(){const ee=this._map;this._internalUpdate=!0;for(const oe in this._deferredEvents)this._deferredEvents[oe]&&ee.fire(oe);this._internalUpdate=!1;const ae=this._map.transform;ee.transform=this._renderTransform,this._onAfterRepaint=()=>{_h(this._renderTransform,ae),ee.transform=ae}}}hn.savedMaps=[];function Rp(){let Q=null;if(typeof location<"u"){const ee=/access_token=([^&\/]*)/.exec(location.search);Q=ee&&ee[1]}try{Q=Q||bh.MapboxAccessToken}catch{}try{Q=Q||bh.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return Q}
1const Bp=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function Fp(Q){if(!Q)return null;const ee=Q.map,ae={getMap:()=>ee,getCenter:()=>Q.transform.center,getZoom:()=>Q.transform.zoom,getBearing:()=>Q.transform.bearing,getPitch:()=>Q.transform.pitch,getPadding:()=>Q.transform.padding,getBounds:()=>Q.transform.getBounds(),project:oe=>{const ne=ee.transform;ee.transform=Q.transform;const me=ee.project(oe);return ee.transform=ne,me},unproject:oe=>{const ne=ee.transform;ee.transform=Q.transform;const me=ee.unproject(oe);return ee.transform=ne,me},queryTerrainElevation:(oe,ne)=>{const me=ee.transform;ee.transform=Q.transform;const xe=ee.queryTerrainElevation(oe,ne);return ee.transform=me,xe},queryRenderedFeatures:(oe,ne)=>{const me=ee.transform;ee.transform=Q.transform;const xe=ee.queryRenderedFeatures(oe,ne);return ee.transform=me,xe}};for(const oe of Op(ee))!(oe in ae)&&!Bp.includes(oe)&&(ae[oe]=ee[oe].bind(ee));return ae}function Op(Q){const ee=new Set;let ae=Q;for(;ae;){for(const oe of Object.getOwnPropertyNames(ae))oe[0]!=="_"&&typeof Q[oe]=="function"&&oe!=="fire"&&oe!=="setEventedParent"&&ee.add(oe);ae=Object.getPrototypeOf(ae)}return Array.from(ee)}const Vp=typeof document<"u"?We.useLayoutEffect:We.useEffect,Np=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function Up(Q,ee){for(const oe of Np)oe in ee&&(Q[oe]=ee[oe]);const{RTLTextPlugin:ae="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=ee;ae&&Q.getRTLTextPluginStatus&&Q.getRTLTextPluginStatus()==="unavailable"&&Q.setRTLTextPlugin(ae,oe=>{oe&&console.error(oe)},!0)}const El=We.createContext(null);function Qp(Q,ee,ae){const oe=We.useContext(Cp),[ne,me]=We.useState(null),xe=We.useRef(),{current:c}=We.useRef({mapLib:null,map:null});We.useEffect(()=>{const Ke=Q.mapLib;let lt=!0,ke;return Promise.resolve(Ke||ae).then(Wt=>{if(!lt)return;if(!Wt)throw new Error("Invalid mapLib");const ii="Map"in Wt?Wt:Wt.default;if(!ii.Map)throw new Error("Invalid mapLib");if(Up(ii,Q),!ii.supported||ii.supported(Q))Q.reuseMaps&&(ke=hn.reuse(Q,xe.current)),ke||(ke=new hn(ii.Map,Q,xe.current)),c.map=Fp(ke),c.mapLib=ii,me(ke),oe?.onMapMount(c.map,Q.id);else throw new Error("Map is not supported by this browser")}).catch(Wt=>{const{onError:ii}=Q;ii?ii({type:"error",target:null,originalEvent:null,error:Wt}):console.error(Wt)}),()=>{lt=!1,ke&&(oe?.onMapUnmount(Q.id),Q.reuseMaps?ke.recycle():ke.destroy())}},[]),Vp(()=>{ne&&ne.setProps(Q)}),We.useImperativeHandle(ee,()=>c.map,[ne]);const Fe=We.useMemo(()=>({position:"relative",width:"100%",height:"100%",...Q.style}),[Q.style]),K={height:"100%"};return We.createElement("div",{id:Q.id,ref:xe,style:Fe},ne&&We.createElement(El.Provider,{value:c},We.createElement("div",{"mapboxgl-children":"",style:K},Q.children)))}const $p=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function ba(Q,ee){if(!Q||!ee)return;const ae=Q.style;for(const oe in ee){const ne=ee[oe];Number.isFinite(ne)&&!$p.test(oe)?ae[oe]=`${ne}px`:ae[oe]=ne}}function jp(Q,ee){const{map:ae,mapLib:oe}=We.useContext(El),ne=We.useRef({props:Q});ne.current.props=Q;const me=We.useMemo(()=>{let Sr=!1;We.Children.forEach(Q.children,Ii=>{Ii&&(Sr=!0)});const ri={...Q,element:Sr?document.createElement("div"):null},_t=new oe.Marker(ri);return _t.setLngLat([Q.longitude,Q.latitude]),_t.getElement().addEventListener("click",Ii=>{var jt,Vt;(Vt=(jt=ne.current.props).onClick)===null||Vt===void 0||Vt.call(jt,{type:"click",target:_t,originalEvent:Ii})}),_t.on("dragstart",Ii=>{var jt,Vt;const gi=Ii;gi.lngLat=me.getLngLat(),(Vt=(jt=ne.current.props).onDragStart)===null||Vt===void 0||Vt.call(jt,gi)}),_t.on("drag",Ii=>{var jt,Vt;const gi=Ii;gi.lngLat=me.getLngLat(),(Vt=(jt=ne.current.props).onDrag)===null||Vt===void 0||Vt.call(jt,gi)}),_t.on("dragend",Ii=>{var jt,Vt;const gi=Ii;gi.lngLat=me.getLngLat(),(Vt=(jt=ne.current.props).onDragEnd)===null||Vt===void 0||Vt.call(jt,gi)}),_t},[]);We.useEffect(()=>(me.addTo(ae.getMap()),()=>{me.remove()}),[]);const{longitude:xe,latitude:c,offset:Fe,style:K,draggable:Ke=!1,popup:lt=null,rotation:ke=0,rotationAlignment:Wt="auto",pitchAlignment:ii="auto"}=Q;return We.useEffect(()=>{ba(me.getElement(),K)},[K]),We.useImperativeHandle(ee,()=>me,[]),(me.getLngLat().lng!==xe||me.getLngLat().lat!==c)&&me.setLngLat([xe,c]),Fe&&!Pp(me.getOffset(),Fe)&&me.setOffset(Fe),me.isDraggable()!==Ke&&me.setDraggable(Ke),me.getRotation()!==ke&&me.setRotation(ke),me.getRotationAlignment()!==Wt&&me.setRotationAlignment(Wt),me.getPitchAlignment()!==ii&&me.setP
1itchAlignment(ii),me.getPopup()!==lt&&me.setPopup(lt),Ah.createPortal(Q.children,me.getElement())}We.memo(We.forwardRef(jp));function Ih(Q){return new Set(Q?Q.trim().split(/\s+/):[])}function qp(Q,ee){const{map:ae,mapLib:oe}=We.useContext(El),ne=We.useMemo(()=>document.createElement("div"),[]),me=We.useRef({props:Q});me.current.props=Q;const xe=We.useMemo(()=>{const c={...Q},Fe=new oe.Popup(c);return Fe.setLngLat([Q.longitude,Q.latitude]),Fe.once("open",K=>{var Ke,lt;(lt=(Ke=me.current.props).onOpen)===null||lt===void 0||lt.call(Ke,K)}),Fe},[]);if(We.useEffect(()=>{const c=Fe=>{var K,Ke;(Ke=(K=me.current.props).onClose)===null||Ke===void 0||Ke.call(K,Fe)};return xe.on("close",c),xe.setDOMContent(ne).addTo(ae.getMap()),()=>{xe.off("close",c),xe.isOpen()&&xe.remove()}},[]),We.useEffect(()=>{ba(xe.getElement(),Q.style)},[Q.style]),We.useImperativeHandle(ee,()=>xe,[]),xe.isOpen()&&((xe.getLngLat().lng!==Q.longitude||xe.getLngLat().lat!==Q.latitude)&&xe.setLngLat([Q.longitude,Q.latitude]),Q.offset&&!ws(xe.options.offset,Q.offset)&&xe.setOffset(Q.offset),(xe.options.anchor!==Q.anchor||xe.options.maxWidth!==Q.maxWidth)&&(xe.options.anchor=Q.anchor,xe.setMaxWidth(Q.maxWidth)),xe.options.className!==Q.className)){const c=Ih(xe.options.className),Fe=Ih(Q.className);for(const K of c)Fe.has(K)||xe.removeClassName(K);for(const K of Fe)c.has(K)||xe.addClassName(K);xe.options.className=Q.className}return Ah.createPortal(Q.children,ne)}We.memo(We.forwardRef(qp));function xo(Q,ee,ae,oe){const ne=We.useContext(El),me=We.useMemo(()=>Q(ne),[]);return We.useEffect(()=>{const xe=ee,c=null,Fe=typeof ee=="function"?ee:null,{map:K}=ne;return K.hasControl(me)||(K.addControl(me,xe?.position),c&&c(ne)),()=>{Fe&&Fe(ne),K.hasControl(me)&&K.removeControl(me)}},[]),me}function Zp(Q){const ee=xo(({mapLib:ae})=>new ae.AttributionControl(Q),{position:Q.position});return We.useEffect(()=>{ba(ee._container,Q.style)},[Q.style]),null}We.memo(Zp);function Gp(Q){const ee=xo(({mapLib:ae})=>new ae.FullscreenControl({container:Q.containerId&&document.getElementById(Q.containerId)}),{position:Q.position});return We.useEffect(()=>{ba(ee._controlContainer,Q.style)},[Q.style]),null}We.memo(Gp);function Wp(Q,ee){const ae=We.useRef({props:Q}),oe=xo(({mapLib:ne})=>{const me=new ne.GeolocateControl(Q),xe=me._setupUI;return me._setupUI=c=>{me._container.hasChildNodes()||xe(c)},me.on("geolocate",c=>{var Fe,K;(K=(Fe=ae.current.props).onGeolocate)===null||K===void 0||K.call(Fe,c)}),me.on("error",c=>{var Fe,K;(K=(Fe=ae.current.props).onError)===null||K===void 0||K.call(Fe,c)}),me.on("outofmaxbounds",c=>{var Fe,K;(K=(Fe=ae.current.props).onOutOfMaxBounds)===null||K===void 0||K.call(Fe,c)}),me.on("trackuserlocationstart",c=>{var Fe,K;(K=(Fe=ae.current.props).onTrackUserLocationStart)===null||K===void 0||K.call(Fe,c)}),me.on("trackuserlocationend",c=>{var Fe,K;(K=(Fe=ae.current.props).onTrackUserLocationEnd)===null||K===void 0||K.call(Fe,c)}),me},{position:Q.position});return ae.current.props=Q,We.useImperativeHandle(ee,()=>oe,[]),We.useEffect(()=>{ba(oe._container,Q.style)},[Q.style]),null}We.memo(We.forwardRef(Wp));function Hp(Q){const ee=xo(({mapLib:ae})=>new ae.NavigationControl(Q),{position:Q.position});return We.useEffect(()=>{ba(ee._container,Q.style)},[Q.style]),null}We.memo(Hp);function Xp(Q){const ee=xo(({mapLib:me})=>new me.ScaleControl(Q),{position:Q.position}),ae=We.useRef(Q),oe=ae.current;ae.current=Q;const{style:ne}=Q;return Q.maxWidth!==void 0&&Q.maxWidth!==oe.maxWidth&&(ee.options.maxWidth=Q.maxWidth),Q.unit!==void 0&&Q.unit!==oe.unit&&ee.setUnit(Q.unit),We.useEffect(()=>{ba(ee._container,ne)},[ne]),null}We.memo(Xp);var Eh={exports:{}};(function(Q,ee){(function(ae,oe){Q.exports=oe()})(Ip,function(){var ae,oe,ne;function me(c,Fe){if(!ae)ae=Fe;else if(!oe)oe=Fe;else{var K="var sharedChunk = {}; ("+ae+")(sharedChunk); ("+oe+")(sharedChunk);",Ke={};ae(Ke),ne=Fe(Ke),typeof window<"u"&&(ne.workerUrl=window.URL.createObjectURL(new Blob([K],{type:"text/javascript"})))}}me(["exports"],function(c){function Fe(i,e,r,a){return new(r||(r=Promise))(function(o,d){function p(x){try{_(a.next(x))}catch(b){d(b)}}function f(x){try{_(a.throw(x))}catch(b){d(b)}}function _(x){var b;x.done?o(x.value):(b=x.value,b instanceof r?b:new r(function(T){T(b)})).then(p,f)}_((a=a.apply(i,e||[])).next())})}function K(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Ke=lt;function lt(i,e){this.x=i,this.y=e}lt.prototype={clone:function(){return new lt(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)}
1,rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),o=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},lt.convert=function(i){return i instanceof lt?i:Array.isArray(i)?new lt(i[0],i[1]):i};var ke=K(Ke),Wt=ii;function ii(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}ii.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)<e)return r;var d=this.sampleCurveDerivativeX(r);if(Math.abs(d)<1e-6)break;r-=o/d}var p=0,f=1;for(r=i,a=0;a<20&&(o=this.sampleCurveX(r),!(Math.abs(o-i)<e));a++)i>o?p=r:f=r,r=.5*(f-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Sr=K(Wt);let ri,_t;function Ii(){return ri==null&&(ri=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ri}function jt(){if(_t==null&&(_t=!1,Ii())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<5*5;a++){const o=4*a;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&r[a]!==a){_t=!0;break}}}return _t||!1}function Vt(i,e,r,a){const o=new Sr(i,e,r,a);return function(d){return o.solve(d)}}const gi=Vt(.25,.1,.25,1);function ur(i,e,r){return Math.min(r,Math.max(e,i))}function Xs(i,e,r){const a=r-e,o=((i-e)%a+a)%a+e;return o===e?r:o}function si(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}let wa=1;function Et(i,e,r){const a={};for(const o in i)a[o]=e.call(r||this,i[o],o,i);return a}function Ss(i,e,r){const a={};for(const o in i)e.call(r||this,i[o],o,i)&&(a[o]=i[o]);return a}function sr(i){return Array.isArray(i)?i.map(sr):typeof i=="object"&&i?Et(i,sr):i}const Or={};function _i(i){Or[i]||(typeof console<"u"&&console.warn(i),Or[i]=!0)}function Bi(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function Tr(i){let e=0;for(let r,a,o=0,d=i.length,p=d-1;o<d;p=o++)r=i[o],a=i[p],e+=(a.x-r.x)*(r.y+a.y);return e}function Wi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let es=null;function Ks(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Sa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Ys(i,e,r,a,o){return Fe(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const d=new VideoFrame(i,{timestamp:0});try{const p=d?.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error(`Unrecognized format ${p}`);const f=p.startsWith("BGR"),_=new Uint8ClampedArray(a*o*4);if(yield d.copyTo(_,function(x,b,T,A,C){const P=4*Math.max(-b,0),D=(Math.max(0,T)-T)*A*4+P,V=4*A,$=Math.max(0,b),X=Math.max(0,T);return{rect:{x:$,y:X,width:Math.min(x.width,b+A)-$,height:Math.min(x.height,T+C)-X},layout:[{offset:D,stride:V}]}}(i,e,r,a,o)),f)for(let x=0;x<_.length;x+=4){const b=_[x];_[x]=_[x+2],_[x+2]=b}return _}finally{d.close()}})}let hr,bt,Ai,ts;const Ts={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(Ai||(Ai=document.createElement("a")),Ai.href=i,Ai.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(ts==null&&(ts=matchMedia("(prefers-reduced-motion: reduce)")),ts.matches)}},Is={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};
1class Vr extends Error{constructor(e,r,a,o){super(`AJAXError: ${r} (${e}): ${a}`),this.status=e,this.statusText=r,this.url=a,this.body=o}}const ar=Wi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Hi=i=>Is.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function Js(i,e){const r=new AbortController,a=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:ar(),signal:r.signal});let o=!1,d=!1;return i.type==="json"&&a.headers.set("Accept","application/json"),d||fetch(a).then(p=>p.ok?(f=>{(i.type==="arrayBuffer"||i.type==="image"?f.arrayBuffer():i.type==="json"?f.json():f.text()).then(_=>{d||(o=!0,e(null,_,f.headers.get("Cache-Control"),f.headers.get("Expires")))}).catch(_=>{d||e(new Error(_.message))})})(p):p.blob().then(f=>e(new Vr(p.status,p.statusText,i.url,f)))).catch(p=>{p.code!==20&&e(new Error(p.message))}),{cancel:()=>{d=!0,o||r.abort()}}}const Nr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Wi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Wi())return(Hi(i.url)||Js)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(ar())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Js(i,e);if(Wi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(a,o){const d=new XMLHttpRequest;d.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(d.responseType="arraybuffer");for(const p in a.headers)d.setRequestHeader(p,a.headers[p]);return a.type==="json"&&(d.responseType="text",d.setRequestHeader("Accept","application/json")),d.withCredentials=a.credentials==="include",d.onerror=()=>{o(new Error(d.statusText))},d.onload=()=>{if((d.status>=200&&d.status<300||d.status===0)&&d.response!==null){let p=d.response;if(a.type==="json")try{p=JSON.parse(d.response)}catch(f){return o(f)}o(null,p,d.getResponseHeader("Cache-Control"),d.getResponseHeader("Expires"))}else{const p=new Blob([d.response],{type:d.getResponseHeader("Content-Type")});o(new Vr(d.status,d.statusText,a.url,p))}},d.send(a.body),{cancel:()=>d.abort()}}(i,e)},Qs=function(i,e){return Nr(si(i,{type:"arrayBuffer"}),e)};function Ir(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function As(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function is(i,e,r){if(r&&r[i]){const a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class Ur{constructor(e,r={}){si(this,r),this.type=e}}class $r extends Ur{constructor(e,r={}){super("error",si({error:e},r))}}class rs{on(e,r){return this._listeners=this._listeners||{},As(e,r,this._listeners),this}off(e,r){return is(e,r,this._listeners),is(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},As(e,r,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,r){typeof e=="string"&&(e=new Ur(e,r||{}));const a=e.type;if(this.listens(a)){e.target=this;const o=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const f of o)f.call(this,e);const d=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const f of d)is(a,f,this._oneTimeListeners),f.call(this,e);const p=this._eventedParent;p&&(si(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(e))}else e instanceof $r&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var le={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"}
vendor: 3,526 bytes, line 1
1,bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},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},"*":{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:"*"},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:{},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
vendor: 10,514 bytes, line 1
1","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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","property-type":"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","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},
vendor: 1,289 bytes, line 1
1filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},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:"*",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
vendor: 14,262 bytes, line 1
1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","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"]},"property-type":"cross-faded"},"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"},"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:"number",default:335,minimum:0,maximum:359,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:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",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"}},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"}}};const 
1Ei=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Xi(i,e){const r={};for(const a in i)a!=="ref"&&(r[a]=i[a]);return Ei.forEach(a=>{a in e&&(r[a]=e[a])}),r}function yt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r<i.length;r++)if(!yt(i[r],e[r]))return!1;return!0}if(typeof i=="object"&&i!==null&&e!==null){if(typeof e!="object"||Object.keys(i).length!==Object.keys(e).length)return!1;for(const r in i)if(!yt(i[r],e[r]))return!1;return!0}return i===e}const ot={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};
vendor: 6,112 bytes, line 1
1function dr(i,e,r){r.push({command:ot.addSource,args:[i,e[i]]})}function Es(i,e,r){e.push({command:ot.removeSource,args:[i]}),r[i]=!0}function Ar(i,e,r,a){Es(i,r,a),dr(i,e,r)}function Ta(i,e,r){let a;for(a in i[r])if(Object.prototype.hasOwnProperty.call(i[r],a)&&a!=="data"&&!yt(i[r][a],e[r][a]))return!1;for(a in e[r])if(Object.prototype.hasOwnProperty.call(e[r],a)&&a!=="data"&&!yt(i[r][a],e[r][a]))return!1;return!0}function Ms(i,e,r,a,o,d){let p;for(p in e=e||{},i=i||{})Object.prototype.hasOwnProperty.call(i,p)&&(yt(i[p],e[p])||r.push({command:d,args:[a,p,e[p],o]}));for(p in e)Object.prototype.hasOwnProperty.call(e,p)&&!Object.prototype.hasOwnProperty.call(i,p)&&(yt(i[p],e[p])||r.push({command:d,args:[a,p,e[p],o]}))}function jr(i){return i.id}function ss(i,e){return i[e.id]=e,i}class be{constructor(e,r,a,o){this.message=(e?`${e}: `:"")+a,o&&(this.identifier=o),r!=null&&r.__line__&&(this.line=r.__line__)}}function pr(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}class zt extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class as{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[a,o]of r)this.bindings[a]=o}concat(e){return new as(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 Er={kind:"null"},Se={kind:"number"},Ye={kind:"string"},Ze={kind:"boolean"},yi={kind:"color"},fr={kind:"object"},He={kind:"value"},Mr={kind:"collator"},B={kind:"formatted"},I={kind:"padding"},E={kind:"resolvedImage"},k={kind:"variableAnchorOffsetCollection"};function O(i,e){return{kind:"array",itemType:i,N:e}}function N(i){if(i.kind==="array"){const e=N(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const Y=[Er,Se,Ye,Ze,yi,B,fr,O(He),I,E,k];function Z(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Z(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of Y)if(!Z(r,e))return null}}return`Expected ${N(i)} but found ${N(e)} instead.`}function j(i,e){return e.some(r=>r.kind===i.kind)}function H(i,e){return e.some(r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i)}function ce(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const ue=.96422,pe=.82521,Ve=4/29,qe=6/29,ze=3*qe*qe,Ue=qe*qe*qe,Ge=Math.PI/180,dt=180/Math.PI;function mt(i){return(i%=360)<0&&(i+=360),i}function nt([i,e,r,a]){let o,d;const p=ui((.2225045*(i=at(i))+.7168786*(e=at(e))+.0606169*(r=at(r)))/1);i===e&&e===r?o=d=p:(o=ui((.4360747*i+.3850649*e+.1430804*r)/ue),d=ui((.0139322*i+.0971045*e+.7141733*r)/pe));const f=116*p-16;return[f<0?0:f,500*(o-p),200*(p-d),a]}function at(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function ui(i){return i>Ue?Math.pow(i,1/3):i/ze+Ve}function xt([i,e,r,a]){let o=(i+16)/116,d=isNaN(e)?o:o+e/500,p=isNaN(r)?o:o-r/200;return o=1*ai(o),d=ue*ai(d),p=pe*ai(p),[qt(3.1338561*d-1.6168667*o-.4906146*p),qt(-.9787684*d+1.9161415*o+.033454*p),qt(.0719453*d-.2289914*o+1.4052427*p),a]}function qt(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function ai(i){return i>qe?i*i*i:ze*(i-Ve)}function Ki(i){return parseInt(i.padEnd(2,i),16)/255}function vo(i,e){return Cs(e?i/100:i,0,1)}function Cs(i,e,r){return Math.min(Math.max(e,i),r)}function Ps(i){return!i.some(Number.isNaN)}const Ml={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],ol
1ive:[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]};class pt{constructor(e,r,a,o=1,d=!0){this.r=e,this.g=r,this.b=a,this.a=o,d||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,r,a,o]))}static parse(e){if(e instanceof pt)return e;if(typeof e!="string")return;const r=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=Ml[a];if(o){const[p,f,_]=o;return[p/255,f/255,_/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const p=a.length<6?1:2;let f=1;return[Ki(a.slice(f,f+=p)),Ki(a.slice(f,f+=p)),Ki(a.slice(f,f+=p)),Ki(a.slice(f,f+p)||"ff")]}if(a.startsWith("rgb")){const p=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[f,_,x,b,T,A,C,P,D,V,$,X]=p,q=[b||" ",C||" ",V].join("");if(q==="  "||q==="  /"||q===",,"||q===",,,"){const J=[x,A,D].join(""),ie=J==="%%%"?100:J===""?255:0;if(ie){const de=[Cs(+_/ie,0,1),Cs(+T/ie,0,1),Cs(+P/ie,0,1),$?vo(+$,X):1];if(Ps(de))return de}}return}}const d=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[p,f,_,x,b,T,A,C,P]=d,D=[_||" ",b||" ",A].join("");if(D==="  "||D==="  /"||D===",,"||D===",,,"){const V=[+f,Cs(+x,0,100),Cs(+T,0,100),C?vo(+C,P):1];if(Ps(V))return function([$,X,q,J]){function ie(de){const Me=(de+$/30)%12,Le=X*Math.min(q,1-q);return q-Le*Math.max(-1,Math.min(Me-3,9-Me,1))}return $=mt($),X/=100,q/=100,[ie(0),ie(8),ie(4),J]}(V)}}}(e);return r?new pt(...r,!1):void 0}get rgb(){const{r:e,g:r,b:a,a:o}=this,d=o||1/0;return this.overwriteGetter("rgb",[e/d,r/d,a/d,o])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,a,o,d]=nt(e),p=Math.sqrt(a*a+o*o);return[Math.round(1e4*p)?mt(Math.atan2(o,a)*dt):NaN,p,r,d]}(this.rgb))}get lab(){return this.overwriteGetter("lab",nt(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,a,o]=this.rgb;return`rgba(${[e,r,a].map(d=>Math.round(255*d)).join(",")},${o})`}}pt.black=new pt(0,0,0,1),pt.white=new pt(1,1,1,1),pt.transparent=new pt(0,0,0,0),pt.red=new pt(1,0,0,1);class dn{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ia{constructor(e,r,a,o,d){this.text=e,this.image=r,this.scale=a,this.fontStack=o,this.textColor=d}}class hi{constructor(e){this.sections=e}static fromString(e){return new hi([new Ia(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof hi?e:hi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Fi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Fi)return e;if(typeof e=="number")return new Fi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Fi(e)}}toString(){return JSON.stringify(this.values)}}const Cl=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Yi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Yi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r<e.length;r+=2){const a=e[r],o=e[r+1];if(typeof a!="string"||!Cl.has(a)||!Array.isArray(o)||o.length!==2||typeof o[0]!="number"||typeof o[1]!="number")return}return new Yi(e)}}toString(){return JSON.stringify(this.values)}}class ni{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ni({name:e,available:!1}):null}}function Aa(i,e,r,a){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ks(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof pt||i instanceof dn||i instanceof hi||i instanceof Fi||i instanceof Yi||i instanceof ni)return!0;
vendor: 4,137 bytes, line 1
1if(Array.isArray(i)){for(const e of i)if(!ks(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!ks(i[e]))return!1;return!0}return!1}function Mt(i){if(i===null)return Er;if(typeof i=="string")return Ye;if(typeof i=="boolean")return Ze;if(typeof i=="number")return Se;if(i instanceof pt)return yi;if(i instanceof dn)return Mr;if(i instanceof hi)return B;if(i instanceof Fi)return I;if(i instanceof Yi)return k;if(i instanceof ni)return E;if(Array.isArray(i)){const e=i.length;let r;for(const a of i){const o=Mt(a);if(r){if(r===o)continue;r=He;break}r=o}return O(r||He,e)}return fr}function ct(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof pt||i instanceof hi||i instanceof Fi||i instanceof Yi||i instanceof ni?i.toString():JSON.stringify(i)}class ns{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ks(e[1]))return r.error("invalid value");const a=e[1];let o=Mt(a);const d=r.expectedType;return o.kind!=="array"||o.N!==0||!d||d.kind!=="array"||typeof d.N=="number"&&d.N!==0||(o=d),new ns(o,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Dt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Ea={string:Ye,number:Se,boolean:Ze,object:fr};class Ji{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,o=1;const d=e[0];if(d==="array"){let f,_;if(e.length>2){const x=e[1];if(typeof x!="string"||!(x in Ea)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=Ea[x],o++}else f=He;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=e[2],o++}a=O(f,_)}else{if(!Ea[d])throw new Error(`Types doesn't contain name = ${d}`);a=Ea[d]}const p=[];for(;o<e.length;o++){const f=r.parse(e[o],o,He);if(!f)return null;p.push(f)}return new Ji(a,p)}evaluate(e){for(let r=0;r<this.args.length;r++){const a=this.args[r].evaluate(e);if(!Z(this.type,Mt(a)))return a;if(r===this.args.length-1)throw new Dt(`Expected value to be of type ${N(this.type)}, but found ${N(Mt(a))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const pn={"to-boolean":Ze,"to-color":yi,"to-number":Se,"to-string":Ye};class qr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[0];if(!pn[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&e.length!==2)return r.error("Expected one argument.");const o=pn[a],d=[];for(let p=1;p<e.length;p++){const f=r.parse(e[p],p,He);if(!f)return null;d.push(f)}return new qr(o,d)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,a;for(const o of this.args){if(r=o.evaluate(e),a=null,r instanceof pt)return r;if(typeof r=="string"){const d=e.parseColor(r);if(d)return d}else if(Array.isArray(r)&&(a=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Aa(r[0],r[1],r[2],r[3]),!a))return new pt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Dt(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(e);const o=Fi.parse(r);if(o)return o}throw new Dt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(e);const o=Yi.parse(r);if(o)return o}throw new Dt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(e),r===null)return 0;const o=Number(r);
1if(!isNaN(o))return o}throw new Dt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return hi.fromString(ct(this.args[0].evaluate(e)));case"resolvedImage":return ni.fromString(ct(this.args[0].evaluate(e)));default:return ct(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const bo=["Unknown","Point","LineString","Polygon"];class fn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?bo[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 r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=pt.parse(e)),r}}class Ma{constructor(e,r,a=[],o,d=new as,p=[]){this.registry=e,this.path=a,this.key=a.map(f=>`[${f}]`).join(""),this.scope=d,this.errors=p,this.expectedType=o,this._isConstant=r}parse(e,r,a,o,d={}){return r?this.concat(r,a,o)._parse(e,d):this._parse(e,d)}_parse(e,r){function a(o,d,p){return p==="assert"?new Ji(d,[o]):p==="coerce"?new qr(d,[o]):o}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const o=e[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const d=this.registry[o];if(d){let p=d.parse(e,this);if(!p)return null;if(this.expectedType){const f=this.expectedType,_=p.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||_.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||_.kind!=="value"&&_.kind!=="string")if(f.kind!=="padding"||_.kind!=="value"&&_.kind!=="number"&&_.kind!=="array")if(f.kind!=="variableAnchorOffsetCollection"||_.kind!=="value"&&_.kind!=="array"){if(this.checkSubtype(f,_))return null}else p=a(p,f,r.typeAnnotation||"coerce");else p=a(p,f,r.typeAnnotation||"coerce");else p=a(p,f,r.typeAnnotation||"coerce");else p=a(p,f,r.typeAnnotation||"assert")}if(!(p instanceof ns)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){const f=new fn;try{p=new ns(p.type,p.evaluate(f))}catch(_){return this.error(_.message),null}}return p}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,a){const o=typeof e=="number"?this.path.concat(e):this.path,d=a?this.scope.concat(a):this.scope;return new Ma(this.registry,this._isConstant,o,r||null,d,this.errors)}error(e,...r){const a=`${this.key}${r.map(o=>`[${o}]`).join("")}`;this.errors.push(new zt(a,e))}checkSubtype(e,r){const a=Z(e,r);return a&&this.error(a),a}}class Ca{constructor(e,r,a){this.type=Mr,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const a=e[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const o=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Ze);if(!o)return null;const d=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Ze);if(!d)return null;let p=null;return a.locale&&(p=r.parse(a.locale,1,Ye),!p)?null:new Ca(o,d,p)}evaluate(e){return new dn(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}}const Zr=8192;function mn(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function ea(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function wo(i,e){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*Zr),Math.round(a*o*Zr)]}function Pl(i,e,r){const a=i[0]-e[0],o=i[1]-e[1],d=i[0]-r[0],p=i[1]-r[1];return a*p-d*o==0&&a*d<=0&&o*p<=0}function gn(i,e){let r=!1;for(let p=0,f=e.length;p<f;p++){const _=e[p];for(let x=0,b=_.length;x<b-1;x++){if(Pl(i,_[x],_[x+1]))return!1;(o=_[x])[1]>(a=i)[1]!=(d=_[x+1])[1]>a[1]&&a[0]<(d[0]-o[0])*(a[1]-o[1])/(d[1]-o[1])+o[0]&&(r=!r)}}var a,o,d;return r}function _n(i,e){for(let r=0;r<e.length;r++)if(gn(i,e[r]))return!0;return!1}function So(i,e,r,a){const o=a[0]-r[0],d=a[1]-r[1],p=(i[0]-r[0])*d-o*(i[1]-r[1]),f=(e[0]-r[0])*d-o*(e[1]-r[1]);return p>0&&f<0||p<0&&f>0}function kl(i,e,r){for(const x of r)for(let b=0;b<x.length-1;++b)if((f=[(p=x[b+1])[0]-(d=x[b])[0],p[1]-d[1]])[0]*(_=[(o=e)[0]-(a=i)[0],o[1]-a[1]])[1]-f[1]*_[0]!=0&&So(a,o,d,p)&&So(d,p,a,o))return!0;var a,o,d,p,f,_;return!1}function To(i,e){for(let r=0;r<i.length;++r)if(!gn(i[r],e))return!1;for(let r=0;r<i.length-1;++r)if(kl(i[r],i[r+1],e))return!1;return!0}function Io(i,e){for(let r=0;r<e.length;r++)if(To(i,e[r]))return!0;return!1}function Pa(i,e,r){const a=[];for(let o=0;o<i.length;o++){const d=[];for(let p=0;p<i[o].length;p++){const f=wo(i[o][p],r);mn(e,f),d.push(f)}a.push(d)}return a}function Ao(i,e,r){const a=[];for(let o=0;o<i.length;o++){const d=Pa(i[o],e,r);a.push(d)}return a}function Eo(i,e,r,a){if(i[0]<r[0]||i[0]>r[2]){const o=.5*a;let d=i[0]-r[0]>o?-a:r[0]-i[0]>o?a:0;
1d===0&&(d=i[0]-r[2]>o?-a:r[2]-i[0]>o?a:0),i[0]+=d}mn(e,i)}function yn(i,e,r,a){const o=Math.pow(2,a.z)*Zr,d=[a.x*Zr,a.y*Zr],p=[];for(const f of i)for(const _ of f){const x=[_.x+d[0],_.y+d[1]];Eo(x,e,r,o),p.push(x)}return p}function xn(i,e,r,a){const o=Math.pow(2,a.z)*Zr,d=[a.x*Zr,a.y*Zr],p=[];for(const _ of i){const x=[];for(const b of _){const T=[b.x+d[0],b.y+d[1]];mn(e,T),x.push(T)}p.push(x)}if(e[2]-e[0]<=o/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const _ of p)for(const x of _)Eo(x,e,r,o)}var f;return p}class os{constructor(e,r){this.type=Ze,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ks(e[1])){const a=e[1];if(a.type==="FeatureCollection")for(let o=0;o<a.features.length;++o){const d=a.features[o].geometry.type;if(d==="Polygon"||d==="MultiPolygon")return new os(a,a.features[o].geometry)}else if(a.type==="Feature"){const o=a.geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new os(a,a.geometry)}else if(a.type==="Polygon"||a.type==="MultiPolygon")return new os(a,a)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(r,a){const o=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if(a.type==="Polygon"){const f=Pa(a.coordinates,d,p),_=yn(r.geometry(),o,d,p);if(!ea(o,d))return!1;for(const x of _)if(!gn(x,f))return!1}if(a.type==="MultiPolygon"){const f=Ao(a.coordinates,d,p),_=yn(r.geometry(),o,d,p);if(!ea(o,d))return!1;for(const x of _)if(!_n(x,f))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(r,a){const o=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if(a.type==="Polygon"){const f=Pa(a.coordinates,d,p),_=xn(r.geometry(),o,d,p);if(!ea(o,d))return!1;for(const x of _)if(!To(x,f))return!1}if(a.type==="MultiPolygon"){const f=Ao(a.coordinates,d,p),_=xn(r.geometry(),o,d,p);if(!ea(o,d))return!1;for(const x of _)if(!Io(x,f))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class ka{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");const a=e[1];return r.scope.has(a)?new ka(a,r.scope.get(a)):r.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Qi{constructor(e,r,a,o){this.name=e,this.type=r,this._evaluate=a,this.args=o}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const a=e[0],o=Qi.definitions[a];if(!o)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const d=Array.isArray(o)?o[0]:o.type,p=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,f=p.filter(([x])=>!Array.isArray(x)||x.length===e.length-1);let _=null;for(const[x,b]of f){_=new Ma(r.registry,za,r.path,null,r.scope);const T=[];let A=!1;for(let C=1;C<e.length;C++){const P=e[C],D=Array.isArray(x)?x[C-1]:x.type,V=_.parse(P,1+T.length,D);if(!V){A=!0;break}T.push(V)}if(!A)if(Array.isArray(x)&&x.length!==T.length)_.error(`Expected ${x.length} arguments, but found ${T.length} instead.`);else{for(let C=0;C<T.length;C++){const P=Array.isArray(x)?x[C]:x.type,D=T[C];_.concat(C+1).checkSubtype(P,D.type)}if(_.errors.length===0)return new Qi(a,d,b,T)}}if(f.length===1)r.errors.push(..._.errors);else{const x=(f.length?f:p).map(([T])=>{return A=T,Array.isArray(A)?`(${A.map(N).join(", ")})`:`(${N(A.type)}...)`;var A}).join(" | "),b=[];for(let T=1;T<e.length;T++){const A=r.parse(e[T],1+b.length);if(!A)return null;b.push(N(A.type))}r.error(`Expected arguments of type ${x}, but found (${b.join(", ")}) instead.`)}return null}static register(e,r){Qi.definitions=r;for(const a in r)e[a]=Qi}}function za(i){if(i instanceof ka)return za(i.boundExpression);if(i instanceof Qi&&i.name==="error"||i instanceof Ca||i instanceof os)return!1;const e=i instanceof qr||i instanceof Ji;let r=!0;return i.eachChild(a=>{r=e?r&&za(a):r&&a instanceof ns}),!!r&&Da(i)&&La(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}
1function Da(i){if(i instanceof Qi&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof os)return!1;let e=!0;return i.eachChild(r=>{e&&!Da(r)&&(e=!1)}),e}function ta(i){if(i instanceof Qi&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(r=>{e&&!ta(r)&&(e=!1)}),e}function La(i,e){if(i instanceof Qi&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!La(a,e)&&(r=!1)}),r}function zs(i,e){const r=i.length-1;let a,o,d=0,p=r,f=0;for(;d<=p;)if(f=Math.floor((d+p)/2),a=i[f],o=i[f+1],a<=e){if(f===r||e<o)return f;d=f+1}else{if(!(a>e))throw new Dt("Input is not a number.");p=f-1}return 0}class Gr{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[o,d]of a)this.labels.push(o),this.outputs.push(d)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(e[1],1,Se);if(!a)return null;const o=[];let d=null;r.expectedType&&r.expectedType.kind!=="value"&&(d=r.expectedType);for(let p=1;p<e.length;p+=2){const f=p===1?-1/0:e[p],_=e[p+1],x=p,b=p+1;if(typeof f!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(o.length&&o[o.length-1][0]>=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const T=r.parse(_,b,d);if(!T)return null;d=d||T.type,o.push([f,T])}return new Gr(d,a,o)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const d=r.length;return o>=r[d-1]?a[d-1].evaluate(e):a[zs(r,o)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function rt(i,e,r){return i+r*(e-i)}function Ra(i,e,r){return i.map((a,o)=>rt(a,e[o],r))}const Oi={number:rt,color:function(i,e,r,a="rgb"){switch(a){case"rgb":{const[o,d,p,f]=Ra(i.rgb,e.rgb,r);return new pt(o,d,p,f,!1)}case"hcl":{const[o,d,p,f]=i.hcl,[_,x,b,T]=e.hcl;let A,C;if(isNaN(o)||isNaN(_))isNaN(o)?isNaN(_)?A=NaN:(A=_,p!==1&&p!==0||(C=x)):(A=o,b!==1&&b!==0||(C=d));else{let X=_-o;_>o&&X>180?X-=360:_<o&&o-_>180&&(X+=360),A=o+r*X}const[P,D,V,$]=function([X,q,J,ie]){return X=isNaN(X)?0:X*Ge,xt([J,Math.cos(X)*q,Math.sin(X)*q,ie])}([A,C??rt(d,x,r),rt(p,b,r),rt(f,T,r)]);return new pt(P,D,V,$,!1)}case"lab":{const[o,d,p,f]=xt(Ra(i.lab,e.lab,r));return new pt(o,d,p,f,!1)}}},array:Ra,padding:function(i,e,r){return new Fi(Ra(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const a=i.values,o=e.values;if(a.length!==o.length)throw new Dt(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const d=[];for(let p=0;p<a.length;p+=2){if(a[p]!==o[p])throw new Dt(`Cannot interpolate values containing mismatched anchors. from[${p}]: ${a[p]}, to[${p}]: ${o[p]}`);d.push(a[p]);const[f,_]=a[p+1],[x,b]=o[p+1];d.push([rt(f,x,r),rt(_,b,r)])}return new Yi(d)}};class Vi{constructor(e,r,a,o,d){this.type=e,this.operator=r,this.interpolation=a,this.input=o,this.labels=[],this.outputs=[];for(const[p,f]of d)this.labels.push(p),this.outputs.push(f)}static interpolationFactor(e,r,a,o){let d=0;if(e.name==="exponential")d=vn(r,e.base,a,o);else if(e.name==="linear")d=vn(r,1,a,o);else if(e.name==="cubic-bezier"){const p=e.controlPoints;d=new Sr(p[0],p[1],p[2],p[3]).solve(vn(r,1,a,o))}return d}static parse(e,r){let[a,o,d,...p]=e;if(!Array.isArray(o)||o.length===0)return r.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){const x=o[1];if(typeof x!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:x}}else{if(o[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const x=o.slice(1);if(x.length!==4||x.some(b=>typeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:x}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(d=r.parse(d,2,Se),!d)return null;const f=[];let _=null;a==="interpolate-hcl"||a==="interpolate-lab"?_=yi:r.expectedType&&r.expectedType.kind!=="value"&&(_=r.expectedType);for(let x=0;x<p.length;x+=2){const b=p[x],T=p[x+1],A=x+3,C=x+4;if(typeof b!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not c
1omputed expressions) for the input values.',A);if(f.length&&f[f.length-1][0]>=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',A);const P=r.parse(T,C,_);if(!P)return null;_=_||P.type,f.push([b,P])}return ce(_,Se)||ce(_,yi)||ce(_,I)||ce(_,k)||ce(_,O(Se))?new Vi(_,a,o,d,f):r.error(`Type ${N(_)} is not interpolatable.`)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const d=r.length;if(o>=r[d-1])return a[d-1].evaluate(e);const p=zs(r,o),f=Vi.interpolationFactor(this.interpolation,o,r[p],r[p+1]),_=a[p].evaluate(e),x=a[p+1].evaluate(e);switch(this.operator){case"interpolate":return Oi[this.type.kind](_,x,f);case"interpolate-hcl":return Oi.color(_,x,f,"hcl");case"interpolate-lab":return Oi.color(_,x,f,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function vn(i,e,r,a){const o=a-r,d=i-r;return o===0?0:e===1?d/o:(Math.pow(e,d)-1)/(Math.pow(e,o)-1)}class Ba{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let a=null;const o=r.expectedType;o&&o.kind!=="value"&&(a=o);const d=[];for(const f of e.slice(1)){const _=r.parse(f,1+d.length,a,void 0,{typeAnnotation:"omit"});if(!_)return null;a=a||_.type,d.push(_)}if(!a)throw new Error("No output type");const p=o&&d.some(f=>Z(o,f.type));return new Ba(p?He:a,d)}evaluate(e){let r,a=null,o=0;for(const d of this.args)if(o++,a=d.evaluate(e),a&&a instanceof ni&&!a.available&&(r||(r=a.name),a=null,o===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Fa{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let d=1;d<e.length-1;d+=2){const p=e[d];if(typeof p!="string")return r.error(`Expected string, but found ${typeof p} instead.`,d);if(/[^a-zA-Z0-9_]/.test(p))return r.error("Variable names must contain only alphanumeric characters or '_'.",d);const f=r.parse(e[d+1],d+1);if(!f)return null;a.push([p,f])}const o=r.parse(e[e.length-1],e.length-1,r.expectedType,a);return o?new Fa(a,o):null}outputDefined(){return this.result.outputDefined()}}class bn{constructor(e,r,a){this.type=e,this.index=r,this.input=a}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Se),o=r.parse(e[2],2,O(r.expectedType||He));return a&&o?new bn(o.type.itemType,a,o):null}evaluate(e){const r=this.index.evaluate(e),a=this.input.evaluate(e);if(r<0)throw new Dt(`Array index out of bounds: ${r} < 0.`);if(r>=a.length)throw new Dt(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new Dt(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class wn{constructor(e,r){this.type=Ze,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,He),o=r.parse(e[2],2,He);return a&&o?j(a.type,[Ze,Ye,Se,Er,He])?new wn(a,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(a.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!H(r,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${N(Mt(r))} instead.`);if(!H(a,["string","array"]))throw new Dt(`Expected second argument to be of type array or string, but found ${N(Mt(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Oa{constructor(e,r,a){this.type=Se,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,He),o=r.parse(e[2],2,He);if(!a||!o)return null;if(!j(a.type,[Ze,Ye,Se,Er,He]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(a.type)} instead`);if(e.length===4){const d=r.parse(e[3],3,Se);return d?new Oa(a,o,d):null}return new Oa(a,o)}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!H(r,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${N(Mt(r))} instead.`);if(!H(a,["string","array"]))throw new Dt(`Expected second argument to be of type array or string, but found ${N(Mt(a))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(e);return a.indexOf(r,o)}return a.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Sn{constructor(e,r,a,o,d,p){this.inputType=e,this.type=r,this.input=a,this.cases=o,this.outputs=d,this.otherwise=p}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const d={},p=[];for(let x=2;x<e.length-1;x+=2){let b=e[x];const T=e[x+1];Array.isArray(b)||(b=[b]);const A=r.concat(x);if(b.length===0)return A.error("Expected at least one branch label.");for(const P of b){if(typeof P!="number"&&typeof P!="string")return A.error("Branch labels must be numbers or strings.");if(typeof P=="number"&&Math.abs(P)>Number.MAX_SAFE_INTEGER)return A.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof P=="number"&&Math.floor(P)!==P)return A.error("Numeric branch labels must be integer values.");if(a){if(A.checkSubtype(a,Mt(P)))return null}else a=Mt(P);
vendor: 33,207 bytes, line 1
1if(d[String(P)]!==void 0)return A.error("Branch labels must be unique.");d[String(P)]=p.length}const C=r.parse(T,x,o);if(!C)return null;o=o||C.type,p.push(C)}const f=r.parse(e[1],1,He);if(!f)return null;const _=r.parse(e[e.length-1],e.length-1,o);return _?f.type.kind!=="value"&&r.concat(1).checkSubtype(a,f.type)?null:new Sn(a,o,f,d,p,_):null}evaluate(e){const r=this.input.evaluate(e);return(Mt(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class Tn{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const o=[];for(let p=1;p<e.length-1;p+=2){const f=r.parse(e[p],p,Ze);if(!f)return null;const _=r.parse(e[p+1],p+1,a);if(!_)return null;o.push([f,_]),a=a||_.type}const d=r.parse(e[e.length-1],e.length-1,a);if(!d)return null;if(!a)throw new Error("Can't infer output type");return new Tn(a,o,d)}evaluate(e){for(const[r,a]of this.branches)if(r.evaluate(e))return a.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,a]of this.branches)e(r),e(a);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}}class Va{constructor(e,r,a,o){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,He),o=r.parse(e[2],2,Se);if(!a||!o)return null;if(!j(a.type,[O(He),Ye,He]))return r.error(`Expected first argument to be of type array or string, but found ${N(a.type)} instead`);if(e.length===4){const d=r.parse(e[3],3,Se);return d?new Va(a.type,a,o,d):null}return new Va(a.type,a,o)}evaluate(e){const r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!H(r,["string","array"]))throw new Dt(`Expected first argument to be of type array or string, but found ${N(Mt(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(e);return r.slice(a,o)}return r.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Mo(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Co(i,e,r,a){return a.compare(e,r)===0}function Ds(i,e,r){const a=i!=="=="&&i!=="!=";return class Mh{constructor(d,p,f){this.type=Ze,this.lhs=d,this.rhs=p,this.collator=f,this.hasUntypedArgument=d.type.kind==="value"||p.type.kind==="value"}static parse(d,p){if(d.length!==3&&d.length!==4)return p.error("Expected two or three arguments.");const f=d[0];let _=p.parse(d[1],1,He);if(!_)return null;if(!Mo(f,_.type))return p.concat(1).error(`"${f}" comparisons are not supported for type '${N(_.type)}'.`);let x=p.parse(d[2],2,He);if(!x)return null;if(!Mo(f,x.type))return p.concat(2).error(`"${f}" comparisons are not supported for type '${N(x.type)}'.`);if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return p.error(`Cannot compare types '${N(_.type)}' and '${N(x.type)}'.`);a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Ji(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Ji(_.type,[x])));let b=null;if(d.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(b=p.parse(d[3],3,Mr),!b)return null}return new Mh(_,x,b)}evaluate(d){const p=this.lhs.evaluate(d),f=this.rhs.evaluate(d);if(a&&this.hasUntypedArgument){const _=Mt(p),x=Mt(f);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new Dt(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const _=Mt(p),x=Mt(f);if(_.kind!=="string"||x.kind!=="string")return e(d,p,f)}return this.collator?r(d,p,f,this.collator.evaluate(d)):e(d,p,f)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}const zl=Ds("==",function(i,e,r){return e===r},Co),Dl=Ds("!=",function(i,e,r){return e!==r},function(i,e,r,a){return!Co(0,e,r,a)}),Ll=Ds("<",function(i,e,r){return e<r},function(i,e,r,a){return a.compare(e,r)<0}),Rl=Ds(">",function(i,e,r){return e>r},function(i,e,r,a){return a.compare(e,r)>0}),Bl=Ds("<=",function(i,e,r){return e<=r},function(i,e,r,a){return a.compare(e,r)<=0}),Fl=Ds(">=",function(i,e,r){return e>=r},function(i,e,r,a){return a.compare(e,r)>=0});class In{constructor(e,r,a,o,d){this.type=Ye,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=o,this.maxFractionDigits=d}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const a=r.parse(e[1],1,Se);if(!a)return null;const o=e[2];if(typeof o!="object"||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let d=null;if(o.locale&&(d=r.parse(o.locale,1,Ye),!d))return null;let p=null;if(o.currency&&(p=r.parse(o.currency,1,Ye),!p))return null;let f=null;if(o["min-fraction-digits"]&&(f=r.parse(o["min-fraction-digits"],1,Se),!f))return null;let _=null;return o["max-fraction-digits"]&&(_=r.parse(o["max-fraction-digits"],1,Se),!_)?null:new In(a,d,p,f,_)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Na{constructor(e){this.type=B,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const o=[];let d=!1;for(let p=1;p<=e.length-1;++p){const f=e[p];if(d&&typeof f=="object"&&!Array.isArray(f)){d=!1;let _=null;if(f["font-scale"]&&(_=r.parse(f["font-scale"],1,Se),!_))return null;let x=null;if(f["text-font"]&&(x=r.parse(f["text-font"],1,O(Ye)),!x))return null;let b=null;if(f["text-color"]&&(b=r.parse(f["text-color"],1,yi),!b))return null;const T=o[o.length-1];T.scale=_,T.font=x,T.textColor=b}else{const _=r.parse(e[p],1,He);if(!_)return null;const x=_.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,o.push({content:_,scale:null,font:null,textColor:null})}}return new Na(o)}evaluate(e){return new hi(this.sections.map(r=>{const a=r.content.evaluate(e);return Mt(a)===E?new Ia("",a,null,null,null):new Ia(ct(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class An{constructor(e){this.type=E,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const a=r.parse(e[1],1,Ye);return a?new An(a):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),a=ni.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class En{constructor(e){this.type=Se,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${N(a.type)} instead.`):new En(a):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Dt(`Expected value to be of type string or array, but found ${N(Mt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Ls={"==":zl,"!=":Dl,">":Rl,"<":Ll,">=":Fl,"<=":Bl,array:Ji,at:bn,boolean:Ji,case:Tn,coalesce:Ba,collator:Ca,format:Na,image:An,in:wn,"index-of":Oa,interpolate:Vi,"interpolate-hcl":Vi,"interpolate-lab":Vi,length:En,let:Fa,literal:ns,match:Sn,number:Ji,"number-format":In,object:Ji,slice:Va,step:Gr,string:Ji,"to-boolean":qr,"to-color":qr,"to-number":qr,"to-string":qr,var:ka,within:os};function Po(i,[e,r,a,o]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const d=o?o.evaluate(i):1,p=Aa(e,r,a,d);if(p)throw new Dt(p);return new pt(e/255,r/255,a/255,d,!1)}function ko(i,e){return i in e}function Mn(i,e){const r=e[i];return r===void 0?null:r}function ls(i){return{type:i}}function zo(i){return{result:"success",value:i}}function Wr(i){return{result:"error",value:i}}function Rs(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Do(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Cn(i){return!!i.expression&&i.expression.interpolated}function ut(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Ct(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Ol(i){return i}function st(i,e){const r=e.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",o=a||!(a||i.property!==void 0),d=i.type||(Cn(e)?"exponential":"interval");if(r||e.type==="padding"){const b=r?pt.parse:Fi.parse;(i=pr({},i)).stops&&(i.stops=i.stops.map(T=>[T[0],b(T[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(p=i.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var p;let f,_,x;if(d==="exponential")f=ia;else if(d==="interval")f=It;else if(d==="categorical"){f=Pt,_=Object.create(null);for(const b of i.stops)_[b[0]]=b[1];x=typeof i.stops[0][0]}else{if(d!=="identity")throw new Error(`Unknown function type "${d}"`);f=Lo}if(a){const b={},T=[];for(let P=0;P<i.stops.length;P++){const D=i.stops[P],V=D[0].zoom;b[V]===void 0&&(b[V]={zoom:V,type:i.type,property:i.property,default:i.default,stops:[]},T.push(V)),b[V].stops.push([D[0].value,D[1]])}const A=[];for(const P of T)A.push([b[P].zoom,st(b[P],e)]);const C={name:"linear"};return{kind:"composite",interpolationType:C,interpolationFactor:Vi.interpolationFactor.bind(void 0,C),zoomStops:A.map(P=>P[0]),evaluate:({zoom:P},D)=>ia({stops:A,base:i.base},e,P).evaluate(P,D)}}if(o){const b=d==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:Vi.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(T=>T[0]),evaluate:({zoom:T})=>f(i,e,T,_,x)}}return{kind:"source",evaluate(b,T){const A=T&&T.properties?T.properties[i.property]:void 0;return A===void 0?cs(i.default,e.default):f(i,e,A,_,x)}}}function cs(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Pt(i,e,r,a,o){return cs(typeof r===o?a[r]:void 0,i.default,e.default)}function It(i,e,r){if(ut(r)!=="number")return cs(i.default,e.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const o=zs(i.stops.map(d=>d[0]),r);return i.stops[o][1]}function ia(i,e,r){const a=i.base!==void 0?i.base:1;if(ut(r)!=="number")return cs(i.default,e.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const d=zs(i.stops.map(b=>b[0]),r),p=function(b,T,A,C){const P=C-A,D=b-A;return P===0?0:T===1?D/P:(Math.pow(T,D)-1)/(Math.pow(T,P)-1)}(r,a,i.stops[d][0],i.stops[d+1][0]),f=i.stops[d][1],_=i.stops[d+1][1],x=Oi[e.type]||Ol;return typeof f.evaluate=="function"?{evaluate(...b){const T=f.evaluate.apply(void 0,b),A=_.evaluate.apply(void 0,b);if(T!==void 0&&A!==void 0)return x(T,A,p,i.colorSpace)}}:x(f,_,p,i.colorSpace)}function Lo(i,e,r){switch(e.type){case"color":r=pt.parse(r);break;case"formatted":r=hi.fromString(r.toString());break;case"resolvedImage":r=ni.fromString(r.toString());break;case"padding":r=Fi.parse(r);break;default:ut(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return cs(r,i.default,e.default)}Qi.register(Ls,{error:[{kind:"error"},[Ye],(i,[e])=>{throw new Dt(e.evaluate(i))}],typeof:[Ye,[He],(i,[e])=>N(Mt(e.evaluate(i)))],"to-rgba":[O(Se,4),[yi],(i,[e])=>{const[r,a,o,d]=e.evaluate(i).rgb;return[255*r,255*a,255*o,d]}],rgb:[yi,[Se,Se,Se],Po],rgba:[yi,[Se,Se,Se,Se],Po],has:{type:Ze,overloads:[[[Ye],(i,[e])=>ko(e.evaluate(i),i.properties())],[[Ye,fr],(i,[e,r])=>ko(e.evaluate(i),r.evaluate(i))]]},get:{type:He,overloads:[[[Ye],(i,[e])=>Mn(e.evaluate(i),i.properties())],[[Ye,fr],(i,[e,r])=>Mn(e.evaluate(i),r.evaluate(i))]]},"feature-state":[He,[Ye],(i,[e])=>Mn(e.evaluate(i),i.featureState||{})],properties:[fr,[],i=>i.properties()],"geometry-type":[Ye,[],i=>i.geometryType()],id:[He,[],i=>i.id()],zoom:[Se,[],i=>i.globals.zoom],"heatmap-density":[Se,[],i=>i.globals.heatmapDensity||0],"line-progress":[Se,[],i=>i.globals.lineProgress||0],accumulated:[He,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Se,ls(Se),(i,e)=>{let r=0;for(const a of e)r+=a.evaluate(i);return r}],"*":[Se,ls(Se),(i,e)=>{let r=1;for(const a of e)r*=a.evaluate(i);return r}],"-":{type:Se,overloads:[[[Se,Se],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Se],(i,[e])=>-e.evaluate(i)]]},"/":[Se,[Se,Se],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Se,[Se,Se],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Se,[],()=>Math.LN2],pi:[Se,[],()=>Math.PI],e:[Se,[],()=>Math.E],"^":[Se,[Se,Se],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Se,[Se],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))],log2:[Se,[Se],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Se,[Se],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Se,[Se],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Se,[Se],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Se,[Se],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Se,[Se],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Se,[Se],(i,[e])=>Math.atan(e.evaluate(i))],min:[Se,ls(Se),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[Se,ls(Se),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[Se,[Se],(i,[e])=>Math.abs(e.evaluate(i))],round:[Se,[Se],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Se,[Se],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Se,[Se],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ze,[Ye,He],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ze,[He],(i,[e])=>i.id()===e.value],"filter-type-==":[Ze,[Ye],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ze,[Ye,He],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<o}],"filter-id-<":[Ze,[He],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<a}],"filter->":[Ze,[Ye,He],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>o}],"filter-id->":[Ze,[He],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[Ze,[Ye,He],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[Ze,[He],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[Ze,[Ye,He],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[Ze,[He],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[Ze,[He],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ze,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ze,[O(Ye)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ze,[O(He)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ze,[Ye,O(He)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ze,[Ye,O(He)],(i,[e,r])=>function(a,o,d,p){for(;d<=p;){const f=d+p>>1;if(o[f]===a)return!0;o[f]>a?p=f-1:d=f+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Ze,overloads:[[[Ze,Ze],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[ls(Ze),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ze,overloads:[[[Ze,Ze],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[ls(Ze),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ze,[Ze],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ze,[Ye],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Ye,[Ye],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Ye,[Ye],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Ye,ls(He),(i,e)=>e.map(r=>ct(r.evaluate(i))).join("")],"resolved-locale":[Ye,[Mr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Pn{constructor(e,r){var a;this.expression=e,this._warningHistory={},this._evaluator=new fn,this._defaultValue=r?(a=r).type==="color"&&Ct(a.default)?new pt(0,0,0,0):a.type==="color"?pt.parse(a.default)||null:a.type==="padding"?Fi.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?Yi.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,a,o,d,p){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=o,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(e,r,a,o,d,p){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=o,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new Dt(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function Ua(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Ls}function $a(i,e){const r=new Ma(Ls,za,[],e?function(o){const d={color:yi,string:Ye,number:Se,enum:Ye,boolean:Ze,formatted:B,padding:I,resolvedImage:E,variableAnchorOffsetCollection:k};return o.type==="array"?O(d[o.value]||He,o.length):d[o.type]}(e):void 0),a=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?zo(new Pn(a,e)):Wr(r.errors)}class kn{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!ta(r.expression)}evaluateWithoutErrorHandling(e,r,a,o,d,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,d,p)}evaluate(e,r,a,o,d,p){return this._styleExpression.evaluate(e,r,a,o,d,p)}}class ja{constructor(e,r,a,o){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!ta(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(e,r,a,o,d,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,d,p)}evaluate(e,r,a,o,d,p){return this._styleExpression.evaluate(e,r,a,o,d,p)}interpolationFactor(e,r,a){return this.interpolationType?Vi.interpolationFactor(this.interpolationType,e,r,a):0}}function zn(i,e){const r=$a(i,e);if(r.result==="error")return r;const a=r.value.expression,o=Da(a);if(!o&&!Rs(e))return Wr([new zt("","data expressions not supported")]);const d=La(a,["zoom"]);if(!d&&!Do(e))return Wr([new zt("","zoom expressions not supported")]);const p=sa(a);return p||d?p instanceof zt?Wr([p]):p instanceof Vi&&!Cn(e)?Wr([new zt("",'"interpolate" expressions cannot be used with this property')]):zo(p?new ja(o?"camera":"composite",r.value,p.labels,p instanceof Vi?p.interpolation:void 0):new kn(o?"constant":"source",r.value)):Wr([new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ra{constructor(e,r){this._parameters=e,this._specification=r,pr(this,st(this._parameters,this._specification))}static deserialize(e){return new ra(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function sa(i){let e=null;if(i instanceof Fa)e=sa(i.result);else if(i instanceof Ba){for(const r of i.args)if(e=sa(r),e)break}else(i instanceof Gr||i instanceof Vi)&&i.input instanceof Qi&&i.input.name==="zoom"&&(e=i);return e instanceof zt||i.eachChild(r=>{const a=sa(r);a instanceof zt?e=a:!e&&a?e=new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new zt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function aa(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!aa(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Vl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Dn(i){if(i==null)return{filter:()=>!0,needGeometry:!1};aa(i)||(i=qa(i));const e=$a(i,Vl);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,o)=>e.value.evaluate(r,a,{},o),needGeometry:Ro(i)}}function Nl(i,e){return i<e?-1:i>e?1:0}function Ro(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(Ro(i[e]))return!0;return!1}function qa(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?Ln(i[1],i[2],"=="):e==="!="?na(Ln(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Ln(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(qa))):e==="all"?["all"].concat(i.slice(1).map(qa)):e==="none"?["all"].concat(i.slice(1).map(qa).map(na)):e==="in"?Bo(i[1],i.slice(2)):e==="!in"?na(Bo(i[1],i.slice(2))):e==="has"?Fo(i[1]):e==="!has"?na(Fo(i[1])):e!=="within"||i;var r}function Ln(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function Bo(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(Nl)]]:["filter-in-small",i,["literal",e]]}}function Fo(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function na(i){return["!",i]}function Za(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let o="[";for(const d of i)o+=`${Za(d)},`;return`${o}]`}const r=Object.keys(i).sort();let a="{";for(let o=0;o<r.length;o++)a+=`${JSON.stringify(r[o])}:${Za(i[r[o]])},`;return`${a}}`}function Ga(i){let e="";for(const r of Ei)e+=`/${Za(i[r])}`;return e}function Oo(i){const e=i.value;return e?[new be(i.key,e,"constants have been deprecated as of v8")]:[]}function Lt(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function us(i){if(Array.isArray(i))return i.map(us);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=us(i[r]);return e}return Lt(i)}function Mi(i){const e=i.key,r=i.value,a=i.valueSpec||{},o=i.objectElementValidators||{},d=i.style,p=i.styleSpec,f=i.validateSpec;let _=[];const x=ut(r);if(x!=="object")return[new be(e,r,`object expected, ${x} found`)];for(const b in r){const T=b.split(".")[0],A=a[T]||a["*"];let C;if(o[T])C=o[T];else if(a[T])C=f;else if(o["*"])C=o["*"];else{if(!a["*"]){_.push(new be(e,r[b],`unknown property "${b}"`));continue}C=f}_=_.concat(C({key:(e&&`${e}.`)+b,value:r[b],valueSpec:A,style:d,styleSpec:p,object:r,objectKey:b,validateSpec:f},r))}for(const b in a)o[b]||a[b].required&&a[b].default===void 0&&r[b]===void 0&&_.push(new be(e,r,`missing required property "${b}"`));return _}function Bs(i){const e=i.value,r=i.valueSpec,a=i.style,o=i.styleSpec,d=i.key,p=i.arrayElementValidator||i.validateSpec;if(ut(e)!=="array")return[new be(d,e,`array expected, ${ut(e)} found`)];if(r.length&&e.length!==r.length)return[new be(d,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new be(d,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let f={type:r.value,values:r.values};o.$version<7&&(f.function=r.function),ut(r.value)==="object"&&(f=r.value);let _=[];for(let x=0;x<e.length;x++)_=_.concat(p({array:e,arrayIndex:x,value:e[x],valueSpec:f,validateSpec:i.validateSpec,style:a,styleSpec:o,key:`${d}[${x}]`}));return _}function oa(i){const e=i.key,r=i.value,a=i.valueSpec;let o=ut(r);return o==="number"&&r!=r&&(o="NaN"),o!=="number"?[new be(e,r,`number expected, ${o} found`)]:"minimum"in a&&r<a.minimum?[new be(e,r,`${r} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&r>a.maximum?[new be(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function Wa(i){const e=i.valueSpec,r=Lt(i.value.type);let a,o,d,p={};const f=r!=="categorical"&&i.value.property===void 0,_=!f,x=ut(i.value.stops)==="array"&&ut(i.value.stops[0])==="array"&&ut(i.value.stops[0][0])==="object",b=Mi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new be(C.key,C.value,'identity function may not have a "stops" property')];let P=[];const D=C.value;return P=P.concat(Bs({key:C.key,value:D,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:T})),ut(D)==="array"&&D.length===0&&P.push(new be(C.key,D,"array must have at least one stop")),P},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&f&&b.push(new be(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||b.push(new be(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Cn(i.valueSpec)&&b.push(new be(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!Rs(i.valueSpec)?b.push(new be(i.key,i.value,"property functions not supported")):f&&!Do(i.valueSpec)&&b.push(new be(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!x||i.value.property!==void 0||b.push(new be(i.key,i.value,'"property" property is required')),b;function T(C){let P=[];const D=C.value,V=C.key;if(ut(D)!=="array")return[new be(V,D,`array expected, ${ut(D)} found`)];if(D.length!==2)return[new be(V,D,`array length 2 expected, length ${D.length} found`)];if(x){if(ut(D[0])!=="object")return[new be(V,D,`object expected, ${ut(D[0])} found`)];if(D[0].zoom===void 0)return[new be(V,D,"object stop key must have zoom")];if(D[0].value===void 0)return[new be(V,D,"object stop key must have value")];if(d&&d>Lt(D[0].zoom))return[new be(V,D[0].zoom,"stop zoom values must appear in ascending order")];Lt(D[0].zoom)!==d&&(d=Lt(D[0].zoom),o=void 0,p={}),P=P.concat(Mi({key:`${V}[0]`,value:D[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:oa,value:A}}))}else P=P.concat(A({key:`${V}[0]`,value:D[0],validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},D));return Ua(us(D[1]))?P.concat([new be(`${V}[1]`,D[1],"expressions are not allowed in function stops.")]):P.concat(C.validateSpec({key:`${V}[1]`,value:D[1],valueSpec:e,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function A(C,P){const D=ut(C.value),V=Lt(C.value),$=C.value!==null?C.value:P;if(a){if(D!==a)return[new be(C.key,$,`${D} stop domain type must match previous stop domain type ${a}`)]}else a=D;if(D!=="number"&&D!=="string"&&D!=="boolean")return[new be(C.key,$,"stop domain value must be a number, string, or boolean")];if(D!=="number"&&r!=="categorical"){let X=`number expected, ${D} found`;return Rs(e)&&r===void 0&&(X+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new be(C.key,$,X)]}return r!=="categorical"||D!=="number"||isFinite(V)&&Math.floor(V)===V?r!=="categorical"&&D==="number"&&o!==void 0&&V<o?[new be(C.key,$,"stop domain values must appear in ascending order")]:(o=V,r==="categorical"&&V in p?[new be(C.key,$,"stop domain values must be unique")]:(p[V]=!0,[])):[new be(C.key,$,`integer expected, found ${V}`)]}}function hs(i){const e=(i.expressionContext==="property"?zn:$a)(us(i.value),i.valueSpec);if(e.result==="error")return e.value.map(a=>new be(`${i.key}${a.key}`,i.value,a.message));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new be(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!ta(r))return[new be(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!ta(r))return[new be(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!La(r,["zoom","feature-state"]))return[new be(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Da(r))return[new be(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function la(i){const e=i.key,r=i.value,a=i.valueSpec,o=[];return Array.isArray(a.values)?a.values.indexOf(Lt(r))===-1&&o.push(new be(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(Lt(r))===-1&&o.push(new be(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function Fs(i){return aa(us(i.value))?hs(pr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Vo(i)}function Vo(i){const e=i.value,r=i.key;if(ut(e)!=="array")return[new be(r,e,`array expected, ${ut(e)} found`)];const a=i.styleSpec;let o,d=[];if(e.length<1)return[new be(r,e,"filter array must have at least 1 element")];switch(d=d.concat(la({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),Lt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Lt(e[1])==="$type"&&d.push(new be(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&d.push(new be(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=ut(e[1]),o!=="string"&&d.push(new be(`${r}[1]`,e[1],`string expected, ${o} found`)));for(let p=2;p<e.length;p++)o=ut(e[p]),Lt(e[1])==="$type"?d=d.concat(la({key:`${r}[${p}]`,value:e[p],valueSpec:a.geometry_type,style:i.style,styleSpec:i.styleSpec})):o!=="string"&&o!=="number"&&o!=="boolean"&&d.push(new be(`${r}[${p}]`,e[p],`string, number, or boolean expected, ${o} found`));break;case"any":case"all":case"none":for(let p=1;p<e.length;p++)d=d.concat(Vo({key:`${r}[${p}]`,value:e[p],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":o=ut(e[1]),e.length!==2?d.push(new be(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):o!=="string"&&d.push(new be(`${r}[1]`,e[1],`string expected, ${o} found`));break;case"within":o=ut(e[1]),e.length!==2?d.push(new be(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):o!=="object"&&d.push(new be(`${r}[1]`,e[1],`object expected, ${o} found`))}return d}function No(i,e){const r=i.key,a=i.validateSpec,o=i.style,d=i.styleSpec,p=i.value,f=i.objectKey,_=d[`${e}_${i.layerType}`];if(!_)return[];const x=f.match(/^(.*)-transition$/);if(e==="paint"&&x&&_[x[1]]&&_[x[1]].transition)return a({key:r,value:p,valueSpec:d.transition,style:o,styleSpec:d});const b=i.valueSpec||_[f];if(!b)return[new be(r,p,`unknown property "${f}"`)];let T;
1if(ut(p)==="string"&&Rs(b)&&!b.tokens&&(T=/^{([^}]+)}$/.exec(p)))return[new be(r,p,`"${f}" does not support interpolation syntax
2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(T[1])} }\`.`)];const A=[];return i.layerType==="symbol"&&(f==="text-field"&&o&&!o.glyphs&&A.push(new be(r,p,'use of "text-field" requires a style "glyphs" property')),f==="text-font"&&Ct(us(p))&&Lt(p.type)==="identity"&&A.push(new be(r,p,'"text-font" does not support identity functions'))),A.concat(a({key:i.key,value:p,valueSpec:b,style:o,styleSpec:d,expressionContext:"property",propertyType:e,propertyKey:f}))}function Uo(i){return No(i,"paint")}function $o(i){return No(i,"layout")}function jo(i){let e=[];const r=i.value,a=i.key,o=i.style,d=i.styleSpec;r.type||r.ref||e.push(new be(a,r,'either "type" or "ref" is required'));let p=Lt(r.type);const f=Lt(r.ref);if(r.id){const _=Lt(r.id);for(let x=0;x<i.arrayIndex;x++){const b=o.layers[x];Lt(b.id)===_&&e.push(new be(a,r.id,`duplicate layer id "${r.id}", previously used at line ${b.id.__line__}`))}}if("ref"in r){let _;["type","source","source-layer","filter","layout"].forEach(x=>{x in r&&e.push(new be(a,r[x],`"${x}" is prohibited for ref layers`))}),o.layers.forEach(x=>{Lt(x.id)===f&&(_=x)}),_?_.ref?e.push(new be(a,r.ref,"ref cannot reference another ref layer")):p=Lt(_.type):e.push(new be(a,r.ref,`ref layer "${f}" not found`))}else if(p!=="background")if(r.source){const _=o.sources&&o.sources[r.source],x=_&&Lt(_.type);_?x==="vector"&&p==="raster"?e.push(new be(a,r.source,`layer "${r.id}" requires a raster source`)):x!=="raster-dem"&&p==="hillshade"?e.push(new be(a,r.source,`layer "${r.id}" requires a raster-dem source`)):x==="raster"&&p!=="raster"?e.push(new be(a,r.source,`layer "${r.id}" requires a vector source`)):x!=="vector"||r["source-layer"]?x==="raster-dem"&&p!=="hillshade"?e.push(new be(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):p!=="line"||!r.paint||!r.paint["line-gradient"]||x==="geojson"&&_.lineMetrics||e.push(new be(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new be(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new be(a,r.source,`source "${r.source}" not found`))}else e.push(new be(a,r,'missing required property "source"'));return e=e.concat(Mi({key:a,value:r,valueSpec:d.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:d.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Fs,layout:_=>Mi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>$o(pr({layerType:p},x))}}),paint:_=>Mi({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Uo(pr({layerType:p},x))}})}})),e}function mr(i){const e=i.value,r=i.key,a=ut(e);return a!=="string"?[new be(r,e,`string expected, ${a} found`)]:[]}const ca={promoteId:function({key:i,value:e}){if(ut(e)==="string")return mr({key:i,value:e});{const r=[];for(const a in e)r.push(...mr({key:`${i}.${a}`,value:e[a]}));return r}}};function Ni(i){const e=i.value,r=i.key,a=i.styleSpec,o=i.style,d=i.validateSpec;if(!e.type)return[new be(r,e,'"type" is required')];const p=Lt(e.type);let f;switch(p){case"vector":case"raster":return f=Mi({key:r,value:e,valueSpec:a[`source_${p.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:ca,validateSpec:d}),f;case"raster-dem":return f=function(_){var x;const b=(x=_.sourceName)!==null&&x!==void 0?x:"",T=_.value,A=_.styleSpec,C=A.source_raster_dem,P=_.style;let D=[];const V=ut(T);if(T===void 0)return D;if(V!=="object")return D.push(new be("source_raster_dem",T,`object expected, ${V} found`)),D;const $=Lt(T.encoding)==="custom",X=["redFactor","greenFactor","blueFactor","baseShift"],q=_.value.encoding?`"${_.value.encoding}"`:"Default";for(const J in T)!$&&X.includes(J)?D.push(new be(J,T[J],`In "${b}": "${J}" is only valid when "encoding" is set to "custom". ${q} encoding found`)):C[J]?D=D.concat(_.validateSpec({key:J,value:T[J],valueSpec:C[J],validateSpec:_.validateSpec,style:P,styleSpec:A})):D.push(new be(J,T[J],`unknown property "${J}"`));return D}({sourceName:r,value:e,style:i.style,styleSpec:a,validateSpec:d}),f;case"geojson":if(f=Mi({key:r,value:e,valueSpec:a.source_geojson,style:o,styleSpec:a,validateSpec:d,objectElementValidators:ca}),e.cluster)for(const _ in e.clusterProperties){const[x,b]=e.clusterProperties[_],T=typeof x=="str
2ing"?[x,["accumulated"],["get",_]]:x;f.push(...hs({key:`${r}.${_}.map`,value:b,expressionContext:"cluster-map"})),f.push(...hs({key:`${r}.${_}.reduce`,value:T,expressionContext:"cluster-reduce"}))}return f;case"video":return Mi({key:r,value:e,valueSpec:a.source_video,style:o,validateSpec:d,styleSpec:a});case"image":return Mi({key:r,value:e,valueSpec:a.source_image,style:o,validateSpec:d,styleSpec:a});case"canvas":return[new be(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return la({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ua(i){const e=i.value,r=i.styleSpec,a=r.light,o=i.style;let d=[];const p=ut(e);if(e===void 0)return d;if(p!=="object")return d=d.concat([new be("light",e,`object expected, ${p} found`)]),d;for(const f in e){const _=f.match(/^(.*)-transition$/);d=d.concat(_&&a[_[1]]&&a[_[1]].transition?i.validateSpec({key:f,value:e[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:o,styleSpec:r}):a[f]?i.validateSpec({key:f,value:e[f],valueSpec:a[f],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new be(f,e[f],`unknown property "${f}"`)])}return d}function qo(i){const e=i.value,r=i.styleSpec,a=r.terrain,o=i.style;let d=[];const p=ut(e);if(e===void 0)return d;if(p!=="object")return d=d.concat([new be("terrain",e,`object expected, ${p} found`)]),d;for(const f in e)d=d.concat(a[f]?i.validateSpec({key:f,value:e[f],valueSpec:a[f],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new be(f,e[f],`unknown property "${f}"`)]);return d}function Zo(i){let e=[];const r=i.value,a=i.key;if(Array.isArray(r)){const o=[],d=[];for(const p in r)r[p].id&&o.includes(r[p].id)&&e.push(new be(a,r,`all the sprites' ids must be unique, but ${r[p].id} is duplicated`)),o.push(r[p].id),r[p].url&&d.includes(r[p].url)&&e.push(new be(a,r,`all the sprites' URLs must be unique, but ${r[p].url} is duplicated`)),d.push(r[p].url),e=e.concat(Mi({key:`${a}[${p}]`,value:r[p],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return mr({key:a,value:r})}const Go={"*":()=>[],array:Bs,boolean:function(i){const e=i.value,r=i.key,a=ut(e);return a!=="boolean"?[new be(r,e,`boolean expected, ${a} found`)]:[]},number:oa,color:function(i){const e=i.key,r=i.value,a=ut(r);return a!=="string"?[new be(e,r,`color expected, ${a} found`)]:pt.parse(String(r))?[]:[new be(e,r,`color expected, "${r}" found`)]},constants:Oo,enum:la,filter:Fs,function:Wa,layer:jo,object:Mi,source:Ni,light:ua,terrain:qo,string:mr,formatted:function(i){return mr(i).length===0?[]:hs(i)},resolvedImage:function(i){return mr(i).length===0?[]:hs(i)},padding:function(i){const e=i.key,r=i.value;if(ut(r)==="array"){if(r.length<1||r.length>4)return[new be(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const a={type:"number"};let o=[];for(let d=0;d<r.length;d++)o=o.concat(i.validateSpec({key:`${e}[${d}]`,value:r[d],validateSpec:i.validateSpec,valueSpec:a}));return o}return oa({key:e,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(i){const e=i.key,r=i.value,a=ut(r),o=i.styleSpec;if(a!=="array"||r.length<1||r.length%2!=0)return[new be(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let d=[];for(let p=0;p<r.length;p+=2)d=d.concat(la({key:`${e}[${p}]`,value:r[p],valueSpec:o.layout_symbol["text-anchor"]})),d=d.concat(Bs({key:`${e}[${p+1}]`,value:r[p+1],valueSpec:{length:2,value:"number"},validateSpec:i.validateSpec,style:i.style,styleSpec:o}));return d},sprite:Zo};function Hr(i){const e=i.value,r=i.valueSpec,a=i.styleSpec;return i.validateSpec=Hr,r.expression&&Ct(Lt(e))?Wa(i):r.expression&&Ua(us(e))?hs(i):r.type&&Go[r.type]?Go[r.type](i):Mi(pr({},i,{valueSpec:r.type?a[r.type]:r}))}function Wo(i){const e=i.value,r=i.key,a=mr(i);return a.length||(e.indexOf("{fontstack}")===-1&&a.push(new be(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new be(r,e,'"glyphs" url must include a "{range}" token'))),a}function er(i,e=le){let r=[];return r=r.concat(Hr({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,validateSpec:Hr,objectElementValidators:{glyphs:Wo,"*":()=>[]}})),i.constants&&(r=r.concat(Oo({key:"constants",value:i.constants}))),Ha(r)}function Cr(i){return function(e){return i({...e,validateSpec:Hr})}}function Ha(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function Pr(i){return function(...e){return Ha(i.apply(this,e))}}er.source=Pr(Cr(Ni)),er.sprite=Pr(Cr(Zo)),er.glyphs=Pr(Cr(Wo)),er.light=Pr(Cr(ua)),er.terrain=Pr(Cr(qo)),er.layer=Pr(Cr(jo)),er.filter=Pr(Cr(Fs)),er.paintProperty=Pr(Cr(Uo)),er.layoutProperty=Pr(Cr($o));const kr=er,Ul=kr.light,Rn=kr.paintProperty,Ho=kr.layoutProperty;function Xa(i,e){let r=!1;if(e&&e.length)for(const a of e)i.fire(new $r(new Error(a.message))),r=!0;return r}class Os{constructor(e,r,a){const o=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const p=new Int32Array(this.arrayBuffer);e=p[0],this.d=(r=p[1])+2*(a=p[2]);for(let _=0;_<this.d*this.d;_++){const x=p[3+_],b=p[3+_+1];o.push(x===b?null:p.subarray(x,b))}const f=p[3+o.length+1];this.keys=p.subarray(p[3+o.length],f),this.bboxes=p.subarray(f),this.insert=this._insertReadonly}else{this.d=r+2*a;for(let p=0;p<this.d*this.d;p++)o.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=a,this.scale=r/e,this.uid=0;const d=a/r*e;this.min=-d,this.max=e+d}
2insert(e,r,a,o,d){this._forEachCell(r,a,o,d,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(o),this.bboxes.push(d)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,a,o,d,p){this.cells[d].push(p)}query(e,r,a,o,d){const p=this.min,f=this.max;if(e<=p&&r<=p&&f<=a&&f<=o&&!d)return Array.prototype.slice.call(this.keys);{const _=[];return this._forEachCell(e,r,a,o,this._queryCell,_,{},d),_}}_queryCell(e,r,a,o,d,p,f,_){const x=this.cells[d];if(x!==null){const b=this.keys,T=this.bboxes;for(let A=0;A<x.length;A++){const C=x[A];if(f[C]===void 0){const P=4*C;(_?_(T[P+0],T[P+1],T[P+2],T[P+3]):e<=T[P+2]&&r<=T[P+3]&&a>=T[P+0]&&o>=T[P+1])?(f[C]=!0,p.push(b[C])):f[C]=!1}}}}_forEachCell(e,r,a,o,d,p,f,_){const x=this._convertToCellCoord(e),b=this._convertToCellCoord(r),T=this._convertToCellCoord(a),A=this._convertToCellCoord(o);for(let C=x;C<=T;C++)for(let P=b;P<=A;P++){const D=this.d*P+C;if((!_||_(this._convertFromCellCoord(C),this._convertFromCellCoord(P),this._convertFromCellCoord(C+1),this._convertFromCellCoord(P+1)))&&d.call(this,e,r,a,o,D,p,f,_))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let a=0;for(let p=0;p<this.cells.length;p++)a+=this.cells[p].length;const o=new Int32Array(r+a+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;let d=r;for(let p=0;p<e.length;p++){const f=e[p];o[3+p]=d,o.set(f,d),d+=f.length}return o[3+e.length]=d,o.set(this.keys,d),d+=this.keys.length,o[3+e.length+1]=d,o.set(this.bboxes,d),d+=this.bboxes.length,o.buffer}static serialize(e,r){const a=e.toArrayBuffer();return r&&r.push(a),{buffer:a}}static deserialize(e){return new Os(e.buffer)}}const zr={};function Ce(i,e,r={}){if(zr[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),zr[i]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}Ce("Object",Object),Ce("TransferableGridIndex",Os),Ce("Color",pt),Ce("Error",Error),Ce("AJAXError",Vr),Ce("ResolvedImage",ni),Ce("StylePropertyFunction",ra),Ce("StyleExpression",Pn,{omit:["_evaluator"]}),Ce("ZoomDependentExpression",ja),Ce("ZoomConstantExpression",kn),Ce("CompoundExpression",Qi,{omit:["_evaluate"]});for(const i in Ls)Ls[i]._classRegistryKey||Ce(`Expression_${i}`,Ls[i]);function Ka(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function Xr(i,e){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob)return i;if(Ka(i)||Ks(i))return e&&e.push(i),i;if(ArrayBuffer.isView(i)){const r=i;return e&&e.push(r.buffer),r}if(i instanceof ImageData)return e&&e.push(i.data.buffer),i;if(Array.isArray(i)){const r=[];for(const a of i)r.push(Xr(a,e));return r}if(typeof i=="object"){const r=i.constructor,a=r._classRegistryKey;if(!a)throw new Error("can't serialize object of unregistered class");if(!zr[a])throw new Error(`${a} is not registered.`);const o=r.serialize?r.serialize(i,e):{};if(r.serialize){if(e&&o===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const d in i){if(!i.hasOwnProperty(d)||zr[a].omit.indexOf(d)>=0)continue;const p=i[d];o[d]=zr[a].shallow.indexOf(d)>=0?p:Xr(p,e)}i instanceof Error&&(o.message=i.message)}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(o.$name=a),o}throw new Error("can't serialize object of type "+typeof i)}function Vs(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Ka(i)||Ks(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Vs);if(typeof i=="object"){const e=i.$name||"Object";if(!zr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=zr[e];
2if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const o of Object.keys(i)){if(o==="$name")continue;const d=i[o];a[o]=zr[e].shallow.indexOf(o)>=0?d:Vs(d)}return a}throw new Error("can't deserialize object of type "+typeof i)}class Xo{constructor(){this.first=!0}update(e,r){const a=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<a&&(this.lastIntegerZoom=a,this.lastIntegerZoomTime=r),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=a,!0))}}const Ee={"Latin-1 Supplement":i=>i>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Bn(i){for(const e of i)if(On(e.charCodeAt(0)))return!0;return!1}function Fn(i){for(const e of i)if(!$l(e.charCodeAt(0)))return!1;return!0}function $l(i){return!(Ee.Arabic(i)||Ee["Arabic Supplement"](i)||Ee["Arabic Extended-A"](i)||Ee["Arabic Presentation Forms-A"](i)||Ee["Arabic Presentation Forms-B"](i))}function On(i){return!(i!==746&&i!==747&&(i<4352||!(Ee["Bopomofo Extended"](i)||Ee.Bopomofo(i)||Ee["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Ee["CJK Compatibility Ideographs"](i)||Ee["CJK Compatibility"](i)||Ee["CJK Radicals Supplement"](i)||Ee["CJK Strokes"](i)||!(!Ee["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Ee["CJK Unified Ideographs Extension A"](i)||Ee["CJK Unified Ideographs"](i)||Ee["Enclosed CJK Letters and Months"](i)||Ee["Hangul Compatibility Jamo"](i)||Ee["Hangul Jamo Extended-A"](i)||Ee["Hangul Jamo Extended-B"](i)||Ee["Hangul Jamo"](i)||Ee["Hangul Syllables"](i)||Ee.Hiragana(i)||Ee["Ideographic Description Characters"](i)||Ee.Kanbun(i)||Ee["Kangxi Radicals"](i)||Ee["Katakana Phonetic Extensions"](i)||Ee.Katakana(i)&&i!==12540||!(!Ee["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Ee["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Ee["Unified Canadian Aboriginal Syllabics"](i)||Ee["Unified Canadian Aboriginal Syllabics Extended"](i)||Ee["Vertical Forms"](i)||Ee["Yijing Hexagram Symbols"](i)||Ee["Yi Syllables"](i)||Ee["Yi Radicals"](i))))}function Ko(i){return!(On(i)||function(e){return!!(Ee["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Ee["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Ee["Letterlike Symbols"](e)||Ee["Number Forms"](e)||Ee["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ee["Control Pictures"](e)&&e!==9251||Ee["Optical Character Recognition"](e)||Ee["Enclosed Alphanumerics"](e)||Ee["Geometric Shapes"](e)||Ee["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Ee["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Ee["CJK Symbols and Punctuation"](e)||Ee.Katakana(e)||Ee["Private Use Area"](e)||Ee["CJK Compatibility Forms"](e)||Ee["Small Form Variants"](e)||Ee["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function Yo(i){return i>=1424&&i<=2303||Ee["Arabic Presentation Forms-A"](i)||Ee["Arabic Presentation Forms-B"](i)}function Jo(i,e){return!(!e&&Yo(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Ee.Khmer(i))}function jl(i){for(const e of i)if(Yo(e.charCodeAt(0)))return!0;return!1}const Vn="deferred",Nn="loading",Un="loaded";let $n=null,Ci="unavailable",Kr=null;const ha=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(Ci="error"),$n&&$n(i)};function jn(){da.fire(new Ur("pluginStateChange",{pluginStatus:Ci,pluginURL:Kr}))}const da=new rs,qn=function(){return Ci},Qo=function(){if(Ci!==Vn||!Kr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ci=Nn,jn(),Kr&&Qs({url:Kr},i=>{i?ha(i):(Ci=Un,jn())})},Ui={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Ci===Un||Ui.applyArabicShaping!=null,isLoading:()=>Ci===Nn,setState(i){if(!Wi())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Ci=i.pluginStatus,Kr=i.pluginURL},isParsed(){if(!Wi())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ui.applyArabicShaping!=null&&Ui.processBidirectionalText!=null&&Ui.processStyledBidirectionalText!=null},getPluginURL(){if(!Wi())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Kr}};class wt{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Xo,this.transition={})}isSupportedScript(e){return function(r,a){for(const o of r)if(!Jo(o.charCo
2deAt(0),a))return!1;return!0}(e,Ui.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class Ya{constructor(e,r){this.property=e,this.value=r,this.expression=function(a,o){if(Ct(a))return new ra(a,o);if(Ua(a)){const d=zn(a,o);if(d.result==="error")throw new Error(d.value.map(p=>`${p.key}: ${p.message}`).join(", "));return d.value}{let d=a;return o.type==="color"&&typeof a=="string"?d=pt.parse(a):o.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?o.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(d=Yi.parse(a)):d=Fi.parse(a),{kind:"constant",evaluate:()=>d}}}(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,a){return this.property.possiblyEvaluate(this,e,r,a)}}class Zn{constructor(e){this.property=e,this.value=new Ya(e,void 0)}transitioned(e,r){return new tl(this.property,this.value,r,si({},e.transition,this.transition),e.now)}untransitioned(){return new tl(this.property,this.value,null,{},0)}}class el{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return sr(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Zn(this._values[e].property)),this._values[e].value=new Ya(this._values[e].property,r===null?void 0:sr(r))}getTransition(e){return sr(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Zn(this._values[e].property)),this._values[e].transition=sr(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a);const o=this.getTransition(r);o!==void 0&&(e[`${r}-transition`]=o)}return e}transitioned(e,r){const a=new il(this._properties);for(const o of Object.keys(this._values))a._values[o]=this._values[o].transitioned(e,r._values[o]);return a}untransitioned(){const e=new il(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class tl{constructor(e,r,a,o,d){this.property=e,this.value=r,this.begin=d+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=a)}possiblyEvaluate(e,r,a){const o=e.now||0,d=this.value.possiblyEvaluate(e,r,a),p=this.prior;if(p){if(o>this.end)return this.prior=null,d;if(this.value.isDataDriven())return this.prior=null,d;if(o<this.begin)return p.possiblyEvaluate(e,r,a);{const f=(o-this.begin)/(this.end-this.begin);return this.property.interpolate(p.possiblyEvaluate(e,r,a),d,function(_){if(_<=0)return 0;if(_>=1)return 1;const x=_*_,b=x*_;return 4*(_<.5?b:3*(_-x)+b-.75)}(f))}}return d}}class il{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,a){const o=new Ja(this._properties);for(const d of Object.keys(this._values))o._values[d]=this._values[d].possiblyEvaluate(e,r,a);return o}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class ql{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return sr(this._values[e].value)}setValue(e,r){this._values[e]=new Ya(this._values[e].property,r===null?void 0:sr(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a)}return e}possiblyEvaluate(e,r,a){const o=new Ja(this._properties);for(const d of Object.keys(this._values))o._values[d]=this._values[d].possiblyEvaluate(e,r,a);return o}}class xi{constructor(e,r,a){this.property=e,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,a,o){return this.property.evaluate(this.value,this.parameters,e,r,a,o)}}class Ja{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Oe{constructor(e){this.specification=e}
vendor: 4,132 bytes, line 2
2possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,a){const o=Oi[this.specification.type];return o?o(e,r,a):e}}class $e{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,a,o){return new xi(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},a,o)}:e.expression,r)}interpolate(e,r,a){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new xi(this,{kind:"constant",value:void 0},e.parameters);const o=Oi[this.specification.type];if(o){const d=o(e.value.value,r.value.value,a);return new xi(this,{kind:"constant",value:d},e.parameters)}return e}evaluate(e,r,a,o,d,p){return e.kind==="constant"?e.value:e.evaluate(r,a,o,d,p)}}class pa extends $e{possiblyEvaluate(e,r,a,o){if(e.value===void 0)return new xi(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const d=e.expression.evaluate(r,null,{},a,o),p=e.property.specification.type==="resolvedImage"&&typeof d!="string"?d.name:d,f=this._calculate(p,p,p,r);return new xi(this,{kind:"constant",value:f},r)}if(e.expression.kind==="camera"){const d=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new xi(this,{kind:"constant",value:d},r)}return new xi(this,e.expression,r)}evaluate(e,r,a,o,d,p){if(e.kind==="source"){const f=e.evaluate(r,a,o,d,p);return this._calculate(f,f,f,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},a,o),e.evaluate({zoom:Math.floor(r.zoom)},a,o),e.evaluate({zoom:Math.floor(r.zoom)+1},a,o),r):e.value}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class Gn{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){if(e.value!==void 0){if(e.expression.kind==="constant"){const d=e.expression.evaluate(r,null,{},a,o);return this._calculate(d,d,d,r)}return this._calculate(e.expression.evaluate(new wt(Math.floor(r.zoom-1),r)),e.expression.evaluate(new wt(Math.floor(r.zoom),r)),e.expression.evaluate(new wt(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class Wn{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){return!!e.expression.evaluate(r,null,{},a,o)}interpolate(){return!1}}class Nt{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const o=this.defaultPropertyValues[r]=new Ya(a,void 0),d=this.defaultTransitionablePropertyValues[r]=new Zn(a);this.defaultTransitioningPropertyValues[r]=d.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=o.possiblyEvaluate({})}}}Ce("DataDrivenProperty",$e),Ce("DataConstantProperty",Oe),Ce("CrossFadedDataDrivenProperty",pa),Ce("CrossFadedProperty",Gn),Ce("ColorRampProperty",Wn);const Hn="-transition";class tr extends rs{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new ql(r.layout)),r.paint)){this._transitionablePaint=new el(r.paint);for(const a in e.paint)this.setPaintProperty(a,e.paint[a],{validate:!1});for(const a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ja(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,a={}
2){r!=null&&this._validate(Ho,`layers.${this.id}.layout.${e}`,e,r,a)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Hn)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,a={}){if(r!=null&&this._validate(Rn,`layers.${this.id}.paint.${e}`,e,r,a))return!1;if(e.endsWith(Hn))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const o=this._transitionablePaint._values[e],d=o.property.specification["property-type"]==="cross-faded-data-driven",p=o.value.isDataDriven(),f=o.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const _=this._transitionablePaint._values[e].value;return _.isDataDriven()||p||d||this._handleOverridablePaintPropertyUpdate(e,f,_)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,a){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}
vendor: 5,297 bytes, line 2
2serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Ss(e,(r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length))}_validate(e,r,a,o,d={}){return(!d||d.validate!==!1)&&Xa(this,e.call(kr,{key:r,layerType:this.type,objectKey:a,value:o,styleSpec:le,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof xi&&Rs(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const rl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ds{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Rt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function kt(i,e=1){let r=0,a=0;return{members:i.map(o=>{const d=rl[o.type].BYTES_PER_ELEMENT,p=r=Ns(r,Math.max(e,d)),f=o.components||1;return a=Math.max(a,d),r+=d*f,{name:o.name,type:o.type,components:f,offset:p}}),size:Ns(r,Math.max(a,e)),alignment:e}}function Ns(i,e){return Math.ceil(i/e)*e}class fa extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.int16[o+0]=r,this.int16[o+1]=a,e}}fa.prototype.bytesPerElement=4,Ce("StructArrayLayout2i4",fa);class ma extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const d=3*e;return this.int16[d+0]=r,this.int16[d+1]=a,this.int16[d+2]=o,e}}ma.prototype.bytesPerElement=6,Ce("StructArrayLayout3i6",ma);class ps extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,a,o)}emplace(e,r,a,o,d){const p=4*e;return this.int16[p+0]=r,this.int16[p+1]=a,this.int16[p+2]=o,this.int16[p+3]=d,e}}ps.prototype.bytesPerElement=8,Ce("StructArrayLayout4i8",ps);class Xn extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,o,d,p)}emplace(e,r,a,o,d,p,f){const _=6*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=d,this.int16[_+4]=p,this.int16[_+5]=f,e}}Xn.prototype.bytesPerElement=12,Ce("StructArrayLayout2i4i12",Xn);class Kn extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,o,d,p)}emplace(e,r,a,o,d,p,f){const _=4*e,x=8*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.uint8[x+4]=o,this.uint8[x+5]=d,this.uint8[x+6]=p,this.uint8[x+7]=f,e}}Kn.prototype.bytesPerElement=8,Ce("StructArrayLayout2i4ub8",Kn);class Us extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.float32[o+0]=r,this.float32[o+1]=a,e}}Us.prototype.bytesPerElement=8,Ce("StructArrayLayout2f8",Us);class Yn extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d,p,f,_,x,b){const T=this.length;return this.resize(T+1),this.emplace(T,e,r,a,o,d,p,f,_,x,b)}emplace(e,r,a,o,d,p,f,_,x,b,T){const A=10*e;return this.uint16[A+0]=r,this.uint16[A+1]=a,this.uint16[A+2]=o,this.uint16[A+3]=d,this.uint16[A+4]=p,this.uint16[A+5]=f,this.uint16[A+6]=_,this.uint16[A+7]=x,this.uint16[A+8]=b,this.uint16[A+9]=T,e}}
vendor: 15,143 bytes, line 2
2Yn.prototype.bytesPerElement=20,Ce("StructArrayLayout10ui20",Yn);class Jn extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d,p,f,_,x,b,T,A){const C=this.length;return this.resize(C+1),this.emplace(C,e,r,a,o,d,p,f,_,x,b,T,A)}emplace(e,r,a,o,d,p,f,_,x,b,T,A,C){const P=12*e;return this.int16[P+0]=r,this.int16[P+1]=a,this.int16[P+2]=o,this.int16[P+3]=d,this.uint16[P+4]=p,this.uint16[P+5]=f,this.uint16[P+6]=_,this.uint16[P+7]=x,this.int16[P+8]=b,this.int16[P+9]=T,this.int16[P+10]=A,this.int16[P+11]=C,e}}Jn.prototype.bytesPerElement=24,Ce("StructArrayLayout4i4ui4i24",Jn);class ht extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const d=3*e;return this.float32[d+0]=r,this.float32[d+1]=a,this.float32[d+2]=o,e}}ht.prototype.bytesPerElement=12,Ce("StructArrayLayout3f12",ht);class u extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}u.prototype.bytesPerElement=4,Ce("StructArrayLayout1ul4",u);class t extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d,p,f,_,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,r,a,o,d,p,f,_,x)}emplace(e,r,a,o,d,p,f,_,x,b){const T=10*e,A=5*e;return this.int16[T+0]=r,this.int16[T+1]=a,this.int16[T+2]=o,this.int16[T+3]=d,this.int16[T+4]=p,this.int16[T+5]=f,this.uint32[A+3]=_,this.uint16[T+8]=x,this.uint16[T+9]=b,e}}t.prototype.bytesPerElement=20,Ce("StructArrayLayout6i1ul2ui20",t);class s extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,o,d,p)}emplace(e,r,a,o,d,p,f){const _=6*e;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=o,this.int16[_+3]=d,this.int16[_+4]=p,this.int16[_+5]=f,e}}s.prototype.bytesPerElement=12,Ce("StructArrayLayout2i2i2i12",s);class n extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,o,d)}emplace(e,r,a,o,d,p){const f=4*e,_=8*e;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=o,this.int16[_+6]=d,this.int16[_+7]=p,e}}n.prototype.bytesPerElement=16,Ce("StructArrayLayout2f1f2i16",n);class l extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,a,o)}emplace(e,r,a,o,d){const p=12*e,f=3*e;return this.uint8[p+0]=r,this.uint8[p+1]=a,this.float32[f+1]=o,this.float32[f+2]=d,e}}l.prototype.bytesPerElement=12,Ce("StructArrayLayout2ub2f12",l);class h extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const d=3*e;return this.uint16[d+0]=r,this.uint16[d+1]=a,this.uint16[d+2]=o,e}}h.prototype.bytesPerElement=6,Ce("StructArrayLayout3ui6",h);class m extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d,p,f,_,x,b,T,A,C,P,D,V,$){const X=this.length;return this.resize(X+1),this.emplace(X,e,r,a,o,d,p,f,_,x,b,T,A,C,P,D,V,$)}emplace(e,r,a,o,d,p,f,_,x,b,T,A,C,P,D,V,$,X){const q=24*e,J=12*e,ie=48*e;return this.int16[q+0]=r,this.int16[q+1]=a,this.uint16[q+2]=o,this.uint16[q+3]=d,this.uint32[J+2]=p,this.uint32[J+3]=f,this.uint32[J+4]=_,this.uint16[q+10]=x,this.uint16[q+11]=b,this.uint16[q+12]=T,this.float32[J+7]=A,this.float32[J+8]=C,this.uint8[ie+36]=P,this.uint8[ie+37]=D,this.uint8[ie+38]=V,this.uint32[J+10]=$,this.int16[q+22]=X,e}}m.prototype.bytesPerElement=48,Ce("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",m);class g extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o,d,p,f,_,x,b,T,A,C,P,D,V,$,X,q,J,ie,de,Me,Le,Ae,Ie,ve,Pe){const we=this.length;return this.resize(we+1),this.emplace(we,e,r,a,o,d,p,f,_,x,b,T,A,C,P,D,V,$,X,q,J,ie,de,Me,Le,Ae,Ie,ve,Pe)}emplace(e,r,a,o,d,p,f,_,x,b,T,A,C,P,D,V,$,X,q,J,ie,de,Me,Le,Ae,Ie,ve,Pe,we){const _e=32*e,Ne=16*e;return this.int16[_e+0]=r,this.int16[_e+1]=a,this.int16[_e+2]=o,this.int16[_e+3]=d,this.int16[_e+4]=p,this.int16[_e+5]=f,this.int16[_e+6]=_,this.int16[_e+7]=x,this.uint16[_e+8]=b,this.uint16[_e+9]=T,this.uint16[_e+10]=A,this.uint16[_e+11]=C,this.uint16[_e+12]=P,this.uint16[_e+13]=D,this.uint16[_e+14]=V,this.uint16[_e+15]=$,this.uint16[_e+16]=X,this.uint16[_e+17]=q,this.uint16[_e+18]=J,this.uint16[_e+19]=ie,this.uint16[_e+20]=de,this.uint16[_e+21]=Me,this.uint16[_e+22]=Le,this.uint32[Ne+12]=Ae,this.float32[Ne+13]=Ie,this.float32[Ne+14]=ve,this.uint16[_e+30]=Pe,this.uint16[_e+31]=we,e}}g.prototype.bytesPerElement=64,Ce("StructArrayLayout8i15ui1ul2f2ui64",g);class y extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}y.prototype.bytesPerElement=4,Ce("StructArrayLayout1f4",y);class v extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const d=3*e;return this.uint16[6*e+0]=r,this.float32[d+1]=a,this.float32[d+2]=o,e}}v.prototype.bytesPerElement=12,Ce("StructArrayLayout1ui2f12",v);class w extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const d=4*e;return this.uint32[2*e+0]=r,this.uint16[d+2]=a,this.uint16[d+3]=o,e}}w.prototype.bytesPerElement=8,Ce("StructArrayLayout1ul2ui8",w);class S extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.uint16[o+0]=r,this.uint16[o+1]=a,e}}S.prototype.bytesPerElement=4,Ce("StructArrayLayout2ui4",S);class M extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}M.prototype.bytesPerElement=2,Ce("StructArrayLayout1ui2",M);class R extends Rt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const d=this.length;return this.resize(d+1),this.emplace(d,e,r,a,o)}emplace(e,r,a,o,d){const p=4*e;return this.float32[p+0]=r,this.float32[p+1]=a,this.float32[p+2]=o,this.float32[p+3]=d,e}}R.prototype.bytesPerElement=16,Ce("StructArrayLayout4f16",R);class L extends ds{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new ke(this.anchorPointX,this.anchorPointY)}}L.prototype.size=20;class F extends t{get(e){return new L(this,e)}}Ce("CollisionBoxArray",F);class z extends ds{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}z.prototype.size=48;class G extends m{get(e){return new z(this,e)}}Ce("PlacedSymbolArray",G);class te extends ds{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}te.prototype.size=64;class U extends g{get(e){return new te(this,e)}}Ce("SymbolInstanceArray",U);class W extends y{getoffsetX(e){return this.float32[1*e+0]}}Ce("GlyphOffsetArray",W);class re extends ma{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ce("SymbolLineVertexArray",re);class se extends ds{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}se.prototype.size=12;class he extends v{get(e){return new se(this,e)}}Ce("TextAnchorOffsetArray",he);class ge extends ds{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}ge.prototype.size=8;class fe extends w{get(e){return new ge(this,e)}}Ce("FeatureIndexArray",fe);class ye extends fa{}class De extends fa{}class et extends fa{}class Te extends Xn{}class je extends Kn{}class Re extends Us{}class ft extends Yn{}class Qe extends Jn{}class Xe extends ht{}class tt extends u{}class Bt extends s{}class vt extends l{}class oi extends h{}class Ht extends S{}const Ut=kt([{name:"a_pos",components:2,type:"Int16"}],4),{members:$i}=Ut;class St{constructor(e=[]){this.segments=e}prepareSegment(e,r,a,o){let d=this.segments[this.segments.length-1];return e>St.MAX_VERTEX_ARRAY_LENGTH&&_i(`Max vertices per segment is ${St.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!d||d.vertexLength+e>St.MAX_VERTEX_ARRAY_LENGTH||d.sortKey!==o)&&(d={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},o!==void 0&&(d.sortKey=o),this.segments.push(d)),d}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,a,o){return new St([{vertexOffset:e,primitiveOffset:r,vertexLength:a,primitiveLength:o,vaos:{},sortKey:0}])}}function gr(i,e){return 256*(i=ur(Math.floor(i),0,255))+ur(Math.floor(e),0,255)}St.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ce("SegmentVector",St);const _r=kt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Yr={exports:{}},fs={exports:{}};fs.exports=function(i,e){var r,a,o,d,p,f,_,x;for(a=i.length-(r=3&i.length),o=e,p=3432918353,f=461845907,x=0;x<a;)_=255&i.charCodeAt(x)|(255&i.charCodeAt(++x))<<8|(255&i.charCodeAt(++x))<<16|(255&i.charCodeAt(++x))<<24,++x,o=27492+(65535&(d=5*(65535&(o=(o^=_=(65535&(_=(_=(65535&_)*p+(((_>>>16)*p&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(d>>>16)&65535)<<16);
2switch(_=0,r){case 3:_^=(255&i.charCodeAt(x+2))<<16;case 2:_^=(255&i.charCodeAt(x+1))<<8;case 1:o^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(x)))*p+(((_>>>16)*p&65535)<<16)&4294967295)<<15|_>>>17))*f+(((_>>>16)*f&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0};var $s=fs.exports,di={exports:{}};di.exports=function(i,e){for(var r,a=i.length,o=e^a,d=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(d)|(255&i.charCodeAt(++d))<<8|(255&i.charCodeAt(++d))<<16|(255&i.charCodeAt(++d))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++d;switch(a){case 3:o^=(255&i.charCodeAt(d+2))<<16;case 2:o^=(255&i.charCodeAt(d+1))<<8;case 1:o=1540483477*(65535&(o^=255&i.charCodeAt(d)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};var li=$s,vi=di.exports;Yr.exports=li,Yr.exports.murmur3=li,Yr.exports.murmur2=vi;var ms=K(Yr.exports);class Ft{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,a,o){this.ids.push(Xt(e)),this.positions.push(r,a,o)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Xt(e);let a=0,o=this.ids.length-1;for(;a<o;){const p=a+o>>1;this.ids[p]>=r?o=p:a=p+1}const d=[];for(;this.ids[a]===r;)d.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return d}static serialize(e,r){const a=new Float64Array(e.ids),o=new Uint32Array(e.positions);return Pi(a,o,0,a.length-1),r&&r.push(a.buffer,o.buffer),{ids:a,positions:o}}static deserialize(e){const r=new Ft;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Xt(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ms(String(i))}function Pi(i,e,r,a){for(;r<a;){const o=i[r+a>>1];let d=r-1,p=a+1;for(;;){do d++;while(i[d]<o);do p--;while(i[p]>o);if(d>=p)break;Ot(i,d,p),Ot(e,3*d,3*p),Ot(e,3*d+1,3*p+1),Ot(e,3*d+2,3*p+2)}p-r<a-p?(Pi(i,e,r,p),r=p+1):(Pi(i,e,p+1,a),a=p)}}function Ot(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}Ce("FeaturePositionMap",Ft);class gs{constructor(e,r){this.gl=e.gl,this.location=r}}class Qa extends gs{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class sl extends gs{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class al extends gs{constructor(e,r){super(e,r),this.current=pt.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Zl=new Float32Array(16);function Qn(i){return[gr(255*i.r,255*i.g),gr(255*i.b,255*i.a)]}class yr{constructor(e,r,a){this.value=e,this.uniformNames=r.map(o=>`u_${o}`),this.type=a}setUniform(e,r,a){e.set(a.constantOr(this.value))}getBinding(e,r,a){return this.type==="color"?new al(e,r):new Qa(e,r)}}class _s{constructor(e,r){this.uniformNames=r.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,a,o){const d=o==="u_pattern_to"?this.patternTo:o==="u_pattern_from"?this.patternFrom:o==="u_pixel_ratio_to"?this.pixelRatioTo:o==="u_pixel_ratio_from"?this.pixelRatioFrom:null;d&&e.set(d)}getBinding(e,r,a){return a.substr(0,9)==="u_pattern"?new sl(e,r):new Qa(e,r)}}class xr{constructor(e,r,a,o){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map(d=>({name:`a_${d}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,r,a,o,d){const p=this.paintVertexArray.length,f=this.expression.evaluate(new wt(0),r,{},o,[],d);this.paintVertexArray.resize(e),this._setPaintValue(p,e,f)}updatePaintArray(e,r,a,o){const d=this.expression.evaluate({zoom:0},a,o);this._setPaintValue(e,r,d)}
2_setPaintValue(e,r,a){if(this.type==="color"){const o=Qn(a);for(let d=e;d<r;d++)this.paintVertexArray.emplace(d,o[0],o[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,a);this.maxValue=Math.max(this.maxValue,Math.abs(a))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ir{constructor(e,r,a,o,d,p){this.expression=e,this.uniformNames=r.map(f=>`u_${f}_t`),this.type=a,this.useIntegerZoom=o,this.zoom=d,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new p}populatePaintArray(e,r,a,o,d){const p=this.expression.evaluate(new wt(this.zoom),r,{},o,[],d),f=this.expression.evaluate(new wt(this.zoom+1),r,{},o,[],d),_=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(_,e,p,f)}updatePaintArray(e,r,a,o){const d=this.expression.evaluate({zoom:this.zoom},a,o),p=this.expression.evaluate({zoom:this.zoom+1},a,o);this._setPaintValue(e,r,d,p)}_setPaintValue(e,r,a,o){if(this.type==="color"){const d=Qn(a),p=Qn(o);for(let f=e;f<r;f++)this.paintVertexArray.emplace(f,d[0],d[1],p[0],p[1])}else{for(let d=e;d<r;d++)this.paintVertexArray.emplace(d,a,o);this.maxValue=Math.max(this.maxValue,Math.abs(a),Math.abs(o))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){const a=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,o=ur(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);e.set(o)}getBinding(e,r,a){return new Qa(e,r)}}class vr{constructor(e,r,a,o,d,p){this.expression=e,this.type=r,this.useIntegerZoom=a,this.zoom=o,this.layerId=p,this.zoomInPaintVertexArray=new d,this.zoomOutPaintVertexArray=new d}populatePaintArray(e,r,a){const o=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(o,e,r.patterns&&r.patterns[this.layerId],a)}updatePaintArray(e,r,a,o,d){this._setPaintValues(e,r,a.patterns&&a.patterns[this.layerId],d)}_setPaintValues(e,r,a,o){if(!o||!a)return;const{min:d,mid:p,max:f}=a,_=o[d],x=o[p],b=o[f];if(_&&x&&b)for(let T=e;T<r;T++)this.zoomInPaintVertexArray.emplace(T,x.tl[0],x.tl[1],x.br[0],x.br[1],_.tl[0],_.tl[1],_.br[0],_.br[1],x.pixelRatio,_.pixelRatio),this.zoomOutPaintVertexArray.emplace(T,x.tl[0],x.tl[1],x.br[0],x.br[1],b.tl[0],b.tl[1],b.br[0],b.br[1],x.pixelRatio,b.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,_r.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,_r.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class eo{constructor(e,r,a){this.binders={},this._buffers=[];const o=[];for(const d in e.paint._values){if(!a(d))continue;const p=e.paint.get(d);if(!(p instanceof xi&&Rs(p.property.specification)))continue;const f=Ph(d,e.type),_=p.value,x=p.property.specification.type,b=p.property.useIntegerZoom,T=p.property.specification["property-type"],A=T==="cross-faded"||T==="cross-faded-data-driven";if(_.kind==="constant")this.binders[d]=A?new _s(_.value,f):new yr(_.value,f,x),o.push(`/u_${d}`);else if(_.kind==="source"||A){const C=Bc(d,x,"source");this.binders[d]=A?new vr(_,x,b,r,C,e.id):new xr(_,f,x,C),o.push(`/a_${d}`)}else{const C=Bc(d,x,"composite");this.binders[d]=new ir(_,f,x,b,r,C),o.push(`/z_${d}`)}}this.cacheKey=o.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof xr||r instanceof ir?r.maxValue:0}populatePaintArrays(e,r,a,o,d){for(const p in this.binders){const f=this.binders[p];(f instanceof xr||f instanceof ir||f instanceof vr)&&f.populatePaintArray(e,r,a,o,d)}}setConstantPatternPositions(e,r){for(const a in this.binders){const o=this.binders[a];o instanceof _s&&o.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,a,o,d){let p=!1;for(const f in e){const _=r.getPositions(f);for(const x of _){const b=a.feature(x.index);for(const T in this.binders){const A=this.binders[T];if((A instanceof xr||A instanceof ir||A instanceof vr)&&A.expression.isStateDependent===!0){const C=o.paint.get(T);A.expression=C.value,A.updatePaintArray(x.start,x.end,b,e[f],d),p=!0}}}}return p}defines(){const e=[];for(const r in this.binders){const a=this.binders[r];(a instanceof yr||a instanceof _s)&&e.push(...a.uniformNames.map(o=>`#define HAS_UNIFORM_${o}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof xr||a instanceof ir)for(let o=0;o<a.paintVertexAttributes.length;
vendor: 10,296 bytes, line 2
2o++)e.push(a.paintVertexAttributes[o].name);else if(a instanceof vr)for(let o=0;o<_r.members.length;o++)e.push(_r.members[o].name)}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof yr||a instanceof _s||a instanceof ir)for(const o of a.uniformNames)e.push(o)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){const a=[];for(const o in this.binders){const d=this.binders[o];if(d instanceof yr||d instanceof _s||d instanceof ir){for(const p of d.uniformNames)if(r[p]){const f=d.getBinding(e,r[p],p);a.push({name:p,property:o,binding:f})}}}return a}setUniforms(e,r,a,o){for(const{name:d,property:p,binding:f}of r)this.binders[p].setUniform(f,o,a.get(p),d)}updatePaintBuffers(e){this._buffers=[];for(const r in this.binders){const a=this.binders[r];if(e&&a instanceof vr){const o=e.fromScale===2?a.zoomInPaintVertexBuffer:a.zoomOutPaintVertexBuffer;o&&this._buffers.push(o)}else(a instanceof xr||a instanceof ir)&&a.paintVertexBuffer&&this._buffers.push(a.paintVertexBuffer)}}upload(e){for(const r in this.binders){const a=this.binders[r];(a instanceof xr||a instanceof ir||a instanceof vr)&&a.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof xr||r instanceof ir||r instanceof vr)&&r.destroy()}}}class Dr{constructor(e,r,a=()=>!0){this.programConfigurations={};for(const o of e)this.programConfigurations[o.id]=new eo(o,r,a);this.needsUpload=!1,this._featureMap=new Ft,this._bufferOffset=0}populatePaintArrays(e,r,a,o,d,p){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,r,o,d,p);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,a,o){for(const d of a)this.needsUpload=this.programConfigurations[d.id].updatePaintArrays(e,this._featureMap,r,d,o)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Ph(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Bc(i,e,r){const a={color:{source:Us,composite:R},number:{source:y,composite:Us}},o=function(d){return{"line-pattern":{source:ft,composite:ft},"fill-pattern":{source:ft,composite:ft},"fill-extrusion-pattern":{source:ft,composite:ft}}[d]}(i);return o&&o[r]||a[e][r]}Ce("ConstantBinder",yr),Ce("CrossFadedConstantBinder",_s),Ce("SourceExpressionBinder",xr),Ce("CrossFadedCompositeBinder",vr),Ce("CompositeExpressionBinder",ir),Ce("ProgramConfiguration",eo,{omit:["_buffers"]}),Ce("ProgramConfigurationSet",Dr);const Zt=8192,Gl=Math.pow(2,14)-1,Fc=-Gl-1;function ga(i){const e=Zt/i.extent,r=i.loadGeometry();for(let a=0;a<r.length;a++){const o=r[a];for(let d=0;d<o.length;d++){const p=o[d],f=Math.round(p.x*e),_=Math.round(p.y*e);p.x=ur(f,Fc,Gl),p.y=ur(_,Fc,Gl),(f<p.x||f>p.x+1||_<p.y||_>p.y+1)&&_i("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function _a(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?ga(i):[]}}function nl(i,e,r,a,o){i.emplaceBack(2*e+(a+1)/2,2*r+(o+1)/2)}class Wl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new De,this.indexArray=new oi,this.segments=new St,this.programConfigurations=new Dr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){const o=this.layers[0],d=[];let p=null,f=!1;o.type==="circle"&&(p=o.layout.get("circle-sort-key"),f=!p.isConstant());for(const{feature:_,id:x,index:b,sourceLayerIndex:T}of e){const A=this.layers[0]._featureFilter.needGeometry,C=_a(_,A);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),C,a))continue;const P=f?p.evaluate(C,{},a):void 0,D={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:b,geometry:A?C.geometry:ga(_),patterns:{},sortKey:P};d.push(D)}f&&d.sort((_,x)=>_.sortKey-x.sortKey);for(const _ of d){const{geometry:x,index:b,sourceLayerIndex:T}=_,A=e[b].feature;this.addFeature(_,x,b,a),r.featureIndex.insert(A,x,b,T,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$i),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,a,o){for(const d of r)for(const p of d){const f=p.x,_=p.y;if(f<0||f>=Zt||_<0||_>=Zt)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=x.vertexLength;nl(this.layoutVertexArray,f,_,-1,-1),nl(this.layoutVertexArray,f,_,1,-1),nl(this.layoutVertexArray,f,_,1,1),nl(this.layoutVertexArray,f,_,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},o)}}function Oc(i,e){for(let r=0;r<i.length;r++)if(en(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(en(i,e[r]))return!0;return!!Hl(i,e)}function kh(i,e,r){return!!en(i,e)||!!Xl(e,i,r)}function Vc(i,e){if(i.length===1)return Uc(e,i[0]);for(let r=0;r<e.length;r++){const a=e[r];for(let o=0;o<a.length;o++)if(en(i,a[o]))return!0}for(let r=0;r<i.length;r++)if(Uc(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(Hl(i,e[r]))return!0;return!1}function zh(i,e,r){if(i.length>1){if(Hl(i,e))return!0;for(let a=0;a<e.length;a++)if(Xl(e[a],i,r))return!0}for(let a=0;a<i.length;a++)if(Xl(i[a],e,r))return!0;return!1}function Hl(i,e){if(i.length===0||e.length===0)return!1;for(let r=0;r<i.length-1;r++){const a=i[r],o=i[r+1];for(let d=0;d<e.length-1;d++)if(Dh(a,o,e[d],e[d+1]))return!0}return!1}function Dh(i,e,r,a){return Bi(i,r,a)!==Bi(e,r,a)&&Bi(i,e,r)!==Bi(i,e,a)}function Xl(i,e,r){const a=r*r;if(e.length===1)return i.distSqr(e[0])<a;for(let o=1;o<e.length;o++)if(Nc(i,e[o-1],e[o])<a)return!0;return!1}function Nc(i,e,r){const a=e.distSqr(r);if(a===0)return i.distSqr(e);const o=((i.x-e.x)*(r.x-e.x)+(i.y-e.y)*(r.y-e.y))/a;return i.distSqr(o<0?e:o>1?r:r.sub(e)._mult(o)._add(e))}function Uc(i,e){let r,a,o,d=!1;for(let p=0;p<i.length;p++){r=i[p];for(let f=0,_=r.length-1;f<r.length;_=f++)a=r[f],o=r[_],a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(d=!d)}return d}function en(i,e){let r=!1;for(let a=0,o=i.length-1;a<i.length;o=a++){const d=i[a],p=i[o];d.y>e.y!=p.y>e.y&&e.x<(p.x-d.x)*(e.y-d.y)/(p.y-d.y)+d.x&&(r=!r)}return r}function Lh(i,e,r){const a=r[0],o=r[2];if(i.x<a.x&&e.x<a.x||i.x>o.x&&e.x>o.x||i.y<a.y&&e.y<a.y||i.y>o.y&&e.y>o.y)return!1;const d=Bi(i,e,r[0]);return d!==Bi(i,e,r[1])||d!==Bi(i,e,r[2])||d!==Bi(i,e,r[3])}function to(i,e,r){const a=e.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(e.id).getMaxValue(i)}function ol(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function ll(i,e,r,a,o){if(!e[0]&&!e[1])return i;const d=ke.convert(e)._mult(o);r==="viewport"&&d._rotate(-a);const p=[];for(let f=0;f<i.length;f++)p.push(i[f].sub(d));return p}let $c,jc;Ce("CircleBucket",Wl,{omit:["layers"]});var Rh={get paint(){return jc=jc||new Nt({"circle-radius":new $e(le.paint_circle["circle-radius"]),"circle-color":new $e(le.paint_circle["circle-color"]),"circle-blur":new $e(le.paint_circle["circle-blur"]),"circle-opacity":new $e(le.paint_circle["circle-opacity"]),"circle-translate":new Oe(le.paint_circle["circle-translate"]),"circle-translate-anchor":new Oe(le.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Oe(le.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Oe(le.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new $e(le.paint_circle["circle-stroke-width"]),"circle-stroke-color":new $e(le.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new $e(le.paint_circle["circle-stroke-opacity"])})},get layout(){return $c=$c||new Nt({"circle-sort-key":new $e(le.layout_circle["circle-sort-key"])})}},ki=1e-6,tn=typeof Float32Array<"u"?Float32Array:Array;function Kl(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function qc(i,e,r){var a=e[0],o=e[1],d=e[2],p=e[3],f=e[4],_=e[5],x=e[6],b=e[7],T=e[8],A=e[9],C=e[10],P=e[11],D=e[12],V=e[13],$=e[14],X=e[15],q=r[0],J=r[1],ie=r[2],de=r[3];return i[0]=q*a+J*f+ie*T+de*D,i[1]=q*o+J*_+ie*A+de*V,i[2]=q*d+J*x+ie*C+de*$,i[3]=q*p+J*b+ie*P+de*X,i[4]=(q=r[4])*a+(J=r[5])*f+(ie=r[6])*T+(de=r[7])*D,i[5]=q*o+J*_+ie*A+de*V,i[6]=q*d+J*x+ie*C+de*$,i[7]=q*p+J*b+ie*P+de*X,i[8]=(q=r[8])*a+(J=r[9])*f+(ie=r[10])*T+(de=r[11])*D,i[9]=q*o+J*_+ie*A+de*V,i[10]=q*d+J*x+ie*C+de*$,i[11]=q*p+J*b+ie*P+de*X,i[12]=(q=r[12])*a+(J=r[13])*f+(ie=r[14])*T+(de=r[15])*D,i[13]=q*o+J*_+ie*A+de*V,i[14]=q*d+J*x+ie*C+de*$,i[15]=q*p+J*b+ie*P+de*X,i}Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)});var io,Bh=qc;function cl(i,e,r){var a=e[0],o=e[1],d=e[2],p=e[3];return i[0]=r[0]*a+r[4]*o+r[8]*d+r[12]*p,i[1]=r[1]*a+r[5]*o+r[9]*d+r[13]*p,i[2]=r[2]*a+r[6]*o+r[10]*d+r[14]*p,i[3]=r[3]*a+r[7]*o+r[11
2]*d+r[15]*p,i}io=new tn(4),tn!=Float32Array&&(io[0]=0,io[1]=0,io[2]=0,io[3]=0);class Fh extends tr{constructor(e){super(e,Rh)}createBucket(e){return new Wl(e)}queryRadius(e){const r=e;return to("circle-radius",this,r)+to("circle-stroke-width",this,r)+ol(this.paint.get("circle-translate"))}queryIntersectsFeature(e,r,a,o,d,p,f,_){const x=ll(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,f),b=this.paint.get("circle-radius").evaluate(r,a)+this.paint.get("circle-stroke-width").evaluate(r,a),T=this.paint.get("circle-pitch-alignment")==="map",A=T?x:function(P,D){return P.map(V=>Zc(V,D))}(x,_),C=T?b*f:b;for(const P of o)for(const D of P){const V=T?D:Zc(D,_);let $=C;const X=cl([],[D.x,D.y,0,1],_);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?$*=X[3]/p.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&($*=p.cameraToCenterDistance/X[3]),kh(A,V,$))return!0}return!1}}function Zc(i,e){const r=cl([],[i.x,i.y,0,1],e);return new ke(r[0]/r[3],r[1]/r[3])}class Gc extends Wl{}let Wc;Ce("HeatmapBucket",Gc,{omit:["layers"]});var Oh={get paint(){return Wc=Wc||new Nt({"heatmap-radius":new $e(le.paint_heatmap["heatmap-radius"]),"heatmap-weight":new $e(le.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Oe(le.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Wn(le.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Oe(le.paint_heatmap["heatmap-opacity"])})}};function Yl(i,{width:e,height:r},a,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==e*r*a)throw new RangeError(`mismatched image size. expected: ${o.length} but got: ${e*r*a}`)}else o=new Uint8Array(e*r*a);return i.width=e,i.height=r,i.data=o,i}function Hc(i,{width:e,height:r},a){if(e===i.width&&r===i.height)return;const o=Yl({},{width:e,height:r},a);Jl(i,o,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},a),i.width=e,i.height=r,i.data=o.data}function Jl(i,e,r,a,o,d){if(o.width===0||o.height===0)return e;if(o.width>i.width||o.height>i.height||r.x>i.width-o.width||r.y>i.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||a.x>e.width-o.width||a.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");const p=i.data,f=e.data;if(p===f)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_<o.height;_++){const x=((r.y+_)*i.width+r.x)*d,b=((a.y+_)*e.width+a.x)*d;for(let T=0;T<o.width*d;T++)f[b+T]=p[x+T]}return e}class ro{constructor(e,r){Yl(this,e,1,r)}resize(e){Hc(this,e,1)}clone(){return new ro({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,a,o,d){Jl(e,r,a,o,d,1)}}class nr{constructor(e,r){Yl(this,e,4,r)}resize(e){Hc(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new nr({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,a,o,d){Jl(e,r,a,o,d,4)}}function Xc(i){const e={},r=i.resolution||256,a=i.clips?i.clips.length:1,o=i.image||new nr({width:r,height:a});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const d=(p,f,_)=>{e[i.evaluationKey]=_;const x=i.expression.evaluate(e);o.data[p+f+0]=Math.floor(255*x.r/x.a),o.data[p+f+1]=Math.floor(255*x.g/x.a),o.data[p+f+2]=Math.floor(255*x.b/x.a),o.data[p+f+3]=Math.floor(255*x.a)};if(i.clips)for(let p=0,f=0;p<a;++p,f+=4*r)for(let _=0,x=0;_<r;_++,x+=4){const b=_/(r-1),{start:T,end:A}=i.clips[p];d(f,x,T*(1-b)+A*b)}else for(let p=0,f=0;p<r;p++,f+=4)d(0,f,p/(r-1));return o}Ce("AlphaImage",ro),Ce("RGBAImage",nr);class Vh extends tr{createBucket(e){return new Gc(e)}constructor(e){super(e,Oh),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Xc({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Kc;var Nh={get paint(){return Kc=Kc||new Nt({"hillshade-illumination-direction":new Oe(le.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Oe(le.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Oe(le.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Oe(le.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Oe(le.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Oe(le.paint_hillshade["hillshade-accent-color"])})}};class Uh extends tr{constructor(e){super(e,Nh)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const $h=kt([{name:"a_pos",components:2,type:"Int16"}],4),{members:jh}=$h;var Ql={exports:{}};function ul(i,e,r){r=r||2;var a,o,d,p,f,_,x,b=e&&e.length,T=b?e[0]*r:i.length,A=Yc(i,0,T,r,!0),C=[];if(!A||A.next===A.prev)return C;if(b&&(A=function(D,V,$,X){var q,J,ie,de=[];for(q=0,J=V.length;q<J;q++)(ie=Yc(D,V[q]*X,q<J-1?V[q+1]*X:D.length,X,!1))===ie.next&&(ie.steiner=!0),de.push(Yh(ie));for(de.sort(Hh),q=0;q<de.length;q++)$=Xh(de[q],$);return $}(i,e,A,r)),i.length>80*r){a=d=i[0],o=p=i[1];for(var P=r;P<T;P+=r)(f=i[P])<a&&(a=f),(_=i[P+1])<o&&(o=_),f>d&&(d=f),_>p&&(p=_);x=(x=Math.max(d-a,p-o))!==0?32767/x:0}return so(A,C,r,a,o,x,0),C}function Yc(i,e,r,a,o){var d,p;if(o===ic(i,e,r,a)>0)for(d=e;d<r;d+=a)p=eu(d,i[d],i[d+1],p);else for(d=r-a;d>=e;d-=a)p=eu(d,i[d],i[d+1],p);return p&&hl(p,p.next)&&(no(p),p=p.next),p}function ya(i,e){if(!i)return i;e||(e=i);var r,a=i;do if(r=!1,a.steiner||!hl(a,a.next)&&$t(a.prev,a,a.next)!==0)a=a.next;else{if(no(a),(a=e=a.prev)===a.next)break;r=!0}while(r||a!==e);return e}function so(i,e,r,a,o,d,p){if(i){!p&&d&&function(b,T,A,C){var P=b;do P.z===0&&(P.z=ec(P.x,P.y,T,A,C)),P.prevZ=P.prev,P.nextZ=P.next,P=P.next;while(P!==b);P.prevZ.nextZ=null,P.prevZ=null,function(D){var V,$,X,q,J,ie,de,Me,Le=1;do{for($=D,D=null,J=null,ie=0;$;
vendor: 4,813 bytes, line 2
2){for(ie++,X=$,de=0,V=0;V<Le&&(de++,X=X.nextZ);V++);for(Me=Le;de>0||Me>0&&X;)de!==0&&(Me===0||!X||$.z<=X.z)?(q=$,$=$.nextZ,de--):(q=X,X=X.nextZ,Me--),J?J.nextZ=q:D=q,q.prevZ=J,J=q;$=X}J.nextZ=null,Le*=2}while(ie>1)}(P)}(i,a,o,d);for(var f,_,x=i;i.prev!==i.next;)if(f=i.prev,_=i.next,d?Zh(i,a,o,d):qh(i))e.push(f.i/r|0),e.push(i.i/r|0),e.push(_.i/r|0),no(i),i=_.next,x=_.next;else if((i=_)===x){p?p===1?so(i=Gh(ya(i),e,r),e,r,a,o,d,2):p===2&&Wh(i,e,r,a,o,d):so(ya(i),e,r,a,o,d,1);break}}}function qh(i){var e=i.prev,r=i,a=i.next;if($t(e,r,a)>=0)return!1;for(var o=e.x,d=r.x,p=a.x,f=e.y,_=r.y,x=a.y,b=o<d?o<p?o:p:d<p?d:p,T=f<_?f<x?f:x:_<x?_:x,A=o>d?o>p?o:p:d>p?d:p,C=f>_?f>x?f:x:_>x?_:x,P=a.next;P!==e;){if(P.x>=b&&P.x<=A&&P.y>=T&&P.y<=C&&rn(o,f,d,_,p,x,P.x,P.y)&&$t(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function Zh(i,e,r,a){var o=i.prev,d=i,p=i.next;if($t(o,d,p)>=0)return!1;for(var f=o.x,_=d.x,x=p.x,b=o.y,T=d.y,A=p.y,C=f<_?f<x?f:x:_<x?_:x,P=b<T?b<A?b:A:T<A?T:A,D=f>_?f>x?f:x:_>x?_:x,V=b>T?b>A?b:A:T>A?T:A,$=ec(C,P,e,r,a),X=ec(D,V,e,r,a),q=i.prevZ,J=i.nextZ;q&&q.z>=$&&J&&J.z<=X;){if(q.x>=C&&q.x<=D&&q.y>=P&&q.y<=V&&q!==o&&q!==p&&rn(f,b,_,T,x,A,q.x,q.y)&&$t(q.prev,q,q.next)>=0||(q=q.prevZ,J.x>=C&&J.x<=D&&J.y>=P&&J.y<=V&&J!==o&&J!==p&&rn(f,b,_,T,x,A,J.x,J.y)&&$t(J.prev,J,J.next)>=0))return!1;J=J.nextZ}for(;q&&q.z>=$;){if(q.x>=C&&q.x<=D&&q.y>=P&&q.y<=V&&q!==o&&q!==p&&rn(f,b,_,T,x,A,q.x,q.y)&&$t(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;J&&J.z<=X;){if(J.x>=C&&J.x<=D&&J.y>=P&&J.y<=V&&J!==o&&J!==p&&rn(f,b,_,T,x,A,J.x,J.y)&&$t(J.prev,J,J.next)>=0)return!1;J=J.nextZ}return!0}function Gh(i,e,r){var a=i;do{var o=a.prev,d=a.next.next;!hl(o,d)&&Jc(o,a,a.next,d)&&ao(o,d)&&ao(d,o)&&(e.push(o.i/r|0),e.push(a.i/r|0),e.push(d.i/r|0),no(a),no(a.next),a=i=d),a=a.next}while(a!==i);return ya(a)}function Wh(i,e,r,a,o,d){var p=i;do{for(var f=p.next.next;f!==p.prev;){if(p.i!==f.i&&Jh(p,f)){var _=Qc(p,f);return p=ya(p,p.next),_=ya(_,_.next),so(p,e,r,a,o,d,0),void so(_,e,r,a,o,d,0)}f=f.next}p=p.next}while(p!==i)}function Hh(i,e){return i.x-e.x}function Xh(i,e){var r=function(o,d){var p,f=d,_=o.x,x=o.y,b=-1/0;do{if(x<=f.y&&x>=f.next.y&&f.next.y!==f.y){var T=f.x+(x-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(T<=_&&T>b&&(b=T,p=f.x<f.next.x?f:f.next,T===_))return p}f=f.next}while(f!==d);if(!p)return null;var A,C=p,P=p.x,D=p.y,V=1/0;f=p;do _>=f.x&&f.x>=P&&_!==f.x&&rn(x<D?_:b,x,P,D,x<D?b:_,x,f.x,f.y)&&(A=Math.abs(x-f.y)/(_-f.x),ao(f,o)&&(A<V||A===V&&(f.x>p.x||f.x===p.x&&Kh(p,f)))&&(p=f,V=A)),f=f.next;while(f!==C);return p}(i,e);if(!r)return e;var a=Qc(r,i);return ya(a,a.next),ya(r,r.next)}function Kh(i,e){return $t(i.prev,i,e.prev)<0&&$t(e.next,i,i.next)<0}function ec(i,e,r,a,o){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*o|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Yh(i){var e=i,r=i;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==i);return r}function rn(i,e,r,a,o,d,p,f){return(o-p)*(e-f)>=(i-p)*(d-f)&&(i-p)*(a-f)>=(r-p)*(e-f)&&(r-p)*(d-f)>=(o-p)*(a-f)}function Jh(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,a){var o=r;do{if(o.i!==r.i&&o.next.i!==r.i&&o.i!==a.i&&o.next.i!==a.i&&Jc(o,o.next,r,a))return!0;o=o.next}while(o!==r);return!1}(i,e)&&(ao(i,e)&&ao(e,i)&&function(r,a){var o=r,d=!1,p=(r.x+a.x)/2,f=(r.y+a.y)/2;do o.y>f!=o.next.y>f&&o.next.y!==o.y&&p<(o.next.x-o.x)*(f-o.y)/(o.next.y-o.y)+o.x&&(d=!d),o=o.next;while(o!==r);return d}(i,e)&&($t(i.prev,i,e.prev)||$t(i,e.prev,e))||hl(i,e)&&$t(i.prev,i,i.next)>0&&$t(e.prev,e,e.next)>0)}function $t(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function hl(i,e){return i.x===e.x&&i.y===e.y}function Jc(i,e,r,a){var o=pl($t(i,e,r)),d=pl($t(i,e,a)),p=pl($t(r,a,i)),f=pl($t(r,a,e));return o!==d&&p!==f||!(o!==0||!dl(i,r,e))||!(d!==0||!dl(i,a,e))||!(p!==0||!dl(r,i,a))||!(f!==0||!dl(r,e,a))}function dl(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function pl(i){return i>0?1:i<0?-1:0}function ao(i,e){return $t(i.prev,i,i.next)<0?$t(i,e,i.next)>=0&&$t(i,i.prev,e)>=0:$t(i,e,i.prev)<0||$t(i,i.next,e)<0}function Qc(i,e){var r=new tc(i.i,i.x,i.y),a=new tc(e.i,e.x,e.y),o=i.next,d=e.prev;return i.next=e,e.prev=i,r.next=o,o.prev=r,a.next=r,r.prev=a,d.next=a,a.prev=d,a}function eu(i,e,r,a){var o=new tc(i,e,r);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function no(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function tc(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ic(i,e,r,a){for(var o=0,d=e,p=r-a;d<r;d+=a)o+=(i[p]-i[d])*(i[d+1]+i[p+1]),p=d;return o}
2Ql.exports=ul,Ql.exports.default=ul,ul.deviation=function(i,e,r,a){var o=e&&e.length,d=Math.abs(ic(i,0,o?e[0]*r:i.length,r));if(o)for(var p=0,f=e.length;p<f;p++)d-=Math.abs(ic(i,e[p]*r,p<f-1?e[p+1]*r:i.length,r));var _=0;for(p=0;p<a.length;p+=3){var x=a[p]*r,b=a[p+1]*r,T=a[p+2]*r;_+=Math.abs((i[x]-i[T])*(i[b+1]-i[x+1])-(i[x]-i[b])*(i[T+1]-i[x+1]))}return d===0&&_===0?0:Math.abs((_-d)/d)},ul.flatten=function(i){for(var e=i[0][0].length,r={vertices:[],holes:[],dimensions:e},a=0,o=0;o<i.length;o++){for(var d=0;d<i[o].length;d++)for(var p=0;p<e;p++)r.vertices.push(i[o][d][p]);o>0&&r.holes.push(a+=i[o-1].length)}return r};var tu=K(Ql.exports);function Qh(i,e,r,a,o){iu(i,e,r,a||i.length-1,o||ed)}function iu(i,e,r,a,o){for(;a>r;){if(a-r>600){var d=a-r+1,p=e-r+1,f=Math.log(d),_=.5*Math.exp(2*f/3),x=.5*Math.sqrt(f*_*(d-_)/d)*(p-d/2<0?-1:1);iu(i,e,Math.max(r,Math.floor(e-p*_/d+x)),Math.min(a,Math.floor(e+(d-p)*_/d+x)),o)}var b=i[e],T=r,A=a;for(oo(i,r,e),o(i[a],b)>0&&oo(i,r,a);T<A;){for(oo(i,T,A),T++,A--;o(i[T],b)<0;)T++;for(;o(i[A],b)>0;)A--}o(i[r],b)===0?oo(i,r,A):oo(i,++A,a),A<=e&&(r=A+1),e<=A&&(a=A-1)}}function oo(i,e,r){var a=i[e];i[e]=i[r],i[r]=a}function ed(i,e){return i<e?-1:i>e?1:0}function rc(i,e){const r=i.length;if(r<=1)return[i];const a=[];let o,d;for(let p=0;p<r;p++){const f=Tr(i[p]);f!==0&&(i[p].area=Math.abs(f),d===void 0&&(d=f<0),d===f<0?(o&&a.push(o),o=[i[p]]):o.push(i[p]))}if(o&&a.push(o),e>1)for(let p=0;p<a.length;p++)a[p].length<=e||(Qh(a[p],e,1,a[p].length-1,td),a[p]=a[p].slice(0,e));return a}function td(i,e){return e.area-i.area}function sc(i,e,r){const a=r.patternDependencies;let o=!1;for(const d of e){const p=d.paint.get(`${i}-pattern`);p.isConstant()||(o=!0);const f=p.constantOr(null);f&&(o=!0,a[f.to]=!0,a[f.from]=!0)}return o}function ac(i,e,r,a,o){const d=o.patternDependencies;for(const p of e){const f=p.paint.get(`${i}-pattern`).value;if(f.kind!=="constant"){let _=f.evaluate({zoom:a-1},r,{},o.availableImages),x=f.evaluate({zoom:a},r,{},o.availableImages),b=f.evaluate({zoom:a+1},r,{},o.availableImages);_=_&&_.name?_.name:_,x=x&&x.name?x.name:x,b=b&&b.name?b.name:b,d[_]=!0,d[x]=!0,d[b]=!0,r.patterns[p.id]={min:_,mid:x,max:b}}}return r}class nc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new et,this.indexArray=new oi,this.indexArray2=new Ht,this.programConfigurations=new Dr(e.layers,e.zoom),this.segments=new St,this.segments2=new St,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=sc("fill",this.layers,r);const o=this.layers[0].layout.get("fill-sort-key"),d=!o.isConstant(),p=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of e){const T=this.layers[0]._featureFilter.needGeometry,A=_a(f,T);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),A,a))continue;const C=d?o.evaluate(A,{},a,r.availableImages):void 0,P={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:T?A.geometry:ga(f),patterns:{},sortKey:C};p.push(P)}d&&p.sort((f,_)=>f.sortKey-_.sortKey);for(const f of p){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const T=ac("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(f,_,x,a,{});r.featureIndex.insert(e[x].feature,_,x,b,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,jh),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,a,o,d){for(const p of rc(r,500)){let f=0;for(const C of p)f+=C.length;const _=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),x=_.vertexLength,b=[],T=[];
2for(const C of p){if(C.length===0)continue;C!==p[0]&&T.push(b.length/2);const P=this.segments2.prepareSegment(C.length,this.layoutVertexArray,this.indexArray2),D=P.vertexLength;this.layoutVertexArray.emplaceBack(C[0].x,C[0].y),this.indexArray2.emplaceBack(D+C.length-1,D),b.push(C[0].x),b.push(C[0].y);for(let V=1;V<C.length;V++)this.layoutVertexArray.emplaceBack(C[V].x,C[V].y),this.indexArray2.emplaceBack(D+V-1,D+V),b.push(C[V].x),b.push(C[V].y);P.vertexLength+=C.length,P.primitiveLength+=C.length}const A=tu(b,T);for(let C=0;C<A.length;C+=3)this.indexArray.emplaceBack(x+A[C],x+A[C+1],x+A[C+2]);_.vertexLength+=f,_.primitiveLength+=A.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,d,o)}}let ru,su;Ce("FillBucket",nc,{omit:["layers","patternFeatures"]});var id={get paint(){return su=su||new Nt({"fill-antialias":new Oe(le.paint_fill["fill-antialias"]),"fill-opacity":new $e(le.paint_fill["fill-opacity"]),"fill-color":new $e(le.paint_fill["fill-color"]),"fill-outline-color":new $e(le.paint_fill["fill-outline-color"]),"fill-translate":new Oe(le.paint_fill["fill-translate"]),"fill-translate-anchor":new Oe(le.paint_fill["fill-translate-anchor"]),"fill-pattern":new pa(le.paint_fill["fill-pattern"])})},get layout(){return ru=ru||new Nt({"fill-sort-key":new $e(le.layout_fill["fill-sort-key"])})}};class rd extends tr{constructor(e){super(e,id)}recalculate(e,r){super.recalculate(e,r);const a=this.paint._values["fill-outline-color"];a.value.kind==="constant"&&a.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new nc(e)}queryRadius(){return ol(this.paint.get("fill-translate"))}queryIntersectsFeature(e,r,a,o,d,p,f){return Vc(ll(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,f),o)}isTileClipped(){return!0}}const sd=kt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),ad=kt([{name:"a_centroid",components:2,type:"Int16"}],4),{members:nd}=sd;var js={},od=Ke,au=sn;function sn(i,e,r,a,o){this.properties={},this.extent=r,this.type=0,this._pbf=i,this._geometry=-1,this._keys=a,this._values=o,i.readFields(ld,this,e)}function ld(i,e,r){i==1?e.id=r.readVarint():i==2?function(a,o){for(var d=a.readVarint()+a.pos;a.pos<d;){var p=o._keys[a.readVarint()],f=o._values[a.readVarint()];o.properties[p]=f}}(r,e):i==3?e.type=r.readVarint():i==4&&(e._geometry=r.pos)}function cd(i){for(var e,r,a=0,o=0,d=i.length,p=d-1;o<d;p=o++)a+=((r=i[p]).x-(e=i[o]).x)*(e.y+r.y);return a}sn.types=["Unknown","Point","LineString","Polygon"],sn.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var e,r=i.readVarint()+i.pos,a=1,o=0,d=0,p=0,f=[];i.pos<r;){if(o<=0){var _=i.readVarint();a=7&_,o=_>>3}if(o--,a===1||a===2)d+=i.readSVarint(),p+=i.readSVarint(),a===1&&(e&&f.push(e),e=[]),e.push(new od(d,p));else{if(a!==7)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&f.push(e),f},sn.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,a=0,o=0,d=0,p=1/0,f=-1/0,_=1/0,x=-1/0;i.pos<e;){if(a<=0){var b=i.readVarint();r=7&b,a=b>>3}if(a--,r===1||r===2)(o+=i.readSVarint())<p&&(p=o),o>f&&(f=o),(d+=i.readSVarint())<_&&(_=d),d>x&&(x=d);else if(r!==7)throw new Error("unknown command "+r)}return[p,_,f,x]},sn.prototype.toGeoJSON=function(i,e,r){var a,o,d=this.extent*Math.pow(2,r),p=this.extent*i,f=this.extent*e,_=this.loadGeometry(),x=sn.types[this.type];function b(C){for(var P=0;P<C.length;P++){var D=C[P];C[P]=[360*(D.x+p)/d-180,360/Math.PI*Math.atan(Math.exp((180-360*(D.y+f)/d)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(a=0;a<_.length;a++)T[a]=_[a][0];b(_=T);break;case 2:for(a=0;a<_.length;a++)b(_[a]);break;case 3:for(_=function(C){var P=C.length;if(P<=1)return[C];for(var D,V,$=[],X=0;X<P;X++){var q=cd(C[X]);q!==0&&(V===void 0&&(V=q<0),V===q<0?(D&&$.push(D),D=[C[X]]):D.push(C[X]))}return D&&$.push(D),$}(_),a=0;a<_.length;a++)for(o=0;o<_[a].length;o++)b(_[a][o])}_.length===1?_=_[0]:x="Multi"+x;var A={type:"Feature",geometry:{type:x,coordinates:_},properties:this.properties};return"id"in this&&(A.id=this.id),A};
2var ud=au,nu=ou;function ou(i,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(hd,this,e),this.length=this._features.length}function hd(i,e,r){i===15?e.version=r.readVarint():i===1?e.name=r.readString():i===5?e.extent=r.readVarint():i===2?e._features.push(r.pos):i===3?e._keys.push(r.readString()):i===4&&e._values.push(function(a){for(var o=null,d=a.readVarint()+a.pos;a.pos<d;){var p=a.readVarint()>>3;o=p===1?a.readString():p===2?a.readFloat():p===3?a.readDouble():p===4?a.readVarint64():p===5?a.readVarint():p===6?a.readSVarint():p===7?a.readBoolean():null}return o}(r))}ou.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new ud(this._pbf,e,this.extent,this._keys,this._values)};var dd=nu;function pd(i,e,r){if(i===3){var a=new dd(r,r.readVarint()+r.pos);a.length&&(e[a.name]=a)}}js.VectorTile=function(i,e){this.layers=i.readFields(pd,{},e)},js.VectorTileFeature=au,js.VectorTileLayer=nu;const fd=js.VectorTileFeature.types,oc=Math.pow(2,13);function lo(i,e,r,a,o,d,p,f){i.emplaceBack(e,r,2*Math.floor(a*oc)+p,o*oc*2,d*oc*2,Math.round(f))}class lc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Te,this.centroidVertexArray=new ye,this.indexArray=new oi,this.programConfigurations=new Dr(e.layers,e.zoom),this.segments=new St,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.features=[],this.hasPattern=sc("fill-extrusion",this.layers,r);for(const{feature:o,id:d,index:p,sourceLayerIndex:f}of e){const _=this.layers[0]._featureFilter.needGeometry,x=_a(o,_);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),x,a))continue;const b={id:d,sourceLayerIndex:f,index:p,geometry:_?x.geometry:ga(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(ac("fill-extrusion",this.layers,b,this.zoom,r)):this.addFeature(b,b.geometry,p,a,{}),r.featureIndex.insert(o,b.geometry,p,f,this.index,!0)}}addFeatures(e,r,a){for(const o of this.features){const{geometry:d}=o;this.addFeature(o,d,o.index,r,a)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,nd),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,ad.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,a,o,d){const p={x:0,y:0,vertexCount:0};for(const f of rc(r,500)){let _=0;for(const P of f)_+=P.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const P of f){if(P.length===0||gd(P))continue;let D=0;for(let V=0;V<P.length;V++){const $=P[V];if(V>=1){const X=P[V-1];if(!md($,X)){x.vertexLength+4>St.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const q=$.sub(X)._perp()._unit(),J=X.dist($);D+J>32768&&(D=0),lo(this.layoutVertexArray,$.x,$.y,q.x,q.y,0,0,D),lo(this.layoutVertexArray,$.x,$.y,q.x,q.y,0,1,D),p.x+=2*$.x,p.y+=2*$.y,p.vertexCount+=2,D+=J,lo(this.layoutVertexArray,X.x,X.y,q.x,q.y,0,0,D),lo(this.layoutVertexArray,X.x,X.y,q.x,q.y,0,1,D),p.x+=2*X.x,p.y+=2*X.y,p.vertexCount+=2;const ie=x.vertexLength;this.indexArray.emplaceBack(ie,ie+2,ie+1),this.indexArray.emplaceBack(ie+1,ie+2,ie+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+_>St.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),fd[e.type]!=="Polygon")continue;const b=[],T=[],A=x.vertexLength;for(const P of f)if(P.length!==0){P!==f[0]&&T.push(b.length/2);for(let D=0;D<P.length;D++){const V=P[D];lo(this.layoutVertexArray,V.x,V.y,0,0,1,1,0),p.x+=V.x,p.y+=V.y,p.vertexCount+=1,b.push(V.x),b.push(V.y)}}const C=tu(b,T);for(let P=0;P<C.length;P+=3)this.indexArray.emplaceBack(A+C[P],A+C[P+2],A+C[P+1]);x.primitiveLength+=C.length/3,x.vertexLength+=_}for(let f=0;f<p.vertexCount;f++)this.centroidVertexArray.emplaceBack(Math.floor(p.x/p.vertexCount),Math.floor(p.y/p.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,d,o)}}function md(i,e){return i.x===e.x&&(i.x<0||i.x>Zt)||i.y===e.y&&(i.y<0||i.y>Zt)}function gd(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Zt)||i.every(e=>e.y<0)||i.every(e=>e.y>Zt)}let lu;Ce("FillExtrusionBucket",lc,{omit:["layers","features"]});var _d={get paint(){return lu=lu||new Nt({"fill-extrusion-opacity":new Oe(le["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new $e(le["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Oe(le["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Oe(le["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new pa(le["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new $e(le["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new $e(le["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Oe(le["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class yd extends tr{constructor(e){super(e,_d)}createBucket(e){return new lc(e)}queryRadius(){return ol(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,a,o,d,p,f,_){const x=ll(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,f),b=this.paint.get("fill-extrusion-height").evaluate(r,a),T=this.paint.get("fill-extrusion-base").evaluate(r,a),A=function(P,D,V,$){const X=[];for(const q of P){const J=[q.x,q.y,0,1];cl(J,J,D),X.push(new ke(J[0]/J[3],J[1]/J[3]))}return X}(x,_),C=function(P,D,V,$){const X=[],q=[],J=$[8]*D,ie=$[9]*D,de=$[10]*D,Me=$[11]*D,Le=$[8]*V,Ae=$[9]*V,Ie=$[10]*V,ve=$[11
vendor: 17,103 bytes, line 2
2]*V;for(const Pe of P){const we=[],_e=[];for(const Ne of Pe){const Be=Ne.x,Je=Ne.y,Tt=$[0]*Be+$[4]*Je+$[12],At=$[1]*Be+$[5]*Je+$[13],Yt=$[2]*Be+$[6]*Je+$[14],rr=$[3]*Be+$[7]*Je+$[15],zi=Yt+de,Gt=rr+Me,ci=Tt+Le,fi=At+Ae,Di=Yt+Ie,Li=rr+ve,Jt=new ke((Tt+J)/Gt,(At+ie)/Gt);Jt.z=zi/Gt,we.push(Jt);const Qt=new ke(ci/Li,fi/Li);Qt.z=Di/Li,_e.push(Qt)}X.push(we),q.push(_e)}return[X,q]}(o,T,b,_);return function(P,D,V){let $=1/0;Vc(V,D)&&($=cu(V,D[0]));for(let X=0;X<D.length;X++){const q=D[X],J=P[X];for(let ie=0;ie<q.length-1;ie++){const de=q[ie],Me=[de,q[ie+1],J[ie+1],J[ie],de];Oc(V,Me)&&($=Math.min($,cu(V,Me)))}}return $!==1/0&&$}(C[0],C[1],A)}}function co(i,e){return i.x*e.x+i.y*e.y}function cu(i,e){if(i.length===1){let r=0;const a=e[r++];let o;for(;!o||a.equals(o);)if(o=e[r++],!o)return 1/0;for(;r<e.length;r++){const d=e[r],p=i[0],f=o.sub(a),_=d.sub(a),x=p.sub(a),b=co(f,f),T=co(f,_),A=co(_,_),C=co(x,f),P=co(x,_),D=b*A-T*T,V=(A*C-T*P)/D,$=(b*P-T*C)/D,X=a.z*(1-V-$)+o.z*V+d.z*$;if(isFinite(X))return X}return 1/0}{let r=1/0;for(const a of e)r=Math.min(r,a.z);return r}}const xd=kt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:vd}=xd,bd=kt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:wd}=bd,Sd=js.VectorTileFeature.types,Td=Math.cos(Math.PI/180*37.5),uu=Math.pow(2,14)/.5;class cc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new je,this.layoutVertexArray2=new Re,this.indexArray=new oi,this.programConfigurations=new Dr(e.layers,e.zoom),this.segments=new St,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,a){this.hasPattern=sc("line",this.layers,r);const o=this.layers[0].layout.get("line-sort-key"),d=!o.isConstant(),p=[];for(const{feature:f,id:_,index:x,sourceLayerIndex:b}of e){const T=this.layers[0]._featureFilter.needGeometry,A=_a(f,T);if(!this.layers[0]._featureFilter.filter(new wt(this.zoom),A,a))continue;const C=d?o.evaluate(A,{},a):void 0,P={id:_,properties:f.properties,type:f.type,sourceLayerIndex:b,index:x,geometry:T?A.geometry:ga(f),patterns:{},sortKey:C};p.push(P)}d&&p.sort((f,_)=>f.sortKey-_.sortKey);for(const f of p){const{geometry:_,index:x,sourceLayerIndex:b}=f;if(this.hasPattern){const T=ac("line",this.layers,f,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(f,_,x,a,{});r.featureIndex.insert(e[x].feature,_,x,b,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,wd)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vd),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,a,o,d){const p=this.layers[0].layout,f=p.get("line-join").evaluate(e,{}),_=p.get("line-cap"),x=p.get("line-miter-limit"),b=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const T of r)this.addLine(T,e,f,_,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,d,o)}addLine(e,r,a,o,d,p){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let $=0;$<e.length-1;$++)this.totalDistance+=e[$].dist(e[$+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const f=Sd[r.type]==="Polygon";let _=e.length;for(;_>=2&&e[_-1].equals(e[_-2]);)_--;let x=0;for(;x<_-1&&e[x].equals(e[x+1]);)x++;if(_<(f?3:2))return;a==="bevel"&&(d=1.05);const b=this.overscaling<=16?15*Zt/(512*this.overscaling):0,T=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray);let A,C,P,D,V;this.e1=this.e2=-1,f&&(A=e[_-2],V=e[x].sub(A)._unit()._perp());for(let $=x;$<_;$++){if(P=$===_-1?f?e[x+1]:void 0:e[$+1],P&&e[$].equals(P))continue;V&&(D=V),A&&(C=A),A=e[$],V=P?P.sub(A)._unit()._perp():D,D=D||V;let X=D.add(V);X.x===0&&X.y===0||X._unit();const q=D.x*V.x+D.y*V.y,J=X.x*V.x+X.y*V.y,ie=J!==0?1/J:1/0,de=2*Math.sqrt(2-2*J),Me=J<Td&&C&&P,Le=D.x*V.y-D.y*V.x>0;if(Me&&$>x){const ve=A.dist(C);if(ve>2*b){const Pe=A.sub(A.sub(C)._mult(b/ve)._round());this.updateDistance(C,Pe),this.addCurrentVertex(Pe,D,0,0,T),C=Pe}}const Ae=C&&P;let Ie=Ae?a:f?"butt":o;if(Ae&&Ie==="round"&&(ie<p?Ie="miter":ie<=2&&(Ie="fakeround")),Ie==="miter"&&ie>d&&(Ie="bevel"),Ie==="bevel"&&(ie>2&&(Ie="flipbevel"),ie<d&&(Ie="miter")),C&&this.updateDistance(C,A),Ie==="miter")X._mult(ie),this.addCurrentVertex(A,X,0,0,T);else if(Ie==="flipbevel"){if(ie>100)X=V.mult(-1);else{const ve=ie*D.add(V).mag()/D.sub(V).mag();X._perp()._mult(ve*(Le?-1:1))}this.addCurrentVertex(A,X,0,0,T),this.addCurrentVertex(A,X.mult(-1),0,0,T)}else if(Ie==="bevel"||Ie==="fakeround"){const ve=-Math.sqrt(ie*ie-1),Pe=Le?ve:0,we=Le?0:ve;if(C&&this.addCurrentVertex(A,D,Pe,we,T),Ie==="fakeround"){const _e=Math.round(180*de/Math.PI/20);for(let Ne=1;Ne<_e;Ne++){let Be=Ne/_e;if(Be!==.5){const Tt=Be-.5;Be+=Be*Tt*(Be-1)*((1.0904+q*(q*(3.55645-1.43519*q)-3.2452))*Tt*Tt+(.848013+q*(.215638*q-1.06021)))}const Je=V.sub(D)._mult(Be)._add(D)._unit()._mult(Le?-1:1);this.addHalfVertex(A,Je.x,Je.y,!1,Le,0,T)}}P&&this.addCurrentVertex(A,V,-Pe,-we,T)}else if(Ie==="butt")this.addCurrentVertex(A,X,0,0,T);else if(Ie==="square"){const ve=C?1:-1;this.addCurrentVertex(A,X,ve,ve,T)}else Ie==="round"&&(C&&(this.addCurrentVertex(A,D,0,0,T),this.addCurrentVertex(A,D,1,1,T,!0)),P&&(this.addCurrentVertex(A,V,-1,-1,T,!0),this.addCurrentVertex(A,V,0,0,T)));if(Me&&$<_-1){const ve=A.dist(P);if(ve>2*b){const Pe=A.add(P.sub(A)._mult(b/ve)._round());this.updateDistance(A,Pe),this.addCurrentVertex(Pe,V,0,0,T),A=Pe}}}}addCurrentVertex(e,r,a,o,d,p=!1){const f=r.y*o-r.x,_=-r.y-r.x*o;this.addHalfVertex(e,r.x+r.y*a,r.y-r.x*a,p,!1,a,d),this.addHalfVertex(e,f,_,p,!0,-o,d),this.distance>uu/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,a,o,d,p))}addHalfVertex({x:e,y:r},a,o,d,p,f,_){const x=.5*(this.lineClips?this.scaledDistance*(uu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(d?1:0),(r<<1)+(p?1:0),Math.round(63*a)+128,Math.round(63*o)+128,1+(f===0?0:f<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const b=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),_.primitiveLength++),p?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let hu,du;Ce("LineBucket",cc,{omit:["layers","patternFeatures"]});var pu={get paint(){return du=du||new Nt({"line-opacity":new $e(le.paint_line["line-opacity"]),"line-color":new $e(le.paint_line["line-color"]),"line-translate":new Oe(le.paint_line["line-translate"]),"line-translate-anchor":new Oe(le.paint_line["line-translate-anchor"]),"line-width":new $e(le.paint_line["line-width"]),"line-gap-width":new $e(le.paint_line["line-gap-width"]),"line-offset":new $e(le.paint_line["line-offset"]),"line-blur":new $e(le.paint_line["line-blur"]),"line-dasharray":new Gn(le.paint_line["line-dasharray"]),"line-pattern":new pa(le.paint_line["line-pattern"]),"line-gradient":new Wn(le.paint_line["line-gradient"])})},get layout(){return hu=hu||new Nt({"line-cap":new Oe(le.layout_line["line-cap"]),"line-join":new $e(le.layout_line["line-join"]),"line-miter-limit":new Oe(le.layout_line["line-miter-limit"]),"line-round-limit":new Oe(le.layout_line["line-round-limit"]),"line-sort-key":new $e(le.layout_line["line-sort-key"])})}};class Id extends $e{possiblyEvaluate(e,r){return r=new wt(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,a,o){return r=si({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,a,o)}}let fl;class Ad extends tr{constructor(e){super(e,pu),this.gradientVersion=0,fl||(fl=new Id(pu.paint.properties["line-width"].specification),fl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(r)&&r._styleExpression.expression instanceof Gr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=fl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new cc(e)}queryRadius(e){const r=e,a=fu(to("line-width",this,r),to("line-gap-width",this,r)),o=to("line-offset",this,r);return a/2+Math.abs(o)+ol(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,a,o,d,p,f){const _=ll(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),p.angle,f),x=f/2*fu(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),b=this.paint.get("line-offset").evaluate(r,a);return b&&(o=function(T,A){const C=[];for(let P=0;P<T.length;P++){const D=T[P],V=[];for(let $=0;$<D.length;$++){const X=D[$-1],q=D[$],J=D[$+1],ie=$===0?new ke(0,0):q.sub(X)._unit()._perp(),de=$===D.length-1?new ke(0,0):J.sub(q)._unit()._perp(),Me=ie._add(de)._unit(),Le=Me.x*de.x+Me.y*de.y;Le!==0&&Me._mult(1/Le),V.push(Me._mult(A)._add(q))}C.push(V)}return C}(o,b*f)),function(T,A,C){for(let P=0;P<A.length;P++){const D=A[P];if(T.length>=3){for(let V=0;V<D.length;V++)if(en(T,D[V]))return!0}if(zh(T,D,C))return!0}return!1}(_,o,x)}isTileClipped(){return!0}}function fu(i,e){return e>0?e+2*i:i}const Ed=kt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Md=kt([{name:"a_projected_pos",components:3,type:"Float32"}],4);kt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Cd=kt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);kt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const mu=kt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Pd=kt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function kd(i,e,r){return i.sections.forEach(a=>{a.text=function(o,d,p){const f=d.layout.get("text-transform").evaluate(p,{});return f==="uppercase"?o=o.toLocaleUpperCase():f==="lowercase"&&(o=o.toLocaleLowerCase()),Ui.applyArabicShaping&&(o=Ui.applyArabicShaping(o)),o}(a.text,e,r)}),i}kt([{name:"triangle",components:3,type:"Uint16"}]),kt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),kt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),kt([{type:"Float32",name:"offsetX"}]),kt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),kt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const uo={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Kt=24,gu=gt,_u=function(i,e,r,a,o){var d,p,f=8*o-a-1,_=(1<<f)-1,x=_>>1,b=-7,T=o-1,A=-1,C=i[e+T];for(T+=A,d=C&(1<<-b)-1,C>>=-b,b+=f;b>0;d=256*d+i[e+T],T+=A,b-=8);for(p=d&(1<<-b)-1,d>>=-b,b+=a;b>0;p=256*p+i[e+T],T+=A,b-=8);if(d===0)d=1-x;else{if(d===_)return p?NaN:1/0*(C?-1:1);p+=Math.pow(2,a),d-=x}return(C?-1:1)*p*Math.pow(2,d-a)},yu=function(i,e,r,a,o,d){var p,f,_,x=8*d-o-1,b=(1<<x)-1,T=b>>1,A=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=0,P=1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,p=b):(p=Math.floor(Math.log(e)/Math.LN2),e*(_=Math.pow(2,-p))<1&&(p--,_*=2),(e+=p+T>=1?A/_:A*Math.pow(2,1-T))*_>=2&&(p++,_/=2),p+T>=b?(f=0,p=b):p+T>=1?(f=(e*_-1)*Math.pow(2,o),p+=T):(f=e*Math.pow(2,T-1)*Math.pow(2,o),p=0));o>=8;i[r+C]=255&f,C+=P,f/=256,o-=8);for(p=p<<o|f,x+=o;x>0;i[r+C]=255&p,C+=P,p/=256,x-=8);i[r+C-P]|=128*D};function gt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}gt.Varint=0,gt.Fixed64=1,gt.Bytes=2,gt.Fixed32=5;var uc=4294967296,xu=1/uc,vu=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function ys(i){return i.type===gt.Bytes?i.readVarint()+i.pos:i.pos+1}function an(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function bu(i,e,r){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(a);for(var o=r.pos-1;o>=i;o--)r.buf[o+a]=r.buf[o]}function zd(i,e){for(var r=0;r<i.length;r++)e.writeVarint(i[r])}function Dd(i,e){for(var r=0;r<i.length;r++)e.writeSVarint(i[r])}function Ld(i,e){for(var r=0;r<i.length;r++)e.writeFloat(i[r])}function Rd(i,e){for(var r=0;r<i.length;r++)e.writeDouble(i[r])}function Bd(i,e){for(var r=0;r<i.length;r++)e.writeBoolean(i[r])}function Fd(i,e){for(var r=0;r<i.length;r++)e.writeFixed32(i[r])}function Od(i,e){for(var r=0;r<i.length;r++)e.writeSFixed32(i[r])}function Vd(i,e){for(var r=0;r<i.length;
2r++)e.writeFixed64(i[r])}function Nd(i,e){for(var r=0;r<i.length;r++)e.writeSFixed64(i[r])}function ml(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+16777216*i[e+3]}function nn(i,e,r){i[r]=e,i[r+1]=e>>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function wu(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}gt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),o=a>>3,d=this.pos;this.type=7&a,i(o,e,this),this.pos===d&&this.skip(a)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=ml(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=wu(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=ml(this.buf,this.pos)+ml(this.buf,this.pos+4)*uc;return this.pos+=8,i},readSFixed64:function(){var i=ml(this.buf,this.pos)+wu(this.buf,this.pos+4)*uc;return this.pos+=8,i},readFloat:function(){var i=_u(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=_u(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,a=this.buf;return e=127&(r=a[this.pos++]),r<128?e:(e|=(127&(r=a[this.pos++]))<<7,r<128?e:(e|=(127&(r=a[this.pos++]))<<14,r<128?e:(e|=(127&(r=a[this.pos++]))<<21,r<128?e:function(o,d,p){var f,_,x=p.buf;if(f=(112&(_=x[p.pos++]))>>4,_<128||(f|=(127&(_=x[p.pos++]))<<3,_<128)||(f|=(127&(_=x[p.pos++]))<<10,_<128)||(f|=(127&(_=x[p.pos++]))<<17,_<128)||(f|=(127&(_=x[p.pos++]))<<24,_<128)||(f|=(1&(_=x[p.pos++]))<<31,_<128))return an(o,f,d);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&vu?function(r,a,o){return vu.decode(r.subarray(a,o))}(this.buf,e,i):function(r,a,o){for(var d="",p=a;p<o;){var f,_,x,b=r[p],T=null,A=b>239?4:b>223?3:b>191?2:1;if(p+A>o)break;A===1?b<128&&(T=b):A===2?(192&(f=r[p+1]))==128&&(T=(31&b)<<6|63&f)<=127&&(T=null):A===3?(_=r[p+2],(192&(f=r[p+1]))==128&&(192&_)==128&&((T=(15&b)<<12|(63&f)<<6|63&_)<=2047||T>=55296&&T<=57343)&&(T=null)):A===4&&(_=r[p+2],x=r[p+3],(192&(f=r[p+1]))==128&&(192&_)==128&&(192&x)==128&&((T=(15&b)<<18|(63&f)<<12|(63&_)<<6|63&x)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,A=1):T>65535&&(T-=65536,d+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),d+=String.fromCharCode(T),p+=A}return d}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==gt.Bytes)return i.push(this.readVarint(e));var r=ys(this);for(i=i||[];this.pos<r;)i.push(this.readVarint(e));return i},readPackedSVarint:function(i){if(this.type!==gt.Bytes)return i.push(this.readSVarint());var e=ys(this);for(i=i||[];this.pos<e;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==gt.Bytes)return i.push(this.readBoolean());var e=ys(this);for(i=i||[];this.pos<e;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==gt.Bytes)return i.push(this.readFloat());var e=ys(this);for(i=i||[];this.pos<e;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==gt.Bytes)return i.push(this.readDouble());var e=ys(this);for(i=i||[];this.pos<e;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==gt.Bytes)return i.push(this.readFixed32());var e=ys(this);for(i=i||[];this.pos<e;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==gt.Bytes)return i.push(this.readSFixed32());var e=ys(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==gt.Bytes)return i.push(this.readFixed64());var e=ys(this);for(i=i||[];this.pos<e;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==gt.Bytes)return i.push(this.readSFixed64());var e=ys(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed64());return i},skip:function(i){var e=7&i;if(e===gt.Varint)for(;this.buf[this.pos++]>127;);else if(e===gt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===gt.Fixed32)this.pos+=4;else{if(e!==gt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e<this.pos+i;)e*=2;
vendor: 8,773 bytes, line 2
2if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),nn(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),nn(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),nn(this.buf,-1&i,this.pos),nn(this.buf,Math.floor(i*xu),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),nn(this.buf,-1&i,this.pos),nn(this.buf,Math.floor(i*xu),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(e,r){var a,o;if(e>=0?(a=e%4294967296|0,o=e/4294967296|0):(o=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,o=o+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(d,p,f){f.buf[f.pos++]=127&d|128,d>>>=7,f.buf[f.pos++]=127&d|128,d>>>=7,f.buf[f.pos++]=127&d|128,d>>>=7,f.buf[f.pos++]=127&d|128,f.buf[f.pos]=127&(d>>>=7)}(a,0,r),function(d,p){var f=(7&d)<<4;p.buf[p.pos++]|=f|((d>>>=3)?128:0),d&&(p.buf[p.pos++]=127&d|((d>>>=7)?128:0),d&&(p.buf[p.pos++]=127&d|((d>>>=7)?128:0),d&&(p.buf[p.pos++]=127&d|((d>>>=7)?128:0),d&&(p.buf[p.pos++]=127&d|((d>>>=7)?128:0),d&&(p.buf[p.pos++]=127&d)))))}(o,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(a,o,d){for(var p,f,_=0;_<o.length;_++){if((p=o.charCodeAt(_))>55295&&p<57344){if(!f){p>56319||_+1===o.length?(a[d++]=239,a[d++]=191,a[d++]=189):f=p;continue}if(p<56320){a[d++]=239,a[d++]=191,a[d++]=189,f=p;continue}p=f-55296<<10|p-56320|65536,f=null}else f&&(a[d++]=239,a[d++]=191,a[d++]=189,f=null);p<128?a[d++]=p:(p<2048?a[d++]=p>>6|192:(p<65536?a[d++]=p>>12|224:(a[d++]=p>>18|240,a[d++]=p>>12&63|128),a[d++]=p>>6&63|128),a[d++]=63&p|128)}return d}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&bu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),yu(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),yu(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=i[r]},writeRawMessage:function(i,e){this.pos++;var r=this.pos;i(e,this);var a=this.pos-r;a>=128&&bu(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,e,r){this.writeTag(i,gt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,zd,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Dd,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Bd,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Ld,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Rd,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Fd,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Od,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Vd,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Nd,e)},writeBytesField:function(i,e){this.writeTag(i,gt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,gt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,gt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,gt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,gt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,gt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,gt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,gt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,gt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,gt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var hc=K(gu);const dc=3;function Ud(i,e,r){i===1&&r.readMessage($d,e)}function $d(i,e,r){if(i===3){const{id:a,bitmap:o,width:d,height:p,left:f,top:_,advance:x}=r.readMessage(jd,{});e.push({id:a,bitmap:new ro({width:d+2*dc,height:p+2*dc},o),metrics:{width:d,height:p,left:f,top:_,advance:x}})}}function jd(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const Su=dc;function Tu(i){let e=0,r=0;for(const p of i)e+=p.w*p.h,r=Math.max(r,p.w);i.sort((p,f)=>f.h-p.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let o=0,d=0;for(const p of i)for(let f=a.length-1;f>=0;f--){const _=a[f];if(!(p.w>_.w||p.h>_.h)){if(p.x=_.x,p.y=_.y,d=Math.max(d,p.y+p.h),o=Math.max(o,p.x+p.w),p.w===_.w&&p.h===_.h){const x=a.pop();f<a.length&&(a[f]=x)}else p.h===_.h?(_.x+=p.w,_.w-=p.w):p.w===_.w?(_.y+=p.h,_.h-=p.h):(a.push({x:_.x+p.w,y:_.y,w:_.w-p.w,h:p.h}),_.y+=p.h,_.h-=p.h);break}}return{w:o,h:d,fill:e/(o*d)||0}}const ji=1;class pc{constructor(e,{pixelRatio:r,version:a,stretchX:o,stretchY:d,content:p}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=o,this.stretchY=d,this.content=p,this.version=a}get tl(){return[this.paddedRect.x+ji,this.paddedRect.y+ji]}get br(){return[this.paddedRect.x+this.paddedRect.w-ji,this.paddedRect.y+this.paddedRect.h-ji]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*ji)/this.pixelRatio,(this.paddedRect.h-2*ji)/this.pixelRatio]}}class Iu{constructor(e,r){const a={},o={};this.haveRenderCallbacks=[];const d=[];this.addImages(e,a,d),this.addImages(r,o,d);const{w:p,h:f}=Tu(d),_=new nr({width:p||1,height:f||1});for(const x in e){const b=e[x],T=a[x].paddedRect;nr.copy(b.data,_,{x:0,y:0},{x:T.x+ji,y:T.y+ji},b.data)}for(const x in r){const b=r[x],T=o[x].paddedRect,A=T.x+ji,C=T.y+ji,P=b.data.width,D=b.data.height;nr.copy(b.data,_,{x:0,y:0},{x:A,y:C},b.data),nr.copy(b.data,_,{x:0,y:D-1},{x:A,y:C-1},{width:P,height:1}),nr.copy(b.data,_,{x:0,y:0},{x:A,y:C+D},{width:P,height:1}),nr.copy(b.data,_,{x:P-1,y:0},{x:A-1,y:C},{width:1,height:D}),nr.copy(b.data,_,{x:0,y:0},{x:A+P,y:C},{width:1,height:D})}this.image=_,this.iconPositions=a,this.patternPositions=o}addImages(e,r,a){for(const o in e){const d=e[o],p={x:0,y:0,w:d.data.width+2*ji,h:d.data.height+2*ji};a.push(p),r[o]=new pc(p,d),d.hasRenderCallback&&this.haveRenderCallbacks.push(o)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in e.updatedImages)this.patchUpdatedImage(this.iconPositions[a],e.getImage(a),r),this.patchUpdatedImage(this.patternPositions[a],e.getImage(a),r)}patchUpdatedImage(e,r,a){if(!e||!r||e.version===r.version)return;e.version=r.version;const[o,d]=e.tl;a.update(r.data,void 0,{x:o,y:d})}}var qs;Ce("ImagePosition",pc),Ce("ImageAtlas",Iu),c.ai=void 0,(qs=c.ai||(c.ai={}))[qs.none=0]="none",qs[qs.horizontal=1]="horizontal",qs[qs.vertical=2]="vertical",qs[qs.horizontalOnly=3]="horizontalOnly";const ho=-17;class po{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){const a=new po;return a.scale=e||1,a.fontStack=r,a}static forImage(e){const r=new po;return r.imageName=e,r}}class on{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){const a=new on;for(let o=0;o<e.sections.length;o++){const d=e.sections[o];d.image?a.addImageSection(d):a.addTextSection(d,r)}return a}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let r="";for(let a=0;a<e.length;a++){const o=e.charCodeAt(a+1)||null,d=e.charCodeAt(a-1)||null;r+=o&&Ko(o)&&!uo[e[a+1]]||d&&Ko(d)&&!uo[e[a-1]]||!uo[e[a]]?e[a]:uo[e[a]]}return r}(this.text)}trim(){let e=0;for(let a=0;a<this.text.length&&_l[this.text.charCodeAt(a)];a++)e++;let r=this.text.length;for(let a=this.text.length-1;a>=0&&a>=e&&_l[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const a=new on;return a.text=this.text.substring(e,r),a.sectionIndex=this.sectionIndex.slice(e,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>
2Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(po.forText(e.scale,e.fontStack||r));const a=this.sections.length-1;for(let o=0;o<e.text.length;++o)this.sectionIndex.push(a)}addImageSection(e){const r=e.image?e.image.name:"";if(r.length===0)return void _i("Can't add FormattedSection with an empty image.");const a=this.getNextImageSectionCharCode();a?(this.text+=String.fromCharCode(a),this.sections.push(po.forImage(r)),this.sectionIndex.push(this.sections.length-1)):_i("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function gl(i,e,r,a,o,d,p,f,_,x,b,T,A,C,P,D){const V=on.fromFeature(i,o);let $;T===c.ai.vertical&&V.verticalizePunctuation();const{processBidirectionalText:X,processStyledBidirectionalText:q}=Ui;if(X&&V.sections.length===1){$=[];const de=X(V.toString(),fc(V,x,d,e,a,C,P));for(const Me of de){const Le=new on;Le.text=Me,Le.sections=V.sections;for(let Ae=0;Ae<Me.length;Ae++)Le.sectionIndex.push(0);$.push(Le)}}else if(q){$=[];const de=q(V.text,V.sectionIndex,fc(V,x,d,e,a,C,P));for(const Me of de){const Le=new on;Le.text=Me[0],Le.sectionIndex=Me[1],Le.sections=V.sections,$.push(Le)}}else $=function(de,Me){const Le=[],Ae=de.text;let Ie=0;for(const ve of Me)Le.push(de.substring(Ie,ve)),Ie=ve;return Ie<Ae.length&&Le.push(de.substring(Ie,Ae.length)),Le}(V,fc(V,x,d,e,a,C,P));const J=[],ie={positionedLines:J,text:V.toString(),top:b[1],bottom:b[1],left:b[0],right:b[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(de,Me,Le,Ae,Ie,ve,Pe,we,_e,Ne,Be,Je){let Tt=0,At=ho,Yt=0,rr=0;const zi=we==="right"?1:we==="left"?0:.5;let Gt=0;for(const Jt of Ie){Jt.trim();const Qt=Jt.getMaxScale(),bi=(Qt-1)*Kt,Ri={positionedGlyphs:[],lineOffset:0};de.positionedLines[Gt]=Ri;const wi=Ri.positionedGlyphs;let qi=0;if(!Jt.length()){At+=ve,++Gt;continue}for(let ei=0;ei<Jt.length();ei++){const it=Jt.getSection(ei),Si=Jt.getSectionIndex(ei),mi=Jt.getCharCode(ei);let ti=0,br=null,Lr=null,Rr=null,xs=Kt;const wr=!(_e===c.ai.horizontal||!Be&&!On(mi)||Be&&(_l[mi]||(ci=mi,Ee.Arabic(ci)||Ee["Arabic Supplement"](ci)||Ee["Arabic Extended-A"](ci)||Ee["Arabic Presentation Forms-A"](ci)||Ee["Arabic Presentation Forms-B"](ci))));if(it.imageName){const lr=Ae[it.imageName];if(!lr)continue;Rr=it.imageName,de.iconsInText=de.iconsInText||!0,Lr=lr.paddedRect;const Gi=lr.displaySize;it.scale=it.scale*Kt/Je,br={width:Gi[0],height:Gi[1],left:ji,top:-Su,advance:wr?Gi[1]:Gi[0]},ti=bi+(Kt-Gi[1]*it.scale),xs=br.advance;const vs=wr?Gi[0]*it.scale-Kt*Qt:Gi[1]*it.scale-Kt*Qt;vs>0&&vs>qi&&(qi=vs)}else{const lr=Le[it.fontStack],Gi=lr&&lr[mi];if(Gi&&Gi.rect)Lr=Gi.rect,br=Gi.metrics;else{const vs=Me[it.fontStack],yo=vs&&vs[mi];if(!yo)continue;br=yo.metrics}ti=(Qt-it.scale)*Kt}wr?(de.verticalizable=!0,wi.push({glyph:mi,imageName:Rr,x:Tt,y:At+ti,vertical:wr,scale:it.scale,fontStack:it.fontStack,sectionIndex:Si,metrics:br,rect:Lr}),Tt+=xs*it.scale+Ne):(wi.push({glyph:mi,imageName:Rr,x:Tt,y:At+ti,vertical:wr,scale:it.scale,fontStack:it.fontStack,sectionIndex:Si,metrics:br,rect:Lr}),Tt+=br.advance*it.scale+Ne)}wi.length!==0&&(Yt=Math.max(Tt-Ne,Yt),Gd(wi,0,wi.length-1,zi,qi)),Tt=0;const Zi=ve*Qt+qi;
2Ri.lineOffset=Math.max(qi,bi),At+=Zi,rr=Math.max(Zi,rr),++Gt}var ci;const fi=At-ho,{horizontalAlign:Di,verticalAlign:Li}=mc(Pe);(function(Jt,Qt,bi,Ri,wi,qi,Zi,ei,it){const Si=(Qt-bi)*wi;let mi=0;mi=qi!==Zi?-ei*Ri-ho:(-Ri*it+.5)*Zi;for(const ti of Jt)for(const br of ti.positionedGlyphs)br.x+=Si,br.y+=mi})(de.positionedLines,zi,Di,Li,Yt,rr,ve,fi,Ie.length),de.top+=-Li*fi,de.bottom=de.top+fi,de.left+=-Di*Yt,de.right=de.left+Yt}(ie,e,r,a,$,p,f,_,T,x,A,D),!function(de){for(const Me of de)if(Me.positionedGlyphs.length!==0)return!1;return!0}(J)&&ie}const _l={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},qd={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Au(i,e,r,a,o,d){if(e.imageName){const p=a[e.imageName];return p?p.displaySize[0]*e.scale*Kt/d+o:0}{const p=r[e.fontStack],f=p&&p[i];return f?f.metrics.advance*e.scale+o:0}}function Eu(i,e,r,a){const o=Math.pow(i-e,2);return a?i<e?o/2:2*o:o+Math.abs(r)*r}function Zd(i,e,r){let a=0;return i===10&&(a-=1e4),r&&(a+=150),i!==40&&i!==65288||(a+=50),e!==41&&e!==65289||(a+=50),a}function Mu(i,e,r,a,o,d){let p=null,f=Eu(e,r,o,d);for(const _ of a){const x=Eu(e-_.x,r,o,d)+_.badness;x<=f&&(p=_,f=x)}return{index:i,x:e,priorBreak:p,badness:f}}function Cu(i){return i?Cu(i.priorBreak).concat(i.index):[]}function fc(i,e,r,a,o,d,p){if(d!=="point")return[];if(!i)return[];const f=[],_=function(A,C,P,D,V,$){let X=0;for(let q=0;q<A.length();q++){const J=A.getSection(q);X+=Au(A.getCharCode(q),J,D,V,C,$)}return X/Math.max(1,Math.ceil(X/P))}(i,e,r,a,o,p),x=i.text.indexOf("​")>=0;let b=0;for(let A=0;A<i.length();A++){const C=i.getSection(A),P=i.getCharCode(A);if(_l[P]||(b+=Au(P,C,a,o,e,p)),A<i.length()-1){const D=!((T=P)<11904||!(Ee["Bopomofo Extended"](T)||Ee.Bopomofo(T)||Ee["CJK Compatibility Forms"](T)||Ee["CJK Compatibility Ideographs"](T)||Ee["CJK Compatibility"](T)||Ee["CJK Radicals Supplement"](T)||Ee["CJK Strokes"](T)||Ee["CJK Symbols and Punctuation"](T)||Ee["CJK Unified Ideographs Extension A"](T)||Ee["CJK Unified Ideographs"](T)||Ee["Enclosed CJK Letters and Months"](T)||Ee["Halfwidth and Fullwidth Forms"](T)||Ee.Hiragana(T)||Ee["Ideographic Description Characters"](T)||Ee["Kangxi Radicals"](T)||Ee["Katakana Phonetic Extensions"](T)||Ee.Katakana(T)||Ee["Vertical Forms"](T)||Ee["Yi Radicals"](T)||Ee["Yi Syllables"](T)));(qd[P]||D||C.imageName)&&f.push(Mu(A+1,b,_,f,Zd(P,i.getCharCode(A+1),D&&x),!1))}}var T;return Cu(Mu(i.length(),b,_,f,0,!0))}function mc(i){let e=.5,r=.5;switch(i){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Gd(i,e,r,a,o){if(!a&&!o)return;const d=i[r],p=(i[r].x+d.metrics.advance*d.scale)*a;for(let f=e;f<=r;f++)i[f].x-=p,i[f].y+=o}function Wd(i,e,r){const{horizontalAlign:a,verticalAlign:o}=mc(r),d=e[0]-i.displaySize[0]*a,p=e[1]-i.displaySize[1]*o;return{image:i,top:p,bottom:p+i.displaySize[1],left:d,right:d+i.displaySize[0]}}function Pu(i,e,r,a,o,d){const p=i.image;let f;if(p.content){const V=p.content,$=p.pixelRatio||1;f=[V[0]/$,V[1]/$,p.displaySize[0]-V[2]/$,p.displaySize[1]-V[3]/$]}const _=e.left*d,x=e.right*d;let b,T,A,C;r==="width"||r==="both"?(C=o[0]+_-a[3],T=o[0]+x+a[1]):(C=o[0]+(_+x-p.displaySize[0])/2,T=C+p.displaySize[0]);const P=e.top*d,D=e.bottom*d;return r==="height"||r==="both"?(b=o[1]+P-a[0],A=o[1]+D+a[2]):(b=o[1]+(P+D-p.displaySize[1])/2,A=b+p.displaySize[1]),{image:p,top:b,right:T,bottom:A,left:C,collisionPadding:f}}const fo=255,Jr=128,Zs=fo*Jr;function ku(i,e){const{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new wt(i+1))};if(r.kind==="source")return{kind:"source"};{const{zoomStops:a,interpolationType:o}=r;let d=0;for(;d<a.length&&a[d]<=i;)d++;d=Math.max(0,d-1);let p=d;for(;p<a.length&&a[p]<i+1;)p++;p=Math.min(a.length-1,p);const f=a[d],_=a[p];return r.kind==="composite"?{kind:"composite",minZoom:f,maxZoom:_,interpolationType:o}:{kind:"camera",minZoom:f,maxZoom:_,minSize:r.evaluate(new wt(f)),maxSize:r.evaluate(new wt(_)),interpolationType:o}}}function gc(i,e,r){let a="never";const o=i.get(e);return o?a=o:i.get(r)&&(a="always"),a}const Hd=js.VectorTileFeature.types,Xd=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function yl(i,e,r,a,o,d,p,f,_,x,b,T,A){const C=f?Math.min(Zs,Math.round(f[0])):0,P=f?Math.min(Zs,Math.round(f[1])):0;i.emplaceBack(e,r,Math.round(32*a),Math.round(32*o),d,p,(C<<1)+(_?1:0),P,16*x,16*b,256*T,256*A)}function _c(i,e,r){i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r)}function Kd(i){for(const e of i.sections)if(jl(e.text))return!0;return!1}class yc{constructor(e){this.layoutVertexArray=new Qe,this.indexArray=new oi,this.programConfigurations=e,this.segments=new St,this.dynamicLayoutVertexArray=new Xe,this.opacityVertexArray=new tt,this.hasVisibleVertices=!1,this.placedSymbolArray=new G}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,a,o){this.isEmpty()||(a&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ed.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Md.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Xd,!0),this.opacityVertexBuffer.itemSize=1),(a||o)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Ce("SymbolBuffers",yc);class xc{constructor(e,r,a){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new a,this.segments=new St,this.collisionVertexArray=new vt}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Cd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ce("CollisionBuffers",xc);class ln{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(p=>p.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.s
vendor: 21,824 bytes, line 2
2ourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Kl([]),this.placementViewportMatrix=Kl([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ku(this.zoom,r["text-size"]),this.iconSizeData=ku(this.zoom,r["icon-size"]);const a=this.layers[0].layout,o=a.get("symbol-sort-key"),d=a.get("symbol-z-order");this.canOverlap=gc(a,"text-overlap","text-allow-overlap")!=="never"||gc(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=d!=="viewport-y"&&!o.isConstant(),this.sortFeaturesByY=(d==="viewport-y"||d==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(p=>c.ai[p])),this.stateDependentLayerIds=this.layers.filter(p=>p.isStateDependent()).map(p=>p.id),this.sourceID=e.sourceID}createArrays(){this.text=new yc(new Dr(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new yc(new Dr(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new W,this.lineVertexArray=new re,this.symbolInstances=new U,this.textAnchorOffsets=new he}calculateGlyphDependencies(e,r,a,o,d){for(let p=0;p<e.length;p++)if(r[e.charCodeAt(p)]=!0,(a||o)&&d){const f=uo[e.charAt(p)];f&&(r[f.charCodeAt(0)]=!0)}}populate(e,r,a){const o=this.layers[0],d=o.layout,p=d.get("text-font"),f=d.get("text-field"),_=d.get("icon-image"),x=(f.value.kind!=="constant"||f.value.value instanceof hi&&!f.value.value.isEmpty()||f.value.value.toString().length>0)&&(p.value.kind!=="constant"||p.value.value.length>0),b=_.value.kind!=="constant"||!!_.value.value||Object.keys(_.parameters).length>0,T=d.get("symbol-sort-key");if(this.features=[],!x&&!b)return;const A=r.iconDependencies,C=r.glyphDependencies,P=r.availableImages,D=new wt(this.zoom);for(const{feature:V,id:$,index:X,sourceLayerIndex:q}of e){const J=o._featureFilter.needGeometry,ie=_a(V,J);if(!o._featureFilter.filter(D,ie,a))continue;let de,Me;if(J||(ie.geometry=ga(V)),x){const Ae=o.getValueAndResolveTokens("text-field",ie,a,P),Ie=hi.factory(Ae);Kd(Ie)&&(this.hasRTLText=!0),(!this.hasRTLText||qn()==="unavailable"||this.hasRTLText&&Ui.isParsed())&&(de=kd(Ie,o,ie))}if(b){const Ae=o.getValueAndResolveTokens("icon-image",ie,a,P);Me=Ae instanceof ni?Ae:ni.fromString(Ae)}if(!de&&!Me)continue;const Le=this.sortFeaturesByKey?T.evaluate(ie,{},a):void 0;if(this.features.push({id:$,text:de,icon:Me,index:X,sourceLayerIndex:q,geometry:ie.geometry,properties:V.properties,type:Hd[V.type],sortKey:Le}),Me&&(A[Me.name]=!0),de){const Ae=p.evaluate(ie,{},a).join(","),Ie=d.get("text-rotation-alignment")!=="viewport"&&d.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(c.ai.vertical)>=0;for(const ve of de.sections)if(ve.image)A[ve.image.name]=!0;else{const Pe=Bn(de.toString()),we=ve.fontStack||Ae,_e=C[we]=C[we]||{};this.calculateGlyphDependencies(ve.text,_e,Ie,this.allowVerticalPlacement,Pe)}}}d.get("symbol-placement")==="line"&&(this.features=function(V){const $={},X={},q=[];let J=0;function ie(Ae){q.push(V[Ae]),J++}function de(Ae,Ie,ve){const Pe=X[Ae];return delete X[Ae],X[Ie]=Pe,q[Pe].geometry[0].pop(),q[Pe].geometry[0]=q[Pe].geometry[0].concat(ve[0]),Pe}function Me(Ae,Ie,ve){const Pe=$[Ie];return delete $[Ie],$[Ae]=Pe,q[Pe].geometry[0].shift(),q[Pe].geometry[0]=ve[0].concat(q[Pe].geometry[0]),Pe}function Le(Ae,Ie,ve){const Pe=ve?Ie[0][Ie[0].length-1]:Ie[0][0];return`${Ae}:${Pe.x}:${Pe.y}`}for(let Ae=0;Ae<V.length;Ae++){const Ie=V[Ae],ve=Ie.geometry,Pe=Ie.text?Ie.text.toString():null;if(!Pe){ie(Ae);continue}const we=Le(Pe,ve),_e=Le(Pe,ve,!0);if(we in X&&_e in $&&X[we]!==$[_e]){const Ne=Me(we,_e,ve),Be=de(we,_e,q[Ne].geometry);delete $[we],delete X[_e],X[Le(Pe,q[Be].geometry,!0)]=Be,q[Ne].geometry=null}else we in X?de(we,_e,ve):_e in $?Me(we,_e,ve):(ie(Ae),$[we]=J-1,X[_e]=J-1)}return q.filter(Ae=>Ae.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((V,$)=>V.sortKey-$.sortKey)}update(e,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,a))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const a=this.lineVertexArray.length;if(e.segment!==void 0){let o=e.dist(r[e.segment+1]),d=e.dist(r[e.segment]);const p={};for(let f=e.segment+1;f<r.length;f++)p[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:o},f<r.length-1&&(o+=r[f+1].dist(r[f]));for(let f=e.segment||0;f>=0;f--)p[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:d},f>0&&(d+=r[f-1].dist(r[f]));for(let f=0;f<r.length;f++){const _=p[f];this.lineVertexArray.emplaceBack(_.x,_.y,_.tileUnitDistanceFromAnchor)}}return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(e,r,a,o,d,p,f,_,x,b,T,A){const C=e.indexArray,P=e.layoutVertexArray,D=e.segments.prepareSegment(4*r.length,P,C,this.canOverlap?p.sortKey:void 0),V=this.glyphOffsetArray.length,$=D.vertexLength,X=this.allowVerticalPlacement&&f===c.ai.vertical?Math.PI/2:0,q=p.text&&p.text.sections;for(let J=0;J<r.length;J++){const{tl:ie,tr:de,bl:Me,br:Le,tex:Ae,pixelOffsetTL:Ie,pixelOffsetBR:ve,minFontScaleX:Pe,minFontScaleY:we,glyphOffset:_e,isSDF:Ne,sectionIndex:Be}=r[J],Je=D.vertexLength,Tt=_e[1];yl(P,_.x,_.y,ie.x,Tt+ie.y,Ae.x,Ae.y,a,Ne,Ie.x,Ie.y,Pe,we),yl(P,_.x,_.y,de.x,Tt+de.y,Ae.x+Ae.w,Ae.y,a,Ne,ve.x,Ie.y,Pe,we),yl(P,_.x,_.y,Me.x,Tt+Me.y,Ae.x,Ae.y+Ae.h,a,Ne,Ie.x,ve.y,Pe,we),yl(P,_.x,_.y,Le.x,Tt+Le.y,Ae.x+Ae.w,Ae.y+Ae.h,a,Ne,ve.x,ve.y,Pe,we),_c(e.dynamicLayoutVertexArray,_,X),C.emplaceBack(Je,Je+1,Je+2),C.emplaceBack(Je+1,Je+2,Je+3),D.vertexLength+=4,D.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(_e[0]),J!==r.length-1&&Be===r[J+1].sectionIndex||e.programConfigurations.populatePaintArrays(P.length,p,p.index,{},A,q&&q[Be])}e.placedSymbolArray.emplaceBack(_.x,_.y,V,this.glyphOffsetArray.length-V,$,x,b,_.segment,a?a[0]:0,a?a[1]:0,o[0],o[1],f,0,!1,0,T)}_addCollisionDebugVertex(e,r,a,o,d,p){return r.emplaceBack(0,0),e.emplaceBack(a.x,a.y,o,d,Math.round(p.x),Math.round(p.y))}addCollisionDebugVertices(e,r,a,o,d,p,f){const _=d.segments.prepareSegment(4,d.layoutVertexArray,d.indexArray),x=_.vertexLength,b=d.layoutVertexArray,T=d.collisionVertexArray,A=f.anchorX,C=f.anchorY;this._addCollisionDebugVertex(b,T,p,A,C,new ke(e,r)),this._addCollisionDebugVertex(b,T,p,A,C,new ke(a,r)),this._addCollisionDebugVertex(b,T,p,A,C,new ke(a,o)),this._addCollisionDebugVertex(b,T,p,A,C,new ke(e,o)),_.vertexLength+=4;const P=d.indexArray;P.emplaceBack(x,x+1),P.emplaceBack(x+1,x+2),P.emplaceBack(x+2,x+3),P.emplaceBack(x+3,x),_.primitiveLength+=4}addDebugCollisionBoxes(e,r,a,o){for(let d=e;d<r;d++){const p=this.collisionBoxArray.get(d);this.addCollisionDebugVertices(p.x1,p.y1,p.x2,p.y2,o?this.textCollisionBox:this.iconCollisionBox,p.anchorPoint,a)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new xc(Bt,mu.members,Ht),this.iconCollisionBox=new xc(Bt,mu.members,Ht);for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,a,o,d,p,f,_,x){const b={};for(let T=r;T<a;T++){const A=e.get(T);b.textBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},b.textFeatureIndex=A.featureIndex;break}for(let T=o;T<d;T++){const A=e.get(T);b.verticalTextBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},b.verticalTextFeatureIndex=A.featureIndex;break}for(let T=p;T<f;T++){const A=e.get(T);b.iconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},b.iconFeatureIndex=A.featureIndex;break}for(let T=_;T<x;T++){const A=e.get(T);b.verticalIconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},b.verticalIconFeatureIndex=A.featureIndex;break}return b}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const a=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,a.textBoxStartIndex,a.textBoxEndIndex,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a.iconBoxStartIndex,a.iconBoxEndIndex,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const a=e.placedSymbolArray.get(r),o=a.vertexStartIndex+4*a.numGlyphs;for(let d=a.vertexStartIndex;d<o;d+=4)e.indexArray.emplaceBack(d,d+1,d+2),e.indexArray.emplaceBack(d+1,d+2,d+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const r=Math.sin(e),a=Math.cos(e),o=[],d=[],p=[];for(let f=0;f<this.symbolInstances.length;++f){p.push(f);const _=this.symbolInstances.get(f);o.push(0|Math.round(r*_.anchorX+a*_.anchorY)),d.push(_.featureIndex)}return p.sort((f,_)=>o[f]-o[_]||d[_]-d[f]),p}addToSortKeyRanges(e,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((o,d,p)=>{o>=0&&p.indexOf(o)===d&&this.addIndicesForPlacedSymbol(this.text,o)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let zu,Du;Ce("SymbolBucket",ln,{omit:["layers","collisionBoxArray","features","compareText"]}),ln.MAX_GLYPHS=65535,ln.addDynamicAttributes=_c;var vc={get paint(){return Du=Du||new Nt({"icon-opacity":new $e(le.paint_symbol["icon-opacity"]),"icon-color":new $e(le.paint_symbol["icon-color"]),"icon-halo-color":new $e(le.paint_symbol["icon-halo-color"]),"icon-halo-width":new $e(le.paint_symbol["icon-halo-width"]),"icon-halo-blur":new $e(le.paint_symbol["icon-halo-blur"]),"icon-translate":new Oe(le.paint_symbol["icon-translate"]),"icon-translate-anchor":new Oe(le.paint_symbol["icon-translate-anchor"]),"text-opacity":new $e(le.paint_symbol["text-opacity"]),"text-color":new $e(le.paint_symbol["text-color"],{runtimeType:yi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new $e(le.paint_symbol["text-halo-color"]),"text-halo-width":new $e(le.paint_symbol["text-halo-width"]),"text-halo-blur":new $e(le.paint_symbol["text-halo-blur"]),"text-translate":new Oe(le.paint_symbol["text-translate"]),"text-translate-anchor":new Oe(le.paint_symbol["text-translate-anchor"])})},get layout(){return zu=zu||new Nt({"symbol-placement":new Oe(le.layout_symbol["symbol-placement"]),"symbol-spacing":new Oe(le.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Oe(le.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new $e(le.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Oe(le.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Oe(le.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Oe(le.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Oe(le.layout_symbol["icon-ignore-placement"]),"icon-optional":new Oe(le.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Oe(le.layout_symbol["icon-rotation-alignment"]),"icon-size":new $e(le.layout_symbol["icon-size"]),"icon-text-fit":new Oe(le.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Oe(le.layout_symbol["icon-text-fit-padding"]),"icon-image":new $e(le.layout_symbol["icon-image"]),"icon-rotate":new $e(le.layout_symbol["icon-rotate"]),"icon-padding":new $e(le.layout_symbol["icon-padding"]),"icon-keep-upright":new Oe(le.layout_symbol["icon-keep-upright"]),"icon-offset":new $e(le.layout_symbol["icon-offset"]),"icon-anchor":new $e(le.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Oe(le.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Oe(le.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Oe(le.layout_symbol["text-rotation-alignment"]),"text-field":new $e(le.layout_symbol["text-field"]),"text-font":new $e(le.layout_symbol["text-font"]),"text-size":new $e(le.layout_symbol["text-size"]),"text-max-width":new $e(le.layout_symbol["text-max-width"]),"text-line-height":new Oe(le.layout_symbol["text-line-height"]),"text-letter-spacing":new $e(le.layout_symbol["text-letter-spacing"]),"text-justify":new $e(le.layout_symbol["text-justify"]),"text-radial-offset":new $e(le.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Oe(le.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new $e(le.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new $e(le.layout_symbol["text-anchor"]),"text-max-angle":new Oe(le.layout_symbol["text-max-angle"]),"text-writing-mode":new Oe(le.layout_symbol["text-writing-mode"]),"text-rotate":new $e(le.layout_symbol["text-rotate"]),"text-padding":new Oe(le.layout_symbol["text-padding"]),"text-keep-upright":new Oe(le.layout_symbol["text-keep-upright"]),"text-transform":new $e(le.layout_symbol["text-transform"]),"text-offset":new $e(le.layout_symbol["text-offset"]),"text-allow-overlap":new Oe(le.layout_symbol["text-allow-overlap"]),"text-overlap":new Oe(le.layout_symbol["text-overlap"]),"text-ignore-placement":new Oe(le.layout_symbol["text-ignore-placement"]),"text-optional":new Oe(le.layout_symbol["text-optional"])})}};class Lu{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Er,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ce("FormatSectionOverride",Lu,{omit:["defaultValue"]});class xl extends tr{constructor(e){super(e,vc)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const a=this.layout.get("text-writing-mode");if(a){const o=[];for(const d of a)o.indexOf(d)<0&&o.push(d);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,a,o){const d=this.layout.get(e).evaluate(r,{},a,o),p=this._unevaluatedLayout._values[e];return p.isDataDriven()||Ua(p.value)||!d?d:function(f,_){return _.replace(/{([^{}]+)}/g,(x,b)=>f&&b in f?String(f[b]):"")}(r.properties,d)}createBucket(e){return new ln(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of vc.paint.overridableProperties){if(!xl.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),a=new Lu(r),o=new Pn(a,r.property.specification);let d=null;d=r.value.kind==="constant"||r.value.kind==="source"?new kn("source",o):new ja("composite",o,r.value.zoomStops),this.paint._values[e]=new xi(r.property,d,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&xl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const a=e.get("text-field"),o=vc.paint.properties[r];let d=!1;const p=f=>{for(const _ of f)if(o.overrides&&o.overrides.hasOverride(_))return void(d=!0)};if(a.value.kind==="constant"&&a.value.value instanceof hi)p(a.value.value.sections);else if(a.value.kind==="source"){const f=x=>{d||(x instanceof ns&&Mt(x.value)===B?p(x.value.sections):x instanceof Na?p(x.sections):x.eachChild(f))},_=a.value;_._styleExpression&&f(_._styleExpression.expression)}return d}}let Ru;var Yd={get paint(){return Ru=Ru||new Nt({"background-color":new Oe(le.paint_background["background-color"]),"background-pattern":new Gn(le.paint_background["background-pattern"]),"background-opacity":new Oe(le.paint_background["background-opacity"])})}};class Jd extends tr{constructor(e){super(e,Yd)}}let Bu;var Qd={get paint(){return Bu=Bu||new Nt({"raster-opacity":new Oe(le.paint_raster["raster-opacity"]),"raster-hue-rotate":new Oe(le.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Oe(le.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Oe(le.paint_raster["raster-brightness-max"]),"raster-saturation":new Oe(le.paint_raster["raster-saturation"]),"raster-contrast":new Oe(le.paint_raster["raster-contrast"]),"raster-resampling":new Oe(le.paint_raster["raster-resampling"]),"raster-fade-duration":new Oe(le.paint_raster["raster-fade-duration"])})}};class ep extends tr{constructor(e){super(e,Qd)}}class tp extends tr{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class ip{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const bc=63710088e-1;class Gs{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Gs(Xs(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,a=this.lat*r,o=e.lat*r,d=Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos((e.lng-this.lng)*r);return bc*Math.acos(Math.min(d,1))}static convert(e){if(e instanceof Gs)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Gs(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Gs(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Fu=2*Math.PI*bc;function Ou(i){return Fu*Math.cos(i*Math.PI/180)}function Vu(i){return(180+i)/360}function Nu(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Uu(i,e){return i/Ou(e)}function $u(i){return 360*i-180}function wc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180)
vendor: 15,126 bytes, line 2
2)-90}class vl{constructor(e,r,a=0){this.x=+e,this.y=+r,this.z=+a}static fromLngLat(e,r=0){const a=Gs.convert(e);return new vl(Vu(a.lng),Nu(a.lat),Uu(r,a.lat))}toLngLat(){return new Gs($u(this.x),wc(this.y))}toAltitude(){return this.z*Ou(wc(this.y))}meterInMercatorCoordinateUnits(){return 1/Fu*(e=wc(this.y),1/Math.cos(e*Math.PI/180));var e}}function ju(i,e,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class Sc{constructor(e,r,a){if(e<0||e>25||a<0||a>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${a}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=a,this.key=mo(0,e,e,r,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,a){const o=(p=this.y,f=this.z,_=ju(256*(d=this.x),256*(p=Math.pow(2,f)-p-1),f),x=ju(256*(d+1),256*(p+1),f),_[0]+","+_[1]+","+x[0]+","+x[1]);var d,p,f,_,x;const b=function(T,A,C){let P,D="";for(let V=T;V>0;V--)P=1<<V-1,D+=(A&P?1:0)+(C&P?2:0);return D}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(a==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,o)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new ke((e.x*r-this.x)*Zt,(e.y*r-this.y)*Zt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class qu{constructor(e,r){this.wrap=e,this.canonical=r,this.key=mo(e,r.z,r.z,r.x,r.y)}}class or{constructor(e,r,a,o,d){if(e<a)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Sc(a,+o,+d),this.key=mo(r,e,a,o,d)}clone(){return new or(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new or(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new or(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-e;return e>this.canonical.z?mo(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):mo(this.wrap*+r,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new or(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,o=2*this.canonical.y;return[new or(r,this.wrap,r,a,o),new or(r,this.wrap,r,a+1,o),new or(r,this.wrap,r,a,o+1),new or(r,this.wrap,r,a+1,o+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new or(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new or(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new qu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new vl(e.x-this.wrap,e.y))}}function mo(i,e,r,a,o){(i*=2)<0&&(i=-1*i-1);const d=1<<r;return(d*d*i+d*o+a).toString(36)+r.toString(36)+e.toString(36)}Ce("CanonicalTileID",Sc),Ce("OverscaledTileID",or,{omit:["posMatrix"]});class Zu{constructor(e,r,a,o=1,d=1,p=1,f=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(a&&!["mapbox","terrarium","custom"].includes(a))return void _i(`"${a}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;const _=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),a){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=o,this.greenFactor=d,this.blueFactor=p,this.baseShift=f;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let x=0;x<_;x++)this.data[this._idx(-1,x)]=this.data[this._idx(0,x)],this.data[this._idx(_,x)]=this.data[this._idx(_-1,x)],this.data[this._idx(x,-1)]=this.data[this._idx(x,0)],this.data[this._idx(x,_)]=this.data[this._idx(x,_-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(_,-1)]=this.data[this._idx(_-1,0)],this.data[this._idx(-1,_)]=this.data[this._idx(0,_-1)],this.data[this._idx(_,_)]=this.data[this._idx(_-1,_-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let x=0;x<_;x++)for(let b=0;b<_;b++){const T=this.get(x,b);T>this.max&&(this.max=T),T<this.min&&(this.min=T)}}get(e,r){const a=new Uint8Array(this.data.buffer),o=4*this._idx(e,r);return this.unpack(a[o],a[o+1],a[o+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,a){return e*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new nr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let o=r*this.dim,d=r*this.dim+this.dim,p=a*this.dim,f=a*this.dim+this.dim;switch(r){case-1:o=d-1;break;case 1:d=o+1}switch(a){case-1:p=f-1;break;case 1:f=p+1}const _=-r*this.dim,x=-a*this.dim;for(let b=p;b<f;b++)for(let T=o;T<d;T++)this.data[this._idx(T,b)]=e.data[this._idx(T+_,b+x)]}}Ce("DEMData",Zu);class Gu{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const a=e[r];this._stringToNumber[a]=r,this._numberToString[r]=a}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Wu{constructor(e,r,a,o,d){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=a,e._y=o,this.properties=e.properties,this.id=d}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Hu{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Os(Zt,16,0),this.grid3D=new Os(Zt,16,0),this.featureIndexArray=new fe,this.promoteId=r}insert(e,r,a,o,d,p){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,o,d);const _=p?this.grid3D:this.grid;for(let x=0;x<r.length;x++){const b=r[x],T=[1/0,1/0,-1/0,-1/0];for(let A=0;A<b.length;A++){const C=b[A];T[0]=Math.min(T[0],C.x),T[1]=Math.min(T[1],C.y),T[2]=Math.max(T[2],C.x),T[3]=Math.max(T[3],C.y)}T[0]<Zt&&T[1]<Zt&&T[2]>=0&&T[3]>=0&&_.insert(f,T[0],T[1],T[2],T[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new js.VectorTile(new hc(this.rawTileData)).layers,this.sourceLayerCoder=new Gu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,a,o){this.loadVTLayers();const d=e.params||{},p=Zt/e.tileSize/e.scale,f=Dn(d.filter),_=e.queryGeometry,x=e.queryPadding*p,b=Ku(_),T=this.grid.query(b.minX-x,b.minY-x,b.maxX+x,b.maxY+x),A=Ku(e.cameraQueryGeometry),C=this.grid3D.query(A.minX-x,A.minY-x,A.maxX+x,A.maxY+x,(V,$,X,q)=>function(J,ie,de,Me,Le){for(const Ie of J)if(ie<=Ie.x&&de<=Ie.y&&Me>=Ie.x&&Le>=Ie.y)return!0;const Ae=[new ke(ie,de),new ke(ie,Le),new ke(Me,Le),new ke(Me,de)];if(J.length>2){for(const Ie of Ae)if(en(J,Ie))return!0}for(let Ie=0;Ie<J.length-1;Ie++)if(Lh(J[Ie],J[Ie+1],Ae))return!0;return!1}(e.cameraQueryGeometry,V-x,$-x,X+x,q+x));for(const V of C)T.push(V);T.sort(rp);const P={};let D;for(let V=0;V<T.length;V++){const $=T[V];if($===D)continue;D=$;const X=this.featureIndexArray.get($);let q=null;this.loadMatchingFeature(P,X.bucketIndex,X.sourceLayerIndex,X.featureIndex,f,d.layers,d.availableImages,r,a,o,(J,ie,de)=>(q||(q=ga(J)),ie.queryIntersectsFeature(_,J,de,q,this.z,e.transform,p,e.pixelPosMatrix)))}return P}loadMatchingFeature(e,r,a,o,d,p,f,_,x,b,T){const A=this.bucketLayerIDs[r];if(p&&!function(V,$){for(let X=0;X<V.length;X++)if($.indexOf(V[X])>=0)return!0;return!1}(p,A))return;const C=this.sourceLayerCoder.decode(a),P=this.vtLayers[C].feature(o);if(d.needGeometry){const V=_a(P,!0);if(!d.filter(new wt(this.tileID.overscaledZ),V,this.tileID.canonical))return}else if(!d.filter(new wt(this.tileID.overscaledZ),P))return;const D=this.getId(P,C);for(let V=0;V<A.length;V++){const $=A[V];if(p&&p.indexOf($)<0)continue;const X=_[$];if(!X)continue;let q={};D&&b&&(q=b.getState(X.sourceLayer||"_geojsonTileLayer",D));const J=si({},x[$]);J.paint=Xu(J.paint,X.paint,P,q,f),J.layout=Xu(J.layout,X.layout,P,q,f);const ie=!T||T(P,X,q);if(!ie)continue;const de=new Wu(P,this.z,this.x,this.y,D);de.layer=J;let Me=e[$];Me===void 0&&(Me=e[$]=[]),Me.push({featureIndex:o,feature:de,intersectionZ:ie})}}lookupSymbolFeatures(e,r,a,o,d,p,f,_){const x={};this.loadVTLayers();const b=Dn(d);for(const T of e)this.loadMatchingFeature(x,a,o,T,b,p,f,_,r);return x}hasLayer(e){for(const r of this.bucketLayerIDs)for(const a of r)if(e===a)return!0;return!1}getId(e,r){let a=e.id;return this.promoteId&&(a=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[r]],typeof a=="boolean"&&(a=Number(a))),a}}function Xu(i,e,r,a,o){return Et(i,(d,p)=>{const f=e instanceof Ja?e.get(p):null;return f&&f.evaluate?f.evaluate(r,a,o):f})}function Ku(i){let e=1/0,r=1/0,a=-1/0,o=-1/0;for(const d of i)e=Math.min(e,d.x),r=Math.min(r,d.y),a=Math.max(a,d.x),o=Math.max(o,d.y);return{minX:e,minY:r,maxX:a,maxY:o}}function rp(i,e){return e-i}function Yu(i,e,r,a,o){const d=[];for(let p=0;p<i.length;p++){const f=i[p];let _;for(let x=0;x<f.length-1;x++){let b=f[x],T=f[x+1];b.x<e&&T.x<e||(b.x<e?b=new ke(e,b.y+(e-b.x)/(T.x-b.x)*(T.y-b.y))._round():T.x<e&&(T=new ke(e,b.y+(e-b.x)/(T.x-b.x)*(T.y-b.y))._round()),b.y<r&&T.y<r||(b.y<r?b=new ke(b.x+(r-b.y)/(T.y-b.y)*(T.x-b.x),r)._round():T.y<r&&(T=new ke(b.x+(r-b.y)/(T.y-b.y)*(T.x-b.x),r)._round()),b.x>=a&&T.x>=a||(b.x>=a?b=new ke(a,b.y+(a-b.x)/(T.x-b.x)*(T.y-b.y))._round():T.x>=a&&(T=new ke(a,b.y+(a-b.x)/(T.x-b.x)*(T.y-b.y))._round()),b.y>=o&&T.y>=o||(b.y>=o?b=new ke(b.x+(o-b.y)/(T.y-b.y)*(T.x-b.x),o)._round():T.y>=o&&(T=new ke(b.x+(o-b.y)/(T.y-b.y)*(T.x-b.x),o)._round()),_&&b.equals(_[_.length-1])||(_=[b],d.push(_)),_.push(T)))))}}return d}Ce("FeatureIndex",Hu,{omit:["rawTileData","sourceLayerCoder"]});class Ws extends ke{constructor(e,r,a,o){super(e,r),this.angle=a,o!==void 0&&(this.segment=o)}clone(){return new Ws(this.x,this.y,this.angle,this.segment)}}function Ju(i,e,r,a,o){if(e.segment===void 0||r===0)return!0;let d=e,p=e.segment+1,f=0;for(;f>-r/2;){if(p--,p<0)return!1;f-=i[p].dist(d),d=i[p]}f+=i[p].dist(i[p+1]),p++;const _=[];let x=0;for(;f<r/2;){const b=i[p],T=i[p+1];if(!T)return!1;let A=i[p-1].angleTo(b)-b.angleTo(T);for(A=Math.abs((A+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:f,angleDelta:A}),x+=A;f-_[0].distance>a;)x-=_.shift().angleDelta;if(x>o)return!1;p++,f+=b.dist(T)}return!0}function Qu(i){let e=0;for(let r=0;r<i.length-1;r++)e+=i[r].dist(i[r+1]);return e}function eh(i,e,r){return i?.6*e*r:0}function th(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function sp(i,e,r,a,o,d){const p=eh(r,o,d),f=th(r,a)*d;let _=0;const x=Qu(i)/2;for(let b=0;b<i.length-1;b++){const T=i[b],A=i[b+1],C=T.dist(A);if(_+C>x){const P=(x-_)/C,D=Oi.number(T.x,A.x,P),V=Oi.number(T.y,A.y,P),$=new Ws(D,V,A.angleTo(T),b);return $._round(),!p||Ju(i,$,f,p,e)?$:void 0}_+=C}}function ap(i,e,r,a,o,d,p,f,_){const x=eh(a,d,p),b=th(a,o),T=b*p,A=i[0].x===0||i[0].x===_||i[0].y===0||i[0].y===_;return e-T<e/4&&(e=T+e/4),ih(i,A?e/2*f%e:(b/2+2*d)*p*f%e,e,x,r,T,A,!1,_)}function ih(i,e,r,a,o,d,p,f,_){const x=d/2,b=Qu(i);let T=0,A=e-r,C=[];for(let P=0;P<i.length-1;P++){const D=i[P],V=i[P+1],$=D.dist(V),X=V.angleTo(D);for(;A+r<T+$;){A+=r;const q=(A-T)/$,J=Oi.number(D.x,V.x,q),ie=Oi.number(D.y,V.y,q);if(J>=0&&J<_&&ie>=0&&ie<_&&A-x>=0&&A+x<=b){const de=new Ws(J,ie,X,P);de._round(),a&&!Ju(i,de,d,a,o)||C.push(de)}}T+=$}return f||C.length||p||(C=ih(i,T/2,r,a,o,d,p,!0,_)),C}Ce("Anchor",Ws);const cn=ji;function rh(i,e,r,a){const o=[],d=i.image,p=d.pixelRatio,f=d.paddedRect.w-2*cn,_=d.paddedRect.h-2*cn,x=i.right-i.left,b=i.bottom-i.top,T=d.stretchX||[[0,f]],A=d.stretchY||[[0,_]],C=(ve,Pe)=>ve+Pe[1]-Pe[0],P=T.reduce(C,0),D=A.reduce(C,0),V=f-P,$=_-D;let X=0,q=P,J=0,ie=D,de=0,Me=V,Le=0,Ae=$;if(d.content&&a){const ve=d.content;X=bl(T,0,ve[0]),J=bl(A,0,ve[1]),q=bl(T,ve[0],ve[2]),ie=bl(A,ve[1],ve[3]),de=ve[0]-X,Le=ve[1]-J,Me=ve[2]-ve[0]-q,Ae=ve[3]-ve[1]-ie}const Ie=(ve,Pe,we,_e)=>{const Ne=wl(ve.stretch-X,q,x,i.left),Be=Sl(ve.fixed-de,Me,ve.stretch,P),Je=wl(Pe.stretch-J,ie,b,i.top),Tt=Sl(Pe.fixed-Le,Ae,Pe.stretch,D),At=wl(we.stretch-X,q,x,i.left),Yt=Sl(we.fixed-de,Me,we.stretch,P),rr=wl(_e.stretch-J,ie,b,i.top),zi=Sl(_e.fixed-Le,Ae,_e.stretch,D),Gt=new ke(Ne,Je),ci=new ke(At,Je),fi=new ke(At,rr),Di=new ke(Ne,rr),Li=new ke(Be/p,Tt/p),Jt=new ke(Yt/p,zi/p),Qt=e*Math.PI/180;if(Qt){const wi=Math.sin(Qt),qi=Math.cos(Qt),Zi=[qi,-wi,wi,qi];Gt._matMult(Zi),ci._matMult(Zi),Di._matMult(Zi),fi._matMult(Zi)}const bi=ve.stretch+ve.fixed,Ri=Pe.stretch+Pe.fixed;return{tl:Gt,tr:ci,bl:Di,br:fi,tex:{x:d.paddedRect.x+cn+bi,y:d.paddedRect.y+cn+Ri,w:we.stretch+we.fixed-bi,h:_e.stretch+_e.fixed-Ri},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Li,pixelOffsetBR:Jt,minFontScaleX:Me/p/x,minFontScaleY:Ae/p/b,isSDF:r}};if(a&&(d.stretchX||d.stretchY)){const ve=sh(T,V,P),Pe=sh(A,$,D);for(let we=0;we<ve.length-1;we++){const _e=ve[we],Ne=ve[we+1];for(let Be=0;Be<Pe.length-1;Be++)o.push(Ie(_e,Pe[Be],Ne,Pe[Be+1]))}}else o.push(Ie({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:f+1},{fixed:0,stretch:_+1}));return o}function bl(i,e,r){let a=0;for(const o of i)a+=Math.max(e,Math.min(r,o[1]))-Math.max(e,Math.min(r,o[0]));return a}function sh(i,e,r){const a=[{fixed:-cn,stretch:0}];for(const[o,d]of i){const p=a[a.length-1];
2a.push({fixed:o-p.stretch,stretch:p.stretch}),a.push({fixed:o-p.stretch,stretch:p.stretch+(d-o)})}return a.push({fixed:e+cn,stretch:r}),a}function wl(i,e,r,a){return i/e*r+a}function Sl(i,e,r,a){return i-e*r/a}class Tl{constructor(e,r,a,o,d,p,f,_,x,b){if(this.boxStartIndex=e.length,x){let T=p.top,A=p.bottom;const C=p.collisionPadding;C&&(T-=C[1],A+=C[3]);let P=A-T;P>0&&(P=Math.max(10,P),this.circleDiameter=P)}else{let T=p.top*f-_[0],A=p.bottom*f+_[2],C=p.left*f-_[3],P=p.right*f+_[1];const D=p.collisionPadding;if(D&&(C-=D[0]*f,T-=D[1]*f,P+=D[2]*f,A+=D[3]*f),b){const V=new ke(C,T),$=new ke(P,T),X=new ke(C,A),q=new ke(P,A),J=b*Math.PI/180;V._rotate(J),$._rotate(J),X._rotate(J),q._rotate(J),C=Math.min(V.x,$.x,X.x,q.x),P=Math.max(V.x,$.x,X.x,q.x),T=Math.min(V.y,$.y,X.y,q.y),A=Math.max(V.y,$.y,X.y,q.y)}e.emplaceBack(r.x,r.y,C,T,P,A,a,o,d)}this.boxEndIndex=e.length}}class np{constructor(e=[],r=op){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:a}=this,o=r[e];for(;e>0;){const d=e-1>>1,p=r[d];if(a(o,p)>=0)break;r[e]=p,e=d}r[e]=o}_down(e){const{data:r,compare:a}=this,o=this.length>>1,d=r[e];for(;e<o;){let p=1+(e<<1),f=r[p];const _=p+1;if(_<this.length&&a(r[_],f)<0&&(p=_,f=r[_]),a(f,d)>=0)break;r[e]=f,e=p}r[e]=d}}function op(i,e){return i<e?-1:i>e?1:0}function lp(i,e=1,r=!1){let a=1/0,o=1/0,d=-1/0,p=-1/0;const f=i[0];for(let C=0;C<f.length;C++){const P=f[C];(!C||P.x<a)&&(a=P.x),(!C||P.y<o)&&(o=P.y),(!C||P.x>d)&&(d=P.x),(!C||P.y>p)&&(p=P.y)}const _=Math.min(d-a,p-o);let x=_/2;const b=new np([],cp);if(_===0)return new ke(a,o);for(let C=a;C<d;C+=_)for(let P=o;P<p;P+=_)b.push(new un(C+x,P+x,x,i));let T=function(C){let P=0,D=0,V=0;const $=C[0];for(let X=0,q=$.length,J=q-1;X<q;J=X++){const ie=$[X],de=$[J],Me=ie.x*de.y-de.x*ie.y;D+=(ie.x+de.x)*Me,V+=(ie.y+de.y)*Me,P+=3*Me}return new un(D/P,V/P,0,C)}(i),A=b.length;for(;b.length;){const C=b.pop();(C.d>T.d||!T.d)&&(T=C,r&&console.log("found best %d after %d probes",Math.round(1e4*C.d)/1e4,A)),C.max-T.d<=e||(x=C.h/2,b.push(new un(C.p.x-x,C.p.y-x,x,i)),b.push(new un(C.p.x+x,C.p.y-x,x,i)),b.push(new un(C.p.x-x,C.p.y+x,x,i)),b.push(new un(C.p.x+x,C.p.y+x,x,i)),A+=4)}return r&&(console.log(`num probes: ${A}`),console.log(`best distance: ${T.d}`)),T.p}function cp(i,e){return e.max-i.max}function un(i,e,r,a){this.p=new ke(i,e),this.h=r,this.d=function(o,d){let p=!1,f=1/0;for(let _=0;_<d.length;_++){const x=d[_];for(let b=0,T=x.length,A=T-1;b<T;A=b++){const C=x[b],P=x[A];C.y>o.y!=P.y>o.y&&o.x<(P.x-C.x)*(o.y-C.y)/(P.y-C.y)+C.x&&(p=!p),f=Math.min(f,Nc(o,C,P))}}return(p?1:-1)*Math.sqrt(f)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var pi;c.aq=void 0,(pi=c.aq||(c.aq={}))[pi.center=1]="center",pi[pi.left=2]="left",pi[pi.right=3]="right",pi[pi.top=4]="top",pi[pi.bottom=5]="bottom",pi[pi["top-left"]=6]="top-left",pi[pi["top-right"]=7]="top-right",pi[pi["bottom-left"]=8]="bottom-left",pi[pi["bottom-right"]=9]="bottom-right";const Hs=7,Tc=Number.POSITIVE_INFINITY;function ah(i,e){return e[1]!==Tc?function(r,a,o){let d=0,p=0;switch(a=Math.abs(a),o=Math.abs(o),r){case"top-right":case"top-left":case"top":p=o-Hs;break;case"bottom-right":case"bottom-left":case"bottom":p=-o+Hs}switch(r){case"top-right":case"bottom-right":case"right":d=-a;break;case"top-left":case"bottom-left":case"left":d=a}return[d,p]}(i,e[0],e[1]):function(r,a){let o=0,d=0;a<0&&(a=0);const p=a/Math.SQRT2;switch(r){case"top-right":case"top-left":d=p-Hs;break;case"bottom-right":case"bottom-left":d=-p+Hs;break;case"bottom":d=-a+Hs;break;case"top":d=a-Hs}switch(r){case"top-right":case"bottom-right":o=-p;break;case"top-left":case"bottom-left":o=p;break;case"left":o=a;break;case"right":o=-a}return[o,d]}(i,e[0])}function nh(i,e,r){var a;const o=i.layout,d=(a=o.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},r);if(d){const f=d.values,_=[];for(let x=0;x<f.length;x+=2){const b=_[x]=f[x],T=f[x+1].map(A=>A*Kt);b.startsWith("top")?T[1]-=Hs:b.startsWith("bottom")&&(T[1]+=Hs),_[x+1]=T}return new Yi(_)}const p=o.get("text-variable-anchor");if(p){let f;f=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[o.get("text-radial-offset").evaluate(e,{},r)*Kt,Tc]:o.get("text-offset").evaluate(e,{},r).map(x=>x*Kt);const _=[];for(const x of p)_.push(x,ah(x,f));return new Yi(_)}return null}function Ic(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function up(i,e,r,a,o,d,p,f,_,x,b){let T=d.textMaxSize.evaluate(e,{});T===void 0&&(T=p);const A=i.layers[0].layout,C=A.get("icon-offset").evaluate(e,{},b),P=lh(r.horizontal),D=p/24,V=i.tilePixelRatio*D,$=i.tilePixelRatio*T/24,X=i.tilePixelRatio*f,q=i.tilePixelRatio*A.get("symbol-spacing"),J=A.get("text-padding")*i.tilePixelRatio,ie=function(_e,Ne,Be,Je=1){const Tt=_e.get("icon-padding").evaluate(Ne,{},Be),At=Tt&&Tt.values;return[At[0]*Je,At[1]*Je,At[2]*Je,At[3]*Je]}(A,e,b,i.tilePixelRatio),de=A.get("text-max-angle")/180*Math.PI,Me=A.get("text-rotation-alignment")!=="viewport"&&A.get("symbol-placement")!=="point",Le=A.get("icon-rotation-alignment")==="map"&&A.get("symbol-placement")!=="point",Ae=A.get("symbol-placement"),Ie=q/2,ve=A.get("icon-text-fit");let Pe;a&&ve!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Pe=Pu(a,r.vertical,ve,A.get("icon-text-fit-padding"),C,D)),P&&(a=Pu(a,P,ve,A.get("icon-text-fit-padding"),C,D)));const we=(_e,Ne)=>{Ne.x<0||Ne.x>=Zt||Ne.y<0||Ne.y>=Zt||function(Be,Je,Tt,At,Yt,rr,zi,Gt,ci,fi,Di,Li,Jt,Qt,bi,Ri,wi,qi,Zi,ei,it,Si,mi,ti,br){const Lr=Be.addToLineVertexArray(Je,Tt);let Rr,xs,wr,lr,Gi=0,vs=0,yo=0,dh=0,Dc=-1,Lc=-1;const bs={};let ph=ms("");if(Be.allowVerticalPlacement&&At.vertical){const Ti=Gt.layout.get("text-rotate").evaluate(it,{},ti)+90;wr=new Tl(ci,Je,fi,Di,Li,At.vertical,Jt,Qt,bi,Ti),zi&&(lr=new Tl(ci,Je,fi,Di,Li,zi,wi,qi,bi,Ti))}if(Yt){const Ti=Gt.layout.get("icon-rotate").evaluate(it,{}),cr=Gt.layout.get("icon-text-fit")!=="none",xa=rh(Yt,Ti,mi,cr),Fr=zi?rh(zi,Ti,mi,cr):void 0;xs=new Tl(ci,Je,fi,Di,Li,Yt,wi,qi,!1,Ti),Gi=4*xa.length;const va=Be.iconSizeData;let Qr=null;va.kind==="source"?(Qr=[Jr*Gt.layout.get("icon-size").evaluate(it,{})],Qr[0]>Zs&&_i(`${Be.layerIds[0]}: Value for "icon-size" is >= ${fo}. Reduce your "icon-size".`)):va.kind==="composite"&&(Qr=[Jr*Si.compositeIconSizes[0].evaluate(it,{},ti),Jr*Si.compositeIconSizes[1].evaluate(it,{},ti)],(Qr[0]>Zs||Qr[1]>Zs)&&_i(`${Be.layerIds[0]}: Value for "icon-size" is >= ${fo}. Reduce your "icon-size".`)),Be.addSymbols(Be.icon,xa,Qr,ei,Zi,it,c.ai.none,Je,Lr.lineStartIndex,Lr.lineLength,-1,ti),Dc=Be.icon.placedSymbolArray.length-1,Fr&&(vs=4*Fr.length,Be.addSymbols(Be.icon,Fr,Qr,ei,Zi,it,c.ai.vertical,Je,Lr.lineStartIndex,Lr.lineLength,-1,ti),Lc=Be.icon.placedSymbolArray.length-1)}const fh=Object.keys(At.horizontal);for(const Ti of fh){const cr=At.horizontal[Ti];if(!Rr){ph=ms(cr.text);const Fr=Gt.layout.get("text-rotate").evaluate(it,{},ti);Rr=new Tl(ci,Je,fi,Di,Li,cr,Jt,Qt,bi,Fr)}const xa=cr.positionedLines.length===1;if(yo+=oh(Be,Je,cr,rr,Gt,bi,it,Ri,Lr,At.vertical?c.ai.horizontal:c.ai.horizontalOnly,xa?fh:[Ti],bs,Dc,Si,ti),xa)break}At.vertical&&(dh+=oh(Be,Je,At.vertical,rr,Gt,bi,it,Ri,Lr,c.ai.vertical,["vertical"],bs,Lc,Si,ti));const pp=Rr?Rr.boxStartIndex:Be.collisionBoxArray.length,fp=Rr?Rr.boxEndIndex:Be.collisionBoxArray.length,mp=wr?wr.boxStartIndex:Be.collisionBoxArray.length,gp=wr?wr.boxEndIndex:Be.collisionBoxArray.length,_p=xs?xs.boxStartIndex:Be.collisionBoxArray.length,yp=xs?xs.boxEndIndex:Be.collisionBoxArray.length,xp=lr?lr.boxStartIndex:Be.collisionBoxArray.length,vp=lr?lr.boxEndIndex:Be.collisionBoxArray.length;let Br=-1;const Al=(Ti,cr)=>Ti&&Ti.circleDiameter?Math.max(Ti.circleDiameter,cr):cr;Br=Al(Rr,Br),Br=Al(wr,Br),Br=Al(xs,Br),Br=Al(lr,Br);const mh=Br>-1?1:0;mh&&(Br*=br/Kt),Be.glyphOffsetArray.length>=ln.MAX_GLYPHS&&_i("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),it.sortKey!==void 0&&Be.addToSortKey
2Ranges(Be.symbolInstances.length,it.sortKey);const bp=nh(Gt,it,ti),[wp,Sp]=function(Ti,cr){const xa=Ti.length,Fr=cr?.values;if(Fr?.length>0)for(let va=0;va<Fr.length;va+=2){const Qr=Fr[va+1];Ti.emplaceBack(c.aq[Fr[va]],Qr[0],Qr[1])}return[xa,Ti.length]}(Be.textAnchorOffsets,bp);Be.symbolInstances.emplaceBack(Je.x,Je.y,bs.right>=0?bs.right:-1,bs.center>=0?bs.center:-1,bs.left>=0?bs.left:-1,bs.vertical||-1,Dc,Lc,ph,pp,fp,mp,gp,_p,yp,xp,vp,fi,yo,dh,Gi,vs,mh,0,Jt,Br,wp,Sp)}(i,Ne,_e,r,a,o,Pe,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,V,[J,J,J,J],Me,_,X,ie,Le,C,e,d,x,b,p)};if(Ae==="line")for(const _e of Yu(e.geometry,0,0,Zt,Zt)){const Ne=ap(_e,q,de,r.vertical||P,a,24,$,i.overscaling,Zt);for(const Be of Ne)P&&hp(i,P.text,Ie,Be)||we(_e,Be)}else if(Ae==="line-center"){for(const _e of e.geometry)if(_e.length>1){const Ne=sp(_e,de,r.vertical||P,a,24,$);Ne&&we(_e,Ne)}}else if(e.type==="Polygon")for(const _e of rc(e.geometry,0)){const Ne=lp(_e,16);we(_e[0],new Ws(Ne.x,Ne.y,0))}else if(e.type==="LineString")for(const _e of e.geometry)we(_e,new Ws(_e[0].x,_e[0].y,0));else if(e.type==="Point")for(const _e of e.geometry)for(const Ne of _e)we([Ne],new Ws(Ne.x,Ne.y,0))}function oh(i,e,r,a,o,d,p,f,_,x,b,T,A,C,P){const D=function(X,q,J,ie,de,Me,Le,Ae){const Ie=ie.layout.get("text-rotate").evaluate(Me,{})*Math.PI/180,ve=[];for(const Pe of q.positionedLines)for(const we of Pe.positionedGlyphs){if(!we.rect)continue;const _e=we.rect||{};let Ne=Su+1,Be=!0,Je=1,Tt=0;const At=(de||Ae)&&we.vertical,Yt=we.metrics.advance*we.scale/2;
vendor: 6,089 bytes, line 2
2if(Ae&&q.verticalizable&&(Tt=Pe.lineOffset/2-(we.imageName?-(Kt-we.metrics.width*we.scale)/2:(we.scale-1)*Kt)),we.imageName){const ei=Le[we.imageName];Be=ei.sdf,Je=ei.pixelRatio,Ne=ji/Je}const rr=de?[we.x+Yt,we.y]:[0,0];let zi=de?[0,0]:[we.x+Yt+J[0],we.y+J[1]-Tt],Gt=[0,0];At&&(Gt=zi,zi=[0,0]);const ci=we.metrics.isDoubleResolution?2:1,fi=(we.metrics.left-Ne)*we.scale-Yt+zi[0],Di=(-we.metrics.top-Ne)*we.scale+zi[1],Li=fi+_e.w/ci*we.scale/Je,Jt=Di+_e.h/ci*we.scale/Je,Qt=new ke(fi,Di),bi=new ke(Li,Di),Ri=new ke(fi,Jt),wi=new ke(Li,Jt);if(At){const ei=new ke(-Yt,Yt-ho),it=-Math.PI/2,Si=Kt/2-Yt,mi=new ke(5-ho-Si,-(we.imageName?Si:0)),ti=new ke(...Gt);Qt._rotateAround(it,ei)._add(mi)._add(ti),bi._rotateAround(it,ei)._add(mi)._add(ti),Ri._rotateAround(it,ei)._add(mi)._add(ti),wi._rotateAround(it,ei)._add(mi)._add(ti)}if(Ie){const ei=Math.sin(Ie),it=Math.cos(Ie),Si=[it,-ei,ei,it];Qt._matMult(Si),bi._matMult(Si),Ri._matMult(Si),wi._matMult(Si)}const qi=new ke(0,0),Zi=new ke(0,0);ve.push({tl:Qt,tr:bi,bl:Ri,br:wi,tex:_e,writingMode:q.writingMode,glyphOffset:rr,sectionIndex:we.sectionIndex,isSDF:Be,pixelOffsetTL:qi,pixelOffsetBR:Zi,minFontScaleX:0,minFontScaleY:0})}return ve}(0,r,f,o,d,p,a,i.allowVerticalPlacement),V=i.textSizeData;let $=null;V.kind==="source"?($=[Jr*o.layout.get("text-size").evaluate(p,{})],$[0]>Zs&&_i(`${i.layerIds[0]}: Value for "text-size" is >= ${fo}. Reduce your "text-size".`)):V.kind==="composite"&&($=[Jr*C.compositeTextSizes[0].evaluate(p,{},P),Jr*C.compositeTextSizes[1].evaluate(p,{},P)],($[0]>Zs||$[1]>Zs)&&_i(`${i.layerIds[0]}: Value for "text-size" is >= ${fo}. Reduce your "text-size".`)),i.addSymbols(i.text,D,$,f,d,p,x,e,_.lineStartIndex,_.lineLength,A,P);for(const X of b)T[X]=i.text.placedSymbolArray.length-1;return 4*D.length}function lh(i){for(const e in i)return i[e];return null}function hp(i,e,r,a){const o=i.compareText;if(e in o){const d=o[e];for(let p=d.length-1;p>=0;p--)if(a.dist(d[p])<r)return!0}else o[e]=[];return o[e].push(a),!1}const ch=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Ac{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,a]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=a>>4;if(o!==1)throw new Error(`Got v${o} data when expected v1.`);const d=ch[15&a];if(!d)throw new Error("Unrecognized array type.");const[p]=new Uint16Array(e,2,1),[f]=new Uint32Array(e,4,1);return new Ac(f,p,d,e)}constructor(e,r=64,a=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const d=ch.indexOf(this.ArrayType),p=2*e*this.ArrayType.BYTES_PER_ELEMENT,f=e*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-f%8)%8;if(d<0)throw new Error(`Unexpected typed array class: ${a}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+_,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+p+f+_),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+_,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+d]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=r,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ec(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,a,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:d,coords:p,nodeSize:f}=this,_=[0,d.length-1,0],x=[];for(;_.length;){const b=_.pop()||0,T=_.pop()||0,A=_.pop()||0;if(T-A<=f){for(let V=A;V<=T;V++){const $=p[2*V],X=p[2*V+1];$>=e&&$<=a&&X>=r&&X<=o&&x.push(d[V])}continue}const C=A+T>>1,P=p[2*C],D=p[2*C+1];P>=e&&P<=a&&D>=r&&D<=o&&x.push(d[C]),(b===0?e<=P:r<=D)&&(_.push(A),_.push(C-1),_.push(1-b)),(b===0?a>=P:o>=D)&&(_.push(C+1),_.push(T),_.push(1-b))}return x}within(e,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:d,nodeSize:p}=this,f=[0,o.length-1,0],_=[],x=a*a;for(;f.length;){const b=f.pop()||0,T=f.pop()||0,A=f.pop()||0;if(T-A<=p){for(let V=A;V<=T;V++)hh(d[2*V],d[2*V+1],e,r)<=x&&_.push(o[V]);continue}const C=A+T>>1,P=d[2*C],D=d[2*C+1];hh(P,D,e,r)<=x&&_.push(o[C]),(b===0?e-a<=P:r-a<=D)&&(f.push(A),f.push(C-1),f.push(1-b)),(b===0?e+a>=P:r+a>=D)&&(f.push(C+1),f.push(T),f.push(1-b))}return _}}function Ec(i,e,r,a,o,d){if(o-a<=r)return;const p=a+o>>1;uh(i,e,p,a,o,d),Ec(i,e,r,a,p-1,1-d),Ec(i,e,r,p+1,o,1-d)}function uh(i,e,r,a,o,d){for(;o>a;){if(o-a>600){const x=o-a+1,b=r-a+1,T=Math.log(x),A=.5*Math.exp(2*T/3),C=.5*Math.sqrt(T*A*(x-A)/x)*(b-x/2<0?-1:1);uh(i,e,r,Math.max(a,Math.floor(r-b*A/x+C)),Math.min(o,Math.floor(r+(x-b)*A/x+C)),d)}const p=e[2*r+d];let f=a,_=o;for(go(i,e,a,r),e[2*o+d]>p&&go(i,e,a,o);f<_;){for(go(i,e,f,_),f++,_--;e[2*f+d]<p;)f++;for(;e[2*_+d]>p;)_--}e[2*a+d]===p?go(i,e,a,_):(_++,go(i,e,_,o)),_<=r&&(a=_+1),r<=_&&(o=_-1)}}function go(i,e,r,a){Mc(i,r,a),Mc(e,2*r,2*a),Mc(e,2*r+1,2*a+1)}function Mc(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}function hh(i,e,r,a){const o=i-r,d=e-a;return o*o+d*d}var Cc;c.bh=void 0,(Cc=c.bh||(c.bh={})).create="create",Cc.load="load",Cc.fullLoad="fullLoad";let Il=null,_o=[];const Pc=1e3/60,kc="loadTime",zc="fullLoadTime",dp={mark(i){performance.mark(i)},frame(i){const e=i;Il!=null&&_o.push(e-Il),Il=e},clearMetrics(){Il=null,_o=[],performance.clearMeasures(kc),performance.clearMeasures(zc);for(const i in c.bh)performance.clearMarks(c.bh[i])},getPerformanceMetrics(){performance.measure(kc,c.bh.create,c.bh.load),performance.measure(zc,c.bh.create,c.bh.fullLoad);const i=performance.getEntriesByName(kc)[0].duration,e=performance.getEntriesByName(zc)[
20].duration,r=_o.length,a=1/(_o.reduce((d,p)=>d+p,0)/r/1e3),o=_o.filter(d=>d>Pc).reduce((d,p)=>d+(p-Pc)/Pc,0);return{loadTime:i,fullLoadTime:e,fps:a,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};c.$=function(i,e,r){var a,o,d,p,f,_,x,b,T,A,C,P,D=r[0],V=r[1],$=r[2];return e===i?(i[12]=e[0]*D+e[4]*V+e[8]*$+e[12],i[13]=e[1]*D+e[5]*V+e[9]*$+e[13],i[14]=e[2]*D+e[6]*V+e[10]*$+e[14],i[15]=e[3]*D+e[7]*V+e[11]*$+e[15]):(o=e[1],d=e[2],p=e[3],f=e[4],_=e[5],x=e[6],b=e[7],T=e[8],A=e[9],C=e[10],P=e[11],i[0]=a=e[0],i[1]=o,i[2]=d,i[3]=p,i[4]=f,i[5]=_,i[6]=x,i[7]=b,i[8]=T,i[9]=A,i[10]=C,i[11]=P,i[12]=a*D+f*V+T*$+e[12],i[13]=o*D+_*V+A*$+e[13],i[14]=d*D+x*V+C*$+e[14],i[15]=p*D+b*V+P*$+e[15]),i},c.A=tn,c.B=Oi,c.C=class{constructor(i,e,r){this.receive=a=>{const o=a.data,d=o.id;if(d&&(!o.targetMapId||this.mapId===o.targetMapId))if(o.type==="<cancel>"){delete this.tasks[d];const p=this.cancelCallbacks[d];delete this.cancelCallbacks[d],p&&p()}else Wi()||o.mustQueue?(this.tasks[d]=o,this.taskQueue.push(d),this.invoker.trigger()):this.processTask(d,o)},this.process=()=>{if(!this.taskQueue.length)return;const a=this.taskQueue.shift(),o=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),o&&this.processTask(a,o)},this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new ip(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Wi()?i:window}send(i,e,r,a,o=!1){const d=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[d]=r);const p=[],f={id:d,type:i,hasCallback:!!r,targetMapId:a,mustQueue:o,sourceMapId:this.mapId,data:Xr(e,p)};return this.target.postMessage(f,{transfer:p}),{cancel:()=>{r&&delete this.callbacks[d],this.target.postMessage({id:d,type:"<cancel>",targetMapId:a,sourceMapId:this.mapId})}}}processTask(i,e){if(e.type==="<response>"){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(Vs(e.error)):r(null,Vs(e.data)))}else{let r=!1;const a=[],o=e.hasCallback?(f,_)=>{r=!0,delete this.cancelCallbacks[i];const x={id:i,type:"<response>",sourceMapId:this.mapId,error:f?Xr(f):null,data:Xr(_,a)};this.target.postMessage(x,{transfer:a})}:f=>{r=!0};let d=null;const p=Vs(e.data);if(this.parent[e.type])d=this.parent[e.type](e.sourceMapId,p,o);else if("getWorkerSource"in this.parent){const f=e.type.split(".");d=this.parent.getWorkerSource(e.sourceMapId,f[0],p.source)[f[1]](p,o)}else o(new Error(`Could not find function ${e.type}`));!r&&d&&d.cancel&&(this.cancelCallbacks[i]=d.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},c.D=Oe,c.E=rs,c.F=function(i,e){const r={};for(let a=0;a<e.length;a++){const o=e[a];o in i&&(r[o]=i[o])}return r},c.G=Vu,c.H=Nu,c.I=pc,c.J=Ii,c.K=jt,c.L=Gs,c.M=Ys,c.N=Zt,c.O=or,c.P=ke,c.Q=kt,c.R=nr,c.S=St,c.T=el,c.U=vl,c.V=class extends ps{},c.W=Sc,c.X=function(i,e){const r=window.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(let a=0;a<i.length;a++){const o=window.document.createElement("source");Ir(i[a])||(r.crossOrigin="Anonymous"),o.src=i[a],r.appendChild(o)}return{cancel:()=>{}}},c.Y=be,c.Z=function(){var i=new tn(16);return tn!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},c._=Fe,c.a=Ks,c.a$=class extends M{},c.a0=function(i,e,r){var a=r[0],o=r[1],d=r[2];return i[0]=e[0]*a,i[1]=e[1]*a,i[2]=e[2]*a,i[3]=e[3]*a,i[4]=e[4]*o,i[5]=e[5]*o,i[6]=e[6]*o,i[7]=e[7]*o,i[8]=e[8]*d,i[9]=e[9]*d,i[10]=e[10]*d,i[11]=e[11]*d,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.a1=qc,c.a2=function(){return wa++},c.a3=F,c.a4=ln,c.a5=function(){Ui.isLoading()||Ui.isLoaded()||qn()!=="deferred"||Qo()},c.a6=Dn,c.a7=_a,c.a8=wt,c.a9=Wu,c.aA=ha,c.aB=function(i){i=i.slice();const e=Object.create(null);for(let r=0;r<i.length;r++)e[i[r].id]=i[r];for(let r=0;r<i.length;r++)"ref"in i[r]&&(i[r]=Xi(i[r],e[i[r].ref]));return i},c.aC=function(i){if(i.type==="custom")return new tp(i);switch(i.type){case"background":return new Jd(i);case"circle":return new Fh(i);case"fill":return new rd(i);case"fill-extrusion":return new yd(i);case"heatmap":return new Vh(i);case"hillshade":return new Uh(i);case"line":return new Ad(i);case"raster":return new ep(i);case"symbol":return new xl(i)}},c.aD=sr,c.aE=function(i,e){if(!i)return[{command:ot.setStyle,args:[e]}];let r=[];try{if(!yt(i.version,e.version))return[{command:ot.setStyle,args:[e]}];yt(i.center,e.center)||r.push({command:ot.setCenter,args:[e.center]}),yt(i.zoom,e.zoom)||r.push({command:ot.setZoom,args:[e.zoom]}),yt(i.bearing,e.bearing)||r.push({command:ot.setBearing,args:[e.bearing]}),yt(i.pitch,e.pitch)||r.push({command:ot.setPitch,args:[e.pitch]}),yt(i.sprite,e.sprite)||r.push({command:ot.setSprite,args:[e.sprite]}),yt(i.glyphs,e.glyphs)||r.push({command:ot.setGlyphs,args:[e.glyphs]}),yt(i.transition,e.transition)||r.push({command:ot.setTransition,args:[e.transition]}),yt(i.light,e.light)||r.push({command:ot.setLight,args:[e.light]});const a={},o=[];(function(p,f,_,x){let b;for(b in f=f||{},p=p||{})Object.prototype.hasOwnProperty.call(p,b)&&(Object.prototype.hasOwnProperty.call(f,b)||Es(b,_,x));for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&(Object.prototype.hasOwnProperty.call(p,b)?yt(p[b],f[b])||(p[b].type==="geojson"&&f[b].type==="geojson"&&Ta(p,f,b)?_.push({command:ot.setGeoJSONSourceData,args:[b,f[b].data]}):Ar(b,f,_,x)):dr(b,f,_))})(i.sources,e.sources,o,a);const d=[];
2i.layers&&i.layers.forEach(p=>{a[p.source]?r.push({command:ot.removeLayer,args:[p.id]}):d.push(p)}),r=r.concat(o),function(p,f,_){f=f||[];const x=(p=p||[]).map(jr),b=f.map(jr),T=p.reduce(ss,{}),A=f.reduce(ss,{}),C=x.slice(),P=Object.create(null);let D,V,$,X,q,J,ie;for(D=0,V=0;D<x.length;D++)$=x[D],Object.prototype.hasOwnProperty.call(A,$)?V++:(_.push({command:ot.removeLayer,args:[$]}),C.splice(C.indexOf($,V),1));for(D=0,V=0;D<b.length;D++)$=b[b.length-1-D],C[C.length-1-D]!==$&&(Object.prototype.hasOwnProperty.call(T,$)?(_.push({command:ot.removeLayer,args:[$]}),C.splice(C.lastIndexOf($,C.length-V),1)):V++,J=C[C.length-D],_.push({command:ot.addLayer,args:[A[$],J]}),C.splice(C.length-D,0,$),P[$]=!0);for(D=0;D<b.length;D++)if($=b[D],X=T[$],q=A[$],!P[$]&&!yt(X,q))if(yt(X.source,q.source)&&yt(X["source-layer"],q["source-layer"])&&yt(X.type,q.type)){for(ie in Ms(X.layout,q.layout,_,$,null,ot.setLayoutProperty),Ms(X.paint,q.paint,_,$,null,ot.setPaintProperty),yt(X.filter,q.filter)||_.push({command:ot.setFilter,args:[$,q.filter]}),yt(X.minzoom,q.minzoom)&&yt(X.maxzoom,q.maxzoom)||_.push({command:ot.setLayerZoomRange,args:[$,q.minzoom,q.maxzoom]}),X)Object.prototype.hasOwnProperty.call(X,ie)&&ie!=="layout"&&ie!=="paint"&&ie!=="filter"&&ie!=="metadata"&&ie!=="minzoom"&&ie!=="maxzoom"&&(ie.indexOf("paint.")===0?Ms(X[ie],q[ie],_,$,ie.slice(6),ot.setPaintProperty):yt(X[ie],q[ie])||_.push({command:ot.setLayerProperty,args:[$,ie,q[ie]]}));for(ie in q)Object.prototype.hasOwnProperty.call(q,ie)&&!Object.prototype.hasOwnProperty.call(X,ie)&&ie!=="layout"&&ie!=="paint"&&ie!=="filter"&&ie!=="metadata"&&ie!=="minzoom"&&ie!=="maxzoom"&&(ie.indexOf("paint.")===0?Ms(X[ie],q[ie],_,$,ie.slice(6),ot.setPaintProperty):yt(X[ie],q[ie])||_.push({command:ot.setLayerProperty,args:[$,ie,q[ie]]}))}else _.push({command:ot.removeLayer,args:[$]}),J=C[C.lastIndexOf($)+1],_.push({command:ot.addLayer,args:[q,J]})}(d,e.layers,r)}catch(a){console.warn("Unable to compute style diff:",a),r=[{command:ot.setStyle,args:[e]}]}return r},c.aF=function(i){const e=[],r=i.id;return r===void 0&&e.push({message:`layers.${r}: missing required property "id"`}),i.render===void 0&&e.push({message:`layers.${r}: missing required method "render"`}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},c.aG=function i(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let a=0;a<e.length;a++)if(!i(e[a],r[a]))return!1;return!0}if(typeof e=="object"&&e!==null&&r!==null){if(typeof r!="object"||Object.keys(e).length!==Object.keys(r).length)return!1;for(const a in e)if(!i(e[a],r[a]))return!1;return!0}return e===r},c.aH=Et,c.aI=Ss,c.aJ=da,c.aK=function(i){return i({pluginStatus:Ci,pluginURL:Kr}),da.on("pluginStateChange",i),i},c.aL=class extends gs{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},c.aM=Qa,c.aN=class extends gs{constructor(i,e){super(i,e),this.current=Zl}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},c.aO=sl,c.aP=class extends gs{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},c.aQ=class extends gs{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},c.aR=al,c.aS=function(i,e,r,a,o,d,p){var f=1/(e-r),_=1/(a-o),x=1/(d-p);return i[0]=-2*f,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*_,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*x,i[11]=0,i[12]=(e+r)*f,i[13]=(o+a)*_,i[14]=(p+d)*x,i[15]=1,i},c.aT=pt,c.aU=Bh,c.aV=class extends n{},c.aW=Pd,c.aX=class extends h{},c.aY=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},c.aZ=Xc,c.a_=ye,c.aa=function(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,a,o,d)=>{const p=o||d;return e[a]=!p||p.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},c.ab=function(i,e){const r=[];for(const a in i)a in e||r.push(a);return r},c.ac=function(i){if(es==null){const e=i.navigator?i.navigator.userAgent:null;es=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return es},c.ad=ur,c.ae=function(i,e,r){var a=Math.sin(r),o=Math.cos(r),d=e[0],p=e[1],f=e[2],_=e[3],x=e[4],b=e[5],T=e[6],A=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=d*o+x*a,i[1]=p*o+b*a,i[2]=f*o+T*a,i[3]=_*o+A*a,i[4]=x*o-d*a,i[5]=b*o-p*a,i[6]=T*o-f*a,i[7]=A*o-_*a,i},c.af=function(i){var e=new tn(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},c.ag=cl,c.ah=function(i,e){let r=0,a=0;if(i.kind==="constant")a=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:o,minZoom:d,maxZoom:p}=i,f=o?ur(Vi.interpolationFactor(o,e,d,p),0,1):0;i.kind==="camera"?a=Oi.number(i.minSize,i.maxSize,f):r=f}return{uSizeT:r,uSize:a}},c.aj=function(i,{uSize:e,uSizeT:r},{lowerSize:a,upperSize:o}
2){return i.kind==="source"?a/Jr:i.kind==="composite"?Oi.number(a/Jr,o/Jr,r):e},c.ak=_c,c.al=function(i,e,r,a){const o=e.y-i.y,d=e.x-i.x,p=a.y-r.y,f=a.x-r.x,_=p*d-f*o;if(_===0)return null;const x=(f*(i.y-r.y)-p*(i.x-r.x))/_;return new ke(i.x+x*d,i.y+x*o)},c.am=Yu,c.an=Oc,c.ao=Kl,c.ap=Kt,c.ar=gc,c.as=function(i,e){var r=e[0],a=e[1],o=e[2],d=e[3],p=e[4],f=e[5],_=e[6],x=e[7],b=e[8],T=e[9],A=e[10],C=e[11],P=e[12],D=e[13],V=e[14],$=e[15],X=r*f-a*p,q=r*_-o*p,J=r*x-d*p,ie=a*_-o*f,de=a*x-d*f,Me=o*x-d*_,Le=b*D-T*P,Ae=b*V-A*P,Ie=b*$-C*P,ve=T*V-A*D,Pe=T*$-C*D,we=A*$-C*V,_e=X*we-q*Pe+J*ve+ie*Ie-de*Ae+Me*Le;return _e?(i[0]=(f*we-_*Pe+x*ve)*(_e=1/_e),i[1]=(o*Pe-a*we-d*ve)*_e,i[2]=(D*Me-V*de+$*ie)*_e,i[3]=(A*de-T*Me-C*ie)*_e,i[4]=(_*Ie-p*we-x*Ae)*_e,i[5]=(r*we-o*Ie+d*Ae)*_e,i[6]=(V*J-P*Me-$*q)*_e,i[7]=(b*Me-A*J+C*q)*_e,i[8]=(p*Pe-f*Ie+x*Le)*_e,i[9]=(a*Ie-r*Pe-d*Le)*_e,i[10]=(P*de-D*J+$*X)*_e,i[11]=(T*J-b*de-C*X)*_e,i[12]=(f*Ae-p*ve-_*Le)*_e,i[13]=(r*ve-a*Ae+o*Le)*_e,i[14]=(D*q-P*ie-V*X)*_e,i[15]=(b*ie-T*q+A*X)*_e,i):null},c.at=Ic,c.au=mc,c.av=Ac,c.aw=function(){const i={},e=le.$version;for(const r in le.$root){const a=le.$root[r];if(a.required){let o=null;o=r==="version"?e:a.type==="array"?[]:{},o!=null&&(i[r]=o)}}return i},c.ax=ot,c.ay=Xo,c.az=ar,c.b=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(a=>{e(null,a)}).catch(a=>{e(new Error(`Could not load image because of ${a.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},c.b0=oi,c.b1=function(i,e){var r=i[0],a=i[1],o=i[2],d=i[3],p=i[4],f=i[5],_=i[6],x=i[7],b=i[8],T=i[9],A=i[10],C=i[11],P=i[12],D=i[13],V=i[14],$=i[15],X=e[0],q=e[1],J=e[2],ie=e[3],de=e[4],Me=e[5],Le=e[6],Ae=e[7],Ie=e[8],ve=e[9],Pe=e[10],we=e[11],_e=e[12],Ne=e[13],Be=e[14],Je=e[15];return Math.abs(r-X)<=ki*Math.max(1,Math.abs(r),Math.abs(X))&&Math.abs(a-q)<=ki*Math.max(1,Math.abs(a),Math.abs(q))&&Math.abs(o-J)<=ki*Math.max(1,Math.abs(o),Math.abs(J))&&Math.abs(d-ie)<=ki*Math.max(1,Math.abs(d),Math.abs(ie))&&Math.abs(p-de)<=ki*Math.max(1,Math.abs(p),Math.abs(de))&&Math.abs(f-Me)<=ki*Math.max(1,Math.abs(f),Math.abs(Me))&&Math.abs(_-Le)<=ki*Math.max(1,Math.abs(_),Math.abs(Le))&&Math.abs(x-Ae)<=ki*Math.max(1,Math.abs(x),Math.abs(Ae))&&Math.abs(b-Ie)<=ki*Math.max(1,Math.abs(b),Math.abs(Ie))&&Math.abs(T-ve)<=ki*Math.max(1,Math.abs(T),Math.abs(ve))&&Math.abs(A-Pe)<=ki*Math.max(1,Math.abs(A),Math.abs(Pe))&&Math.abs(C-we)<=ki*Math.max(1,Math.abs(C),Math.abs(we))&&Math.abs(P-_e)<=ki*Math.max(1,Math.abs(P),Math.abs(_e))&&Math.abs(D-Ne)<=ki*Math.max(1,Math.abs(D),Math.abs(Ne))&&Math.abs(V-Be)<=ki*Math.max(1,Math.abs(V),Math.abs(Be))&&Math.abs($-Je)<=ki*Math.max(1,Math.abs($),Math.abs(Je))},c.b2=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.b3=function(i,e,r){return i[0]=e[0]*r[0],i[1]=e[1]*r[1],i[2]=e[2]*r[2],i[3]=e[3]*r[3],i},c.b4=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},c.b5=Xs,c.b6=qu,c.b7=Uu,c.b8=function(i,e,r,a,o){var d,p=1/Math.tan(e/2);return i[0]=p/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,o!=null&&o!==1/0?(i[10]=(o+a)*(d=1/(a-o)),i[14]=2*o*a*d):(i[10]=-1,i[14]=-2*a),i},c.b9=function(i,e,r){var a=Math.sin(r),o=Math.cos(r),d=e[4],p=e[5],f=e[6],_=e[7],x=e[8],b=e[9],T=e[10],A=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=d*o+x*a,i[5]=p*o+b*a,i[6]=f*o+T*a,i[7]=_*o+A*a,i[8]=x*o-d*a,i[9]=b*o-p*a,i[10]=T*o-f*a,i[11]=A*o-_*a,i},c.bA=Ke,c.bB=gu,c.bC=$a,c.bD=Ui,c.ba=Vt,c.bb=gi,c.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},c.bd=class extends ma{},c.be=bc,c.bf=$u,c.bg=dp,c.bi=Vr,c.bj=function(i,e,r=!1){if(Ci===Vn||Ci===Nn||Ci===Un)throw new Error("setRTLTextPlugin cannot be called multiple times.");Kr=Ts.resolveURL(i),Ci=Vn,$n=e,jn(),r||Qo()},c.bk=qn,c.bl=function(i,e){const r={};for(let o=0;o<i.length;o++){const d=e&&e[i[o].id]||Ga(i[o]);e&&(e[i[o].id]=d);let p=r[d];p||(p=r[d]=[]),p.push(i[o])}const a=[];for(const o in r)a.push(r[o]);return a},c.bm=Ce,c.bn=Gu,c.bo=Hu,c.bp=Iu,c.bq=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=Zt/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0],r=e.layout,a=e._unevaluatedLayout._values,o={layoutIconSize:a["icon-size"].possiblyEvaluate(new wt(i.bucket.zoom+1),i.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new wt(i.bucket.zoom+1),i.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new wt(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:x,maxZoom:b}=i.bucket.textSizeData;o.compositeTextSizes=[a["text-size"].possiblyEvaluate(new wt(x),i.canonical),a["text-size"].possiblyEvaluate(new wt(b),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:x,maxZoom:b}=i.bucket.iconSizeData;o.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new wt(x),i.canonical),a["icon-size"].possiblyEvaluate(new wt(b),i.canonical)]}const d=r.get("text-line-height")*Kt,p=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",f=r.get("text-keep-upright"),_=r.get("text-size");for(const x of i.bucket.features){const b=r.get("text-font").evaluate(x,{},i.canonical).join(","),T=_.evaluate(x,{},i.canonical),A=o.layoutTextSize.evaluate(x,{},i.canonical),C=o.layoutIconSize.evaluate(x,{},i.canonical),P={horizontal:{},vertical:void 0},D=x.text;let V,$=[0,0];if(D){const J=D.toString(),ie=r.get("text-letter-spacing").evaluate(x,{}
2,i.canonical)*Kt,de=Fn(J)?ie:0,Me=r.get("text-anchor").evaluate(x,{},i.canonical),Le=nh(e,x,i.canonical);if(!Le){const we=r.get("text-radial-offset").evaluate(x,{},i.canonical);$=we?ah(Me,[we*Kt,Tc]):r.get("text-offset").evaluate(x,{},i.canonical).map(_e=>_e*Kt)}let Ae=p?"center":r.get("text-justify").evaluate(x,{},i.canonical);const Ie=r.get("symbol-placement"),ve=Ie==="point"?r.get("text-max-width").evaluate(x,{},i.canonical)*Kt:0,Pe=()=>{i.bucket.allowVerticalPlacement&&Bn(J)&&(P.vertical=gl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,ve,d,Me,"left",de,$,c.ai.vertical,!0,Ie,A,T))};if(!p&&Le){const we=new Set;if(Ae==="auto")for(let Ne=0;Ne<Le.values.length;Ne+=2)we.add(Ic(Le.values[Ne]));else we.add(Ae);let _e=!1;for(const Ne of we)if(!P.horizontal[Ne])if(_e)P.horizontal[Ne]=P.horizontal[0];else{const Be=gl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,ve,d,"center",Ne,de,$,c.ai.horizontal,!1,Ie,A,T);Be&&(P.horizontal[Ne]=Be,_e=Be.positionedLines.length===1)}Pe()}else{Ae==="auto"&&(Ae=Ic(Me));const we=gl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,ve,d,Me,Ae,de,$,c.ai.horizontal,!1,Ie,A,T);we&&(P.horizontal[Ae]=we),Pe(),Bn(J)&&p&&f&&(P.vertical=gl(D,i.glyphMap,i.glyphPositions,i.imagePositions,b,ve,d,Me,Ae,de,$,c.ai.vertical,!1,Ie,A,T))}}let X=!1;if(x.icon&&x.icon.name){const J=i.imageMap[x.icon.name];J&&(V=Wd(i.imagePositions[x.icon.name],r.get("icon-offset").evaluate(x,{},i.canonical),r.get("icon-anchor").evaluate(x,{},i.canonical)),X=!!J.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=X:i.bucket.sdfIcons!==X&&_i("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(J.pixelRatio!==i.bucket.pixelRatio||r.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}const q=lh(P.horizontal)||P.vertical;i.bucket.iconsInText=!!q&&q.iconsInText,(q||V)&&up(i.bucket,x,P,V,i.imageMap,o,A,C,$,X,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},c.br=cc,c.bs=nc,c.bt=lc,c.bu=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},c.bv=hc,c.bw=js,c.bx=function(i,e,r,a,o){return Fe(this,void 0,void 0,function*(){if(jt())try{return yield Ys(i,e,r,a,o)}catch{}return function(d,p,f,_,x){const b=d.width,T=d.height;hr&&bt||(hr=new OffscreenCanvas(b,T),bt=hr.getContext("2d",{willReadFrequently:!0})),hr.width=b,hr.height=T,bt.drawImage(d,0,0,b,T);const A=bt.getImageData(p,f,_,x);return bt.clearRect(0,0,b,T),A.data}(i,e,r,a,o)})},c.by=Zu,c.bz=K,c.c=Is,c.d=function(i,e){const r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=Sa})},r.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const a=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(a):Sa},c.e=si,c.f=function(i,e){return Nr(si(i,{type:"json"}),e)},c.g=Hi,c.h=Ts,c.i=Wi,c.j=$r,c.k=Ur,c.l=Qs,c.m=Nr,c.n=function(i){return new hc(i).readFields(Ud,[])},c.o=function(i,e,r){if(!i.length)return r(null,[]);let a=i.length;const o=new Array(i.length);let d=null;i.forEach((p,f)=>{e(p,(_,x)=>{_&&(d=_),o[f]=x,--a==0&&r(d,o)})})},c.p=Tu,c.q=ro,c.r=Nt,c.s=Ir,c.t=Ul,c.u=Ee,c.v=le,c.w=_i,c.x=Xa,c.y=kr,c.z=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}}}),me(["./shared"],function(c){class Fe{constructor(I){this.keyCache={},I&&this.replace(I)}replace(I){this._layerConfigs={},this._layers={},this.update(I,[])}update(I,E){for(const O of I){this._layerConfigs[O.id]=O;const N=this._layers[O.id]=c.aC(O);N._featureFilter=c.a6(N.filter),this.keyCache[O.id]&&delete this.keyCache[O.id]}for(const O of E)delete this.keyCache[O],delete this._layerConfigs[O],delete this._layers[O];this.familiesBySource={};const k=c.bl(Object.values(this._layerConfigs),this.keyCache);for(const O of k){const N=O.map(ue=>this._layers[ue.id]),Y=N[0];if(Y.visibility==="none")continue;const Z=Y.source||"";let j=this.familiesBySource[Z];j||(j=this.familiesBySource[Z]={});const H=Y.sourceLayer||"_geojsonTileLayer";let ce=j[H];ce||(ce=j[H]=[]),ce.push(N)}}}class K{constructor(I){const E={},k=[];for(const Z in I){const j=I[Z],H=E[Z]={};for(const ce in j){const ue=j[+ce];if(!ue||ue.bitmap.width===0||ue.bitmap.height===0)continue;const pe={x:0,y:0,w:ue.bitmap.width+2,h:ue.bitmap.height+2};k.push(pe),H[ce]={rect:pe,metrics:ue.metrics}}}const{w:O,h:N}
2=c.p(k),Y=new c.q({width:O||1,height:N||1});for(const Z in I){const j=I[Z];for(const H in j){const ce=j[+H];if(!ce||ce.bitmap.width===0||ce.bitmap.height===0)continue;const ue=E[Z][H].rect;c.q.copy(ce.bitmap,Y,{x:0,y:0},{x:ue.x+1,y:ue.y+1},ce.bitmap)}}this.image=Y,this.positions=E}}c.bm("GlyphAtlas",K);class Ke{constructor(I){this.tileID=new c.O(I.tileID.overscaledZ,I.tileID.wrap,I.tileID.canonical.z,I.tileID.canonical.x,I.tileID.canonical.y),this.uid=I.uid,this.zoom=I.zoom,this.pixelRatio=I.pixelRatio,this.tileSize=I.tileSize,this.source=I.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=I.showCollisionBoxes,this.collectResourceTiming=!!I.collectResourceTiming,this.returnDependencies=!!I.returnDependencies,this.promoteId=I.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(I,E,k,O,N){this.status="parsing",this.data=I,this.collisionBoxArray=new c.a3;const Y=new c.bn(Object.keys(I.layers).sort()),Z=new c.bo(this.tileID,this.promoteId);Z.bucketLayerIDs=[];const j={},H={featureIndex:Z,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:k},ce=E.familiesBySource[this.source];for(const nt in ce){const at=I.layers[nt];if(!at)continue;at.version===1&&c.w(`Vector tile source "${this.source}" layer "${nt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ui=Y.encode(nt),xt=[];for(let qt=0;qt<at.length;qt++){const ai=at.feature(qt),Ki=Z.getId(ai,nt);xt.push({feature:ai,id:Ki,index:qt,sourceLayerIndex:ui})}for(const qt of ce[nt]){const ai=qt[0];ai.source!==this.source&&c.w(`layer.source = ${ai.source} does not equal this.source = ${this.source}`),ai.minzoom&&this.zoom<Math.floor(ai.minzoom)||ai.maxzoom&&this.zoom>=ai.maxzoom||ai.visibility!=="none"&&(lt(qt,this.zoom,k),(j[ai.id]=ai.createBucket({index:Z.bucketLayerIDs.length,layers:qt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ui,sourceID:this.source})).populate(xt,H,this.tileID.canonical),Z.bucketLayerIDs.push(qt.map(Ki=>Ki.id)))}}let ue,pe,Ve,qe;const ze=c.aH(H.glyphDependencies,nt=>Object.keys(nt).map(Number));this.inFlightDependencies.forEach(nt=>nt?.cancel()),this.inFlightDependencies=[];const Ue=++this.dependencySentinel;Object.keys(ze).length?this.inFlightDependencies.push(O.send("getGlyphs",{uid:this.uid,stacks:ze,source:this.source,tileID:this.tileID,type:"glyphs"},(nt,at)=>{Ue===this.dependencySentinel&&(ue||(ue=nt,pe=at,mt.call(this)))})):pe={};const Ge=Object.keys(H.iconDependencies);Ge.length?this.inFlightDependencies.push(O.send("getImages",{icons:Ge,source:this.source,tileID:this.tileID,type:"icons"},(nt,at)=>{Ue===this.dependencySentinel&&(ue||(ue=nt,Ve=at,mt.call(this)))})):Ve={};const dt=Object.keys(H.patternDependencies);function mt(){if(ue)return N(ue);if(pe&&Ve&&qe){const nt=new K(pe),at=new c.bp(Ve,qe);for(const ui in j){const xt=j[ui];xt instanceof c.a4?(lt(xt.layers,this.zoom,k),c.bq({bucket:xt,glyphMap:pe,glyphPositions:nt.positions,imageMap:Ve,imagePositions:at.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):xt.hasPattern&&(xt instanceof c.br||xt instanceof c.bs||xt instanceof c.bt)&&(lt(xt.layers,this.zoom,k),xt.addFeatures(H,this.tileID.canonical,at.patternPositions))}this.status="done",N(null,{buckets:Object.values(j).filter(ui=>!ui.isEmpty()),featureIndex:Z,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:nt.image,imageAtlas:at,glyphMap:this.returnDependencies?pe:null,iconMap:this.returnDependencies?Ve:null,glyphPositions:this.returnDependencies?nt.positions:null})}}dt.length?this.inFlightDependencies.push(O.send("getImages",{icons:dt,source:this.source,tileID:this.tileID,type:"patterns"},(nt,at)=>{Ue===this.dependencySentinel&&(ue||(ue=nt,qe=at,mt.call(this)))})):qe={},mt.call(this)}}function lt(B,I,E){const k=new c.a8(I);for(const O of B)O.recalculate(k,E)}function ke(B,I){const E=c.l(B.request,(k,O,N,Y)=>{if(k)I(k);else if(O)try{const Z=new c.bw.VectorTile(new c.bv(O));I(null,{vectorTile:Z,rawData:O,cacheControl:N,expires:Y})}catch(Z){const j=new Uint8Array(O);let H=`Unable to parse the tile at ${B.request.url}, `;H+=j[0]===31&&j[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Z.messge}`,I(new Error(H))}});return()=>
2{E.cancel(),I()}}class Wt{constructor(I,E,k,O){this.actor=I,this.layerIndex=E,this.availableImages=k,this.loadVectorData=O||ke,this.fetching={},this.loading={},this.loaded={}}loadTile(I,E){const k=I.uid;this.loading||(this.loading={});const O=!!(I&&I.request&&I.request.collectResourceTiming)&&new c.bu(I.request),N=this.loading[k]=new Ke(I);N.abort=this.loadVectorData(I,(Y,Z)=>{if(delete this.loading[k],Y||!Z)return N.status="done",this.loaded[k]=N,E(Y);const j=Z.rawData,H={};Z.expires&&(H.expires=Z.expires),Z.cacheControl&&(H.cacheControl=Z.cacheControl);const ce={};if(O){const ue=O.finish();ue&&(ce.resourceTiming=JSON.parse(JSON.stringify(ue)))}N.vectorTile=Z.vectorTile,N.parse(Z.vectorTile,this.layerIndex,this.availableImages,this.actor,(ue,pe)=>{if(delete this.fetching[k],ue||!pe)return E(ue);E(null,c.e({rawTileData:j.slice(0)},pe,H,ce))}),this.loaded=this.loaded||{},this.loaded[k]=N,this.fetching[k]={rawTileData:j,cacheControl:H,resourceTiming:ce}})}reloadTile(I,E){const k=this.loaded,O=I.uid;if(k&&k[O]){const N=k[O];N.showCollisionBoxes=I.showCollisionBoxes,N.status==="parsing"?N.parse(N.vectorTile,this.layerIndex,this.availableImages,this.actor,(Y,Z)=>{if(Y||!Z)return E(Y,Z);let j;if(this.fetching[O]){const{rawTileData:H,cacheControl:ce,resourceTiming:ue}=this.fetching[O];delete this.fetching[O],j=c.e({rawTileData:H.slice(0)},Z,ce,ue)}else j=Z;E(null,j)}):N.status==="done"&&(N.vectorTile?N.parse(N.vectorTile,this.layerIndex,this.availableImages,this.actor,E):E())}}abortTile(I,E){const k=this.loading,O=I.uid;k&&k[O]&&k[O].abort&&(k[O].abort(),delete k[O]),E()}removeTile(I,E){const k=this.loaded,O=I.uid;k&&k[O]&&delete k[O],E()}}class ii{constructor(){this.loaded={}}loadTile(I,E){return c._(this,void 0,void 0,function*(){const{uid:k,encoding:O,rawImageData:N,redFactor:Y,greenFactor:Z,blueFactor:j,baseShift:H}=I,ce=N.width+2,ue=N.height+2,pe=c.a(N)?new c.R({width:ce,height:ue},yield c.bx(N,-1,-1,ce,ue)):N,Ve=new c.by(k,pe,O,Y,Z,j,H);this.loaded=this.loaded||{},this.loaded[k]=Ve,E(null,Ve)})}removeTile(I){const E=this.loaded,k=I.uid;E&&E[k]&&delete E[k]}}function Sr(B,I){if(B.length!==0){ri(B[0],I);for(var E=1;E<B.length;E++)ri(B[E],!I)}}function ri(B,I){for(var E=0,k=0,O=0,N=B.length,Y=N-1;O<N;Y=O++){var Z=(B[O][0]-B[Y][0])*(B[Y][1]+B[O][1]),j=E+Z;k+=Math.abs(E)>=Math.abs(Z)?E-j+Z:Z-j+E,E=j}E+k>=0!=!!I&&B.reverse()}var _t=c.bz(function B(I,E){var k,O=I&&I.type;if(O==="FeatureCollection")for(k=0;k<I.features.length;k++)B(I.features[k],E);else if(O==="GeometryCollection")for(k=0;k<I.geometries.length;k++)B(I.geometries[k],E);else if(O==="Feature")B(I.geometry,E);else if(O==="Polygon")Sr(I.coordinates,E);else if(O==="MultiPolygon")for(k=0;k<I.coordinates.length;k++)Sr(I.coordinates[k],E);return I});const Ii=c.bw.VectorTileFeature.prototype.toGeoJSON;var jt={exports:{}},Vt=c.bA,gi=c.bw.VectorTileFeature,ur=Xs;function Xs(B,I){this.options=I||{},this.features=B,this.length=B.length}function si(B,I){this.id=typeof B.id=="number"?B.id:void 0,this.type=B.type,this.rawGeometry=B.type===1?[B.geometry]:B.geometry,this.properties=B.tags,this.extent=I||4096}Xs.prototype.feature=function(B){return new si(this.features[B],this.options.extent)},si.prototype.loadGeometry=function(){var B=this.rawGeometry;this.geometry=[];for(var I=0;I<B.length;I++){for(var E=B[I],k=[],O=0;O<E.length;O++)k.push(new Vt(E[O][0],E[O][1]));this.geometry.push(k)}return this.geometry},si.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var B=this.geometry,I=1/0,E=-1/0,k=1/0,O=-1/0,N=0;N<B.length;N++)for(var Y=B[N],Z=0;Z<Y.length;Z++){var j=Y[Z];I=Math.min(I,j.x),E=Math.max(E,j.x),k=Math.min(k,j.y),O=Math.max(O,j.y)}return[I,k,E,O]},si.prototype.toGeoJSON=gi.prototype.toGeoJSON;var wa=c.bB,Et=ur;function Ss(B){var I=new wa;return function(E,k){for(var O in E.layers)k.writeMessage(3,sr,E.layers[O])}(B,I),I.finish()}function sr(B,I){var E;I.writeVarintField(15,B.version||1),I.writeStringField(1,B.name||""),I.writeVarintField(5,B.extent||4096);var k={keys:[],values:[],keycache:{},valuecache:{}};for(E=0;E<B.length;E++)k.feature=B.feature(E),I.writeMessage(2,Or,k);var O=k.keys;for(E=0;E<O.length;E++)I.writeStringField(3,O[E]);var N=k.values;for(E=0;E<N.length;E++)I.writeMessage(4,es,N[E])}function Or(B,I){var E=B.feature;E.id!==void 0&&I.writeVarintField(1,E.id),I.writeMessage(2,_i,B),I.writeVarintField(3,E.type),I.writeMessage(4,Wi,E)}function _i(B,I){var E=B.feature,k=B.keys,O=B.values,N=B.keycache,Y=B.valuecache;for(var Z in E.properties){var j=E.properties[Z],H=N[Z];if(j!==null){H===void 0&&(k.push(Z),N[Z]=H=k.length-1),I.writeVarint(H);var ce=typeof j;ce!=="string"&&ce!=="boolean"&&ce!=="number"&&(j=JSON.stringify(j));var ue=ce+":"+j,pe=Y[ue];pe===void 0&&(O.push(j),Y[ue]=pe=O.length-1),I.writeVarint(pe)}}}function Bi(B,I){return(I<<3)+(7&B)}function Tr(B){return B<<1^B>>31}
vendor: 5,922 bytes, line 2
2function Wi(B,I){for(var E=B.loadGeometry(),k=B.type,O=0,N=0,Y=E.length,Z=0;Z<Y;Z++){var j=E[Z],H=1;k===1&&(H=j.length),I.writeVarint(Bi(1,H));for(var ce=k===3?j.length-1:j.length,ue=0;ue<ce;ue++){ue===1&&k!==1&&I.writeVarint(Bi(2,ce-1));var pe=j[ue].x-O,Ve=j[ue].y-N;I.writeVarint(Tr(pe)),I.writeVarint(Tr(Ve)),O+=pe,N+=Ve}k===3&&I.writeVarint(Bi(7,1))}}function es(B,I){var E=typeof B;E==="string"?I.writeStringField(1,B):E==="boolean"?I.writeBooleanField(7,B):E==="number"&&(B%1!=0?I.writeDoubleField(3,B):B<0?I.writeSVarintField(6,B):I.writeVarintField(5,B))}jt.exports=Ss,jt.exports.fromVectorTileJs=Ss,jt.exports.fromGeojsonVt=function(B,I){I=I||{};var E={};for(var k in B)E[k]=new Et(B[k].features,I),E[k].name=k,E[k].version=I.version,E[k].extent=I.extent;return Ss({layers:E})},jt.exports.GeoJSONWrapper=Et;var Ks=c.bz(jt.exports);const Sa={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:B=>B},Ys=Math.fround||(hr=new Float32Array(1),B=>(hr[0]=+B,hr[0]));var hr;const bt=3,Ai=5,ts=6;class Ts{constructor(I){this.options=Object.assign(Object.create(Sa),I),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(I){const{log:E,minZoom:k,maxZoom:O}=this.options;E&&console.time("total time");const N=`prepare ${I.length} points`;E&&console.time(N),this.points=I;const Y=[];for(let j=0;j<I.length;j++){const H=I[j];if(!H.geometry)continue;const[ce,ue]=H.geometry.coordinates,pe=Ys(ar(ce)),Ve=Ys(Hi(ue));Y.push(pe,Ve,1/0,j,-1,1),this.options.reduce&&Y.push(0)}let Z=this.trees[O+1]=this._createTree(Y);E&&console.timeEnd(N);for(let j=O;j>=k;j--){const H=+Date.now();Z=this.trees[j]=this._createTree(this._cluster(Z,j)),E&&console.log("z%d: %d clusters in %dms",j,Z.numItems,+Date.now()-H)}return E&&console.timeEnd("total time"),this}getClusters(I,E){let k=((I[0]+180)%360+360)%360-180;const O=Math.max(-90,Math.min(90,I[1]));let N=I[2]===180?180:((I[2]+180)%360+360)%360-180;const Y=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)k=-180,N=180;else if(k>N){const ue=this.getClusters([k,O,180,Y],E),pe=this.getClusters([-180,O,N,Y],E);return ue.concat(pe)}const Z=this.trees[this._limitZoom(E)],j=Z.range(ar(k),Hi(Y),ar(N),Hi(O)),H=Z.data,ce=[];for(const ue of j){const pe=this.stride*ue;ce.push(H[pe+Ai]>1?Is(H,pe,this.clusterProps):this.points[H[pe+bt]])}return ce}getChildren(I){const E=this._getOriginId(I),k=this._getOriginZoom(I),O="No cluster with the specified id.",N=this.trees[k];if(!N)throw new Error(O);const Y=N.data;if(E*this.stride>=Y.length)throw new Error(O);const Z=this.options.radius/(this.options.extent*Math.pow(2,k-1)),j=N.within(Y[E*this.stride],Y[E*this.stride+1],Z),H=[];for(const ce of j){const ue=ce*this.stride;Y[ue+4]===I&&H.push(Y[ue+Ai]>1?Is(Y,ue,this.clusterProps):this.points[Y[ue+bt]])}if(H.length===0)throw new Error(O);return H}getLeaves(I,E,k){const O=[];return this._appendLeaves(O,I,E=E||10,k=k||0,0),O}getTile(I,E,k){const O=this.trees[this._limitZoom(I)],N=Math.pow(2,I),{extent:Y,radius:Z}=this.options,j=Z/Y,H=(k-j)/N,ce=(k+1+j)/N,ue={features:[]};return this._addTileFeatures(O.range((E-j)/N,H,(E+1+j)/N,ce),O.data,E,k,N,ue),E===0&&this._addTileFeatures(O.range(1-j/N,H,1,ce),O.data,N,k,N,ue),E===N-1&&this._addTileFeatures(O.range(0,H,j/N,ce),O.data,-1,k,N,ue),ue.features.length?ue:null}getClusterExpansionZoom(I){let E=this._getOriginZoom(I)-1;for(;E<=this.options.maxZoom;){const k=this.getChildren(I);if(E++,k.length!==1)break;I=k[0].properties.cluster_id}return E}_appendLeaves(I,E,k,O,N){const Y=this.getChildren(E);for(const Z of Y){const j=Z.properties;if(j&&j.cluster?N+j.point_count<=O?N+=j.point_count:N=this._appendLeaves(I,j.cluster_id,k,O,N):N<O?N++:I.push(Z),I.length===k)break}return N}_createTree(I){const E=new c.av(I.length/this.stride|0,this.options.nodeSize,Float32Array);for(let k=0;k<I.length;k+=this.stride)E.add(I[k],I[k+1]);return E.finish(),E.data=I,E}_addTileFeatures(I,E,k,O,N,Y){for(const Z of I){const j=Z*this.stride,H=E[j+Ai]>1;let ce,ue,pe;if(H)ce=Vr(E,j,this.clusterProps),ue=E[j],pe=E[j+1];else{const ze=this.points[E[j+bt]];ce=ze.properties;const[Ue,Ge]=ze.geometry.coordinates;ue=ar(Ue),pe=Hi(Ge)}const Ve={type:1,geometry:[[Math.round(this.options.extent*(ue*N-k)),Math.round(this.options.extent*(pe*N-O))]],tags:ce};let qe;qe=H||this.options.generateId?E[j+bt]:this.points[E[j+bt]].id,qe!==void 0&&(Ve.id=qe),Y.features.push(Ve)}}_limitZoom(I){return Math.max(this.options.minZoom,Math.min(Math.floor(+I),this.options.maxZoom+1))}_cluster(I,E){const{radius:k,extent:O,reduce:N,minPoints:Y}=this.options,Z=k/(O*Math.pow(2,E)),j=I.data,H=[],ce=this.stride;for(let ue=0;ue<j.length;ue+=ce){if(j[ue+2]<=E)continue;j[ue+2]=E;const pe=j[ue],Ve=j[ue+1],qe=I.within(j[ue],j[ue+1],Z),ze=j[ue+Ai];let Ue=ze;for(const Ge of qe){const dt=Ge*ce;j[dt+2]>E&&(Ue+=j[dt+Ai])}if(Ue>ze&&Ue>=Y){let Ge,dt=pe*ze,mt=Ve*ze,nt=-1;const at=((ue/ce|0)<<5)+(E+1)+this.points.length;for(const ui of qe){const xt=ui*ce;if(j[xt+2]<=E)continue;j[xt+2]=E;const qt=j[xt+Ai];dt+=j[xt]*qt,mt+=j[xt+1]*qt,j[xt+4]=at,N&&(Ge||(Ge=this._map(j,ue,!0),nt=this.clusterProps.length,this.clusterProps.push(Ge)),N(Ge,this._map(j,xt)))}j[ue+4]=at,H.push(dt/Ue,mt/Ue,1/0,at,-1,Ue),N&&H.push(nt)}else{for(let Ge=0;Ge<ce;Ge++)H.push(j[ue+Ge]);if(Ue>1)for(const Ge of qe){const dt=Ge*ce;if(!(j[dt+2]<=E)){j[dt+2]=E;for(let mt=0;mt<ce;mt++)H.push(j[dt+mt])}}}}return H}_getOriginId(I){return I-this.points.length>>5}_getOriginZoom(I){return(I-this.points.length)%32}_map(I,E,k){if(I[E+Ai]>1){const Y=this.clusterProps[I[E+ts]];return k?Object.assign({},Y):Y}const O=this.points[I[E+bt]].properties,N=this.options.map(O);return k&&N===O?Object.assign({},N):N}}function Is(B,I,E){return{type:"Feature",id:B[I+bt],properties:Vr(B,I,E),geometry:{type:"Point",coordinates:[(k=B[I],360*(k-.5)),Js(B[I+1])]}};var k}function Vr(B,I,E){const k=B[I+Ai],O=k>=1e4?`${Math.round(k/1e3)}
2k`:k>=1e3?Math.round(k/100)/10+"k":k,N=B[I+ts],Y=N===-1?{}:Object.assign({},E[N]);return Object.assign(Y,{cluster:!0,cluster_id:B[I+bt],point_count:k,point_count_abbreviated:O})}function ar(B){return B/360+.5}function Hi(B){const I=Math.sin(B*Math.PI/180),E=.5-.25*Math.log((1+I)/(1-I))/Math.PI;return E<0?0:E>1?1:E}function Js(B){const I=(180-360*B)*Math.PI/180;return 360*Math.atan(Math.exp(I))/Math.PI-90}function Nr(B,I,E,k){for(var O,N=k,Y=E-I>>1,Z=E-I,j=B[I],H=B[I+1],ce=B[E],ue=B[E+1],pe=I+3;pe<E;pe+=3){var Ve=Qs(B[pe],B[pe+1],j,H,ce,ue);if(Ve>N)O=pe,N=Ve;else if(Ve===N){var qe=Math.abs(pe-Y);qe<Z&&(O=pe,Z=qe)}}N>k&&(O-I>3&&Nr(B,I,O,k),B[O+2]=N,E-O>3&&Nr(B,O,E,k))}function Qs(B,I,E,k,O,N){var Y=O-E,Z=N-k;if(Y!==0||Z!==0){var j=((B-E)*Y+(I-k)*Z)/(Y*Y+Z*Z);j>1?(E=O,k=N):j>0&&(E+=Y*j,k+=Z*j)}return(Y=B-E)*Y+(Z=I-k)*Z}function Ir(B,I,E,k){var O={id:B===void 0?null:B,type:I,geometry:E,tags:k,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(N){var Y=N.geometry,Z=N.type;if(Z==="Point"||Z==="MultiPoint"||Z==="LineString")As(N,Y);else if(Z==="Polygon"||Z==="MultiLineString")for(var j=0;j<Y.length;j++)As(N,Y[j]);else if(Z==="MultiPolygon")for(j=0;j<Y.length;j++)for(var H=0;H<Y[j].length;H++)As(N,Y[j][H])}(O),O}function As(B,I){for(var E=0;E<I.length;E+=3)B.minX=Math.min(B.minX,I[E]),B.minY=Math.min(B.minY,I[E+1]),B.maxX=Math.max(B.maxX,I[E]),B.maxY=Math.max(B.maxY,I[E+1])}function is(B,I,E,k){if(I.geometry){var O=I.geometry.coordinates,N=I.geometry.type,Y=Math.pow(E.tolerance/((1<<E.maxZoom)*E.extent),2),Z=[],j=I.id;if(E.promoteId?j=I.properties[E.promoteId]:E.generateId&&(j=k||0),N==="Point")Ur(O,Z);else if(N==="MultiPoint")for(var H=0;H<O.length;H++)Ur(O[H],Z);else if(N==="LineString")$r(O,Z,Y,!1);else if(N==="MultiLineString"){if(E.lineMetrics){for(H=0;H<O.length;H++)$r(O[H],Z=[],Y,!1),B.push(Ir(j,"LineString",Z,I.properties));return}rs(O,Z,Y,!1)}else if(N==="Polygon")rs(O,Z,Y,!0);else{if(N!=="MultiPolygon"){if(N==="GeometryCollection"){for(H=0;H<I.geometry.geometries.length;H++)is(B,{id:j,geometry:I.geometry.geometries[H],properties:I.properties},E,k);return}throw new Error("Input data is not a valid GeoJSON object.")}for(H=0;H<O.length;H++){var ce=[];rs(O[H],ce,Y,!0),Z.push(ce)}}B.push(Ir(j,N,Z,I.properties))}}function Ur(B,I){I.push(le(B[0])),I.push(Ei(B[1])),I.push(0)}function $r(B,I,E,k){for(var O,N,Y=0,Z=0;Z<B.length;Z++){var j=le(B[Z][0]),H=Ei(B[Z][1]);I.push(j),I.push(H),I.push(0),Z>0&&(Y+=k?(O*H-j*N)/2:Math.sqrt(Math.pow(j-O,2)+Math.pow(H-N,2))),O=j,N=H}var ce=I.length-3;I[2]=1,Nr(I,0,ce,E),I[ce+2]=1,I.size=Math.abs(Y),I.start=0,I.end=I.size}function rs(B,I,E,k){for(var O=0;O<B.length;O++){var N=[];$r(B[O],N,E,k),I.push(N)}}function le(B){return B/360+.5}function Ei(B){var I=Math.sin(B*Math.PI/180),E=.5-.25*Math.log((1+I)/(1-I))/Math.PI;return E<0?0:E>1?1:E}function Xi(B,I,E,k,O,N,Y,Z){if(k/=I,N>=(E/=I)&&Y<k)return B;if(Y<E||N>=k)return null;for(var j=[],H=0;H<B.length;H++){var ce=B[H],ue=ce.geometry,pe=ce.type,Ve=O===0?ce.minX:ce.minY,qe=O===0?ce.maxX:ce.maxY;if(Ve>=E&&qe<k)j.push(ce);else if(!(qe<E||Ve>=k)){var ze=[];if(pe==="Point"||pe==="MultiPoint")yt(ue,ze,E,k,O);else if(pe==="LineString")ot(ue,ze,E,k,O,!1,Z.lineMetrics);else if(pe==="MultiLineString")Es(ue,ze,E,k,O,!1);else if(pe==="Polygon")Es(ue,ze,E,k,O,!0);else if(pe==="MultiPolygon")for(var Ue=0;Ue<ue.length;Ue++){var Ge=[];Es(ue[Ue],Ge,E,k,O,!0),Ge.length&&ze.push(Ge)}if(ze.length){if(Z.lineMetrics&&pe==="LineString"){for(Ue=0;Ue<ze.length;Ue++)j.push(Ir(ce.id,pe,ze[Ue],ce.tags));continue}pe!=="LineString"&&pe!=="MultiLineString"||(ze.length===1?(pe="LineString",ze=ze[0]):pe="MultiLineString"),pe!=="Point"&&pe!=="MultiPoint"||(pe=ze.length===3?"Point":"MultiPoint"),j.push(Ir(ce.id,pe,ze,ce.tags))}}}return j.length?j:null}function yt(B,I,E,k,O){for(var N=0;N<B.length;N+=3){var Y=B[N+O];Y>=E&&Y<=k&&(I.push(B[N]),I.push(B[N+1]),I.push(B[N+2]))}}function ot(B,I,E,k,O,N,Y){for(var Z,j,H=dr(B),ce=O===0?Ta:Ms,ue=B.start,pe=0;pe<B.length-3;pe+=3){var Ve=B[pe],qe=B[pe+1],ze=B[pe+2],Ue=B[pe+3],Ge=B[pe+4],dt=O===0?Ve:qe,mt=O===0?Ue:Ge,nt=!1;Y&&(Z=Math.sqrt(Math.pow(Ve-Ue,2)+Math.pow(qe-Ge,2))),dt<E?mt>E&&(j=ce(H,Ve,qe,Ue,Ge,E),Y&&(H.start=ue+Z*j)):dt>k?mt<k&&(j=ce(H,Ve,qe,Ue,Ge,k),Y&&(H.start=ue+Z*j)):Ar(H,Ve,qe,ze),mt<E&&dt>=E&&(j=ce(H,Ve,qe,Ue,Ge,E),nt=!0),mt>k&&dt<=k&&(j=ce(H,Ve,qe,Ue,Ge,k),nt=!0),!N&&nt&&(Y&&(H.end=ue+Z*j),I.push(H),H=dr(B)),Y&&(ue+=Z)}var at=B.length-3;Ve=B[at],qe=B[at+1],ze=B[at+2],(dt=O===0?Ve:qe)>=E&&dt<=k&&Ar(H,Ve,qe,ze),at=H.length-3,N&&at>=3&&(H[at]!==H[0]||H[at+1]!==H[1])&&Ar(H,H[0],H[1],H[2]),H.length&&I.push(H)}function dr(B){var I=[];return I.size=B.size,I.start=B.start,I.end=B.end,I}function Es(B,I,E,k,O,N){for(var Y=0;Y<B.length;Y++)ot(B[Y],I,E,k,O,N,!1)}function Ar(B,I,E,k){B.push(I),B.push(E),B.push(k)}function Ta(B,I,E,k,O,N){var Y=(N-I)/(k-I);return B.push(N),B.push(E+(O-E)*Y),B.push(1),Y}function Ms(B,I,E,k,O,N){var Y=(N-E)/(O-E);return B.push(I+(k-I)*Y),B.push(N),B.push(1),Y}function jr(B,I){for(var E=[],k=0;k<B.length;k++){var O,N=B[k],Y=N.type;if(Y==="Point"||Y==="MultiPoint"||Y==="LineString")O=ss(N.geometry,I);else if(Y==="MultiLineString"||Y==="Polygon"){O=[];for(var Z=0;Z<N.geometry.length;Z++)O.push(ss(N.geometry[Z],I))}else if(Y==="MultiPolygon")for(O=[],Z=0;Z<N.geometry.length;Z++){for(var j=[],H=0;H<N.geometry[Z].length;H++)j.push(ss(N.geometry[Z][H],I));O.push(j)}E.push(Ir(N.id,Y,O,N.tags))}return E}function ss(B,I){var E=[];E.size=B.size,B.start!==void 0&&(E.start=B.start,E.end=B.end);for(var k=0;k<B.length;k+=3)E.push(B[k]+I,B[k+1],B[k+2]);return E}function be(B,I){if(B.transformed)return B;var E,k,O,N=1<<B.z,Y=B.x,Z=B.y;for(E=0;E<B.features.length;E++){var j=B.features[E],H=j.geometry,ce=j.type;if(j.geometry=[],ce===1)for(k=0;k<H.length;k+=2)j.geometry.push(pr(H[k],H[k+1],I,N,Y,Z));else for(k=0;k<H.length;k++){var ue=[];for(O=0;O<H[k].length;O+=2)ue.push(pr(H[k][O],H[k][O+1],I,N,Y,Z));j.geometry.push(ue)}}return B.transformed=!0,B}
vendor: 1,707 bytes, line 2
2function pr(B,I,E,k,O,N){return[Math.round(E*(B*k-O)),Math.round(E*(I*k-N))]}function zt(B,I,E,k,O){for(var N=I===O.maxZoom?0:O.tolerance/((1<<I)*O.extent),Y={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:E,y:k,z:I,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Z=0;Z<B.length;Z++){Y.numFeatures++,as(Y,B[Z],N,O);var j=B[Z].minX,H=B[Z].minY,ce=B[Z].maxX,ue=B[Z].maxY;j<Y.minX&&(Y.minX=j),H<Y.minY&&(Y.minY=H),ce>Y.maxX&&(Y.maxX=ce),ue>Y.maxY&&(Y.maxY=ue)}return Y}function as(B,I,E,k){var O=I.geometry,N=I.type,Y=[];if(N==="Point"||N==="MultiPoint")for(var Z=0;Z<O.length;Z+=3)Y.push(O[Z]),Y.push(O[Z+1]),B.numPoints++,B.numSimplified++;else if(N==="LineString")Er(Y,O,B,E,!1,!1);else if(N==="MultiLineString"||N==="Polygon")for(Z=0;Z<O.length;Z++)Er(Y,O[Z],B,E,N==="Polygon",Z===0);else if(N==="MultiPolygon")for(var j=0;j<O.length;j++){var H=O[j];for(Z=0;Z<H.length;Z++)Er(Y,H[Z],B,E,!0,Z===0)}if(Y.length){var ce=I.tags||null;if(N==="LineString"&&k.lineMetrics){for(var ue in ce={},I.tags)ce[ue]=I.tags[ue];ce.mapbox_clip_start=O.start/O.size,ce.mapbox_clip_end=O.end/O.size}var pe={geometry:Y,type:N==="Polygon"||N==="MultiPolygon"?3:N==="LineString"||N==="MultiLineString"?2:1,tags:ce};I.id!==null&&(pe.id=I.id),B.features.push(pe)}}function Er(B,I,E,k,O,N){var Y=k*k;if(k>0&&I.size<(O?Y:k))E.numPoints+=I.length/3;else{for(var Z=[],j=0;j<I.length;j+=3)(k===0||I[j+2]>Y)&&(E.numSimplified++,Z.push(I[j]),Z.push(I[j+1])),E.numPoints++;O&&function(H,ce){for(var ue=0,pe=0,Ve=H.length,qe=Ve-2;pe<Ve;qe=pe,pe+=2)ue+=(H[pe]-H[qe])*(H[pe+1]+H[qe+1]);if(ue>0===ce)for(pe=0,Ve=H.length;pe<Ve/2;pe+=2){var ze=H[pe],Ue=H[pe+1];H[pe]=H[Ve-2-pe],H[pe+1]=H[Ve-1-pe],H[Ve-2-pe]=ze,H[Ve-1-pe]=Ue}}
2(Z,N),B.push(Z)}}function Se(B,I){var E=(I=this.options=function(O,N){for(var Y in N)O[Y]=N[Y];return O}(Object.create(this.options),I)).debug;if(E&&console.time("preprocess data"),I.maxZoom<0||I.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(I.promoteId&&I.generateId)throw new Error("promoteId and generateId cannot be used together.");var k=function(O,N){var Y=[];if(O.type==="FeatureCollection")for(var Z=0;Z<O.features.length;Z++)is(Y,O.features[Z],N,Z);else is(Y,O.type==="Feature"?O:{geometry:O},N);return Y}(B,I);this.tiles={},this.tileCoords=[],E&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",I.indexMaxZoom,I.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),k=function(O,N){var Y=N.buffer/N.extent,Z=O,j=Xi(O,1,-1-Y,Y,0,-1,2,N),H=Xi(O,1,1-Y,2+Y,0,-1,2,N);return(j||H)&&(Z=Xi(O,1,-Y,1+Y,0,-1,2,N)||[],j&&(Z=jr(j,1).concat(Z)),H&&(Z=Z.concat(jr(H,-1)))),Z}(k,I),k.length&&this.splitTile(k,0,0,0),E&&(k.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Ye(B,I,E){return 32*((1<<B)*E+I)+B}function Ze(B,I){return I?B.properties[I]:B.id}function yi(B,I){if(B==null)return!0;if(B.type==="Feature")return Ze(B,I)!=null;if(B.type==="FeatureCollection"){const E=new Set;for(const k of B.features){const O=Ze(k,I);if(O==null||E.has(O))return!1;E.add(O)}return!0}return!1}function fr(B,I){const E=new Map;if(B!=null)if(B.type==="Feature")E.set(Ze(B,I),B);else for(const k of B.features)E.set(Ze(k,I),k);return E}Se.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Se.prototype.splitTile=function(B,I,E,k,O,N,Y){for(var Z=[B,I,E,k],j=this.options,H=j.debug;Z.length;){k=Z.pop(),E=Z.pop(),I=Z.pop(),B=Z.pop();var ce=1<<I,ue=Ye(I,E,k),pe=this.tiles[ue];if(!pe&&(H>1&&console.time("creation"),pe=this.tiles[ue]=zt(B,I,E,k,j),this.tileCoords.push({z:I,x:E,y:k}),H)){H>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",I,E,k,pe.numFeatures,pe.numPoints,pe.numSimplified),console.timeEnd("creation"));var Ve="z"+I;this.stats[Ve]=(this.stats[Ve]||0)+1,this.total++}if(pe.source=B,O){if(I===j.maxZoom||I===O)continue;var qe=1<<O-I;if(E!==Math.floor(N/qe)||k!==Math.floor(Y/qe))continue}else if(I===j.indexMaxZoom||pe.numPoints<=j.indexMaxPoints)continue;if(pe.source=null,B.length!==0){H>1&&console.time("clipping");var ze,Ue,Ge,dt,mt,nt,at=.5*j.buffer/j.extent,ui=.5-at,xt=.5+at,qt=1+at;ze=Ue=Ge=dt=null,mt=Xi(B,ce,E-at,E+xt,0,pe.minX,pe.maxX,j),nt=Xi(B,ce,E+ui,E+qt,0,pe.minX,pe.maxX,j),B=null,mt&&(ze=Xi(mt,ce,k-at,k+xt,1,pe.minY,pe.maxY,j),Ue=Xi(mt,ce,k+ui,k+qt,1,pe.minY,pe.maxY,j),mt=null),nt&&(Ge=Xi(nt,ce,k-at,k+xt,1,pe.minY,pe.maxY,j),dt=Xi(nt,ce,k+ui,k+qt,1,pe.minY,pe.maxY,j),nt=null),H>1&&console.timeEnd("clipping"),Z.push(ze||[],I+1,2*E,2*k),Z.push(Ue||[],I+1,2*E,2*k+1),Z.push(Ge||[],I+1,2*E+1,2*k),Z.push(dt||[],I+1,2*E+1,2*k+1)}}},Se.prototype.getTile=function(B,I,E){var k=this.options,O=k.extent,N=k.debug;if(B<0||B>24)return null;var Y=1<<B,Z=Ye(B,I=(I%Y+Y)%Y,E);if(this.tiles[Z])return be(this.tiles[Z],O);N>1&&console.log("drilling down to z%d-%d-%d",B,I,E);for(var j,H=B,ce=I,ue=E;!j&&H>0;)H--,ce=Math.floor(ce/2),ue=Math.floor(ue/2),j=this.tiles[Ye(H,ce,ue)];return j&&j.source?(N>1&&console.log("found parent tile z%d-%d-%d",H,ce,ue),N>1&&console.time("drilling down"),this.splitTile(j.source,H,ce,ue,B,I,E),N>1&&console.timeEnd("drilling down"),this.tiles[Z]?be(this.tiles[Z],O):null):null};class He extends Wt{constructor(I,E,k,O){super(I,E,k),this._dataUpdateable=new Map,this.loadGeoJSON=(N,Y)=>{const{promoteId:Z}=N;if(N.request)return c.f(N.request,(j,H,ce,ue)=>{this._dataUpdateable=yi(H,Z)?fr(H,Z):void 0,Y(j,H,ce,ue)});
2if(typeof N.data=="string")try{const j=JSON.parse(N.data);this._dataUpdateable=yi(j,Z)?fr(j,Z):void 0,Y(null,j)}catch{Y(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`))}else N.dataDiff?this._dataUpdateable?(function(j,H,ce){var ue,pe,Ve,qe;if(H.removeAll&&j.clear(),H.remove)for(const ze of H.remove)j.delete(ze);if(H.add)for(const ze of H.add){const Ue=Ze(ze,ce);Ue!=null&&j.set(Ue,ze)}if(H.update)for(const ze of H.update){let Ue=j.get(ze.id);if(Ue==null)continue;const Ge=!ze.removeAllProperties&&(((ue=ze.removeProperties)===null||ue===void 0?void 0:ue.length)>0||((pe=ze.addOrUpdateProperties)===null||pe===void 0?void 0:pe.length)>0);if((ze.newGeometry||ze.removeAllProperties||Ge)&&(Ue=Object.assign({},Ue),j.set(ze.id,Ue),Ge&&(Ue.properties=Object.assign({},Ue.properties))),ze.newGeometry&&(Ue.geometry=ze.newGeometry),ze.removeAllProperties)Ue.properties={};else if(((Ve=ze.removeProperties)===null||Ve===void 0?void 0:Ve.length)>0)for(const dt of ze.removeProperties)Object.prototype.hasOwnProperty.call(Ue.properties,dt)&&delete Ue.properties[dt];if(((qe=ze.addOrUpdateProperties)===null||qe===void 0?void 0:qe.length)>0)for(const{key:dt,value:mt}of ze.addOrUpdateProperties)Ue.properties[dt]=mt}}(this._dataUpdateable,N.dataDiff,Z),Y(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):Y(new Error(`Cannot update existing geojson data in ${N.source}`)):Y(new Error(`Input data given to '${N.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,O&&(this.loadGeoJSON=O)}loadGeoJSONTile(I,E){const k=I.tileID.canonical;if(!this._geoJSONIndex)return E(null,null);const O=this._geoJSONIndex.getTile(k.z,k.x,k.y);if(!O)return E(null,null);const N=new class{constructor(Z){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=c.N,this.length=Z.length,this._features=Z}feature(Z){return new class{constructor(j){this._feature=j,this.extent=c.N,this.type=j.type,this.properties=j.tags,"id"in j&&!isNaN(j.id)&&(this.id=parseInt(j.id,10))}loadGeometry(){if(this._feature.type===1){const j=[];for(const H of this._feature.geometry)j.push([new c.P(H[0],H[1])]);return j}{const j=[];for(const H of this._feature.geometry){const ce=[];for(const ue of H)ce.push(new c.P(ue[0],ue[1]));j.push(ce)}return j}}toGeoJSON(j,H,ce){return Ii.call(this,j,H,ce)}}(this._features[Z])}}(O.features);let Y=Ks(N);Y.byteOffset===0&&Y.byteLength===Y.buffer.byteLength||(Y=new Uint8Array(Y)),E(null,{vectorTile:N,rawData:Y.buffer})}loadData(I,E){var k;(k=this._pendingRequest)===null||k===void 0||k.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const O=!!(I&&I.request&&I.request.collectResourceTiming)&&new c.bu(I.request);this._pendingCallback=E,this._pendingRequest=this.loadGeoJSON(I,(N,Y)=>{if(delete this._pendingCallback,delete this._pendingRequest,N||!Y)return E(N);if(typeof Y!="object")return E(new Error(`Input data given to '${I.source}' is not a valid GeoJSON object.`));{_t(Y,!0);try{if(I.filter){const j=c.bC(I.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(j.result==="error")throw new Error(j.value.map(ce=>`${ce.key}: ${ce.message}`).join(", "));Y={type:"FeatureCollection",features:Y.features.filter(ce=>j.value.evaluate({zoom:0},ce))}}this._geoJSONIndex=I.cluster?new Ts(function({superclusterOptions:j,clusterProperties:H}){if(!H||!j)return j;const ce={},ue={},pe={accumulated:null,zoom:0},Ve={properties:null},qe=Object.keys(H);for(const ze of qe){const[Ue,Ge]=H[ze],dt=c.bC(Ge),mt=c.bC(typeof Ue=="string"?[Ue,["accumulated"],["get",ze]]:Ue);ce[ze]=dt.value,ue[ze]=mt.value}return j.map=ze=>{Ve.properties=ze;const Ue={};for(const Ge of qe)Ue[Ge]=ce[Ge].evaluate(pe,Ve);return Ue},j.reduce=(ze,Ue)=>{Ve.properties=Ue;for(const Ge of qe)pe.accumulated=ze[Ge],ze[Ge]=ue[Ge].evaluate(pe,Ve)},j}(I)).load(Y.features):function(j,H){return new Se(j,H)}(Y,I.geojsonVtOptions)}catch(j){return E(j)}this.loaded={};const Z={};if(O){const j=O.finish();j&&(Z.resourceTiming={},Z.resourceTiming[I.source]=JSON.parse(JSON.stringify(j)))}E(null,Z)}})}reloadTile(I,E){const k=this.loaded;return k&&k[I.uid]?super.reloadTile(I,E):this.loadTile(I,E)}removeSource(I,E){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),E()}getClusterExpansionZoom(I,E){try{E(null,this._geoJSONIndex.getClusterExpansionZoom(I.clusterId))}catch(k){E(k)}}getClusterChildren(I,E){try{E(null,this._geoJSONIndex.getChildren(I.clusterId))}catch(k){E(k)}}getClusterLeaves(I,E){try{E(null,this._geoJSONIndex.getLeaves(I.clusterId,I.limit,I.offset))}catch(k){E(k)}}}class Mr{constructor(I){this.self=I,this.actor=new c.C(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Wt,geojson:He},this.workerSources={},this.demWorkerSources={}
2,this.self.registerWorkerSource=(E,k)=>{if(this.workerSourceTypes[E])throw new Error(`Worker source with name "${E}" already registered.`);this.workerSourceTypes[E]=k},this.self.registerRTLTextPlugin=E=>{if(c.bD.isParsed())throw new Error("RTL text plugin already registered.");c.bD.applyArabicShaping=E.applyArabicShaping,c.bD.processBidirectionalText=E.processBidirectionalText,c.bD.processStyledBidirectionalText=E.processStyledBidirectionalText}}setReferrer(I,E){this.referrer=E}setImages(I,E,k){this.availableImages[I]=E;for(const O in this.workerSources[I]){const N=this.workerSources[I][O];for(const Y in N)N[Y].availableImages=E}k()}setLayers(I,E,k){this.getLayerIndex(I).replace(E),k()}updateLayers(I,E,k){this.getLayerIndex(I).update(E.layers,E.removedIds),k()}loadTile(I,E,k){this.getWorkerSource(I,E.type,E.source).loadTile(E,k)}loadDEMTile(I,E,k){this.getDEMWorkerSource(I,E.source).loadTile(E,k)}reloadTile(I,E,k){this.getWorkerSource(I,E.type,E.source).reloadTile(E,k)}abortTile(I,E,k){this.getWorkerSource(I,E.type,E.source).abortTile(E,k)}removeTile(I,E,k){this.getWorkerSource(I,E.type,E.source).removeTile(E,k)}removeDEMTile(I,E){this.getDEMWorkerSource(I,E.source).removeTile(E)}removeSource(I,E,k){if(!this.workerSources[I]||!this.workerSources[I][E.type]||!this.workerSources[I][E.type][E.source])return;const O=this.workerSources[I][E.type][E.source];delete this.workerSources[I][E.type][E.source],O.removeSource!==void 0?O.removeSource(E,k):k()}loadWorkerSource(I,E,k){try{this.self.importScripts(E.url),k()}catch(O){k(O.toString())}}syncRTLPluginState(I,E,k){try{c.bD.setState(E);const O=c.bD.getPluginURL();if(c.bD.isLoaded()&&!c.bD.isParsed()&&O!=null){this.self.importScripts(O);const N=c.bD.isParsed();k(N?void 0:new Error(`RTL Text Plugin failed to import scripts from ${O}`),N)}}catch(O){k(O.toString())}}getAvailableImages(I){let E=this.availableImages[I];return E||(E=[]),E}getLayerIndex(I){let E=this.layerIndexes[I];return E||(E=this.layerIndexes[I]=new Fe),E}getWorkerSource(I,E,k){return this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][E]||(this.workerSources[I][E]={}),this.workerSources[I][E][k]||(this.workerSources[I][E][k]=new this.workerSourceTypes[E]({send:(O,N,Y)=>{this.actor.send(O,N,Y,I)}},this.getLayerIndex(I),this.getAvailableImages(I))),this.workerSources[I][E][k]}getDEMWorkerSource(I,E){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][E]||(this.demWorkerSources[I][E]=new ii),this.demWorkerSources[I][E]}}return c.i()&&(self.worker=new Mr(self)),Mr}),me(["./shared"],function(c){var Fe="3.6.2";class K{static testProp(t){if(!K.docStyle)return t[0];for(let s=0;s<t.length;s++)if(t[s]in K.docStyle)return t[s];return t[0]}static create(t,s,n){const l=window.document.createElement(t);return s!==void 0&&(l.className=s),n&&n.appendChild(l),l}static createNS(t,s){return window.document.createElementNS(t,s)}static disableDrag(){K.docStyle&&K.selectProp&&(K.userSelect=K.docStyle[K.selectProp],K.docStyle[K.selectProp]="none")}static enableDrag(){K.docStyle&&K.selectProp&&(K.docStyle[K.selectProp]=K.userSelect)}static setTransform(t,s){t.style[K.transformProp]=s}static addEventListener(t,s,n,l={}){t.addEventListener(s,n,"passive"in l?l:l.capture)}static removeEventListener(t,s,n,l={}){t.removeEventListener(s,n,"passive"in l?l:l.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",K.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",K.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",K.suppressClickInternal,!0)},0)}static mousePos(t,s){const n=t.getBoundingClientRect();return new c.P(s.clientX-n.left-t.clientLeft,s.clientY-n.top-t.clientTop)}static touchPos(t,s){const n=t.getBoundingClientRect(),l=[];for(let h=0;h<s.length;h++)l.push(new c.P(s[h].clientX-n.left-t.clientLeft,s[h].clientY-n.top-t.clientTop));return l}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}K.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,K.selectProp=K.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),K.transformProp=K.testProp(["transform","WebkitTransform"]);
2const Ke={supported:!1,testSupport:function(u){!Wt&&ke&&(ii?Sr(u):lt=u)}};let lt,ke,Wt=!1,ii=!1;function Sr(u){const t=u.createTexture();u.bindTexture(u.TEXTURE_2D,t);try{if(u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,ke),u.isContextLost())return;Ke.supported=!0}catch{}u.deleteTexture(t),Wt=!0}var ri,_t;typeof document<"u"&&(ke=document.createElement("img"),ke.onload=function(){lt&&Sr(lt),lt=null,ii=!0},ke.onerror=function(){Wt=!0,lt=null},ke.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(u){let t,s,n,l;u.resetRequestQueue=()=>{t=[],s=0,n=0,l={}},u.addThrottleControl=v=>{const w=n++;return l[w]=v,w},u.removeThrottleControl=v=>{delete l[v],g()},u.getImage=(v,w,S=!0)=>{Ke.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*");const M={requestParameters:v,supportImageRefresh:S,callback:w,cancelled:!1,completed:!1,cancel:()=>{M.completed||M.cancelled||(M.cancelled=!0,M.innerRequest&&(M.innerRequest.cancel(),s--),g())}};return t.push(M),g(),M};const h=v=>{const{requestParameters:w,supportImageRefresh:S,callback:M}=v;return c.e(w,{type:"image"}),(S!==!1||c.i()||c.g(w.url)||w.headers&&!Object.keys(w.headers).reduce((R,L)=>R&&L==="accept",!0)?c.m:y)(w,(R,L,F,z)=>{m(v,M,R,L,F,z)})},m=(v,w,S,M,R,L)=>{S?w(S):M instanceof HTMLImageElement||c.a(M)?w(null,M):M&&((F,z)=>{typeof createImageBitmap=="function"?c.b(F,z):c.d(F,z)})(M,(F,z)=>{F!=null?w(F):z!=null&&w(null,z,{cacheControl:R,expires:L})}),v.cancelled||(v.completed=!0,s--,g())},g=()=>{const v=(()=>{const w=Object.keys(l);let S=!1;if(w.length>0){for(const M of w)if(S=l[M](),S)break}return S})()?c.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let w=s;w<v&&t.length>0;w++){const S=t.shift();if(S.cancelled){w--;continue}const M=h(S);s++,S.innerRequest=M}},y=(v,w)=>{const S=new Image,M=v.url;let R=!1;const L=v.credentials;return L&&L==="include"?S.crossOrigin="use-credentials":(L&&L==="same-origin"||!c.s(M))&&(S.crossOrigin="anonymous"),S.fetchPriority="high",S.onload=()=>{w(null,S),S.onerror=S.onload=null},S.onerror=()=>{R||w(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),S.onerror=S.onload=null},S.src=M,{cancel:()=>{R=!0,S.src=""}}}}(ri||(ri={})),ri.resetRequestQueue(),function(u){u.Glyphs="Glyphs",u.Image="Image",u.Source="Source",u.SpriteImage="SpriteImage",u.SpriteJSON="SpriteJSON",u.Style="Style",u.Tile="Tile",u.Unknown="Unknown"}(_t||(_t={}));class Ii{constructor(t){this._transformRequestFn=t}transformRequest(t,s){return this._transformRequestFn&&this._transformRequestFn(t,s)||{url:t}}normalizeSpriteURL(t,s,n){const l=function(h){const m=h.match(jt);if(!m)throw new Error(`Unable to parse URL "${h}"`);return{protocol:m[1],authority:m[2],path:m[3]||"/",params:m[4]?m[4].split("&"):[]}}(t);return l.path+=`${s}${n}`,function(h){const m=h.params.length?`?${h.params.join("&")}`:"";return`${h.protocol}://${h.authority}${h.path}${m}`}(l)}setTransformRequest(t){this._transformRequestFn=t}}const jt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Vt(u){var t=new c.A(3);return t[0]=u[0],t[1]=u[1],t[2]=u[2],t}var gi,ur=function(u,t,s){return u[0]=t[0]-s[0],u[1]=t[1]-s[1],u[2]=t[2]-s[2],u};gi=new c.A(3),c.A!=Float32Array&&(gi[0]=0,gi[1]=0,gi[2]=0);var Xs=function(u){var t=u[0],s=u[1];return t*t+s*s};function si(u){const t=[];if(typeof u=="string")t.push({id:"default",url:u});else if(u&&u.length>0){const s=[];for(const{id:n,url:l}of u){const h=`${n}${l}`;s.indexOf(h)===-1&&(s.push(h),t.push({id:n,url:l}))}}return t}function wa(u,t,s,n,l){if(n)return void u(n);if(l!==Object.values(t).length||l!==Object.values(s).length)return;const h={};for(const m in t){h[m]={};const g=c.h.getImageCanvasContext(s[m]),y=t[m];for(const v in y){const{width:w,height:S,x:M,y:R,sdf:L,pixelRatio:F,stretchX:z,stretchY:G,content:te}=y[v];h[m][v]={data:null,pixelRatio:F,sdf:L,stretchX:z,stretchY:G,content:te,spriteData:{width:w,height:S,x:M,y:R,context:g}}}}u(null,h)}(function(){var u=new c.A(2);c.A!=Float32Array&&(u[0]=0,u[1]=0)})();class Et{constructor(t,s,n,l){this.context=t,this.format=n,this.texture=t.gl.createTexture(),this.update(s,l)}update(t,s,n){const{width:l,height:h}=t,m=!(this.size&&this.size[0]===l&&this.size[1]===h||n),{context:g}=this,{gl:y}=g;if(this.useMipmap=!!(s&&s.useMipmap),y.bindTexture(y.TEXTURE_2D,this.texture),g.pixelStoreUnpackFlipY.set(!1),g.pixelStoreUnpack.set(1),g.pixelStoreUnpackPremultiplyAlpha.set(this.format===y.RGBA&&(!s||s.premultiply!==!1)),m)this.size=[l,h],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.a(t)?y.texImage2D(y.TEXTURE_2D,0,this.format,this.format,y.UNSIGNED_BYTE,t):y.texImage2D(y.TEXTURE_2D,0,this.format,l,h,0,this.format,y.UNSIGNED_BYTE,t.data);else{const{x:v,y:w}=n||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.a(t)?y.texSubImage2D(y.TEXTURE_2D,0,v,w,y.RGBA,y.UNSIGNED_BYTE,t):y.texSubImage2D(y.TEXTURE_2D,0,v,w,l,h,y.RGBA,y.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&y.generateMipmap(y.TEXTURE_2D)}bind(t,s,n){const{context:l}=this,{gl:h}=l;h.bindTexture(h.TEXTURE_2D,this.texture),n!==h.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=h.LINEAR),t!==this.filter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,n||t),this.filter=t),s!==this.wrap&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,s),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,s),this.wrap=s)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function Ss(u){const{userImage:t}=u;return!!(t&&t.render&&t.render())&&(u.data.replace(new Uint8Array(t.data.buffer)),!0)}class sr extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:s,callback:n}of this.requestors)this._notify(s,n);this.requestors=[]}}getImage(t){const s=this.images[t];if(s&&!s.data&&s.spriteData){const n=s.spriteData;s.data=new c.R({width:n.width,height:n.height},n.context.getImageData(n.x,n.y,n.width,n.height).data),s.spriteData=null}return s}addImage(t,s){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);
2this._validate(t,s)&&(this.images[t]=s)}_validate(t,s){let n=!0;const l=s.data||s.spriteData;return this._validateStretch(s.stretchX,l&&l.width)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchX" value`))),n=!1),this._validateStretch(s.stretchY,l&&l.height)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchY" value`))),n=!1),this._validateContent(s.content,s)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "content" value`))),n=!1),n}_validateStretch(t,s){if(!t)return!0;let n=0;for(const l of t){if(l[0]<n||l[1]<l[0]||s<l[1])return!1;n=l[1]}return!0}_validateContent(t,s){if(!t)return!0;if(t.length!==4)return!1;const n=s.spriteData,l=n&&n.width||s.data.width,h=n&&n.height||s.data.height;return!(t[0]<0||l<t[0]||t[1]<0||h<t[1]||t[2]<0||l<t[2]||t[3]<0||h<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,s,n=!0){const l=this.getImage(t);if(n&&(l.data.width!==s.data.width||l.data.height!==s.data.height))throw new Error(`size mismatch between old image (${l.data.width}x${l.data.height}) and new image (${s.data.width}x${s.data.height}).`);s.version=l.version+1,this.images[t]=s,this.updatedImages[t]=!0}removeImage(t){const s=this.images[t];delete this.images[t],delete this.patterns[t],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,s){let n=!0;if(!this.isLoaded())for(const l of t)this.images[l]||(n=!1);this.isLoaded()||n?this._notify(t,s):this.requestors.push({ids:t,callback:s})}_notify(t,s){const n={};for(const l of t){let h=this.getImage(l);h||(this.fire(new c.k("styleimagemissing",{id:l})),h=this.getImage(l)),h?n[l]={data:h.data.clone(),pixelRatio:h.pixelRatio,sdf:h.sdf,version:h.version,stretchX:h.stretchX,stretchY:h.stretchY,content:h.content,hasRenderCallback:!!(h.userImage&&h.userImage.render)}:c.w(`Image "${l}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}s(null,n)}getPixelSize(){const{width:t,height:s}=this.atlasImage;return{width:t,height:s}}getPattern(t){const s=this.patterns[t],n=this.getImage(t);if(!n)return null;if(s&&s.position.version===n.version)return s.position;if(s)s.position.version=n.version;else{const l={w:n.data.width+2,h:n.data.height+2,x:0,y:0},h=new c.I(l,n);this.patterns[t]={bin:l,position:h}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const s=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Et(t,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const h in this.patterns)t.push(this.patterns[h].bin);const{w:s,h:n}=c.p(t),l=this.atlasImage;l.resize({width:s||1,height:n||1});for(const h in this.patterns){const{bin:m}=this.patterns[h],g=m.x+1,y=m.y+1,v=this.getImage(h).data,w=v.width,S=v.height;c.R.copy(v,l,{x:0,y:0},{x:g,y},{width:w,height:S}),c.R.copy(v,l,{x:0,y:S-1},{x:g,y:y-1},{width:w,height:1}),c.R.copy(v,l,{x:0,y:0},{x:g,y:y+S},{width:w,height:1}),c.R.copy(v,l,{x:w-1,y:0},{x:g-1,y},{width:1,height:S}),c.R.copy(v,l,{x:0,y:0},{x:g+w,y},{width:1,height:S})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const s of t){if(this.callbackDispatchedThisFrame[s])continue;this.callbackDispatchedThisFrame[s]=!0;const n=this.getImage(s);n||c.w(`Image with ID: "${s}" was not found`),Ss(n)&&this.updateImage(s,n)}}}const Or=1e20;function _i(u,t,s,n,l,h,m,g,y){for(let v=t;v<t+n;v++)Bi(u,s*h+v,h,l,m,g,y);for(let v=s;v<s+l;v++)Bi(u,v*h+t,1,n,m,g,y)}function Bi(u,t,s,n,l,h,m){h[0]=0,m[0]=-Or,m[1]=Or,l[0]=u[t];for(let g=1,y=0,v=0;g<n;g++){l[g]=u[t+g*s];const w=g*g;do{const S=h[y];v=(l[g]-l[S]+w-S*S)/(g-S)/2}while(v<=m[y]&&--y>-1);y++,h[y]=g,m[y]=v,m[y+1]=Or}for(let g=0,y=0;g<n;g++){for(;m[y+1]<g;)y++;const v=h[y],w=g-v;u[t+g*s]=l[v]+w*w}}class Tr{constructor(t,s){this.requestManager=t,this.localIdeographFontFamily=s,this.entries={}}setURL(t){this.url=t}getGlyphs(t,s){const n=[];for(const l in t)for(const h of t[l])n.push({stack:l,id:h});c.o(n,({stack:l,id:h},m)=>{let g=this.entries[l];g||(g=this.entries[l]={glyphs:{},requests:{},ranges:{}});let y=g.glyphs[h];if(y!==void 0)return void m(null,{stack:l,id:h,glyph:y});if(y=this._tinySDF(g,l,h),y)return g.glyphs[h]=y,void m(null,{stack:l,id:h,glyph:y});const v=Math.floor(h/256);if(256*v>65535)return void m(new Error("glyphs > 65535 not supported"));if(g.ranges[v])return void m(null,{stack:l,id:h,glyph:y});if(!this.url)return void m(new Error("glyphsUrl is not set"));let w=g.requests[v];w||(w=g.requests[v]=[],Tr.loadGlyphRange(l,v,this.url,this.requestManager,(S,M)=>
2{if(M){for(const R in M)this._doesCharSupportLocalGlyph(+R)||(g.glyphs[+R]=M[+R]);g.ranges[v]=!0}for(const R of w)R(S,M);delete g.requests[v]})),w.push((S,M)=>{S?m(S):M&&m(null,{stack:l,id:h,glyph:M[h]||null})})},(l,h)=>{if(l)s(l);else if(h){const m={};for(const{stack:g,id:y,glyph:v}of h)(m[g]||(m[g]={}))[y]=v&&{id:v.id,bitmap:v.bitmap.clone(),metrics:v.metrics};s(null,m)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(c.u["CJK Unified Ideographs"](t)||c.u["Hangul Syllables"](t)||c.u.Hiragana(t)||c.u.Katakana(t))}_tinySDF(t,s,n){const l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(n))return;let h=t.tinySDF;if(!h){let g="400";/bold/i.test(s)?g="900":/medium/i.test(s)?g="500":/light/i.test(s)&&(g="200"),h=t.tinySDF=new Tr.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:g})}const m=h.draw(String.fromCharCode(n));return{id:n,bitmap:new c.q({width:m.width||60,height:m.height||60},m.data),metrics:{width:m.glyphWidth/2||24,height:m.glyphHeight/2||24,left:m.glyphLeft/2+.5||0,top:m.glyphTop/2-27.5||-8,advance:m.glyphAdvance/2||24,isDoubleResolution:!0}}}}Tr.loadGlyphRange=function(u,t,s,n,l){const h=256*t,m=h+255,g=n.transformRequest(s.replace("{fontstack}",u).replace("{range}",`${h}-${m}`),_t.Glyphs);c.l(g,(y,v)=>{if(y)l(y);else if(v){const w={};for(const S of c.n(v))w[S.id]=S;l(null,w)}})},Tr.TinySDF=class{constructor({fontSize:u=24,buffer:t=3,radius:s=8,cutoff:n=.25,fontFamily:l="sans-serif",fontWeight:h="normal",fontStyle:m="normal"}={}){this.buffer=t,this.cutoff=n,this.radius=s;const g=this.size=u+4*t,y=this._createCanvas(g),v=this.ctx=y.getContext("2d",{willReadFrequently:!0});v.font=`${m} ${h} ${u}px ${l}`,v.textBaseline="alphabetic",v.textAlign="left",v.fillStyle="black",this.gridOuter=new Float64Array(g*g),this.gridInner=new Float64Array(g*g),this.f=new Float64Array(g),this.z=new Float64Array(g+1),this.v=new Uint16Array(g)}_createCanvas(u){const t=document.createElement("canvas");return t.width=t.height=u,t}draw(u){const{width:t,actualBoundingBoxAscent:s,actualBoundingBoxDescent:n,actualBoundingBoxLeft:l,actualBoundingBoxRight:h}=this.ctx.measureText(u),m=Math.ceil(s),g=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(h-l))),y=Math.min(this.size-this.buffer,m+Math.ceil(n)),v=g+2*this.buffer,w=y+2*this.buffer,S=Math.max(v*w,0),M=new Uint8ClampedArray(S),R={data:M,width:v,height:w,glyphWidth:g,glyphHeight:y,glyphTop:m,glyphLeft:0,glyphAdvance:t};if(g===0||y===0)return R;const{ctx:L,buffer:F,gridInner:z,gridOuter:G}=this;L.clearRect(F,F,g,y),L.fillText(u,F,F+m);const te=L.getImageData(F,F,g,y);G.fill(Or,0,S),z.fill(0,0,S);for(let U=0;U<y;U++)for(let W=0;W<g;W++){const re=te.data[4*(U*g+W)+3]/255;if(re===0)continue;const se=(U+F)*v+W+F;if(re===1)G[se]=0,z[se]=Or;else{const he=.5-re;G[se]=he>0?he*he:0,z[se]=he<0?he*he:0}}_i(G,0,0,v,w,v,this.f,this.v,this.z),_i(z,F,F,g,y,v,this.f,this.v,this.z);for(let U=0;U<S;U++){const W=Math.sqrt(G[U])-Math.sqrt(z[U]);M[U]=Math.round(255-255*(W/this.radius+this.cutoff))}return R}};class Wi{constructor(){this.specification=c.v.light.position}possiblyEvaluate(t,s){return c.z(t.expression.evaluate(s))}interpolate(t,s,n){return{x:c.B.number(t.x,s.x,n),y:c.B.number(t.y,s.y,n),z:c.B.number(t.z,s.z,n)}}}let es;class Ks extends c.E{constructor(t){super(),es=es||new c.r({anchor:new c.D(c.v.light.anchor),position:new Wi,color:new c.D(c.v.light.color),intensity:new c.D(c.v.light.intensity)}),this._transitionable=new c.T(es),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,s={}){if(!this._validate(c.t,t,s))for(const n in t){const l=t[n];n.endsWith("-transition")?this._transitionable.setTransition(n.slice(0,-11),l):this._transitionable.setValue(n,l)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,s,n){return(!n||n.validate!==!1)&&c.x(this,t.call(c.y,c.e({value:s,style:{glyphs:!0,sprite:!0},styleSpec:c.v})))}}class Sa{constructor(t,s){this.width=t,this.height=s,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,s){const n=t.join(",")+String(s);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(t,s)),this.dashEntry[n]}getDashRanges(t,s,n){const l=[];let h=t.length%2==1?-t[t.length-1]*n:0,m=t[0]*n,g=!0;l.push({left:h,right:m,isDash:g,zeroLength:t[0]===0});let y=t[0];for(let v=1;v<t.length;v++){g=!g;const w=t[v];h=y*n,y+=w,m=y*n,l.push({left:h,right:m,isDash:g,zeroLength:w===0})}return l}addRoundDash(t,s,n){const l=s/2;for(let h=-n;h<=n;h++){const m=this.width*(this.nextRow+n+h);let g=0,y=t[g];for(let v=0;v<this.width;v++){v/y.right>1&&(y=t[++g]);const w=Math.abs(v-y.left),S=Math.abs(v-y.right),M=Math.min(w,S);let R;const L=h/n*(l+1);if(y.isDash){const F=l-Math.abs(L);R=Math.sqrt(M*M+F*F)}else R=l-Math.sqrt(M*M+L*L);this.data[m+v]=Math.max(0,Math.min(255,R+128))}}}
2addRegularDash(t){for(let g=t.length-1;g>=0;--g){const y=t[g],v=t[g+1];y.zeroLength?t.splice(g,1):v&&v.isDash===y.isDash&&(v.left=y.left,t.splice(g,1))}const s=t[0],n=t[t.length-1];s.isDash===n.isDash&&(s.left=n.left-this.width,n.right=s.right+this.width);const l=this.width*this.nextRow;let h=0,m=t[h];for(let g=0;g<this.width;g++){g/m.right>1&&(m=t[++h]);const y=Math.abs(g-m.left),v=Math.abs(g-m.right),w=Math.min(y,v);this.data[l+g]=Math.max(0,Math.min(255,(m.isDash?w:-w)+128))}}addDash(t,s){const n=s?7:0,l=2*n+1;if(this.nextRow+l>this.height)return c.w("LineAtlas out of space"),null;let h=0;for(let g=0;g<t.length;g++)h+=t[g];if(h!==0){const g=this.width/h,y=this.getDashRanges(t,this.width,g);s?this.addRoundDash(y,g,n):this.addRegularDash(y)}const m={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:h};return this.nextRow+=l,this.dirty=!0,m}bind(t){const s=t.gl;this.texture?(s.bindTexture(s.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,s.texSubImage2D(s.TEXTURE_2D,0,0,0,this.width,this.height,s.ALPHA,s.UNSIGNED_BYTE,this.data))):(this.texture=s.createTexture(),s.bindTexture(s.TEXTURE_2D,this.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texImage2D(s.TEXTURE_2D,0,s.ALPHA,this.width,this.height,0,s.ALPHA,s.UNSIGNED_BYTE,this.data))}}class Ys{constructor(t,s,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=n;const l=this.workerPool.acquire(n);for(let h=0;h<l.length;h++){const m=new c.C(l[h],s,n);m.name=`Worker ${h}`,this.actors.push(m)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,s,n){c.o(this.actors,(l,h)=>{l.send(t,s,h)},n=n||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(s=>{s.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function hr(u,t,s){const n=function(l,h){if(l)return s(l);if(h){const m=c.F(c.e(h,u),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);h.vector_layers&&(m.vectorLayers=h.vector_layers,m.vectorLayerIds=m.vectorLayers.map(g=>g.id)),s(null,m)}};return u.url?c.f(t.transformRequest(u.url,_t.Source),n):c.h.frame(()=>n(null,u))}class bt{constructor(t,s){t&&(s?this.setSouthWest(t).setNorthEast(s):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof c.L?new c.L(t.lng,t.lat):c.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof c.L?new c.L(t.lng,t.lat):c.L.convert(t),this}extend(t){const s=this._sw,n=this._ne;let l,h;if(t instanceof c.L)l=t,h=t;else{if(!(t instanceof bt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(bt.convert(t)):this.extend(c.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(c.L.convert(t)):this;if(l=t._sw,h=t._ne,!l||!h)return this}return s||n?(s.lng=Math.min(l.lng,s.lng),s.lat=Math.min(l.lat,s.lat),n.lng=Math.max(h.lng,n.lng),n.lat=Math.max(h.lat,n.lat)):(this._sw=new c.L(l.lng,l.lat),this._ne=new c.L(h.lng,h.lat)),this}getCenter(){return new c.L((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new c.L(this.getWest(),this.getNorth())}getSouthEast(){return new c.L(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:s,lat:n}=c.L.convert(t);let l=this._sw.lng<=s&&s<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=s&&s>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&l}static convert(t){return t instanceof bt?t:t&&new bt(t)}static fromLngLat(t,s=0){const n=360*s/40075017,l=n/Math.cos(Math.PI/180*t.lat);return new bt(new c.L(t.lng-l,t.lat-n),new c.L(t.lng+l,t.lat+n))}}class Ai{constructor(t,s,n){this.bounds=bt.convert(this.validateBounds(t)),this.minzoom=s||0,this.maxzoom=n||24}
2validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const s=Math.pow(2,t.z),n=Math.floor(c.G(this.bounds.getWest())*s),l=Math.floor(c.H(this.bounds.getNorth())*s),h=Math.ceil(c.G(this.bounds.getEast())*s),m=Math.ceil(c.H(this.bounds.getSouth())*s);return t.x>=n&&t.x<h&&t.y>=l&&t.y<m}}class ts extends c.E{constructor(t,s,n,l){if(super(),this.load=()=>{this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=hr(this._options,this.map._requestManager,(h,m)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),h?this.fire(new c.j(h)):m&&(c.e(this,m),m.bounds&&(this.tileBounds=new Ai(m.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>c.e({},this._options),this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.e(this,c.F(s,["url","scheme","tileSize","promoteId"])),this._options=c.e({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(t,s){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l={request:this.map._requestManager.transformRequest(n,_t.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
2ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function h(m,g){return delete t.request,t.aborted?s(null):m&&m.status!==404?s(m):(g&&g.resourceTiming&&(t.resourceTiming=g.resourceTiming),this.map._refreshExpiredTiles&&g&&t.setExpiryData(g),t.loadVectorData(g,this.map.painter),s(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=s:t.request=t.actor.send("reloadTile",l,h.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",l,h.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Ts extends c.E{constructor(t,s,n,l){super(),this.id=t,this.dispatcher=n,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},s),c.e(this,c.F(s,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=hr(this._options,this.map._requestManager,(t,s)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new c.j(t)):s&&(c.e(this,s),s.bounds&&(this.tileBounds=new Ai(s.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}serialize(){return c.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,s){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=ri.getImage(this.map._requestManager.transformRequest(n,_t.Tile),(l,h,m)=>{if(delete t.request,t.aborted)t.state="unloaded",s(null);else if(l)t.state="errored",s(l);else if(h){this.map._refreshExpiredTiles&&m&&t.setExpiryData(m);const g=this.map.painter.context,y=g.gl;t.texture=this.map.painter.getTileTexture(h.width),t.texture?t.texture.update(h,{useMipmap:!0}):(t.texture=new Et(g,h,y.RGBA,{useMipmap:!0}),t.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE,y.LINEAR_MIPMAP_NEAREST),g.extTextureFilterAnisotropic&&y.texParameterf(y.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax)),t.state="loaded",s(null)}},this.map._refreshExpiredTiles)}abortTile(t,s){t.request&&(t.request.cancel(),delete t.request),s()}unloadTile(t,s){t.texture&&this.map.painter.saveTileTexture(t.texture),s()}hasTransition(){return!1}}class Is extends Ts{constructor(t,s,n,l){super(t,s,n,l),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox",this.redFactor=s.redFactor,this.greenFactor=s.greenFactor,this.blueFactor=s.blueFactor,this.baseShift=s.baseShift}loadTile(t,s){const n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l=this.map._requestManager.transformRequest(n,_t.Tile);function h(m,g){m&&(t.state="errored",s(m)),g&&(t.dem=g,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",s(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=ri.getImage(l,(m,g,y)=>c._(this,void 0,void 0,function*(){if(delete t.request,t.aborted)t.state="unloaded",s(null);else if(m)t.state="errored",s(m);else if(g){this.map._refreshExpiredTiles&&t.setExpiryData(y);const v=c.a(g)&&c.J()?g:yield function(S){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.K()){const M=S.width+2,R=S.height+2;try{return new c.R({width:M,height:R},yield c.M(S,-1,-1,M,R))}catch{}}return c.h.getImageData(S,1)})}
2(g),w={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:v,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",w,h))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){const s=t.canonical,n=Math.pow(2,s.z),l=(s.x-1+n)%n,h=s.x===0?t.wrap-1:t.wrap,m=(s.x+1+n)%n,g=s.x+1===n?t.wrap+1:t.wrap,y={};return y[new c.O(t.overscaledZ,h,s.z,l,s.y).key]={backfilled:!1},y[new c.O(t.overscaledZ,g,s.z,m,s.y).key]={backfilled:!1},s.y>0&&(y[new c.O(t.overscaledZ,h,s.z,l,s.y-1).key]={backfilled:!1},y[new c.O(t.overscaledZ,t.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},y[new c.O(t.overscaledZ,g,s.z,m,s.y-1).key]={backfilled:!1}),s.y+1<n&&(y[new c.O(t.overscaledZ,h,s.z,l,s.y+1).key]={backfilled:!1},y[new c.O(t.overscaledZ,t.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},y[new c.O(t.overscaledZ,g,s.z,m,s.y+1).key]={backfilled:!1}),y}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})}}class Vr extends c.E{constructor(t,s,n,l){super(),this.load=()=>{this._updateWorkerData()},this.serialize=()=>c.e({}
2,this._options,{type:this.type,data:this._data}),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(l),this._data=s.data,this._options=c.e({},s),this._collectResourceTiming=s.collectResourceTiming,s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;const h=c.N/this.tileSize;this.workerOptions=c.e({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*h,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*h,extent:c.N,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?s.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:c.N,radius:(s.clusterRadius||50)*h,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMa
2xZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},s),this}getClusterChildren(t,s){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},s),this}getClusterLeaves(t,s,n,l){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:s,offset:n},l),this}_updateWorkerData(t){const s=c.e({},this.workerOptions);t?s.dataDiff=t:typeof this._data=="string"?(s.request=this.map._requestManager.transformRequest(c.h.resolveURL(this._data),_t.Source),s.request.collectResourceTiming=this._collectResourceTiming):s.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new c.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,s,(n,l)=>{if(this._pendingLoads--,this._removed||l&&l.abandoned)return void this.fire(new c.k("dataabort",{dataType:"source"}));let h=null;if(l&&l.resourceTiming&&l.resourceTiming[this.id]&&(h=l.resourceTiming[this.id].slice(0)),n)return void this.fire(new c.j(n));const m={dataType:"source"};this._collectResourceTiming&&h&&h.length>0&&c.e(m,{resourceTiming:h}),this.fire(new c.k("data",Object.assign(Object.assign({},m),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},m),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(t,s){const n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const l={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(n,l,(h,m)=>(delete t.request,t.unloadVectorData(),t.aborted?s(null):h?s(h):(t.loadVectorData(m,this.map.painter,n==="reloadTile"),s(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.t
2ype,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var ar=c.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Hi extends c.E{constructor(t,s,n,l){super(),this.load=(h,m)=>{this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=ri.getImage(this.map._requestManager.transformRequest(this.url,_t.Image),(g,y)=>{this._request=null,this._loaded=!0,g?this.fire(new c.j(g)):y&&(this.image=y,h&&(this.coordinates=h),m&&m(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const h=this.map.painter.context,m=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,ar.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Et(h,this.image,m.RGBA),this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE));let g=!1;for(const y in this.tiles){const v=this.tiles[y];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,g=!0)}g&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=t,this.dispatcher=n,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=s}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const s=t.map(c.U.fromLngLat);this.tileID=function(l){let h=1/0,m=1/0,g=-1/0,y=-1/0;for(const M of l)h=Math.min(h,M.x),m=Math.min(m,M.y),g=Math.max(g,M.x),y=Math.max(y,M.y);const v=Math.max(g-h,y-m),w=Math.max(0,Math.floor(-Math.log(v)/Math.LN2)),S=Math.pow(2,w);return new c.W(w,Math.floor((h+g)/2*S),Math.floor((m+y)/2*S))}(s),this.minzoom=this.maxzoom=this.tileID.z;const n=s.map(l=>this.tileID.getTilePoint(l)._round());return this._boundsArray=new c.V,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,c.N,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,c.N),this._boundsArray.emplaceBack(n[2].x,n[2].y,c.N,c.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,s){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},s(null)):(t.state="errored",s(null))}hasTransition(){return!1}}class Js extends Hi{constructor(t,s,n,l){super(t,s,n,l),this.load=()=>{this._loaded=!1;const h=this.options;this.urls=[];for(const m of h.urls)this.urls.push(this.map._requestManager.transformRequest(m,_t.Source).url);c.X(this.urls,(m,g)=>{this._loaded=!0,m?this.fire(new c.j(m)):g&&(this.video=g,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const h=this.map.painter.context,m=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,ar.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE),m.texSubImage2D(m.TEXTURE_2D,0,0,0,m.RGBA,m.UNSIGNED_BYTE,this.video)):(this.texture=new Et(h,this.video,m.RGBA),this.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE));let g=!1;for(const y in this.tiles){const v=this.tiles[y];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,g=!0)}g&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=s}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const s=this.video.seekable;t<s.start(0)||t>s.end(0)?this.fire(new c.j(new c.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${s.start(0)} and ${s.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}
2onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class Nr extends Hi{constructor(t,s,n,l){super(t,s,n,l),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let h=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,h=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,h=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const m=this.map.painter.context,g=m.gl;this.boundsBuffer||(this.boundsBuffer=m.createVertexBuffer(this._boundsArray,ar.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture?(h||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Et(m,this.canvas,g.RGBA,{premultiply:!0});let y=!1;for(const v in this.tiles){const w=this.tiles[v];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture,y=!0)}y&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some(h=>!Array.isArray(h)||h.length!==2||h.some(m=>typeof m!="number"))||this.fire(new c.j(new c.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.Y(`sources.${t}`,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new c.j(new c.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.Y(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new c.j(new c.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Qs={},Ir=u=>{switch(u){case"geojson":return Vr;case"image":return Hi;case"raster":return Ts;case"raster-dem":return Is;case"vector":return ts;case"video":return Js;case"canvas":return Nr}return Qs[u]};function As(u,t){const s=c.Z();return c.$(s,s,[1,1,0]),c.a0(s,s,[.5*u.width,.5*u.height,1]),c.a1(s,s,u.calculatePosMatrix(t.toUnwrapped()))}function is(u,t,s,n,l,h){const m=function(S,M,R){if(S)for(const L of S){const F=M[L];if(F&&F.source===R&&F.type==="fill-extrusion")return!0}else for(const L in M){const F=M[L];if(F.source===R&&F.type==="fill-extrusion")return!0}return!1}(l&&l.layers,t,u.id),g=h.maxPitchScaleFactor(),y=u.tilesIn(n,g,m);y.sort(Ur);const v=[];for(const S of y)v.push({wrappedTileID:S.tileID.wrapped().key,queryResults:S.tile.queryRenderedFeatures(t,s,u._state,S.queryGeometry,S.cameraQueryGeometry,S.scale,l,h,g,As(u.transform,S.tileID))});const w=function(S){const M={},R={};for(const L of S){const F=L.queryResults,z=L.wrappedTileID,G=R[z]=R[z]||{};for(const te in F){const U=F[te],W=G[te]=G[te]||{},re=M[te]=M[te]||[];for(const se of U)W[se.featureIndex]||(W[se.featureIndex]=!0,re.push(se))}}return M}(v);
2for(const S in w)w[S].forEach(M=>{const R=M.feature,L=u.getFeatureState(R.layer["source-layer"],R.id);R.source=R.layer.source,R.layer["source-layer"]&&(R.sourceLayer=R.layer["source-layer"]),R.state=L});return w}function Ur(u,t){const s=u.tileID,n=t.tileID;return s.overscaledZ-n.overscaledZ||s.canonical.y-n.canonical.y||s.wrap-n.wrap||s.canonical.x-n.canonical.x}class $r{constructor(t,s){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=c.a2(),this.uses=0,this.tileSize=s,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const s=t+this.timeAdded;s<this.fadeEndTime||(this.fadeEndTime=s)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,s,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(l,h){const m={};if(!h)return m;for(const g of l){const y=g.layerIds.map(v=>h.getLayer(v)).filter(Boolean);if(y.length!==0){g.layers=y,g.stateDependentLayerIds&&(g.stateDependentLayers=g.stateDependentLayerIds.map(v=>y.filter(w=>w.id===v)[0]));for(const v of y)m[v.id]=g}}return m}(t.buckets,s.style),this.hasSymbolBuckets=!1;for(const l in this.buckets){const h=this.buckets[l];if(h instanceof c.a4){if(this.hasSymbolBuckets=!0,!n)break;h.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const l in this.buckets){const h=this.buckets[l];if(h instanceof c.a4&&h.hasRTLText){this.hasRTLText=!0,c.a5();break}}this.queryPadding=0;for(const l in this.buckets){const h=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,s.style.getLayer(l).queryRadius(h))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new c.a3}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const n in this.buckets){const l=this.buckets[n];l.uploadPending()&&l.upload(t)}const s=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Et(t,this.imageAtlas.image,s.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Et(t,this.glyphAtlasImage,s.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,s,n,l,h,m,g,y,v,w){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:h,scale:m,tileSize:this.tileSize,pixelPosMatrix:w,transform:y,params:g,queryPadding:this.queryPadding*v},t,s,n):{}}querySourceFeatures(t,s){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const l=n.loadVTLayers(),h=s&&s.sourceLayer?s.sourceLayer:"",m=l._geojsonTileLayer||l[h];if(!m)return;const g=c.a6(s&&s.filter),{z:y,x:v,y:w}=this.tileID.canonical,S={z:y,x:v,y:w};for(let M=0;M<m.length;M++){const R=m.feature(M);if(g.needGeometry){const z=c.a7(R,!0);if(!g.filter(new c.a8(this.tileID.overscaledZ),z,this.tileID.canonical))continue}else if(!g.filter(new c.a8(this.tileID.overscaledZ),R))continue;const L=n.getId(R,h),F=new c.a9(R,y,v,w,L);F.tile=S,t.push(F)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const s=this.expirationTime;if(t.cacheControl){const n=c.aa(t.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const n=Date.now();let l=!1;if(this.expirationTime>n)l=!1;else if(s)if(this.expirationTime<s)l=!0;else{const h=this.expirationTime-s;h?this.expirationTime=n+Math.max(h,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(t,s){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;const n=this.latestFeatureIndex.loadVTLayers();for(const l in this.buckets){if(!s.style.hasLayer(l))continue;const h=this.buckets[l],m=h.layers[0].sourceLayer||"_geojsonTileLayer",g=n[m],y=t[m];if(!g||!y||Object.keys(y).length===0)continue;h.update(y,g,this.imageAtlas&&this.imageAtlas.patternPositions||{});const v=s&&s.style&&s.style.getLayer(l);v&&(this.queryPadding=Math.max(this.queryPadding,v.queryRadius(h)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<c.h.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=c.h.now()+t}
vendor: 4,767 bytes, line 2
2setDependencies(t,s){const n={};for(const l of s)n[l]=!0;this.dependencies[t]=n}hasDependency(t,s){for(const n of t){const l=this.dependencies[n];if(l){for(const h of s)if(l[h])return!0}}return!1}}class rs{constructor(t,s){this.max=t,this.onRemove=s,this.reset()}reset(){for(const t in this.data)for(const s of this.data[t])s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value);return this.data={},this.order=[],this}add(t,s,n){const l=t.wrapped().key;this.data[l]===void 0&&(this.data[l]=[]);const h={value:s,timeout:void 0};if(n!==void 0&&(h.timeout=setTimeout(()=>{this.remove(t,h)},n)),this.data[l].push(h),this.order.push(l),this.order.length>this.max){const m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const s=this.data[t].shift();return s.timeout&&clearTimeout(s.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),s.value}getByKey(t){const s=this.data[t];return s?s[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,s){if(!this.has(t))return this;const n=t.wrapped().key,l=s===void 0?0:this.data[n].indexOf(s),h=this.data[n][l];return this.data[n].splice(l,1),h.timeout&&clearTimeout(h.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(h.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this}filter(t){const s=[];for(const n in this.data)for(const l of this.data[n])t(l.value)||s.push(l);for(const n of s)this.remove(n.value.tileID,n)}}class le{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,s,n){const l=String(s);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][l]=this.stateChanges[t][l]||{},c.e(this.stateChanges[t][l],n),this.deletedStates[t]===null){this.deletedStates[t]={};for(const h in this.state[t])h!==l&&(this.deletedStates[t][h]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][l]===null){this.deletedStates[t][l]={};for(const h in this.state[t][l])n[h]||(this.deletedStates[t][l][h]=null)}else for(const h in n)this.deletedStates[t]&&this.deletedStates[t][l]&&this.deletedStates[t][l][h]===null&&delete this.deletedStates[t][l][h]}removeFeatureState(t,s,n){if(this.deletedStates[t]===null)return;const l=String(s);if(this.deletedStates[t]=this.deletedStates[t]||{},n&&s!==void 0)this.deletedStates[t][l]!==null&&(this.deletedStates[t][l]=this.deletedStates[t][l]||{},this.deletedStates[t][l][n]=null);else if(s!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][l])for(n in this.deletedStates[t][l]={},this.stateChanges[t][l])this.deletedStates[t][l][n]=null;else this.deletedStates[t][l]=null;else this.deletedStates[t]=null}getState(t,s){const n=String(s),l=c.e({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const h=this.deletedStates[t][s];if(h===null)return{};for(const m in h)delete l[m]}return l}initializeTileState(t,s){t.setFeatureState(this.state,s)}coalesceChanges(t,s){const n={};for(const l in this.stateChanges){this.state[l]=this.state[l]||{};const h={};for(const m in this.stateChanges[l])this.state[l][m]||(this.state[l][m]={}),c.e(this.state[l][m],this.stateChanges[l][m]),h[m]=this.state[l][m];n[l]=h}for(const l in this.deletedStates){this.state[l]=this.state[l]||{};const h={};if(this.deletedStates[l]===null)for(const m in this.state[l])h[m]={},this.state[l][m]={};else for(const m in this.deletedStates[l]){if(this.deletedStates[l][m]===null)this.state[l][m]={};else for(const g of Object.keys(this.deletedStates[l][m]))delete this.state[l][m][g];h[m]=this.state[l][m]}n[l]=n[l]||{},c.e(n[l],h)}if(this.stateChanges={},this.deletedStates={},Object.keys(n).length!==0)for(const l in t)t[l].setFeatureState(n,s)}}class Ei extends c.E{constructor(t,s,n){super(),this.id=t,this.dispatcher=n,this.on("data",l=>{l.dataType==="source"&&l.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&l.dataType==="source"&&l.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((l,h,m,g)=>{const y=new(Ir(h.type))(l,h,m,g);if(y.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${y.id}`);return y})(t,s,n,this),this._tiles={},this._cache=new rs(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={}
2,this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new le,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const s=this._tiles[t];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,s){return this._source.loadTile(t,s)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new c.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const s in this._tiles){const n=this._tiles[s];n.upload(t),n.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Xi).map(t=>t.key)}getRenderableIds(t){const s=[];for(const n in this._tiles)this._isIdRenderable(n,t)&&s.push(this._tiles[n]);return t?s.sort((n,l)=>{const h=n.tileID,m=l.tileID,g=new c.P(h.canonical.x,h.canonical.y)._rotate(this.transform.angle),y=new c.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle);return h.overscaledZ-m.overscaledZ||y.y-g.y||y.x-g.x}).map(n=>n.tileID.key):s.map(n=>n.tileID).sort(Xi).map(n=>n.key)}hasRenderableParent(t){const s=this.findLoadedParent(t,0);return!!s&&this._isIdRenderable(s.tileID.key)}_isIdRenderable(t,s){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(s||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,s){const n=this._tiles[t];n&&(n.state!=="loading"&&(n.state=s),this._loadTile(n,this._tileLoaded.bind(this,n,t,s)))}_tileLoaded(t,s,n,l){if(l)return t.state="errored",void(l.status!==404?this._source.fire(new c.j(l,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=c.h.now(),n==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(s,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const s=this.getRenderableIds();for(let l=0;l<s.length;l++){const h=s[l];if(t.neighboringTiles&&t.neighboringTiles[h]){const m=this.getTileByID(h);n(t,m),n(m,t)}}function n(l,h){l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0;let m=h.tileID.canonical.x-l.tileID.canonical.x;const g=h.tileID.canonical.y-l.tileID.canonical.y,y=Math.pow(2,l.tileID.canonical.z),v=h.tileID.key;m===0&&g===0||Math.abs(g)>1||(Math.abs(m)>1&&(Math.abs(m+y)===1?m+=y:Math.abs(m-y)===1&&(m-=y)),h.dem&&l.dem&&(l.dem.backfillBorder(h.dem,m,g),l.neighboringTiles&&l.neighboringTiles[v]&&(l.neighboringTiles[v].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,s,n,l){for(const h in this._tiles){let m=this._tiles[h];if(l[h]||!m.hasData()||m.tileID.overscaledZ<=s||m.tileID.overscaledZ>n)continue;let g=m.tileID;for(;m&&m.tileID.overscaledZ>s+1;){const v=m.tileID.scaledTo(m.tileID.overscaledZ-1);m=this._tiles[v.key],m&&m.hasData()&&(g=v)}let y=g;for(;y.overscaledZ>s;)if(y=y.scaledTo(y.overscaledZ-1),t[y.key]){l[g.key]=g;break}}}findLoadedParent(t,s){if(t.key in this._loadedParentTiles){const n=this._loadedParentTiles[t.key];return n&&n.tileID.overscaledZ>=s?n:null}for(let n=t.overscaledZ-1;n>=s;n--){const l=t.scaledTo(n),h=this._getLoadedTile(l);
2if(h)return h}}_getLoadedTile(t){const s=this._tiles[t.key];return s&&s.hasData()?s:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const s=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,l=Math.floor(s*n*(this._maxTileCacheZoomLevels===null?c.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),h=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(h)}handleWrapJump(t){const s=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,s){const n={};for(const l in this._tiles){const h=this._tiles[l];h.tileID=h.tileID.unwrapTo(h.tileID.wrap+s),n[h.tileID.key]=h}this._tiles=n;for(const l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(const l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}update(t,s){if(this.transform=t,this.terrain=s,!this._sourceLoaded||this._paused)return;let n;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(w=>new c.O(w.canonical.z,w.wrap,w.canonical.z,w.canonical.x,w.canonical.y)):(n=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:s}),this._source.hasTile&&(n=n.filter(w=>this._source.hasTile(w)))):n=[];const l=t.coveringZoomLevel(this._source),h=Math.max(l-Ei.maxOverzooming,this._source.minzoom),m=Math.max(l+Ei.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const w={};for(const S of n)if(S.canonical.z>this._source.minzoom){const M=S.scaledTo(S.canonical.z-1);w[M.key]=M;const R=S.scaledTo(Math.max(this._source.minzoom,Math.min(S.canonical.z,5)));w[R.key]=R}n=n.concat(Object.values(w))}const g=n.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,g&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const y=this._updateRetainedTiles(n,l);if(yt(this._source.type)){const w={},S={},M=Object.keys(y),R=c.h.now();for(const L of M){const F=y[L],z=this._tiles[L];if(!z||z.fadeEndTime!==0&&z.fadeEndTime<=R)continue;const G=this.findLoadedParent(F,h);G&&(this._addTile(G.tileID),w[G.tileID.key]=G.tileID),S[L]=F}this._retainLoadedChildren(S,l,m,y);for(const L in w)y[L]||(this._coveredTiles[L]=!0,y[L]=w[L]);if(s){const L={},F={};for(const z of n)this._tiles[z.key].hasData()?L[z.key]=z:F[z.key]=z;for(const z in F){const G=F[z].children(this._source.maxzoom);this._tiles[G[0].key]&&this._tiles[G[1].key]&&this._tiles[G[2].key]&&this._tiles[G[3].key]&&(L[G[0].key]=y[G[0].key]=G[0],L[G[1].key]=y[G[1].key]=G[1],L[G[2].key]=y[G[2].key]=G[2],L[G[3].key]=y[G[3].key]=G[3],delete F[z])}for(const z in F){const G=this.findLoadedParent(F[z],this._source.minzoom);if(G){L[G.tileID.key]=y[G.tileID.key]=G.tileID;for(const te in L)L[te].isChildOf(G.tileID)&&delete L[te]}}for(const z in this._tiles)L[z]||(this._coveredTiles[z]=!0)}}for(const w in y)this._tiles[w].clearFadeHold();const v=c.ab(this._tiles,y);for(const w of v){const S=this._tiles[w];S.hasSymbolBuckets&&!S.holdingForFade()?S.setHoldDuration(this.map._fadeDuration):S.hasSymbolBuckets&&!S.symbolFadeFinished()||this._removeTile(w)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,s){const n={},l={},h=Math.max(s-Ei.maxOverzooming,this._source.minzoom),m=Math.max(s+Ei.maxUnderzooming,this._source.minzoom),g={};for(const y of t){const v=this._addTile(y);n[y.key]=y,v.hasData()||s<this._source.maxzoom&&(g[y.key]=y)}this._retainLoadedChildren(g,s,m,n);for(const y of t){let v=this._tiles[y.key];if(v.hasData())continue;if(s+1>this._source.maxzoom){const S=y.children(this._source.maxzoom)[0],M=this.getTile(S);if(M&&M.hasData()){n[S.key]=S;continue}}else{const S=y.children(this._source.maxzoom);if(n[S[0].key]&&n[S[1].key]&&n[S[2].key]&&n[S[3].key])continue}let w=v.wasRequested();for(let S=y.overscaledZ-1;S>=h;--S){const M=y.scaledTo(S);if(l[M.key])break;if(l[M.key]=!0,v=this.getTile(M),!v&&w&&(v=this._addTile(M)),v){const R=v.hasData();if((w||R)&&(n[M.key]=M),w=v.wasRequested(),R)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const s=[];let n,l=this._tiles[t].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){n=this._loadedParentTiles[l.key];break}s.push(l.key);const h=l.scaledTo(l.overscaledZ-1);if(n=this._getLoadedTile(h),n)break;l=h}for(const h of s)this._loadedParentTiles[h]=n}}_addTile(t){let s=this._tiles[t.key];if(s)return s;s=this._cache.getAndRemove(t),s&&(this._setTileReloadTimer(t.key,s),s.tileID=t,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,s)));const n=s;return s||(s=new $r(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,t.key,s.state))),s.uses++,this._tiles[t.key]=s,n||this._source.fire(new c.k("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s}_setTileReloadTimer(t,s){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const n=s.getExpiryTimeout();n&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},n))}_removeTile(t){const s=this._tiles[t];s&&(s.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,s,n){const l=[],h=this.transform;if(!h)return l;const m=n?h.getCameraQueryGeometry(t):t,g=t.map(L=>h.pointCoordinate(L,this.terrain)),y=m.map(L=>h.pointCoordinate(L,this.terrain)),v=this.getIds();let w=1/0,S=1/0,M=-1/0,R=-1/0;for(const L of y)w=Math.min(w,L.x),S=Math.min(S,L.y),M=Math.max(M,L.x),R=Math.max(R,L.y);for(let L=0;L<v.length;L++){const F=this._tiles[v[L]];if(F.holdingForFade())continue;
2const z=F.tileID,G=Math.pow(2,h.zoom-F.tileID.overscaledZ),te=s*F.queryPadding*c.N/F.tileSize/G,U=[z.getTilePoint(new c.U(w,S)),z.getTilePoint(new c.U(M,R))];if(U[0].x-te<c.N&&U[0].y-te<c.N&&U[1].x+te>=0&&U[1].y+te>=0){const W=g.map(se=>z.getTilePoint(se)),re=y.map(se=>z.getTilePoint(se));l.push({tile:F,tileID:z,queryGeometry:W,cameraQueryGeometry:re,scale:G})}}return l}getVisibleCoordinates(t){const s=this.getRenderableIds(t).map(n=>this._tiles[n].tileID);for(const n of s)n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped());return s}hasTransition(){if(this._source.hasTransition())return!0;if(yt(this._source.type)){const t=c.h.now();for(const s in this._tiles)if(this._tiles[s].fadeEndTime>=t)return!0}return!1}setFeatureState(t,s,n){this._state.updateState(t=t||"_geojsonTileLayer",s,n)}removeFeatureState(t,s,n){this._state.removeFeatureState(t=t||"_geojsonTileLayer",s,n)}getFeatureState(t,s){return this._state.getState(t=t||"_geojsonTileLayer",s)}setDependencies(t,s,n){const l=this._tiles[t];l&&l.setDependencies(s,n)}reloadTilesForDependencies(t,s){for(const n in this._tiles)this._tiles[n].hasDependency(t,s)&&this._reloadTile(n,"reloading");this._cache.filter(n=>!n.hasDependency(t,s))}}function Xi(u,t){const s=Math.abs(2*u.wrap)-+(u.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return u.overscaledZ-t.overscaledZ||n-s||t.canonical.y-u.canonical.y||t.canonical.x-u.canonical.x}function yt(u){return u==="raster"||u==="image"||u==="video"}Ei.maxOverzooming=10,Ei.maxUnderzooming=3;const ot="mapboxgl_preloaded_worker_pool";class dr{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<dr.workerCount;)this.workers.push(new Worker(c.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach(s=>{s.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ot]}numActive(){return Object.keys(this.active).length}}const Es=Math.floor(c.h.hardwareConcurrency/2);let Ar;function Ta(){return Ar||(Ar=new dr),Ar}dr.workerCount=c.ac(globalThis)?Math.max(Math.min(Es,3),1):1;class Ms{constructor(t,s){this.reset(t,s)}reset(t,s){this.points=t||[],this._distances=[0];for(let n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(s||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=c.ad(t,0,1);let s=1,n=this._distances[s];const l=t*this.paddedLength+this.padding;for(;n<l&&s<this._distances.length;)n=this._distances[++s];const h=s-1,m=this._distances[h],g=n-m,y=g>0?(l-m)/g:0;return this.points[h].mult(1-y).add(this.points[s].mult(y))}}function jr(u,t){let s=!0;return u==="always"||u!=="never"&&t!=="never"||(s=!1),s}class ss{constructor(t,s,n){const l=this.boxCells=[],h=this.circleCells=[];this.xCellCount=Math.ceil(t/n),this.yCellCount=Math.ceil(s/n);for(let m=0;m<this.xCellCount*this.yCellCount;m++)l.push([]),h.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=s,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/s,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,s,n,l,h){this._forEachCell(s,n,l,h,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(s),this.bboxes.push(n),this.bboxes.push(l),this.bboxes.push(h)}insertCircle(t,s,n,l){this._forEachCell(s-l,n-l,s+l,n+l,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(s),this.circles.push(n),this.circles.push(l)}_insertBoxCell(t,s,n,l,h,m){this.boxCells[h].push(m)}_insertCircleCell(t,s,n,l,h,m){this.circleCells[h].push(m)}_query(t,s,n,l,h,m,g){if(n<0||t>this.width||l<0||s>this.height)return[];const y=[];if(t<=0&&s<=0&&this.width<=n&&this.height<=l){if(h)return[{key:null,x1:t,y1:s,x2:n,y2:l}];for(let v=0;v<this.boxKeys.length;v++)y.push({key:this.boxKeys[v],x1:this.bboxes[4*v],y1:this.bboxes[4*v+1],x2:this.bboxes[4*v+2],y2:this.bboxes[4*v+3]});for(let v=0;v<this.circleKeys.length;v++){const w=this.circles[3*v],S=this.circles[3*v+1],M=this.circles[3*v+2];y.push({key:this.circleKeys[v],x1:w-M,y1:S-M,x2:w+M,y2:S+M})}}
2else this._forEachCell(t,s,n,l,this._queryCell,y,{hitTest:h,overlapMode:m,seenUids:{box:{},circle:{}}},g);return y}query(t,s,n,l){return this._query(t,s,n,l,!1,null)}hitTest(t,s,n,l,h,m){return this._query(t,s,n,l,!0,h,m).length>0}hitTestCircle(t,s,n,l,h){const m=t-n,g=t+n,y=s-n,v=s+n;if(g<0||m>this.width||v<0||y>this.height)return!1;const w=[];return this._forEachCell(m,y,g,v,this._queryCellCircle,w,{hitTest:!0,overlapMode:l,circle:{x:t,y:s,radius:n},seenUids:{box:{},circle:{}}},h),w.length>0}_queryCell(t,s,n,l,h,m,g,y){const{seenUids:v,hitTest:w,overlapMode:S}=g,M=this.boxCells[h];if(M!==null){const L=this.bboxes;for(const F of M)if(!v.box[F]){v.box[F]=!0;const z=4*F,G=this.boxKeys[F];if(t<=L[z+2]&&s<=L[z+3]&&n>=L[z+0]&&l>=L[z+1]&&(!y||y(G))&&(!w||!jr(S,G.overlapMode))&&(m.push({key:G,x1:L[z],y1:L[z+1],x2:L[z+2],y2:L[z+3]}),w))return!0}}const R=this.circleCells[h];if(R!==null){const L=this.circles;for(const F of R)if(!v.circle[F]){v.circle[F]=!0;const z=3*F,G=this.circleKeys[F];if(this._circleAndRectCollide(L[z],L[z+1],L[z+2],t,s,n,l)&&(!y||y(G))&&(!w||!jr(S,G.overlapMode))){const te=L[z],U=L[z+1],W=L[z+2];if(m.push({key:G,x1:te-W,y1:U-W,x2:te+W,y2:U+W}),w)return!0}}}return!1}_queryCellCircle(t,s,n,l,h,m,g,y){const{circle:v,seenUids:w,overlapMode:S}=g,M=this.boxCells[h];if(M!==null){const L=this.bboxes;for(const F of M)if(!w.box[F]){w.box[F]=!0;const z=4*F,G=this.boxKeys[F];if(this._circleAndRectCollide(v.x,v.y,v.radius,L[z+0],L[z+1],L[z+2],L[z+3])&&(!y||y(G))&&!jr(S,G.overlapMode))return m.push(!0),!0}}const R=this.circleCells[h];if(R!==null){const L=this.circles;for(const F of R)if(!w.circle[F]){w.circle[F]=!0;const z=3*F,G=this.circleKeys[F];if(this._circlesCollide(L[z],L[z+1],L[z+2],v.x,v.y,v.radius)&&(!y||y(G))&&!jr(S,G.overlapMode))return m.push(!0),!0}}}_forEachCell(t,s,n,l,h,m,g,y){const v=this._convertToXCellCoord(t),w=this._convertToYCellCoord(s),S=this._convertToXCellCoord(n),M=this._convertToYCellCoord(l);for(let R=v;R<=S;R++)for(let L=w;L<=M;L++)if(h.call(this,t,s,n,l,this.xCellCount*L+R,m,g,y))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,s,n,l,h,m){const g=l-t,y=h-s,v=n+m;return v*v>g*g+y*y}_circleAndRectCollide(t,s,n,l,h,m,g){const y=(m-l)/2,v=Math.abs(t-(l+y));if(v>y+n)return!1;const w=(g-h)/2,S=Math.abs(s-(h+w));if(S>w+n)return!1;if(v<=y||S<=w)return!0;const M=v-y,R=S-w;return M*M+R*R<=n*n}}function be(u,t,s,n,l){const h=c.Z();return t?(c.a0(h,h,[1/l,1/l,1]),s||c.ae(h,h,n.angle)):c.a1(h,n.labelPlaneMatrix,u),h}function pr(u,t,s,n,l){if(t){const h=c.af(u);return c.a0(h,h,[l,l,1]),s||c.ae(h,h,-n.angle),h}return n.glCoordMatrix}function zt(u,t,s){let n;s?(n=[u.x,u.y,s(u.x,u.y),1],c.ag(n,n,t)):(n=[u.x,u.y,0,1],O(n,n,t));const l=n[3];return{point:new c.P(n[0]/l,n[1]/l),signedDistanceFromCamera:l}}function as(u,t){return .5+u/t*.5}function Er(u,t){const s=u[0]/u[3],n=u[1]/u[3];return s>=-t[0]&&s<=t[0]&&n>=-t[1]&&n<=t[1]}function Se(u,t,s,n,l,h,m,g,y,v){const w=n?u.textSizeData:u.iconSizeData,S=c.ah(w,s.transform.zoom),M=[256/s.width*2+1,256/s.height*2+1],R=n?u.text.dynamicLayoutVertexArray:u.icon.dynamicLayoutVertexArray;R.clear();const L=u.lineVertexArray,F=n?u.text.placedSymbolArray:u.icon.placedSymbolArray,z=s.transform.width/s.transform.height;let G=!1;for(let te=0;te<F.length;te++){const U=F.get(te);if(U.hidden||U.writingMode===c.ai.vertical&&!G){k(U.numGlyphs,R);continue}let W;if(G=!1,v?(W=[U.anchorX,U.anchorY,v(U.anchorX,U.anchorY),1],c.ag(W,W,t)):(W=[U.anchorX,U.anchorY,0,1],O(W,W,t)),!Er(W,M)){k(U.numGlyphs,R);continue}const re=as(s.transform.cameraToCenterDistance,W[3]),se=c.aj(w,S,U),he=m?se/re:se*re,ge=new c.P(U.anchorX,U.anchorY),fe=zt(ge,l,v).point,ye={projections:{},offsets:{}},De=yi(U,he,!1,g,t,l,h,u.glyphOffsetArray,L,R,fe,ge,ye,z,y,v);G=De.useVertical,(De.notEnoughRoom||G||De.needsFlipping&&yi(U,he,!0,g,t,l,h,u.glyphOffsetArray,L,R,fe,ge,ye,z,y,v).notEnoughRoom)&&k(U.numGlyphs,R)}n?u.text.dynamicLayoutVertexBuffer.updateData(R):u.icon.dynamicLayoutVertexBuffer.updateData(R)}function Ye(u,t,s,n,l,h,m,g,y,v,w,S,M){const R=g.glyphStartIndex+g.numGlyphs,L=g.lineStartIndex,F=g.lineStartIndex+g.lineLength,z=t.getoffsetX(g.glyphStartIndex),G=t.getoffsetX(R-1),te=I(u*z,s,n,l,h,m,g.segment,L,F,y,v,w,S,M);if(!te)return null;const U=I(u*G,s,n,l,h,m,g.segment,L,F,y,v,w,S,M);return U?{first:te,last:U}:null}function Ze(u,t,s,n){return u===c.ai.horizontal&&Math.abs(s.y-t.y)>Math.abs(s.x-t.x)*n?{useVertical:!0}:(u===c.ai.vertical?t.y<s.y:t.x>s.x)?{needsFlipping:!0}:null}function yi(u,t,s,n,l,h,m,g,y,v,w,S,M,R,L,F){const z=t/24,G=u.lineOffsetX*z,te=u.lineOffsetY*z;let U;if(u.numGlyphs>1){const W=u.glyphStartIndex+u.numGlyphs,re=u.lineStartIndex,se=u.lineStartIndex+u.lineLength,he=Ye(z,g,G,te,s,w,S,u,y,h,M,L,F);if(!he)return{notEnoughRoom:!0};const ge=zt(he.first.point,m,F).point,fe=zt(he.last.point,m,F).point;if(n&&!s){const ye=Ze(u.writingMode,ge,fe,R);if(ye)return ye}U=[he.first];for(let ye=u.glyphStartIndex+1;ye<W-1;ye++)U.push(I(z*g.getoffsetX(ye),G,te,s,w,S,u.segment,re,se,y,h,M,L,F));U.push(he.last)}else{if(n&&!s){const re=zt(S,l,F).point,se=u.lineStartIndex+u.segment+1,he=new c.P(y.getx(se),y.gety(se)),ge=zt(he,l,F),fe=ge.signedDistanceFromCamera>0?ge.point:fr(S,he,re,1,l,F),ye=Ze(u.writingMode,re,fe,R);if(ye)return ye}const W=I(z*g.getoffsetX(u.glyphStartIndex),G,te,s,w,S,u.segment,u.lineStartIndex,u.lineStartIndex+u.lineLength,y,h,M,L,F);if(!W)return{notEnoughRoom:!0};U=[W]}for(const W of U)c.ak(v,W.point,W.angle);return{}}function fr(u,t,s,n,l,h){const m=zt(u.add(u.sub(t)._unit()),l,h).point,g=s.sub(m);return s.add(g._mult(n/g.mag()))}function He(u,t){const{projectionCache:s,lineVertexArray:n,labelPlaneMatr
2ix:l,tileAnchorPoint:h,distanceFromAnchor:m,getElevation:g,previousVertex:y,direction:v,absOffsetX:w}=t;if(s.projections[u])return s.projections[u];const S=new c.P(n.getx(u),n.gety(u)),M=zt(S,l,g);if(M.signedDistanceFromCamera>0)return s.projections[u]=M.point,M.point;const R=u-v;return fr(m===0?h:new c.P(n.getx(R),n.gety(R)),S,y,w-m+1,l,g)}function Mr(u,t,s){return u._unit()._perp()._mult(t*s)}function B(u,t,s,n,l,h,m,g){const{projectionCache:y,direction:v}=g;if(y.offsets[u])return y.offsets[u];const w=s.add(t);if(u+v<n||u+v>=l)return y.offsets[u]=w,w;const S=He(u+v,g),M=Mr(S.sub(s),m,v),R=s.add(M),L=S.add(M);return y.offsets[u]=c.al(h,w,R,L)||w,y.offsets[u]}function I(u,t,s,n,l,h,m,g,y,v,w,S,M,R){const L=n?u-t:u+t;let F=L>0?1:-1,z=0;n&&(F*=-1,z=Math.PI),F<0&&(z+=Math.PI);let G,te,U=F>0?g+m:g+m+1,W=l,re=l,se=0,he=0;const ge=Math.abs(L),fe=[];let ye;for(;se+he<=ge;){if(U+=F,U<g||U>=y)return null;se+=he,re=W,te=G;const Te={projectionCache:S,lineVertexArray:v,labelPlaneMatrix:w,tileAnchorPoint:h,distanceFromAnchor:se,getElevation:R,previousVertex:re,direction:F,absOffsetX:ge};if(W=He(U,Te),s===0)fe.push(re),ye=W.sub(re);else{let je;const Re=W.sub(re);je=Re.mag()===0?Mr(He(U+F,Te).sub(W),s,F):Mr(Re,s,F),te||(te=re.add(je)),G=B(U,je,W,g,y,te,s,Te),fe.push(te),ye=G.sub(te)}he=ye.mag()}const De=ye._mult((ge-se)/he)._add(te||re),et=z+Math.atan2(W.y-re.y,W.x-re.x);return fe.push(De),{point:De,angle:M?et:0,path:fe}}const E=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function k(u,t){for(let s=0;s<u;s++){const n=t.length;t.resize(n+4),t.float32.set(E,3*n)}}function O(u,t,s){const n=t[0],l=t[1];return u[0]=s[0]*n+s[4]*l+s[12],u[1]=s[1]*n+s[5]*l+s[13],u[3]=s[3]*n+s[7]*l+s[15],u}const N=100;class Y{constructor(t,s=new ss(t.width+200,t.height+200,25),n=new ss(t.width+200,t.height+200,25)){this.transform=t,this.grid=s,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+N,this.screenBottomBoundary=t.height+N,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,s,n,l,h,m){const g=this.projectAndGetPerspectiveRatio(l,t.anchorPointX,t.anchorPointY,m),y=n*g.perspectiveRatio,v=t.x1*y+g.point.x,w=t.y1*y+g.point.y,S=t.x2*y+g.point.x,M=t.y2*y+g.point.y;return!this.isInsideGrid(v,w,S,M)||s!=="always"&&this.grid.hitTest(v,w,S,M,s,h)||g.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[v,w,S,M],offscreen:this.isOffscreen(v,w,S,M)}}placeCollisionCircles(t,s,n,l,h,m,g,y,v,w,S,M,R,L){const F=[],z=new c.P(s.anchorX,s.anchorY),G=zt(z,m,L),te=as(this.transform.cameraToCenterDistance,G.signedDistanceFromCamera),U=(w?h/te:h*te)/c.ap,W=zt(z,g,L).point,re=Ye(U,l,s.lineOffsetX*U,s.lineOffsetY*U,!1,W,z,s,n,g,{projections:{},offsets:{}},!1,L);let se=!1,he=!1,ge=!0;if(re){const fe=.5*M*te+R,ye=new c.P(-100,-100),De=new c.P(this.screenRightBoundary,this.screenBottomBoundary),et=new Ms,Te=re.first,je=re.last;let Re=[];for(let Xe=Te.path.length-1;Xe>=1;Xe--)Re.push(Te.path[Xe]);for(let Xe=1;Xe<je.path.length;Xe++)Re.push(je.path[Xe]);const ft=2.5*fe;if(y){const Xe=Re.map(tt=>zt(tt,y,L));Re=Xe.some(tt=>tt.signedDistanceFromCamera<=0)?[]:Xe.map(tt=>tt.point)}let Qe=[];if(Re.length>0){const Xe=Re[0].clone(),tt=Re[0].clone();for(let Bt=1;Bt<Re.length;Bt++)Xe.x=Math.min(Xe.x,Re[Bt].x),Xe.y=Math.min(Xe.y,Re[Bt].y),tt.x=Math.max(tt.x,Re[Bt].x),tt.y=Math.max(tt.y,Re[Bt].y);Qe=Xe.x>=ye.x&&tt.x<=De.x&&Xe.y>=ye.y&&tt.y<=De.y?[Re]:tt.x<ye.x||Xe.x>De.x||tt.y<ye.y||Xe.y>De.y?[]:c.am([Re],ye.x,ye.y,De.x,De.y)}for(const Xe of Qe){et.reset(Xe,.25*fe);let tt=0;tt=et.length<=.5*fe?1:Math.ceil(et.paddedLength/ft)+1;for(let Bt=0;Bt<tt;Bt++){const vt=Bt/Math.max(tt-1,1),oi=et.lerp(vt),Ht=oi.x+N,Ut=oi.y+N;F.push(Ht,Ut,fe,0);const $i=Ht-fe,St=Ut-fe,gr=Ht+fe,_r=Ut+fe;if(ge=ge&&this.isOffscreen($i,St,gr,_r),he=he||this.isInsideGrid($i,St,gr,_r),t!=="always"&&this.grid.hitTestCircle(Ht,Ut,fe,t,S)&&(se=!0,!v))return{circles:[],offscreen:!1,collisionDetected:se}}}}return{circles:!v&&se||!he||te<this.perspectiveRatioCutoff?[]:F,offscreen:ge,collisionDetected:se}}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const s=[];let n=1/0,l=1/0,h=-1/0,m=-1/0;for(const w of t){const S=new c.P(w.x+N,w.y+N);n=Math.min(n,S.x),l=Math.min(l,S.y),h=Math.max(h,S.x),m=Math.max(m,S.y),s.push(S)}const g=this.grid.query(n,l,h,m).concat(this.ignoredGrid.query(n,l,h,m)),y={},v={};for(const w of g){const S=w.key;if(y[S.bucketInstanceId]===void 0&&(y[S.bucketInstanceId]={}),y[S.bucketInstanceId][S.featureIndex])continue;const M=[new c.P(w.x1,w.y1),new c.P(w.x2,w.y1),new c.P(w.x2,w.y2),new c.P(w.x1,w.y2)];c.an(s,M)&&(y[S.bucketInstanceId][S.featureIndex]=!0,v[S.bucketInstanceId]===void 0&&(v[S.bucketInstanceId]=[]),v[S.bucketInstanceId].push(S.featureIndex))}return v}insertCollisionBox(t,s,n,l,h,m){(n?this.ignoredGrid:this.grid).insert({bucketInstanceId:l,featureIndex:h,collisionGroupID:m,overlapMode:s},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,s,n,l,h,m){const g=n?this.ignoredGrid:this.grid,y={bucketInstanceId:l,featureIndex:h,collisionGroupID:m,overlapMode:s};for(let v=0;v<t.length;
2v+=4)g.insertCircle(y,t[v],t[v+1],t[v+2])}projectAndGetPerspectiveRatio(t,s,n,l){let h;return l?(h=[s,n,l(s,n),1],c.ag(h,h,t)):(h=[s,n,0,1],O(h,h,t)),{point:new c.P((h[0]/h[3]+1)/2*this.transform.width+N,(-h[1]/h[3]+1)/2*this.transform.height+N),perspectiveRatio:.5+this.transform.cameraToCenterDistance/h[3]*.5}}isOffscreen(t,s,n,l){return n<N||t>=this.screenRightBoundary||l<N||s>this.screenBottomBoundary}isInsideGrid(t,s,n,l){return n>=0&&t<this.gridRightBoundary&&l>=0&&s<this.gridBottomBoundary}getViewportMatrix(){const t=c.ao([]);return c.$(t,t,[-100,-100,0]),t}}function Z(u,t,s){return t*(c.N/(u.tileSize*Math.pow(2,s-u.tileID.overscaledZ)))}class j{constructor(t,s,n,l){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?s:-s))):l&&n?1:0,this.placed=n}isHidden(){return this.opacity===0&&!this.placed}}class H{constructor(t,s,n,l,h){this.text=new j(t?t.text:null,s,n,h),this.icon=new j(t?t.icon:null,s,l,h)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ce{constructor(t,s,n){this.text=t,this.icon=s,this.skipFade=n}}class ue{constructor(){this.invProjMatrix=c.Z(),this.viewportMatrix=c.Z(),this.circles=[]}}class pe{constructor(t,s,n,l,h){this.bucketInstanceId=t,this.featureIndex=s,this.sourceLayerIndex=n,this.bucketIndex=l,this.tileID=h}}class Ve{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const s=++this.maxGroupID;this.collisionGroups[t]={ID:s,predicate:n=>n.collisionGroupID===s}}return this.collisionGroups[t]}}function qe(u,t,s,n,l){const{horizontalAlign:h,verticalAlign:m}=c.au(u);return new c.P(-(h-.5)*t+n[0]*l,-(m-.5)*s+n[1]*l)}function ze(u,t,s,n,l,h){const{x1:m,x2:g,y1:y,y2:v,anchorPointX:w,anchorPointY:S}=u,M=new c.P(t,s);return n&&M._rotate(l?h:-h),{x1:m+M.x,y1:y+M.y,x2:g+M.x,y2:v+M.y,anchorPointX:w,anchorPointY:S}}class Ue{constructor(t,s,n,l,h){this.transform=t.clone(),this.terrain=s,this.collisionIndex=new Y(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new Ve(l),this.collisionCircleArrays={},this.prevPlacement=h,h&&(h.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,s,n,l){const h=n.getBucket(s),m=n.latestFeatureIndex;if(!h||!m||s.id!==h.layerIds[0])return;const g=n.collisionBoxArray,y=h.layers[0].layout,v=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),w=n.tileSize/c.N,S=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),M=y.get("text-pitch-alignment")==="map",R=y.get("text-rotation-alignment")==="map",L=Z(n,1,this.transform.zoom),F=be(S,M,R,this.transform,L);let z=null;if(M){const te=pr(S,M,R,this.transform,L);z=c.a1([],this.transform.labelPlaneMatrix,te)}this.retainedQueryData[h.bucketInstanceId]=new pe(h.bucketInstanceId,m,h.sourceLayerIndex,h.index,n.tileID);const G={bucket:h,layout:y,posMatrix:S,textLabelPlaneMatrix:F,labelToScreenMatrix:z,scale:v,textPixelRatio:w,holdingForFade:n.holdingForFade(),collisionBoxArray:g,partiallyEvaluatedTextSize:c.ah(h.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(h.sourceID)};if(l)for(const te of h.sortKeyRanges){const{sortKey:U,symbolInstanceStart:W,symbolInstanceEnd:re}=te;t.push({sortKey:U,symbolInstanceStart:W,symbolInstanceEnd:re,parameters:G})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:h.symbolInstances.length,parameters:G})}attemptAnchorPlacement(t,s,n,l,h,m,g,y,v,w,S,M,R,L,F,z){const G=c.aq[t.textAnchor],te=[t.textOffset0,t.textOffset1],U=qe(G,n,l,te,h),W=this.collisionIndex.placeCollisionBox(ze(s,U.x,U.y,m,g,this.transform.angle),S,y,v,w.predicate,z);if((!F||this.collisionIndex.placeCollisionBox(ze(F,U.x,U.y,m,g,this.transform.angle),S,y,v,w.predicate,z).box.length!==0)&&W.box.length>0){let re;if(this.prevPlacement&&this.prevPlacement.variableOffsets[M.crossTileID]&&this.prevPlacement.placements[M.crossTileID]&&this.prevPlacement.placements[M.crossTileID].text&&(re=this.prevPlacement.variableOffsets[M.crossTileID].anchor),M.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[M.crossTileID]={textOffset:te,width:n,height:l,anchor:G,textBoxScale:h,prevAnchor:re},this.markUsedJustification(R,G,M,L),R.allowVerticalPlacement&&(this.markUsedOrientation(R,L,M),this.placedOrientations[M.crossTileID]=L),{shift:U,placedGlyphBoxes:W}}}placeLayerBucketPart(t,s,n){const{bucket:l,layout:h,posMatrix:m,textLabelPlaneMatr
2ix:g,labelToScreenMatrix:y,textPixelRatio:v,holdingForFade:w,collisionBoxArray:S,partiallyEvaluatedTextSize:M,collisionGroup:R}=t.parameters,L=h.get("text-optional"),F=h.get("icon-optional"),z=c.ar(h,"text-overlap","text-allow-overlap"),G=z==="always",te=c.ar(h,"icon-overlap","icon-allow-overlap"),U=te==="always",W=h.get("text-rotation-alignment")==="map",re=h.get("text-pitch-alignment")==="map",se=h.get("icon-text-fit")!=="none",he=h.get("symbol-z-order")==="viewport-y",ge=G&&(U||!l.hasIconData()||F),fe=U&&(G||!l.hasTextData()||L);!l.collisionArrays&&S&&l.deserializeCollisionBoxes(S);const ye=this.retainedQueryData[l.bucketInstanceId].tileID,De=this.terrain?(Te,je)=>this.terrain.getElevation(ye,Te,je):null,et=(Te,je)=>{var Re,ft;if(s[Te.crossTileID])return;if(w)return void(this.placements[Te.crossTileID]=new ce(!1,!1,!1));let Qe=!1,Xe=!1,tt=!0,Bt=null,vt={box:null,offscreen:null},oi={box:null},Ht=null,Ut=null,$i=null,St=0,gr=0,_r=0;je.textFeatureIndex?St=je.textFeatureIndex:Te.useRuntimeCollisionCircles&&(St=Te.featureIndex),je.verticalTextFeatureIndex&&(gr=je.verticalTextFeatureIndex);const Yr=je.textBox;if(Yr){const di=Ft=>{let Xt=c.ai.horizontal;if(l.allowVerticalPlacement&&!Ft&&this.prevPlacement){const Pi=this.prevPlacement.placedOrientations[Te.crossTileID];Pi&&(this.placedOrientations[Te.crossTileID]=Pi,Xt=Pi,this.markUsedOrientation(l,Xt,Te))}return Xt},li=(Ft,Xt)=>{if(l.allowVerticalPlacement&&Te.numVerticalGlyphVertices>0&&je.verticalTextBox){for(const Pi of l.writingModes)if(Pi===c.ai.vertical?(vt=Xt(),oi=vt):vt=Ft(),vt&&vt.box&&vt.box.length)break}else vt=Ft()},vi=Te.textAnchorOffsetStartIndex,ms=Te.textAnchorOffsetEndIndex;if(ms===vi){const Ft=(Xt,Pi)=>{const Ot=this.collisionIndex.placeCollisionBox(Xt,z,v,m,R.predicate,De);return Ot&&Ot.box&&Ot.box.length&&(this.markUsedOrientation(l,Pi,Te),this.placedOrientations[Te.crossTileID]=Pi),Ot};li(()=>Ft(Yr,c.ai.horizontal),()=>{const Xt=je.verticalTextBox;return l.allowVerticalPlacement&&Te.numVerticalGlyphVertices>0&&Xt?Ft(Xt,c.ai.vertical):{box:null,offscreen:null}}),di(vt&&vt.box&&vt.box.length)}else{let Ft=c.aq[(ft=(Re=this.prevPlacement)===null||Re===void 0?void 0:Re.variableOffsets[Te.crossTileID])===null||ft===void 0?void 0:ft.anchor];const Xt=(Ot,gs,Qa)=>{const sl=Ot.x2-Ot.x1,al=Ot.y2-Ot.y1,Zl=Te.textBoxScale,Qn=se&&te==="never"?gs:null;let yr={box:[],offscreen:!1},_s=z==="never"?1:2,xr="never";Ft&&_s++;for(let ir=0;ir<_s;ir++){for(let vr=vi;vr<ms;vr++){const eo=l.textAnchorOffsets.get(vr);if(Ft&&eo.textAnchor!==Ft)continue;const Dr=this.attemptAnchorPlacement(eo,Ot,sl,al,Zl,W,re,v,m,R,xr,Te,l,Qa,Qn,De);if(Dr&&(yr=Dr.placedGlyphBoxes,yr&&yr.box&&yr.box.length))return Qe=!0,Bt=Dr.shift,yr}Ft?Ft=null:xr=z}return yr};li(()=>Xt(Yr,je.iconBox,c.ai.horizontal),()=>{const Ot=je.verticalTextBox;return l.allowVerticalPlacement&&!(vt&&vt.box&&vt.box.length)&&Te.numVerticalGlyphVertices>0&&Ot?Xt(Ot,je.verticalIconBox,c.ai.vertical):{box:null,offscreen:null}}),vt&&(Qe=vt.box,tt=vt.offscreen);const Pi=di(vt&&vt.box);if(!Qe&&this.prevPlacement){const Ot=this.prevPlacement.variableOffsets[Te.crossTileID];Ot&&(this.variableOffsets[Te.crossTileID]=Ot,this.markUsedJustification(l,Ot.anchor,Te,Pi))}}}if(Ht=vt,Qe=Ht&&Ht.box&&Ht.box.length>0,tt=Ht&&Ht.offscreen,Te.useRuntimeCollisionCircles){const di=l.text.placedSymbolArray.get(Te.centerJustifiedTextSymbolIndex),li=c.aj(l.textSizeData,M,di),vi=h.get("text-padding");Ut=this.collisionIndex.placeCollisionCircles(z,di,l.lineVertexArray,l.glyphOffsetArray,li,m,g,y,n,re,R.predicate,Te.collisionCircleDiameter,vi,De),Ut.circles.length&&Ut.collisionDetected&&!n&&c.w("Collisions detected, but collision boxes are not shown"),Qe=G||Ut.circles.length>0&&!Ut.collisionDetected,tt=tt&&Ut.offscreen}if(je.iconFeatureIndex&&(_r=je.iconFeatureIndex),je.iconBox){const di=li=>{const vi=se&&Bt?ze(li,Bt.x,Bt.y,W,re,this.transform.angle):li;return this.collisionIndex.placeCollisionBox(vi,te,v,m,R.predicate,De)};oi&&oi.box&&oi.box.length&&je.verticalIconBox?($i=di(je.verticalIconBox),Xe=$i.box.length>0):($i=di(je.iconBox),Xe=$i.box.length>0),tt=tt&&$i.offscreen}const fs=L||Te.numHorizontalGlyphVertices===0&&Te.numVerticalGlyphVertices===0,$s=F||Te.numIconVertices===0;if(fs||$s?$s?fs||(Xe=Xe&&Qe):Qe=Xe&&Qe:Xe=Qe=Xe&&Qe,Qe&&Ht&&Ht.box&&this.collisionIndex.insertCollisionBox(Ht.box,z,h.get("text-ignore-placement"),l.bucketInstanceId,oi&&oi.box&&gr?gr:St,R.ID),Xe&&$i&&this.collisionIndex.insertCollisionBox($i.box,te,h.get("icon-ignore-placement"),l.bucketInstanceId,_r,R.ID),Ut&&(Qe&&this.collisionIndex.insertCollisionCircles(Ut.circles,z,h.get("text-ignore-placement"),l.bucketInstanceId,St,R.ID),n)){const di=l.bucketInstanceId;let li=this.collisionCircleArrays[di];li===void 0&&(li=this.collisionCircleArrays[di]=new ue);for(let vi=0;vi<Ut.circles.length;vi+=4)li.circles.push(Ut.circles[vi+0]),li.circles.push(Ut.circles[vi+1]),li.circles.push(Ut.circles[vi+2]),li.circles.push(Ut.collisionDetected?1:0)}if(Te.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(l.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Te.crossTileID]=new ce(Qe||ge,Xe||fe,tt||l.justReloaded),s[Te.crossTileID]=!0};if(he){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");
vendor: 4,333 bytes, line 2
2const Te=l.getSortedSymbolIndexes(this.transform.angle);for(let je=Te.length-1;je>=0;--je){const Re=Te[je];et(l.symbolInstances.get(Re),l.collisionArrays[Re])}}else for(let Te=t.symbolInstanceStart;Te<t.symbolInstanceEnd;Te++)et(l.symbolInstances.get(Te),l.collisionArrays[Te]);if(n&&l.bucketInstanceId in this.collisionCircleArrays){const Te=this.collisionCircleArrays[l.bucketInstanceId];c.as(Te.invProjMatrix,m),Te.viewportMatrix=this.collisionIndex.getViewportMatrix()}l.justReloaded=!1}markUsedJustification(t,s,n,l){let h;h=l===c.ai.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[c.at(s)];const m=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(const g of m)g>=0&&(t.text.placedSymbolArray.get(g).crossTileID=h>=0&&g!==h?0:n.crossTileID)}markUsedOrientation(t,s,n){const l=s===c.ai.horizontal||s===c.ai.horizontalOnly?s:0,h=s===c.ai.vertical?s:0,m=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const g of m)t.text.placedSymbolArray.get(g).placedOrientation=l;n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=h)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const s=this.prevPlacement;let n=!1;this.prevZoomAdjustment=s?s.zoomAdjustment(this.transform.zoom):0;const l=s?s.symbolFadeChange(t):1,h=s?s.opacities:{},m=s?s.variableOffsets:{},g=s?s.placedOrientations:{};for(const y in this.placements){const v=this.placements[y],w=h[y];w?(this.opacities[y]=new H(w,l,v.text,v.icon),n=n||v.text!==w.text.placed||v.icon!==w.icon.placed):(this.opacities[y]=new H(null,l,v.text,v.icon,v.skipFade),n=n||v.text||v.icon)}for(const y in h){const v=h[y];if(!this.opacities[y]){const w=new H(v,l,!1,!1);w.isHidden()||(this.opacities[y]=w,n=n||v.text.placed||v.icon.placed)}}for(const y in m)this.variableOffsets[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.variableOffsets[y]=m[y]);for(const y in g)this.placedOrientations[y]||!this.opacities[y]||this.opacities[y].isHidden()||(this.placedOrientations[y]=g[y]);if(s&&s.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");n?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=s?s.lastPlacementChangeTime:t)}updateLayerOpacities(t,s){const n={};for(const l of s){const h=l.getBucket(t);h&&l.latestFeatureIndex&&t.id===h.layerIds[0]&&this.updateBucketOpacities(h,n,l.collisionBoxArray)}}updateBucketOpacities(t,s,n){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const l=t.layers[0],h=l.layout,m=new H(null,0,!1,!1,!0),g=h.get("text-allow-overlap"),y=h.get("icon-allow-overlap"),v=l._unevaluatedLayout.hasValue("text-variable-anchor")||l._unevaluatedLayout.hasValue("text-variable-anchor-offset"),w=h.get("text-rotation-alignment")==="map",S=h.get("text-pitch-alignment")==="map",M=h.get("icon-text-fit")!=="none",R=new H(null,0,g&&(y||!t.hasIconData()||h.get("icon-optional")),y&&(g||!t.hasTextData()||h.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);const L=(F,z,G)=>{for(let te=0;te<z/4;te++)F.opacityVertexArray.emplaceBack(G);F.hasVisibleVertices=F.hasVisibleVertices||G!==Ki};for(let F=0;F<t.symbolInstances.length;F++){const z=t.symbolInstances.get(F),{numHorizontalGlyphVertices:G,numVerticalGlyphVertices:te,crossTileID:U}=z;let W=this.opacities[U];s[U]?W=m:W||(W=R,this.opacities[U]=W),s[U]=!0;const re=z.numIconVertices>0,se=this.placedOrientations[z.crossTileID],he=se===c.ai.vertical,ge=se===c.ai.horizontal||se===c.ai.horizontalOnly;if(G>0||te>0){const fe=ai(W.text);L(t.text,G,he?Ki:fe),L(t.text,te,ge?Ki:fe);const ye=W.text.isHidden();[z.rightJustifiedTextSymbolIndex,z.centerJustifiedTextSymbolIndex,z.leftJustifiedTextSymbolIndex].forEac
2h(Te=>{Te>=0&&(t.text.placedSymbolArray.get(Te).hidden=ye||he?1:0)}),z.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(z.verticalPlacedTextSymbolIndex).hidden=ye||ge?1:0);const De=this.variableOffsets[z.crossTileID];De&&this.markUsedJustification(t,De.anchor,z,se);const et=this.placedOrientations[z.crossTileID];et&&(this.markUsedJustification(t,"left",z,et),this.markUsedOrientation(t,et,z))}if(re){const fe=ai(W.icon),ye=!(M&&z.verticalPlacedIconSymbolIndex&&he);z.placedIconSymbolIndex>=0&&(L(t.icon,z.numIconVertices,ye?fe:Ki),t.icon.placedSymbolArray.get(z.placedIconSymbolIndex).hidden=W.icon.isHidden()),z.verticalPlacedIconSymbolIndex>=0&&(L(t.icon,z.numVerticalIconVertices,ye?Ki:fe),t.icon.placedSymbolArray.get(z.verticalPlacedIconSymbolIndex).hidden=W.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const fe=t.collisionArrays[F];if(fe){let ye=new c.P(0,0);if(fe.textBox||fe.verticalTextBox){let et=!0;if(v){const Te=this.variableOffsets[U];Te?(ye=qe(Te.anchor,Te.width,Te.height,Te.textOffset,Te.textBoxScale),w&&ye._rotate(S?this.transform.angle:-this.transform.angle)):et=!1}fe.textBox&&Ge(t.textCollisionBox.collisionVertexArray,W.text.placed,!et||he,ye.x,ye.y),fe.verticalTextBox&&Ge(t.textCollisionBox.collisionVertexArray,W.text.placed,!et||ge,ye.x,ye.y)}const De=!!(!ge&&fe.verticalIconBox);fe.iconBox&&Ge(t.iconCollisionBox.collisionVertexArray,W.icon.placed,De,M?ye.x:0,M?ye.y:0),fe.verticalIconBox&&Ge(t.iconCollisionBox.collisionVertexArray,W.icon.placed,!De,M?ye.x:0,M?ye.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const F=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=F.invProjMatrix,t.placementViewportMatrix=F.viewportMatrix,t.collisionCircleArray=F.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,s){const n=this.zoomAtLastRecencyCheck===s?1-this.zoomAdjustment(s):1;return this.zoomAtLastRecencyCheck=s,this.commitTime+this.fadeDuration*n>t}setStale(){this.stale=!0}}function Ge(u,t,s,n,l){u.emplaceBack(t?1:0,s?1:0,n||0,l||0),u.emplaceBack(t?1:0,s?1:0,n||0,l||0),u.emplaceBack(t?1:0,s?1:0,n||0,l||0),u.emplaceBack(t?1:0,s?1:0,n||0,l||0)}const dt=Math.pow(2,25),mt=Math.pow(2,24),nt=Math.pow(2,17),at=Math.pow(2,16),ui=Math.pow(2,9),xt=Math.pow(2,8),qt=Math.pow(2,1);function ai(u){if(u.opacity===0&&!u.placed)return 0;if(u.opacity===1&&u.placed)return 4294967295;const t=u.placed?1:0,s=Math.floor(127*u.opacity);return s*dt+t*mt+s*nt+t*at+s*ui+t*xt+s*qt+t}const Ki=0;class vo{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,s,n,l,h){const m=this._bucketParts;for(;this._currentTileIndex<t.length;)if(s.getBucketParts(m,l,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,h())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,m.sort((g,y)=>g.sortKey-y.sortKey));this._currentPartIndex<m.length;)if(s.placeLayerBucketPart(m[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,h())return!0;return!1}}class Cs{constructor(t,s,n,l,h,m,g,y){this.placement=new Ue(t,s,m,g,y),this._currentPlacementIndex=n.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=h,this._done=!1}isDone(){return this._done}continuePlacement(t,s,n){const l=c.h.now(),h=()=>!this._forceFullPlacement&&c.h.now()-l>2;for(;this._currentPlacementIndex>=0;){const m=s[t[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(m.type==="symbol"&&(!m.minzoom||m.minzoom<=g)&&(!m.maxzoom||m.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new vo(m)),this._inProgressLayer.continuePlacement(n[m.source],this.placement,this._showCollisionBoxes,m,h))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Ps=512/c.N/2;class Ml{constructor(t,s,n){this.tileID=t,this.bucketInstanceId=n,this._symbolsByKey={};const l=new Map;for(let h=0;h<s.length;h++){const m=s.get(h),g=m.key,y=l.get(g);y?y.push(m):l.set(g,[m])}for(const[h,m]of l){const g={positions:m.map(y=>
2({x:Math.floor(y.anchorX*Ps),y:Math.floor(y.anchorY*Ps)})),crossTileIDs:m.map(y=>y.crossTileID)};if(g.positions.length>128){const y=new c.av(g.positions.length,16,Uint16Array);for(const{x:v,y:w}of g.positions)y.add(v,w);y.finish(),delete g.positions,g.index=y}this._symbolsByKey[h]=g}}getScaledCoordinates(t,s){const{x:n,y:l,z:h}=this.tileID.canonical,{x:m,y:g,z:y}=s.canonical,v=Ps/Math.pow(2,y-h),w=(g*c.N+t.anchorY)*v,S=l*c.N*Ps;return{x:Math.floor((m*c.N+t.anchorX)*v-n*c.N*Ps),y:Math.floor(w-S)}}findMatches(t,s,n){const l=this.tileID.canonical.z<s.canonical.z?1:Math.pow(2,this.tileID.canonical.z-s.canonical.z);for(let h=0;h<t.length;h++){const m=t.get(h);if(m.crossTileID)continue;const g=this._symbolsByKey[m.key];if(!g)continue;const y=this.getScaledCoordinates(m,s);if(g.index){const v=g.index.range(y.x-l,y.y-l,y.x+l,y.y+l).sort();for(const w of v){const S=g.crossTileIDs[w];if(!n[S]){n[S]=!0,m.crossTileID=S;break}}}else if(g.positions)for(let v=0;v<g.positions.length;v++){const w=g.positions[v],S=g.crossTileIDs[v];if(Math.abs(w.x-y.x)<=l&&Math.abs(w.y-y.y)<=l&&!n[S]){n[S]=!0,m.crossTileID=S;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class pt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class dn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const s=Math.round((t-this.lng)/360);if(s!==0)for(const n in this.indexes){const l=this.indexes[n],h={};for(const m in l){const g=l[m];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+s),h[g.tileID.key]=g}this.indexes[n]=h}this.lng=t}addBucket(t,s,n){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===s.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let h=0;h<s.symbolInstances.length;h++)s.symbolInstances.get(h).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const l=this.usedCrossTileIDs[t.overscaledZ];for(const h in this.indexes){const m=this.indexes[h];if(Number(h)>t.overscaledZ)for(const g in m){const y=m[g];y.tileID.isChildOf(t)&&y.findMatches(s.symbolInstances,t,l)}else{const g=m[t.scaledTo(Number(h)).key];g&&g.findMatches(s.symbolInstances,t,l)}}for(let h=0;h<s.symbolInstances.length;h++){const m=s.symbolInstances.get(h);m.crossTileID||(m.crossTileID=n.generate(),l[m.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ml(t,s.symbolInstances,s.bucketInstanceId),!0}removeBucketCrossTileIDs(t,s){for(const n of s.getCrossTileIDsLists())for(const l of n)delete this.usedCrossTileIDs[t][l]}removeStaleBuckets(t){let s=!1;for(const n in this.indexes){const l=this.indexes[n];for(const h in l)t[l[h].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,l[h]),delete l[h],s=!0)}return s}}class Ia{constructor(){this.layerIndexes={},this.crossTileIDs=new pt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,s,n){let l=this.layerIndexes[t.id];l===void 0&&(l=this.layerIndexes[t.id]=new dn);let h=!1;const m={};l.handleWrapJump(n);for(const g of s){const y=g.getBucket(t);y&&t.id===y.layerIds[0]&&(y.bucketInstanceId||(y.bucketInstanceId=++this.maxBucketInstanceId),l.addBucket(g.tileID,y,this.crossTileIDs)&&(h=!0),m[y.bucketInstanceId]=!0)}return l.removeStaleBuckets(m)&&(h=!0),h}pruneUnusedLayers(t){const s={};t.forEach(n=>{s[n]=!0});for(const n in this.layerIndexes)s[n]||delete this.layerIndexes[n]}}const hi=(u,t)=>c.x(u,t&&t.filter(s=>s.identifier!=="source.canvas")),Fi=c.F(c.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Cl=c.F(c.ax,["setCenter","setZoom","setBearing","setPitch"]),Yi=c.aw();class ni extends c.E{constructor(t,s={}){super(),this.map=t,this.dispatcher=new Ys(Ta(),this,t._getMapId()),this.imageManager=new sr,this.imageManager.setEventedParent(this),this.glyphManager=new Tr(t._requestManager,s.localIdeographFontFamily),this.lineAtlas=new Sa(256,512),this.crossTileSymbolIndex=new Ia,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",c.az());const n=this;this._rtlTextPluginCallback=ni.registerForPluginStateChange(l=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:l.pluginStatus,pluginURL:l.pluginURL},(h,m)=>{if(c.aA(h),m&&m.every(g=>g))for(const g in n.sourceCaches){const y=n.sourceCaches[g].getSource().type;y!=="vector"&&y!=="geojson"||n.sourceCaches[g].reload()}})}),this.on("data",l=>{if(l.dataType!=="source"||l.sourceDataType!=="metadata")return;const h=this.sourceCaches[l.sourceId];if(!h)return;const m=h.getSource();if(m&&m.vectorLayerIds)for(const g in this._layers){const y=this._layers[g];
2y.source===m.id&&this._validateLayer(y)}})}loadURL(t,s={},n){this.fire(new c.k("dataloading",{dataType:"style"})),s.validate=typeof s.validate!="boolean"||s.validate;const l=this.map._requestManager.transformRequest(t,_t.Style);this._request=c.f(l,(h,m)=>{this._request=null,h?this.fire(new c.j(h)):m&&this._load(m,s,n)})}loadJSON(t,s={},n){this.fire(new c.k("dataloading",{dataType:"style"})),this._request=c.h.frame(()=>{this._request=null,s.validate=s.validate!==!1,this._load(t,s,n)})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(Yi,{validate:!1})}_load(t,s,n){var l;const h=s.transformStyle?s.transformStyle(n,t):t;if(!s.validate||!hi(this,c.y(h))){this._loaded=!0,this.stylesheet=h;for(const m in h.sources)this.addSource(m,h.sources[m],{validate:!1});h.sprite?this._loadSprite(h.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(h.glyphs),this._createLayers(),this.light=new Ks(this.stylesheet.light),this.map.setTerrain((l=this.stylesheet.terrain)!==null&&l!==void 0?l:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const t=c.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(s=>s.id),this._layers={},this._serializedLayers=null;for(const s of t){const n=c.aC(s);n.setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=n}}_loadSprite(t,s=!1,n=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(l,h,m,g){const y=si(l),v=y.length,w=m>1?"@2x":"",S={},M={},R={};for(const{id:L,url:F}of y){const z=h.transformRequest(h.normalizeSpriteURL(F,w,".json"),_t.SpriteJSON),G=`${L}_${z.url}`;S[G]=c.f(z,(W,re)=>{delete S[G],M[L]=re,wa(g,M,R,W,v)});const te=h.transformRequest(h.normalizeSpriteURL(F,w,".png"),_t.SpriteImage),U=`${L}_${te.url}`;S[U]=ri.getImage(te,(W,re)=>{delete S[U],R[L]=re,wa(g,M,R,W,v)})}return{cancel(){for(const L of Object.values(S))L.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(l,h)=>{if(this._spriteRequest=null,l)this.fire(new c.j(l));else if(h)for(const m in h){this._spritesImagesIds[m]=[];const g=this._spritesImagesIds[m]?this._spritesImagesIds[m].filter(y=>!(y in h)):[];for(const y of g)this.imageManager.removeImage(y),this._changedImages[y]=!0;for(const y in h[m]){const v=m==="default"?y:`${m}:${y}`;this._spritesImagesIds[m].push(v),v in this.imageManager.images?this.imageManager.updateImage(v,h[m][y],!1):this.imageManager.addImage(v,h[m][y]),s&&(this._changedImages[v]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),s&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),n&&n(l)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(t){const s=this.sourceCaches[t.source];if(!s)return;const n=t.sourceLayer;if(!n)return;const l=s.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(n)===-1)&&this.fire(new c.j(new Error(`Source layer "${n}" does not exist on source "${l.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const s=this._serializedAllLayers();if(!t||t.length===0)return Object.values(s);const n=[];for(const l of t)s[l]&&n.push(s[l]);return n}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const s=Object.keys(this._layers);for(const n of s){const l=this._layers[n];l.type!=="custom"&&(t[n]=l.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const s=this._changed;if(this._changed){const l=Object.keys(this._updatedLayers),h=Object.keys(this._removedLayers);(l.length||h.length)&&this._updateWorkerLayers(l,h);for(const m in this._updatedSources){const g=this._updatedSources[m];if(g==="reload")this._reloadSource(m);else{if(g!=="clear")throw new Error(`Invalid action ${g}`);this._clearSource(m)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const m in this._updatedPaintProps)this._layers[m].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const n={};for(const l in this.sourceCaches){const h=this.sourceCaches[l];n[l]=h.used,h.used=!1}for(const l of this._order){const h=this._layers[l];h.recalculate(t,this._availableImages),!h.isHidden(t.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}for(const l in n){const h=this.sourceCaches[l];n[l]!==h.used&&h.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(t),this.z=t.zoom,s&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:s})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,s={}){this._checkLoaded();const n=this.serialize();if(t=s.transformStyle?s.transformStyle(n,t):t,hi(this,c.y(t)))return!1;(t=c.aD(t)).layers=c.aB(t.layers);const l=c.aE(n,t).filter(m=>!(m.command in Cl));if(l.length===0)return!1;const h=l.filter(m=>!(m.command in Fi));if(h.length>0)throw new Error(`Unimplemented: ${h.map(m=>m.command).join(", ")}.`);for(const m of l)m.command!=="setTransition"&&this[m.command].apply(this,m.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,s){if(this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,s),this._afterImageUpdated(t)}updateImage(t,s){this.imageManager.updateImage(t,s)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,s,n={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!s.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Ob
2ject.keys(s).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(c.y.source,`sources.${t}`,s,null,n))return;this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);const l=this.sourceCaches[t]=new Ei(t,s,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:t})),l.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===t)return this.fire(new c.j(new Error(`Source "${t}" cannot be removed while layer "${n}" is using it.`)));const s=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],s.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),s.setEventedParent(null),s.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,s){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const n=this.sourceCaches[t].getSource();if(n.type!=="geojson")throw new Error(`geojsonSource.type is ${n.type}, which is !== 'geojson`);n.setData(s),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,s,n={}){this._checkLoaded();const l=t.id;if(this.getLayer(l))return void this.fire(new c.j(new Error(`Layer "${l}" already exists on this map.`)));let h;if(t.type==="custom"){if(hi(this,c.aF(t)))return;h=c.aC(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(l,t.source),t=c.aD(t),t=c.e(t,{source:l})),this._validate(c.y.layer,`layers.${l}`,t,{arrayIndex:-1},n))return;h=c.aC(t),this._validateLayer(h),h.setEventedParent(this,{layer:{id:l}})}const m=s?this._order.indexOf(s):this._order.length;if(s&&m===-1)this.fire(new c.j(new Error(`Cannot add layer "${l}" before non-existing layer "${s}".`)));else{if(this._order.splice(m,0,l),this._layerOrderChanged=!0,this._layers[l]=h,this._removedLayers[l]&&h.source&&h.type!=="custom"){const g=this._removedLayers[l];delete this._removedLayers[l],g.type!==h.type?this._updatedSources[h.source]="clear":(this._updatedSources[h.source]="reload",this.sourceCaches[h.source].pause())}this._updateLayer(h),h.onAdd&&h.onAdd(this.map)}}moveLayer(t,s){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new c.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===s)return;const n=this._order.indexOf(t);this._order.splice(n,1);const l=s?this._order.indexOf(s):this._order.length;s&&l===-1?this.fire(new c.j(new Error(`Cannot move layer "${t}" before non-existing layer "${s}".`))):(this._order.splice(l,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const s=this._layers[t];if(!s)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${t}".`)));s.setEventedParent(null);const n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=s,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],s.onRemove&&s.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,s,n){this._checkLoaded();const l=this.getLayer(t);l?l.minzoom===s&&l.maxzoom===n||(s!=null&&(l.minzoom=s),n!=null&&(l.maxzoom=n),this._updateLayer(l)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,s,n={}){this._checkLoaded();const l=this.getLayer(t);if(l){if(!c.aG(l.filter,s))return s==null?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(c.y.filter,`layers.${l.id}.filter`,s,null,n)||(l.filter=c.aD(s),this._updateLayer(l)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return c.aD(this.getLayer(t).filter)}setLayoutProperty(t,s,n,l={}){this._checkLoaded();const h=this.getLayer(t);h?c.aG(h.getLayoutProperty(s),n)||(h.setLayoutProperty(s,n,l),this._updateLayer(h)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,s){const n=this.getLayer(t);if(n)return n.getLayoutProperty(s);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,s,n,l={}){this._checkLoaded();const h=this.getLayer(t);h?c.aG(h.getPaintProperty(s),n)||(h.setPaintProperty(s,n,l)&&this._updateLayer(h),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,s){return this.getLayer(t).getPaintProperty(s)}setFeatureState(t,s){this._checkLoaded();const n=t.source,l=t.sourceLayer,h=this.sourceCaches[n];if(h===void 0)return void this.fire(new c.j(new Error(`The source '${n}' does not exist in the map's style.`)));const m=h.getSource().type;m==="geojson"&&l?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):m!=="vector"||l?(t.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),h.setFeatureState(l,t.id,s)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,s){this._checkLoaded();const n=t.source,l=this.sourceCaches[n];if(l===void 0)return void this.fire(new c.j(new Error(`The source '${n}' does not exist in the map's style.`)));const h=l.getSource().type,m=h==="vector"?t.sourceLayer:void 0;h!=="vector"||m?s&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(m,t.id,s):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const s=t.source,n=t.sourceLayer,l=this.sourceCaches[s];if(l!==void 0)return l.getSource().type!=="vector"||n?(t.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),l.getFeatureState(n,t.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${s}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=c.aH(this.sourceCaches,h=>h.serialize()),s=this._serializeByIds(this._order),n=this.map.getTerrain()||void 0,l=this.stylesheet;return c.aI({version:l.version,name:l.name,metadata:l.metadata,light:l.light,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,sources:t,layers:s,terrain:n},h=>h!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const s=m=>this._layers[m].type==="fill-extrusion",n={},l=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(s(g)){n[g]=m;for(const y of t){const v=y[g];if(v)for(const w of v)l.push(w)}}}l.sort((m,g)=>g.intersectionZ-m.intersectionZ);const h=[];for(let m=this._order.length-1;m>=0;m--){const g=this._order[m];if(s(g))for(let y=l.length-1;y>=0;y--){const v=l[y].feature;if(n[v.layer.id]<m)break;h.push(v),l.pop()}else for(const y of t){const v=y[g];if(v)for(const w of v)h.push(w.feature)}}return h}
2queryRenderedFeatures(t,s,n){s&&s.filter&&this._validate(c.y.filter,"queryRenderedFeatures.filter",s.filter,null,s);const l={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new c.j(new Error("parameters.layers must be an Array."))),[];for(const g of s.layers){const y=this._layers[g];if(!y)return this.fire(new c.j(new Error(`The layer '${g}' does not exist in the map's style and cannot be queried for features.`))),[];l[y.source]=!0}}const h=[];s.availableImages=this._availableImages;const m=this._serializedAllLayers();for(const g in this.sourceCaches)s.layers&&!l[g]||h.push(is(this.sourceCaches[g],this._layers,m,t,s,n));return this.placement&&h.push(function(g,y,v,w,S,M,R){const L={},F=M.queryRenderedSymbols(w),z=[];for(const G of Object.keys(F).map(Number))z.push(R[G]);z.sort(Ur);for(const G of z){const te=G.featureIndex.lookupSymbolFeatures(F[G.bucketInstanceId],y,G.bucketIndex,G.sourceLayerIndex,S.filter,S.layers,S.availableImages,g);for(const U in te){const W=L[U]=L[U]||[],re=te[U];re.sort((se,he)=>{const ge=G.featureSortOrder;if(ge){const fe=ge.indexOf(se.featureIndex);return ge.indexOf(he.featureIndex)-fe}return he.featureIndex-se.featureIndex});for(const se of re)W.push(se)}}for(const G in L)L[G].forEach(te=>{const U=te.feature,W=v[g[G].source].getFeatureState(U.layer["source-layer"],U.id);U.source=U.layer.source,U.layer["source-layer"]&&(U.sourceLayer=U.layer["source-layer"]),U.state=W});return L}(this._layers,m,this.sourceCaches,t,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(h)}querySourceFeatures(t,s){s&&s.filter&&this._validate(c.y.filter,"querySourceFeatures.filter",s.filter,null,s);const n=this.sourceCaches[t];return n?function(l,h){const m=l.getRenderableIds().map(v=>l.getTileByID(v)),g=[],y={};for(let v=0;v<m.length;v++){const w=m[v],S=w.tileID.canonical.key;y[S]||(y[S]=!0,w.querySourceFeatures(g,h))}return g}(n,s):[]}addSourceType(t,s,n){return Ir(t)?n(new Error(`A source type called "${t}" already exists.`)):(((l,h)=>{Qs[l]=h})(t,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:s.workerSourceURL},n):n(null,null))}getLight(){return this.light.getLight()}setLight(t,s={}){this._checkLoaded();const n=this.light.getLight();let l=!1;for(const m in t)if(!c.aG(t[m],n[m])){l=!0;break}if(!l)return;const h={now:c.h.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,s),this.light.updateTransitions(h)}_validate(t,s,n,l,h={}){return(!h||h.validate!==!1)&&hi(this,t.call(c.y,c.e({key:s,style:this.serialize(),value:n,styleSpec:c.v},l)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),c.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const s in this._layers)this._layers[s].setEventedParent(null);for(const s in this.sourceCaches){const n=this.sourceCaches[s];n.setEventedParent(null),n.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const s in this.sourceCaches)this.sourceCaches[s].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,s,n,l,h=!1){let m=!1,g=!1;const y={};for(const v of this._order){const w=this._layers[v];if(w.type!=="symbol")continue;if(!y[w.source]){const M=this.sourceCaches[w.source];y[w.source]=M.getRenderableIds(!0).map(R=>M.getTileByID(R)).sort((R,L)=>L.tileID.overscaledZ-R.tileID.overscaledZ||(R.tileID.isLessThan(L.tileID)?-1:1))}const S=this.crossTileSymbolIndex.addLayer(w,y[w.source],t.center.lng);m=m||S}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((h=h||this._layerOrderChanged||n===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c.h.now(),t.zoom))&&(this.pauseablePlacement=new Cs(t,this.map.terrain,this._order,h,s,n,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c.h.now()),g=!0),m&&this.pauseablePlacement.placement.setStale()),g||m)for(const v of this._order){const w=this._layers[v];w.type==="symbol"&&this.placement.updateLayerOpacities(w,y[w.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c.h.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,s,n){this.imageManager.getImages(s.icons,n),this._updateTilesForChangedImages();const l=this.sourceCaches[s.source];l&&l.setDependencies(s.tileID.key,s.type,s.icons)}getGlyphs(t,s,n){this.glyphManager.getGlyphs(s.stacks,n);const l=this.sourceCaches[s.source];l&&l.setDependencies(s.tileID.key,s.type,[""])}getResource(t,s,n){return c.m(s,n)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,s={}
2){this._checkLoaded(),t&&this._validate(c.y.glyphs,"glyphs",t,null,s)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,s,n={},l){this._checkLoaded();const h=[{id:t,url:s}],m=[...si(this.stylesheet.sprite),...h];this._validate(c.y.sprite,"sprite",m,null,n)||(this.stylesheet.sprite=m,this._loadSprite(h,!0,l))}removeSprite(t){this._checkLoaded();const s=si(this.stylesheet.sprite);if(s.find(n=>n.id===t)){if(this._spritesImagesIds[t])for(const n of this._spritesImagesIds[t])this.imageManager.removeImage(n),this._changedImages[n]=!0;s.splice(s.findIndex(n=>n.id===t),1),this.stylesheet.sprite=s.length>0?s:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return si(this.stylesheet.sprite)}setSprite(t,s={},n){this._checkLoaded(),t&&this._validate(c.y.sprite,"sprite",t,null,s)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,n):(this._unloadSprite(),n&&n(null)))}}ni.registerForPluginStateChange=c.aK;var Aa=c.Q([{name:"a_pos",type:"Int16",components:2}]),ks="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Mt={prelude:ct(`#ifdef GL_ES
3precision mediump float;
4#else
5#if !defined(lowp)
6#define lowp
7#endif
8#if !defined(mediump)
9#define mediump
10#endif
11#if !defined(highp)
12#define highp
13#endif
14#endif
15`,`#ifdef GL_ES
16precision highp float;
17#else
18#if !defined(lowp)
19#define lowp
20#endif
21#if !defined(mediump)
22#define mediump
23#endif
24#if !defined(highp)
25#define highp
26#endif
27#endif
28vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
29);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}
30#ifdef TERRAIN3D
31uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
32#endif
33const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
34#ifdef TERRAIN3D
35highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
36#else
37return 1.0;
38#endif
39}float calculate_visibility(vec4 pos) {
40#ifdef TERRAIN3D
41vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
42#else
43return 1.0;
44#endif
45}float ele(vec2 pos) {
46#ifdef TERRAIN3D
47vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
48#else
49return 0.0;
50#endif
51}float get_elevation(vec2 pos) {
52#ifdef TERRAIN3D
53vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
54#else
55return 0.0;
56#endif
57}`),background:ct(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
58#ifdef OVERDRAW_INSPECTOR
59gl_FragColor=vec4(1.0);
60#endif
61}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ct(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
61uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
62#ifdef OVERDRAW_INSPECTOR
63gl_FragColor=vec4(1.0);
64#endif
65}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:ct(`varying vec3 v_data;varying float v_visibility;
66#pragma mapbox: define highp vec4 color
67#pragma mapbox: define mediump float radius
68#pragma mapbox: define lowp float blur
69#pragma mapbox: define lowp float opacity
70#pragma mapbox: define highp vec4 stroke_color
71#pragma mapbox: define mediump float stroke_width
72#pragma mapbox: define lowp float stroke_opacity
73void main() {
74#pragma mapbox: initialize highp vec4 color
75#pragma mapbox: initialize mediump float radius
76#pragma mapbox: initialize lowp float blur
77#pragma mapbox: initialize lowp float opacity
78#pragma mapbox: initialize highp vec4 stroke_color
79#pragma mapbox: initialize mediump float stroke_width
80#pragma mapbox: initialize lowp float stroke_opacity
81vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
82#ifdef OVERDRAW_INSPECTOR
83gl_FragColor=vec4(1.0);
84#endif
85}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;
86#pragma mapbox: define highp vec4 color
87#pragma mapbox: define mediump float radius
88#pragma mapbox: define lowp float blur
89#pragma mapbox: define lowp float opacity
90#pragma mapbox: define highp vec4 stroke_color
91#pragma mapbox: define mediump float stroke_width
92#pragma mapbox: define lowp float stroke_opacity
93void main(void) {
94#pragma mapbox: initialize highp vec4 color
95#pragma mapbox: initialize mediump float radius
96#pragma mapbox: initialize lowp float blur
97#pragma mapbox: initialize lowp float opacity
98#pragma mapbox: initialize highp vec4 stroke_color
99#pragma mapbox: initialize mediump float stroke_width
100#pragma mapbox: initialize lowp float stroke_opacity
101vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:ct("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:ct(`uniform highp float u_intensity;varying vec2 v_extrude;
102#pragma mapbox: define highp float weight
103#define GAUSS_COEF 0.3989422804014327
104void main() {
105#pragma mapbox: initialize highp float weight
106float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
107#ifdef OVERDRAW_INSPECTOR
108gl_FragColor=vec4(1.0);
109#endif
110}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
111#pragma mapbox: define highp float weight
112#pragma mapbox: define mediump float radius
113const highp float ZERO=1.0/255.0/16.0;
114#define GAUSS_COEF 0.3989422804014327
115void main(void) {
116#pragma mapbox: initialize highp float weight
117#pragma mapbox: initialize mediump float radius
118vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:ct(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
119#ifdef OVERDRAW_INSPECTOR
120gl_FragColor=vec4(0.0);
121#endif
122}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:ct("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ct("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:ct("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:ct(`#pragma mapbox: define highp vec4 color
123#pragma mapbox: define lowp float opacity
124void main() {
125#pragma mapbox: initialize highp vec4 color
126#pragma mapbox: initialize lowp float opacity
127gl_FragColor=color*opacity;
128#ifdef OVERDRAW_INSPECTOR
129gl_FragColor=vec4(1.0);
130#endif
131}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
132#pragma mapbox: define highp vec4 color
133#pragma mapbox: define lowp float opacity
134void main() {
135#pragma mapbox: initialize highp vec4 color
136#pragma mapbox: initialize lowp float opacity
137gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:ct(`varying vec2 v_pos;
138#pragma mapbox: define highp vec4 outline_color
139#pragma mapbox: define lowp float opacity
140void main() {
141#pragma mapbox: initialize highp vec4 outline_color
142#pragma mapbox: initialize lowp float opacity
143float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
144#ifdef OVERDRAW_INSPECTOR
145gl_FragColor=vec4(1.0);
146#endif
147}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
148#pragma mapbox: define highp vec4 outline_color
149#pragma mapbox: define lowp float opacity
150void main() {
151#pragma mapbox: initialize highp vec4 outline_color
152#pragma mapbox: initialize lowp float opacity
153gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:ct(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
154#pragma mapbox: define lowp float opacity
155#pragma mapbox: define lowp vec4 pattern_from
156#pragma mapbox: define lowp vec4 pattern_to
157void main() {
158#pragma mapbox: initialize lowp float opacity
159#pragma mapbox: initialize mediump vec4 pattern_from
160#pragma mapbox: initialize mediump vec4 pattern_to
161vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
162#ifdef OVERDRAW_INSPECTOR
163gl_FragColor=vec4(1.0);
164#endif
165}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
166#pragma mapbox: define lowp float opacity
167#pragma mapbox: define lowp vec4 pattern_from
168#pragma mapbox: define lowp vec4 pattern_to
169#pragma mapbox: define lowp float pixel_ratio_from
170#pragma mapbox: define lowp float pixel_ratio_to
171void main() {
172#pragma mapbox: initialize lowp float opacity
173#pragma mapbox: initialize mediump vec4 pattern_from
174#pragma mapbox: initialize mediump vec4 pattern_to
175#pragma mapbox: initialize lowp float pixel_ratio_from
176#pragma mapbox: initialize lowp float pixel_ratio_to
177vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:ct(`#ifdef GL_ES
178precision highp float;
179#endif
180uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
181#pragma mapbox: define lowp float opacity
182#pragma mapbox: define lowp vec4 pattern_from
183#pragma mapbox: define lowp vec4 pattern_to
184void main() {
185#pragma mapbox: initialize lowp float opacity
186#pragma mapbox: initialize mediump vec4 pattern_from
187#pragma mapbox: initialize mediump vec4 pattern_to
188vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
189#ifdef OVERDRAW_INSPECTOR
190gl_FragColor=vec4(1.0);
191#endif
192}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
193#pragma mapbox: define lowp float opacity
194#pragma mapbox: define lowp vec4 pattern_from
195#pragma mapbox: define lowp vec4 pattern_to
196#pragma mapbox: define lowp float pixel_ratio_from
197#pragma mapbox: define lowp float pixel_ratio_to
198void main() {
199#pragma mapbox: initialize lowp float opacity
200#pragma mapbox: initialize mediump vec4 pattern_from
201#pragma mapbox: initialize mediump vec4 pattern_to
202#pragma mapbox: initialize lowp float pixel_ratio_from
203#pragma mapbox: initialize lowp float pixel_ratio_to
204vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:ct(`varying vec4 v_color;void main() {gl_FragColor=v_color;
205#ifdef OVERDRAW_INSPECTOR
206gl_FragColor=vec4(1.0);
207#endif
208}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
209#ifdef TERRAIN3D
210attribute vec2 a_centroid;
211#endif
212varying vec4 v_color;
213#pragma mapbox: define highp float base
214#pragma mapbox: define highp float height
215#pragma mapbox: define highp vec4 color
216void main() {
217#pragma mapbox: initialize highp float base
218#pragma mapbox: initialize highp float height
219#pragma mapbox: initialize highp vec4 color
220vec3 normal=a_normal_ed.xyz;
221#ifdef TERRAIN3D
222float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
223#else
224float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
225#endif
226base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.072
2262;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:ct(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
227#pragma mapbox: define lowp float base
228#pragma mapbox: define lowp float height
229#pragma mapbox: define lowp vec4 pattern_from
230#pragma mapbox: define lowp vec4 pattern_to
231#pragma mapbox: define lowp float pixel_ratio_from
232#pragma mapbox: define lowp float pixel_ratio_to
233void main() {
234#pragma mapbox: initialize lowp float base
235#pragma mapbox: initialize lowp float height
236#pragma mapbox: initialize mediump vec4 pattern_from
237#pragma mapbox: initialize mediump vec4 pattern_to
238#pragma mapbox: initialize lowp float pixel_ratio_from
239#pragma mapbox: initialize lowp float pixel_ratio_to
240vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
241#ifdef OVERDRAW_INSPECTOR
242gl_FragColor=vec4(1.0);
243#endif
244}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
245#ifdef TERRAIN3D
246attribute vec2 a_centroid;
247#endif
248varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
249#pragma mapbox: define lowp float base
250#pragma mapbox: define lowp float height
251#pragma mapbox: define lowp vec4 pattern_from
252#pragma mapbox: define lowp vec4 pattern_to
253#pragma mapbox: define lowp float pixel_ratio_from
254#pragma mapbox: define lowp float pixel_ratio_to
255void main() {
256#pragma mapbox: initialize lowp float base
257#pragma mapbox: initialize lowp float height
258#pragma mapbox: initialize mediump vec4 pattern_from
259#pragma mapbox: initialize mediump vec4 pattern_to
260#pragma mapbox: initialize lowp float pixel_ratio_from
261#pragma mapbox: initialize lowp float pixel_ratio_to
262vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
263#ifdef TERRAIN3D
264float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
265#else
266float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
267#endif
268base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
269? a_pos
270: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:ct(`#ifdef GL_ES
271precision highp float;
272#endif
273uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
274#ifdef OVERDRAW_INSPECTOR
275gl_FragColor=vec4(1.0);
276#endif
277}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:ct(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
278#define PI 3.141592653589793
279void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;
279float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
280#ifdef OVERDRAW_INSPECTOR
281gl_FragColor=vec4(1.0);
282#endif
283}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:ct(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
284#pragma mapbox: define highp vec4 color
285#pragma mapbox: define lowp float blur
286#pragma mapbox: define lowp float opacity
287void main() {
288#pragma mapbox: initialize highp vec4 color
289#pragma mapbox: initialize lowp float blur
290#pragma mapbox: initialize lowp float opacity
291float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
292#ifdef OVERDRAW_INSPECTOR
293gl_FragColor=vec4(1.0);
294#endif
295}`,`
296#define scale 0.015873016
297attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
298#pragma mapbox: define highp vec4 color
299#pragma mapbox: define lowp float blur
300#pragma mapbox: define lowp float opacity
301#pragma mapbox: define mediump float gapwidth
302#pragma mapbox: define lowp float offset
303#pragma mapbox: define mediump float width
304void main() {
305#pragma mapbox: initialize highp vec4 color
306#pragma mapbox: initialize lowp float blur
307#pragma mapbox: initialize lowp float opacity
308#pragma mapbox: initialize mediump float gapwidth
309#pragma mapbox: initialize lowp float offset
310#pragma mapbox: initialize mediump float width
311float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
312#ifdef TERRAIN3D
313v_gamma_scale=1.0;
314#else
315float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
316#endif
317v_width2=vec2(outset,inset);}`),lineGradient:ct(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
318#pragma mapbox: define lowp float blur
319#pragma mapbox: define lowp float opacity
320void main() {
321#pragma mapbox: initialize lowp float blur
322#pragma mapbox: initialize lowp float opacity
323float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
324#ifdef OVERDRAW_INSPECTOR
325gl_FragColor=vec4(1.0);
326#endif
327}`,`
328#define scale 0.015873016
329attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
330#pragma mapbox: define lowp float blur
331#pragma mapbox: define lowp float opacity
332#pragma mapbox: define mediump float gapwidth
333#pragma mapbox: define lowp float offset
334#pragma mapbox: define mediump float width
335void main() {
336#pragma mapbox: initialize lowp float blur
337#pragma mapbox: initialize lowp float opacity
338#pragma mapbox: initialize mediump float gapwidth
339#pragma mapbox: initialize lowp float offset
340#pragma mapbox: initialize mediump float width
341float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
342#ifdef TERRAIN3D
343v_gamma_scale=1.0;
344#else
345float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
346#endif
347v_width2=vec2(outset,inset);}`),linePattern:ct(`#ifdef GL_ES
348precision highp float;
349#endif
350uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
351#pragma mapbox: define lowp vec4 pattern_from
352#pragma mapbox: define lowp vec4 pattern_to
353#pragma mapbox: define lowp float pixel_ratio_from
354#pragma mapbox: define lowp float pixel_ratio_to
355#pragma mapbox: define lowp float blur
356#pragma mapbox: define lowp float opacity
357void main() {
358#pragma mapbox: initialize mediump vec4 pattern_from
359#pragma mapbox: initialize mediump vec4 pattern_to
360#pragma mapbox: initialize lowp float pixel_ratio_from
361#pragma mapbox: initialize lowp float pixel_ratio_to
362#pragma mapbox: initialize lowp float blur
363#pragma mapbox: initialize lowp float opacity
364vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
365#ifdef OVERDRAW_INSPECTOR
366gl_FragColor=vec4(1.0);
367#endif
368}`,`
369#define scale 0.015873016
370#define LINE_DISTANCE_SCALE 2.0
371attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
372#pragma mapbox: define lowp float blur
373#pragma mapbox: define lowp float opacity
374#pragma mapbox: define lowp float offset
375#pragma mapbox: define mediump float gapwidth
376#pragma mapbox: define mediump float width
377#pragma mapbox: define lowp float floorwidth
378#pragma mapbox: define lowp vec4 pattern_from
379#pragma mapbox: define lowp vec4 pattern_to
380#pragma mapbox: define lowp float pixel_ratio_from
381#pragma mapbox: define lowp float pixel_ratio_to
382void main() {
383#pragma mapbox: initialize lowp float blur
384#pragma mapbox: initialize lowp float opacity
385#pragma mapbox: initialize lowp float offset
386#pragma mapbox: initialize mediump float gapwidth
387#pragma mapbox: initialize mediump float width
388#pragma mapbox: initialize lowp float floorwidth
389#pragma mapbox: initialize mediump vec4 pattern_from
390#pragma mapbox: initialize mediump vec4 pattern_to
391#pragma mapbox: initialize lowp float pixel_ratio_from
392#pragma mapbox: initialize lowp float pixel_ratio_to
393float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
394#ifdef TERRAIN3D
395v_gamma_scale=1.0;
396#else
397float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
398#endif
399v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:ct(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
399uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
400#pragma mapbox: define highp vec4 color
401#pragma mapbox: define lowp float blur
402#pragma mapbox: define lowp float opacity
403#pragma mapbox: define mediump float width
404#pragma mapbox: define lowp float floorwidth
405void main() {
406#pragma mapbox: initialize highp vec4 color
407#pragma mapbox: initialize lowp float blur
408#pragma mapbox: initialize lowp float opacity
409#pragma mapbox: initialize mediump float width
410#pragma mapbox: initialize lowp float floorwidth
411float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
412#ifdef OVERDRAW_INSPECTOR
413gl_FragColor=vec4(1.0);
414#endif
415}`,`
416#define scale 0.015873016
417#define LINE_DISTANCE_SCALE 2.0
418attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
419#pragma mapbox: define highp vec4 color
420#pragma mapbox: define lowp float blur
421#pragma mapbox: define lowp float opacity
422#pragma mapbox: define mediump float gapwidth
423#pragma mapbox: define lowp float offset
424#pragma mapbox: define mediump float width
425#pragma mapbox: define lowp float floorwidth
426void main() {
427#pragma mapbox: initialize highp vec4 color
428#pragma mapbox: initialize lowp float blur
429#pragma mapbox: initialize lowp float opacity
430#pragma mapbox: initialize mediump float gapwidth
431#pragma mapbox: initialize lowp float offset
432#pragma mapbox: initialize mediump float width
433#pragma mapbox: initialize lowp float floorwidth
434float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
435#ifdef TERRAIN3D
436v_gamma_scale=1.0;
437#else
438float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
439#endif
440v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:ct(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
441#ifdef OVERDRAW_INSPECTOR
442gl_FragColor=vec4(1.0);
443#endif
444}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:ct(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
445#pragma mapbox: define lowp float opacity
446void main() {
447#pragma mapbox: initialize lowp float opacity
448lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
449#ifdef OVERDRAW_INSPECTOR
450gl_FragColor=vec4(1.0);
451#endif
452}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
453#pragma mapbox: define lowp float opacity
454void main() {
455#pragma mapbox: initialize lowp float opacity
456vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
457camera_to_anchor_distance/u_camera_to_center_distance :
458u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:ct(`#define SDF_PX 8.0
459uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
460#pragma mapbox: define highp vec4 fill_color
461#pragma mapbox: define highp vec4 halo_color
462#pragma mapbox: define lowp float opacity
463#pragma mapbox: define lowp float halo_width
464#pragma mapbox: define lowp float halo_blur
465void main() {
466#pragma mapbox: initialize highp vec4 fill_color
467#pragma mapbox: initialize highp vec4 halo_color
468#pragma mapbox: initialize lowp float opacity
469#pragma mapbox: initialize lowp float halo_width
470#pragma mapbox: initialize lowp float halo_blur
471float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);
472#ifdef OVERDRAW_INSPECTOR
473gl_FragColor=vec4(1.0);
474#endif
475}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
476#pragma mapbox: define highp vec4 fill_color
477#pragma mapbox: define highp vec4 halo_color
478#pragma mapbox: define lowp float opacity
479#pragma mapbox: define lowp float halo_width
480#pragma mapbox: define lowp float halo_blur
481void main() {
482#pragma mapbox: initialize highp vec4 fill_color
483#pragma mapbox: initialize highp vec4 halo_color
484#pragma mapbox: initialize lowp float opacity
485#pragma mapbox: initialize lowp float halo_width
486#pragma mapbox: initialize lowp float halo_blur
487vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
488camera_to_anchor_distance/u_camera_to_center_distance :
489u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:ct(`#define SDF_PX 8.0
490#define SDF 1.0
491#define ICON 0.0
492uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
493#pragma mapbox: define highp vec4 fill_color
494#pragma mapbox: define highp vec4 halo_color
495#pragma mapbox: define lowp float opacity
496#pragma mapbox: define lowp float halo_width
497#pragma mapbox: define lowp float halo_blur
498void main() {
499#pragma mapbox: initialize highp vec4 fill_color
500#pragma mapbox: initialize highp vec4 halo_color
501#pragma mapbox: initialize lowp float opacity
502#pragma mapbox: initialize lowp float halo_width
503#pragma mapbox: initialize lowp float halo_blur
504float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
504gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
505#ifdef OVERDRAW_INSPECTOR
506gl_FragColor=vec4(1.0);
507#endif
508return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
509#ifdef OVERDRAW_INSPECTOR
510gl_FragColor=vec4(1.0);
511#endif
512}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
513#pragma mapbox: define highp vec4 fill_color
514#pragma mapbox: define highp vec4 halo_color
515#pragma mapbox: define lowp float opacity
516#pragma mapbox: define lowp float halo_width
517#pragma mapbox: define lowp float halo_blur
518void main() {
519#pragma mapbox: initialize highp vec4 fill_color
520#pragma mapbox: initialize highp vec4 halo_color
521#pragma mapbox: initialize lowp float opacity
522#pragma mapbox: initialize lowp float halo_width
523#pragma mapbox: initialize lowp float halo_blur
524vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
525camera_to_anchor_distance/u_camera_to_center_distance :
526u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:ct("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",ks),terrainDepth:ct("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",ks),terrainCoords:ct("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",ks)};
vendor: 6,169 bytes, lines 526-577
526function ct(u,t){const s=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute ([\w]+) ([\w]+)/g),l=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),h=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=h?h.concat(l):l,g={};return{fragmentSource:u=u.replace(s,(y,v,w,S,M)=>(g[M]=!0,v==="define"?`
527#ifndef HAS_UNIFORM_u_${M}
528varying ${w} ${S} ${M};
529#else
530uniform ${w} ${S} u_${M};
531#endif
532`:`
533#ifdef HAS_UNIFORM_u_${M}
534    ${w} ${S} ${M} = u_${M};
535#endif
536`)),vertexSource:t=t.replace(s,(y,v,w,S,M)=>{const R=S==="float"?"vec2":"vec4",L=M.match(/color/)?"color":R;return g[M]?v==="define"?`
537#ifndef HAS_UNIFORM_u_${M}
538uniform lowp float u_${M}_t;
539attribute ${w} ${R} a_${M};
540varying ${w} ${S} ${M};
541#else
542uniform ${w} ${S} u_${M};
543#endif
544`:L==="vec4"?`
545#ifndef HAS_UNIFORM_u_${M}
546    ${M} = a_${M};
547#else
548    ${w} ${S} ${M} = u_${M};
549#endif
550`:`
551#ifndef HAS_UNIFORM_u_${M}
552    ${M} = unpack_mix_${L}(a_${M}, u_${M}_t);
553#else
554    ${w} ${S} ${M} = u_${M};
555#endif
556`:v==="define"?`
557#ifndef HAS_UNIFORM_u_${M}
558uniform lowp float u_${M}_t;
559attribute ${w} ${R} a_${M};
560#else
561uniform ${w} ${S} u_${M};
562#endif
563`:L==="vec4"?`
564#ifndef HAS_UNIFORM_u_${M}
565    ${w} ${S} ${M} = a_${M};
566#else
567    ${w} ${S} ${M} = u_${M};
568#endif
569`:`
570#ifndef HAS_UNIFORM_u_${M}
571    ${w} ${S} ${M} = unpack_mix_${L}(a_${M}, u_${M}_t);
572#else
573    ${w} ${S} ${M} = u_${M};
574#endif
575`}),staticAttributes:n,staticUniforms:m}}class ns{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,s,n,l,h,m,g,y,v){this.context=t;let w=this.boundPaintVertexBuffers.length!==l.length;for(let S=0;!w&&S<l.length;S++)this.boundPaintVertexBuffers[S]!==l[S]&&(w=!0);!this.vao||this.boundProgram!==s||this.boundLayoutVertexBuffer!==n||w||this.boundIndexBuffer!==h||this.boundVertexOffset!==m||this.boundDynamicVertexBuffer!==g||this.boundDynamicVertexBuffer2!==y||this.boundDynamicVertexBuffer3!==v?this.freshBind(s,n,l,h,m,g,y,v):(t.bindVertexArray.set(this.vao),g&&g.bind(),h&&h.dynamicDraw&&h.bind(),y&&y.bind(),v&&v.bind())}freshBind(t,s,n,l,h,m,g,y){const v=t.numAttributes,w=this.context,S=w.gl;this.vao&&this.destroy(),this.vao=w.createVertexArray(),w.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=s,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=l,this.boundVertexOffset=h,this.boundDynamicVertexBuffer=m,this.boundDynamicVertexBuffer2=g,this.boundDynamicVertexBuffer3=y,s.enableAttributes(S,t);for(const M of n)M.enableAttributes(S,t);m&&m.enableAttributes(S,t),g&&g.enableAttributes(S,t),y&&y.enableAttributes(S,t),s.bind(),s.setVertexAttribPointers(S,t,h);for(const M of n)M.bind(),M.setVertexAttribPointers(S,t,h);m&&(m.bind(),m.setVertexAttribPointers(S,t,h)),l&&l.bind(),g&&(g.bind(),g.setVertexAttribPointers(S,t,h)),y&&(y.bind(),y.setVertexAttribPointers(S,t,h)),w.currentNumAttributes=v}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function Dt(u){const t=[];for(let s=0;s<u.length;s++){if(u[s]===null)continue;const n=u[s].split(" ");t.push(n.pop())}return t}class Ea{constructor(t,s,n,l,h,m){const g=t.gl;this.program=g.createProgram();const y=Dt(s.staticAttributes),v=n?n.getBinderAttributes():[],w=y.concat(v),S=Mt.prelude.staticUniforms?Dt(Mt.prelude.staticUniforms):[],M=s.staticUniforms?Dt(s.staticUniforms):[],R=n?n.getBinderUniforms():[],L=S.concat(M).concat(R),F=[];for(const se of L)F.indexOf(se)<0&&F.push(se);const z=n?n.defines():[];h&&z.push("#define OVERDRAW_INSPECTOR;"),m&&z.push("#define TERRAIN3D;");const G=z.concat(Mt.prelude.fragmentSource,s.fragmentSource).join(`
576`),te=z.concat(Mt.prelude.vertexSource,s.vertexSource).join(`
577`),U=g.createShader(g.FRAGMENT_SHADER);if(g.isContextLost())return void(this.failedToCreate=!0);if(g.shaderSource(U,G),g.compileShader(U),!g.getShaderParameter(U,g.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${g.getShaderInfoLog(U)}`);g.attachShader(this.program,U);const W=g.createShader(g.VERTEX_SHADER);if(g.isContextLost())return void(this.failedToCreate=!0);if(g.shaderSource(W,te),g.compileShader(W),!g.getShaderParameter(W,g.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${g.getShaderInfoLog(W)}`);g.attachShader(this.program,W),this.attributes={};const re={};this.numAttributes=w.length;for(let se=0;se<this.numAttributes;se++)w[se]&&(g.bindAttribLocation(this.program,se,w[se]),this.attributes[w[se]]=se);if(g.linkProgram(this.program),!g.getProgramParameter(this.program,g.LINK_STATUS))throw new Error(`Program failed to link: ${g.getProgramInfoLog(this.program)}`);g.deleteShader(W),g.deleteShader(U);for(let se=0;se<F.length;se++){const he=F[se];if(he&&!re[he]){const ge=g.getUniformLocation(this.program,he);ge&&(re[he]=ge)}}this.fixedUniforms=l(t,re),this.terrainUniforms=((se,he)=>({u_depth:new c.aL(se,he.u_depth),u_terrain:new c.aL(se,he.u_terrain),u_terrain_dim:new c.aM(se,he.u_terrain_dim),u_terrain_matrix:new c.aN(se,he.u_terrain_matrix),u_terrain_unpack:new c.aO(se,he.u_terrain_unpack),u_terrain_exaggeration:new c.aM(se,he.u_terrain_exaggeration)}))(t,re),this.binderUniforms=n?n.getUniforms(t,re):[]}draw(t,s,n,l,h,m,g,y,v,w,S,M,R,L,F,z,G,te){const U=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(n),t.setStencilMode(l),t.setColorMode(h),t.setCullFace(m),y){t.activeTexture.set(U.TEXTURE2),U.bindTexture(U.TEXTURE_2D,y.depthTexture),t.activeTexture.set(U.TEXTURE3),U.bindTexture(U.TEXTURE_2D,y.texture);for(const re in this.terrainUniforms)this.terrainUniforms[re].set(y[re])}for(const re in this.fixedUniforms)this.fixedUniforms[re].set(g[re]);F&&F.setUniforms(t,this.binderUniforms,R,{zoom:L});let W=0;switch(s){case U.LINES:W=2;break;case U.TRIANGLES:W=3;break;case U.LINE_STRIP:W=1}for(const re of M.get()){const se=re.vaos||(re.vaos={});(se[v]||(se[v]=new ns)).bind(t,this,w,F?F.getPaintVertexBuffers():[],S,re.vertexOffset,z,G,te),U.drawElements(s,re.primitiveLength*W,U.UNSIGNED_SHORT,re.primitiveOffset*W*2)}}}function Ji(u,t,s){const n=1/Z(s,1,t.transform.tileZoom),l=Math.pow(2,s.tileID.overscaledZ
577),h=s.tileSize*Math.pow(2,t.transform.tileZoom)/l,m=h*(s.tileID.canonical.x+s.tileID.wrap*l),g=h*s.tileID.canonical.y;return{u_image:0,u_texsize:s.imageAtlasTexture.size,u_scale:[n,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[m>>16,g>>16],u_pixel_coord_lower:[65535&m,65535&g]}}const pn=(u,t,s,n)=>{const l=t.style.light,h=l.properties.get("position"),m=[h.x,h.y,h.z],g=function(){var v=new c.A(9);return c.A!=Float32Array&&(v[1]=0,v[2]=0,v[3]=0,v[5]=0,v[6]=0,v[7]=0),v[0]=1,v[4]=1,v[8]=1,v}();l.properties.get("anchor")==="viewport"&&function(v,w){var S=Math.sin(w),M=Math.cos(w);v[0]=M,v[1]=S,v[2]=0,v[3]=-S,v[4]=M,v[5]=0,v[6]=0,v[7]=0,v[8]=1}(g,-t.transform.angle),function(v,w,S){var M=w[0],R=w[1],L=w[2];v[0]=M*S[0]+R*S[3]+L*S[6],v[1]=M*S[1]+R*S[4]+L*S[7],v[2]=M*S[2]+R*S[5]+L*S[8]}(m,m,g);const y=l.properties.get("color");return{u_matrix:u,u_lightpos:m,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[y.r,y.g,y.b],u_vertical_gradient:+s,u_opacity:n}},qr=(u,t,s,n,l,h,m)=>c.e(pn(u,t,s,n),Ji(h,t,m),{u_height_factor:-Math.pow(2,l.overscaledZ)/m.tileSize/8}),bo=u=>({u_matrix:u}),fn=(u,t,s,n)=>c.e(bo(u),Ji(s,t,n)),Ma=(u,t)=>({u_matrix:u,u_world:t}),Ca=(u,t,s,n,l)=>c.e(fn(u,t,s,n),{u_world:l}),Zr=(u,t,s,n)=>{const l=u.transform;let h,m;if(n.paint.get("circle-pitch-alignment")==="map"){const g=Z(s,1,l.zoom);h=!0,m=[g,g]}else h=!1,m=l.pixelsToGLUnits;return{u_camera_to_center_distance:l.cameraToCenterDistance,u_scale_with_map:+(n.paint.get("circle-pitch-scale")==="map"),u_matrix:u.translatePosMatrix(t.posMatrix,s,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+h,u_device_pixel_ratio:u.pixelRatio,u_extrude_scale:m}},mn=(u,t,s)=>{const n=Z(s,1,t.zoom),l=Math.pow(2,t.zoom-s.tileID.overscaledZ),h=s.tileID.overscaleFactor();return{u_matrix:u,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[t.pixelsToGLUnits[0]/(n*l),t.pixelsToGLUnits[1]/(n*l)],u_overscale_factor:h}},ea=(u,t,s=1)=>({u_matrix:u,u_color:t,u_overlay:0,u_overlay_scale:s}),wo=u=>({u_matrix:u}),Pl=(u,t,s,n)=>({u_matrix:u,u_extrude_scale:Z(t,1,s),u_intensity:n});function gn(u,t){const s=Math.pow(2,t.canonical.z),n=t.canonical.y;return[new c.U(0,n/s).toLngLat().lat,new c.U(0,(n+1)/s).toLngLat().lat]}const _n=(u,t,s,n)=>{const l=u.transform;return{u_matrix:Pa(u,t,s,n),u_ratio:1/Z(t,1,l.zoom),u_device_pixel_ratio:u.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},So=(u,t,s,n,l)=>c.e(_n(u,t,s,l),{u_image:0,u_image_height:n}),kl=(u,t,s,n,l)=>{const h=u.transform,m=Io(t,h);return{u_matrix:Pa(u,t,s,l),u_texsize:t.imageAtlasTexture.size,u_ratio:1/Z(t,1,h.zoom),u_device_pixel_ratio:u.pixelRatio,u_image:0,u_scale:[m,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]]}},To=(u,t,s,n,l,h)=>{const m=u.lineAtlas,g=Io(t,u.transform),y=s.layout.get("line-cap")==="round",v=m.getDash(n.from,y),w=m.getDash(n.to,y),S=v.width*l.fromScale,M=w.width*l.toScale;return c.e(_n(u,t,s,h),{u_patternscale_a:[g/S,-v.height/2],u_patternscale_b:[g/M,-w.height/2],u_sdfgamma:m.width/(256*Math.min(S,M)*u.pixelRatio)/2,u_image:0,u_tex_y_a:v.y,u_tex_y_b:w.y,u_mix:l.t})};function Io(u,t){return 1/Z(u,1,t.tileZoom)}function Pa(u,t,s,n){return u.translatePosMatrix(n?n.posMatrix:t.tileID.posMatrix,t,s.paint.get("line-translate"),s.paint.get("line-translate-anchor"))}const Ao=(u,t,s,n,l)=>{return{u_matrix:u,u_tl_parent:t,u_scale_parent:s,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*l.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:l.paint.get("raster-brightness-min"),u_brightness_high:l.paint.get("raster-brightness-max"),u_saturation_factor:(m=l.paint.get("raster-saturation"),m>0?1-1/(1.001-m):-m),u_contrast_factor:(h=l.paint.get("raster-contrast"),h>0?1/(1-h):1+h),u_spin_weights:Eo(l.paint.get("raster-hue-rotate"))};var h,m};function Eo(u){u*=Math.PI/180;const t=Math.sin(u),s=Math.cos(u);return[(2*s+1)/3,(-Math.sqrt(3)*t-s+1)/3,(Math.sqrt(3)*t-s+1)/3]}const yn=(u,t,s,n,l,h,m,g,y,v)=>{const w=l.transform;return{u_is_size_zoom_constant:+(u==="constant"||u==="source"),u_is_size_feature_constant:+(u==="constant"||u==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:w.cameraToCenterDistance,u_pitch:w.pitch/360*2*Math.PI,u_rotate_symbol:+s,u_aspect_ratio:w.width/w.height,u_fade_change:l.options.fadeDuration?l.symbolFadeChange:1,u_matrix:h,u_label_plane_matrix:m,u_coord_matrix:g,u_is_text:+y,u_pitch_with_map:+n,u_texsize:v,u_texture:0}},xn=(u,t,s,n,l,h,m,g,y,v,w)=>{const S=l.transform;return c.e(yn(u,t,s,n,l,h,m,g,y,v),{u_gamma_scale:n?Math.cos(S._pitch)*S.cameraToCenterDistance:1,u_device_pixel_ratio:l.pixelRatio,u_is_halo:1})},os=(u,t,s,n,l,h,m,g,y,v)=>c.e(xn(u,t,s,n,l,h,m,g,!0,y),{u_texsize_icon:v,u_texture_icon:1}),ka=(u,t,s)=>({u_matrix:u,u_opacity:t,u_color:s}),Qi=(u,t,s,n,l,h)=>c.e(function(m,g,y,v){const w=y.imageManager.getPattern(m.from.toString()),S=y.imageManager.getPattern(m.to.toString()),{width:M,height:R}=y.imageManager.getPixelSize(),L=Math.pow(2,v.tileID.overscaledZ
vendor: 4,339 bytes, line 577
577),F=v.tileSize*Math.pow(2,y.transform.tileZoom)/L,z=F*(v.tileID.canonical.x+v.tileID.wrap*L),G=F*v.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:w.tl,u_pattern_br_a:w.br,u_pattern_tl_b:S.tl,u_pattern_br_b:S.br,u_texsize:[M,R],u_mix:g.t,u_pattern_size_a:w.displaySize,u_pattern_size_b:S.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/Z(v,1,y.transform.tileZoom),u_pixel_coord_upper:[z>>16,G>>16],u_pixel_coord_lower:[65535&z,65535&G]}}(n,h,s,l),{u_matrix:u,u_opacity:t}),za={fillExtrusion:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_lightpos:new c.aP(u,t.u_lightpos),u_lightintensity:new c.aM(u,t.u_lightintensity),u_lightcolor:new c.aP(u,t.u_lightcolor),u_vertical_gradient:new c.aM(u,t.u_vertical_gradient),u_opacity:new c.aM(u,t.u_opacity)}),fillExtrusionPattern:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_lightpos:new c.aP(u,t.u_lightpos),u_lightintensity:new c.aM(u,t.u_lightintensity),u_lightcolor:new c.aP(u,t.u_lightcolor),u_vertical_gradient:new c.aM(u,t.u_vertical_gradient),u_height_factor:new c.aM(u,t.u_height_factor),u_image:new c.aL(u,t.u_image),u_texsize:new c.aQ(u,t.u_texsize),u_pixel_coord_upper:new c.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(u,t.u_pixel_coord_lower),u_scale:new c.aP(u,t.u_scale),u_fade:new c.aM(u,t.u_fade),u_opacity:new c.aM(u,t.u_opacity)}),fill:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix)}),fillPattern:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_image:new c.aL(u,t.u_image),u_texsize:new c.aQ(u,t.u_texsize),u_pixel_coord_upper:new c.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(u,t.u_pixel_coord_lower),u_scale:new c.aP(u,t.u_scale),u_fade:new c.aM(u,t.u_fade)}),fillOutline:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_world:new c.aQ(u,t.u_world)}),fillOutlinePattern:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_world:new c.aQ(u,t.u_world),u_image:new c.aL(u,t.u_image),u_texsize:new c.aQ(u,t.u_texsize),u_pixel_coord_upper:new c.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(u,t.u_pixel_coord_lower),u_scale:new c.aP(u,t.u_scale),u_fade:new c.aM(u,t.u_fade)}),circle:(u,t)=>({u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_scale_with_map:new c.aL(u,t.u_scale_with_map),u_pitch_with_map:new c.aL(u,t.u_pitch_with_map),u_extrude_scale:new c.aQ(u,t.u_extrude_scale),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_matrix:new c.aN(u,t.u_matrix)}),collisionBox:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_pixels_to_tile_units:new c.aM(u,t.u_pixels_to_tile_units),u_extrude_scale:new c.aQ(u,t.u_extrude_scale),u_overscale_factor:new c.aM(u,t.u_overscale_factor)}),collisionCircle:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_inv_matrix:new c.aN(u,t.u_inv_matrix),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_viewport_size:new c.aQ(u,t.u_viewport_size)}),debug:(u,t)=>({u_color:new c.aR(u,t.u_color),u_matrix:new c.aN(u,t.u_matrix),u_overlay:new c.aL(u,t.u_overlay),u_overlay_scale:new c.aM(u,t.u_overlay_scale)}),clippingMask:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix)}),heatmap:(u,t)=>({u_extrude_scale:new c.aM(u,t.u_extrude_scale),u_intensity:new c.aM(u,t.u_intensity),u_matrix:new c.aN(u,t.u_matrix)}),heatmapTexture:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_world:new c.aQ(u,t.u_world),u_image:new c.aL(u,t.u_image),u_color_ramp:new c.aL(u,t.u_color_ramp),u_opacity:new c.aM(u,t.u_opacity)}),hillshade:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_image:new c.aL(u,t.u_image),u_latrange:new c.aQ(u,t.u_latrange),u_light:new c.aQ(u,t.u_light),u_shadow:new c.aR(u,t.u_shadow),u_highlight:new c.aR(u,t.u_highlight),u_accent:new c.aR(u,t.u_accent)}),hillshadePrepare:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_image:new c.aL(u,t.u_image),u_dimension:new c.aQ(u,t.u_dimension),u_zoom:new c.aM(u,t.u_zoom),u_unpack:new c.aO(u,t.u_unpack)}),line:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_ratio:new c.aM(u,t.u_ratio),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(u,t.u_units_to_pixels)}),lineGradient:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_ratio:new c.aM(u,t.u_ratio),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(u,t.u_units_to_pixels),u_image:new c.aL(u,t.u_image),u_image_height:new c.aM(u,t.u_image_height)}),linePattern:(u,t)=>
vendor: 18,112 bytes, line 577
577({u_matrix:new c.aN(u,t.u_matrix),u_texsize:new c.aQ(u,t.u_texsize),u_ratio:new c.aM(u,t.u_ratio),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_image:new c.aL(u,t.u_image),u_units_to_pixels:new c.aQ(u,t.u_units_to_pixels),u_scale:new c.aP(u,t.u_scale),u_fade:new c.aM(u,t.u_fade)}),lineSDF:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_ratio:new c.aM(u,t.u_ratio),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(u,t.u_units_to_pixels),u_patternscale_a:new c.aQ(u,t.u_patternscale_a),u_patternscale_b:new c.aQ(u,t.u_patternscale_b),u_sdfgamma:new c.aM(u,t.u_sdfgamma),u_image:new c.aL(u,t.u_image),u_tex_y_a:new c.aM(u,t.u_tex_y_a),u_tex_y_b:new c.aM(u,t.u_tex_y_b),u_mix:new c.aM(u,t.u_mix)}),raster:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_tl_parent:new c.aQ(u,t.u_tl_parent),u_scale_parent:new c.aM(u,t.u_scale_parent),u_buffer_scale:new c.aM(u,t.u_buffer_scale),u_fade_t:new c.aM(u,t.u_fade_t),u_opacity:new c.aM(u,t.u_opacity),u_image0:new c.aL(u,t.u_image0),u_image1:new c.aL(u,t.u_image1),u_brightness_low:new c.aM(u,t.u_brightness_low),u_brightness_high:new c.aM(u,t.u_brightness_high),u_saturation_factor:new c.aM(u,t.u_saturation_factor),u_contrast_factor:new c.aM(u,t.u_contrast_factor),u_spin_weights:new c.aP(u,t.u_spin_weights)}),symbolIcon:(u,t)=>({u_is_size_zoom_constant:new c.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(u,t.u_is_size_feature_constant),u_size_t:new c.aM(u,t.u_size_t),u_size:new c.aM(u,t.u_size),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_pitch:new c.aM(u,t.u_pitch),u_rotate_symbol:new c.aL(u,t.u_rotate_symbol),u_aspect_ratio:new c.aM(u,t.u_aspect_ratio),u_fade_change:new c.aM(u,t.u_fade_change),u_matrix:new c.aN(u,t.u_matrix),u_label_plane_matrix:new c.aN(u,t.u_label_plane_matrix),u_coord_matrix:new c.aN(u,t.u_coord_matrix),u_is_text:new c.aL(u,t.u_is_text),u_pitch_with_map:new c.aL(u,t.u_pitch_with_map),u_texsize:new c.aQ(u,t.u_texsize),u_texture:new c.aL(u,t.u_texture)}),symbolSDF:(u,t)=>({u_is_size_zoom_constant:new c.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(u,t.u_is_size_feature_constant),u_size_t:new c.aM(u,t.u_size_t),u_size:new c.aM(u,t.u_size),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_pitch:new c.aM(u,t.u_pitch),u_rotate_symbol:new c.aL(u,t.u_rotate_symbol),u_aspect_ratio:new c.aM(u,t.u_aspect_ratio),u_fade_change:new c.aM(u,t.u_fade_change),u_matrix:new c.aN(u,t.u_matrix),u_label_plane_matrix:new c.aN(u,t.u_label_plane_matrix),u_coord_matrix:new c.aN(u,t.u_coord_matrix),u_is_text:new c.aL(u,t.u_is_text),u_pitch_with_map:new c.aL(u,t.u_pitch_with_map),u_texsize:new c.aQ(u,t.u_texsize),u_texture:new c.aL(u,t.u_texture),u_gamma_scale:new c.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_is_halo:new c.aL(u,t.u_is_halo)}),symbolTextAndIcon:(u,t)=>({u_is_size_zoom_constant:new c.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(u,t.u_is_size_feature_constant),u_size_t:new c.aM(u,t.u_size_t),u_size:new c.aM(u,t.u_size),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_pitch:new c.aM(u,t.u_pitch),u_rotate_symbol:new c.aL(u,t.u_rotate_symbol),u_aspect_ratio:new c.aM(u,t.u_aspect_ratio),u_fade_change:new c.aM(u,t.u_fade_change),u_matrix:new c.aN(u,t.u_matrix),u_label_plane_matrix:new c.aN(u,t.u_label_plane_matrix),u_coord_matrix:new c.aN(u,t.u_coord_matrix),u_is_text:new c.aL(u,t.u_is_text),u_pitch_with_map:new c.aL(u,t.u_pitch_with_map),u_texsize:new c.aQ(u,t.u_texsize),u_texsize_icon:new c.aQ(u,t.u_texsize_icon),u_texture:new c.aL(u,t.u_texture),u_texture_icon:new c.aL(u,t.u_texture_icon),u_gamma_scale:new c.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_is_halo:new c.aL(u,t.u_is_halo)}),background:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_opacity:new c.aM(u,t.u_opacity),u_color:new c.aR(u,t.u_color)}),backgroundPattern:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_opacity:new c.aM(u,t.u_opacity),u_image:new c.aL(u,t.u_image),u_pattern_tl_a:new c.aQ(u,t.u_pattern_tl_a),u_pattern_br_a:new c.aQ(u,t.u_pattern_br_a),u_pattern_tl_b:new c.aQ(u,t.u_pattern_tl_b),u_pattern_br_b:new c.aQ(u,t.u_pattern_br_b),u_texsize:new c.aQ(u,t.u_texsize),u_mix:new c.aM(u,t.u_mix),u_pattern_size_a:new c.aQ(u,t.u_pattern_size_a),u_pattern_size_b:new c.aQ(u,t.u_pattern_size_b),u_scale_a:new c.aM(u,t.u_scale_a),u_scale_b:new c.aM(u,t.u_scale_b),u_pixel_coord_upper:new c.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(u,t.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aM(u,t.u_tile_units_to_pixels)}),terrain:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_texture:new c.aL(u,t.u_texture),u_ele_delta:new c.aM(u,t.u_ele_delta)}),terrainDepth:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_ele_delta:new c.aM(u,t.u_ele_delta)}),terrainCoords:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_texture:new c.aL(u,t.u_texture),u_terrain_coords_id:new c.aM(u,t.u_terrain_coords_id),u_ele_delta:new c.aM(u,t.u_ele_delta)})};class Da{constructor(t,s,n){this.context=t;const l=t.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const s=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),s.bufferSubData(s.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const ta={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class La{constructor(t,s,n,l){this.length=s.length,this.attributes=n,this.itemSize=s.bytesPerElement,this.dynamicDraw=l,this.context=t;const h=t.gl;this.buffer=h.createBuffer(),t.bindVertexBuffer.set(this.buffer),h.bufferData(h.ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?h.DYNAMIC_DRAW:h.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const s=this.context.gl;this.bind(),s.bufferSubData(s.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,s){for(let n=0;n<this.attributes.length;n++){const l=s.attributes[this.attributes[n].name];l!==void 0&&t.enableVertexAttribArray(l)}}setVertexAttribPointers(t,s,n){for(let l=0;l<this.attributes.length;l++){const h=this.attributes[l],m=s.attributes[h.name];m!==void 0&&t.vertexAttribPointer(m,h.components,t[ta[h.type]],!1,this.itemSize,h.offset+this.itemSize*(n||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const zs=new WeakMap;function Gr(u){var t;if(zs.has(u))return zs.get(u);{const s=(t=u.getParameter(u.VERSION))===null||t===void 0?void 0:t.startsWith("WebGL 2.0");return zs.set(u,s),s}}class rt{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Ra extends rt{getDefault(){return c.aT.transparent}set(t){const s=this.current;(t.r!==s.r||t.g!==s.g||t.b!==s.b||t.a!==s.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Oi extends rt{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Vi extends rt{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class vn extends rt{getDefault(){return[!0,!0,!0,!0]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||t[2]!==s[2]||t[3]!==s[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ba extends rt{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Fa extends rt{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class bn extends rt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const s=this.current;(t.func!==s.func||t.ref!==s.ref||t.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class wn extends rt{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||t[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Oa extends rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;t?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=t,this.dirty=!1}}class Sn extends rt{getDefault(){return[0,1]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Tn extends rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;t?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=t,this.dirty=!1}}class Va extends rt{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class Mo extends rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;t?s.enable(s.BLEND):s.disable(s.BLEND),this.current=t,this.dirty=!1}}class Co extends rt{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class Ds extends rt{getDefault(){return c.aT.transparent}set(t){const s=this.current;(t.r!==s.r||t.g!==s.g||t.b!==s.b||t.a!==s.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class zl extends rt{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Dl extends rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;t?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=t,this.dirty=!1}}class Ll extends rt{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Rl extends rt{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class Bl extends rt{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class Fl extends rt{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class In extends rt{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||t[2]!==s[2]||t[3]!==s[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Na extends rt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class An extends rt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class En extends rt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.bindTexture(s.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Ls extends rt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Po extends rt{getDefault(){return null}set(t){const s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class ko extends rt{getDefault(){return null}set(t){var s;if(t===this.current&&!this.dirty)return;const n=this.gl;Gr(n)?n.bindVertexArray(t):(s=n.getExtension("OES_vertex_array_object"))===null||s===void 0||s.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Mn extends rt{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class ls extends rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class zo extends rt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Wr extends rt{constructor(t,s){super(t),this.context=t,this.parent=s}getDefault(){return null}}class Rs extends Wr{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Do extends Wr{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Cn extends Wr{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class ut{constructor(t,s,n,l,h){this.context=t,this.width=s,this.height=n;const m=t.gl,g=this.framebuffer=m.createFramebuffer();if(this.colorAttachment=new Rs(t,g),l)this.depthAttachment=h?new Cn(t,g):new Do(t,g);else if(h)throw new Error("Stencil cannot be setted without depth");if(m.checkFramebufferStatus(m.FRAMEBUFFER)!==m.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const t=this.context.gl,s=this.colorAttachment.get();if(s&&t.deleteTexture(s),this.depthAttachment){const n=this.depthAttachment.get();n&&t.deleteRenderbuffer(n)}t.deleteFramebuffer(this.framebuffer)}}class Ct{constructor(t,s,n){this.blendFunction=t,this.blendColor=s,this.mask=n}}Ct.Replace=[1,0],Ct.disabled=new Ct(Ct.Replace,c.aT.transparent,[!1,!1,!1,!1]),Ct.unblended=new Ct(Ct.Replace,c.aT.transparent,[!0,!0,!0,!0]),Ct.alphaBlended=new Ct([1,771],c.aT.transparent,[!0,!0,!0,!0]);class Ol{constructor(t){var s,n;if(this.gl=t,this.clearColor=new Ra(this),this.clearDepth=new Oi(this),this.clearStencil=new Vi(this),this.colorMask=new vn(this),this.depthMask=new Ba(this),this.stencilMask=new Fa(this),this.stencilFunc=new bn(this),this.stencilOp=new wn(this),this.stencilTest=new Oa(this),this.depthRange=new Sn(this),this.depthTest=new Tn(this),this.depthFunc=new Va(this),this.blend=new Mo(this),this.blendFunc=new Co(this),this.blendColor=new Ds(this),this.blendEquation=new zl(this),this.cullFace=new Dl(this),this.cullFaceSide=new Ll(this),this.frontFace=new Rl(this),this.program=new Bl(this),this.activeTexture=new Fl(this),this.viewport=new In(this),this.bindFramebuffer=new Na(this),this.bindRenderbuffer=new An(this),this.bindTexture=new En(this),this.bindVertexBuffer=new Ls(this),this.bindElementBuffer=new Po(this),this.bindVertexArray=new ko(this),this.pixelStoreUnpack=new Mn(this),this.pixelStoreUnpackPremultiplyAlpha=new ls(this),this.pixelStoreUnpackFlipY=new zo(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Gr(t)){this.HALF_FLOAT=t.HALF_FLOAT;const l=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(s=t.RGBA16F)!==null&&s!==void 0?s:l?.RGBA16F_EXT,this.RGB16F=(n=t.RGB16F)!==null&&n!==void 0?n:l?.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const l=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=l?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,s){return new Da(this,t,s)}
577createVertexBuffer(t,s,n){return new La(this,t,s,n)}createRenderbuffer(t,s,n){const l=this.gl,h=l.createRenderbuffer();return this.bindRenderbuffer.set(h),l.renderbufferStorage(l.RENDERBUFFER,t,s,n),this.bindRenderbuffer.set(null),h}createFramebuffer(t,s,n,l){return new ut(this,t,s,n,l)}clear({color:t,depth:s,stencil:n}){const l=this.gl;let h=0;t&&(h|=l.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),s!==void 0&&(h|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(s),this.depthMask.set(!0)),n!==void 0&&(h|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),l.clear(h)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){c.aG(t.blendFunction,Ct.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Gr(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var s;return Gr(this.gl)?this.gl.deleteVertexArray(t):(s=this.gl.getExtension("OES_vertex_array_object"))===null||s===void 0?void 0:s.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class st{constructor(t,s,n){this.func=t,this.mask=s,this.range=n}}st.ReadOnly=!1,st.ReadWrite=!0,st.disabled=new st(519,st.ReadOnly,[0,1]);const cs=7680;class Pt{constructor(t,s,n,l,h,m){this.test=t,this.ref=s,this.mask=n,this.fail=l,this.depthFail=h,this.pass=m}}Pt.disabled=new Pt({func:519,mask:0},0,0,cs,cs,cs);class It{constructor(t,s,n){this.enable=t,this.mode=s,this.frontFace=n}}let ia;function Lo(u,t,s,n,l,h,m){const g=u.context,y=g.gl,v=u.useProgram("collisionBox"),w=[];let S=0,M=0;for(let U=0;U<n.length;U++){const W=n[U],re=t.getTile(W),se=re.getBucket(s);if(!se)continue;let he=W.posMatrix;l[0]===0&&l[1]===0||(he=u.translatePosMatrix(W.posMatrix,re,l,h));const ge=m?se.textCollisionBox:se.iconCollisionBox,fe=se.collisionCircleArray;if(fe.length>0){const ye=c.Z(),De=he;c.aU(ye,se.placementInvProjMatrix,u.transform.glCoordMatrix),c.aU(ye,ye,se.placementViewportMatrix),w.push({circleArray:fe,circleOffset:M,transform:De,invTransform:ye,coord:W}),S+=fe.length/4,M=S}ge&&v.draw(g,y.LINES,st.disabled,Pt.disabled,u.colorModeForRenderPass(),It.disabled,mn(he,u.transform,re),u.style.map.terrain&&u.style.map.terrain.getTerrainData(W),s.id,ge.layoutVertexBuffer,ge.indexBuffer,ge.segments,null,u.transform.zoom,null,null,ge.collisionVertexBuffer)}if(!m||!w.length)return;const R=u.useProgram("collisionCircle"),L=new c.aV;L.resize(4*S),L._trim();let F=0;for(const U of w)for(let W=0;W<U.circleArray.length/4;W++){const re=4*W,se=U.circleArray[re+0],he=U.circleArray[re+1],ge=U.circleArray[re+2],fe=U.circleArray[re+3];L.emplace(F++,se,he,ge,fe,0),L.emplace(F++,se,he,ge,fe,1),L.emplace(F++,se,he,ge,fe,2),L.emplace(F++,se,he,ge,fe,3)}(!ia||ia.length<2*S)&&(ia=function(U){const W=2*U,re=new c.aX;re.resize(W),re._trim();for(let se=0;se<W;se++){const he=6*se;re.uint16[he+0]=4*se+0,re.uint16[he+1]=4*se+1,re.uint16[he+2]=4*se+2,re.uint16[he+3]=4*se+2,re.uint16[he+4]=4*se+3,re.uint16[he+5]=4*se+0}return re}(S));const z=g.createIndexBuffer(ia,!0),G=g.createVertexBuffer(L,c.aW.members,!0);for(const U of w){const W={u_matrix:U.transform,u_inv_matrix:U.invTransform,u_camera_to_center_distance:(te=u.transform).cameraToCenterDistance,u_viewport_size:[te.width,te.height]};R.draw(g,y.TRIANGLES,st.disabled,Pt.disabled,u.colorModeForRenderPass(),It.disabled,W,u.style.map.terrain&&u.style.map.terrain.getTerrainData(U.coord),s.id,G,z,c.S.simpleSegment(0,2*U.circleOffset,U.circleArray.length,U.circleArray.length/2),null,u.transform.zoom,null,null,null)}var te;G.destroy(),z.destroy()}It.disabled=new It(!1,1029,2305),It.backCCW=new It(!0,1029,2305);const Pn=c.ao(new Float32Array(16));function Ua(u,t,s,n,l,h){const{horizontalAlign:m,verticalAlign:g}=c.au(u);return new c.P((-(m-.5)*t/l+n[0])*h,(-(g-.5)*s/l+n[1])*h)}function $a(u,t,s,n,l,h,m,g,y,v,w){const S=u.text.placedSymbolArray,M=u.text.dynamicLayoutVertexArray,R=u.icon.dynamicLayoutVertexArray,L={};M.clear();for(let F=0;F<S.length;F++){const z=S.get(F),G=z.hidden||!z.crossTileID||u.allowVerticalPlacement&&!z.placedOrientation?null:n[z.crossTileID];if(G){const te=new c.P(z.anchorX,z.anchorY),U=zt(te,s?m:h,w),W=as(l.cameraToCenterDistance,U.signedDistanceFromCamera);let re=c.aj(u.textSizeData,y,z)*W/c.ap;s&&(re*=u.tilePixelRatio/g);const{width:se,height:he,anchor:ge,textOffset:fe,textBoxScale:ye}=G,De=Ua(ge,se,he,fe,ye,re),et=s?zt(te.add(De),h,w).point:U.point.add(t?De.rotate(-l.angle):De),Te=u.allowVerticalPlacement&&z.placedOrientation===c.ai.vertical?Math.PI/2:0;for(let je=0;je<z.numGlyphs;je++)c.ak(M,et,Te);v&&z.associatedIconIndex>=0&&(L[z.associatedIconIndex]={shiftedAnchor:et,angle:Te})}else k(z.numGlyphs,M)}if(v){R.clear();const F=u.icon.placedSymbolArray;for(let z=0;z<F.length;z++){const G=F.get(z);if(G.hidden)k(G.numGlyphs,R);else{const te=L[z];if(te)for(let U=0;U<G.numGlyphs;U++)c.ak(R,te.shiftedAnchor,te.angle);else k(G.numGlyphs,R)}}u.icon.dynamicLayoutVertexBuffer.updateData(R)}u.text.dynamicLayoutVertexBuffer.updateData(M)}function kn(u,t,s){return s.iconsInText&&t?"symbolTextAndIcon":u?"symbolSDF":"symbolIcon"}function ja(u,t,s,n,l,h,m,g,y,v,w,S){const M=u.context,R=M.gl,L=u.transform,F=g==="map",z=y==="map",G=g!=="viewport"&&s.layout.get("symbol-placement")!=="point",te=F&&!z&&!G,U=!s.layout.get("symbol-sort-key").isConstant();let W=!1;const re=u.depthModeForSublayer(0,st.ReadOnly),se=s._unevaluatedLayout.hasValue("text-variable-anchor")||s._unevaluatedLayout.hasValue("text-variable-anchor-offset"),he=[];for(const ge of n){const fe=t.getTile(ge),ye=fe.getBucket(s);if(!ye)continue;const De=l?ye.text:ye.icon;if(!De||!De.segments.get().length||!De.hasVisibleVertices)continue;const et=De.programConfigurations.get(s.id),Te=l||ye.sdfIcons,je=l?ye.textSizeData:ye.iconSizeData,Re=z||L.pitch!==0,ft=u.useProgram(kn(Te,l,ye),et),Qe=c.ah(je,L.zoom),Xe=u.style.map.terrain&&u.style.map.terrain.getTerrainData(ge);let tt,Bt,vt,oi,Ht=[0,0],Ut=null;if(l)Bt=fe.glyphAtlasTexture,vt=R.LINEAR,tt=fe.glyphAtlasTexture.size,ye.iconsInText&&(Ht=fe.imageAtlasTexture.size,Ut=fe.imageAtlasTexture,oi=Re||u.options.rotating||u.options.zooming||je.kind==="composite"||je.kind==="camera"?R.LINEAR:R.NEAREST);else{const Ft=s.layout.get("icon-size").constantOr(0)!==1||ye.iconsNeedLinear;Bt=fe.imageAtlasTexture,vt=Te||u.options.rotating||u.options.zooming||Ft||Re?R.LINEAR:R.NEAREST,tt=fe.imageAtlasTexture.size}const $i=Z(fe,1,u.transform.zoom),St=be(ge.posMatrix,z,F,u.transform,$i),gr=pr(ge.posMatrix,z,F,u.transform,$i),_r=se&&ye.hasTextData(),Yr=s.layout.get("icon-text-fit")!=="none"&&_r&&ye.hasIconData();if(G){const Ft=u.style.map.terrain?(Pi,Ot)=>u.style.map.terrain.getElevation(ge,Pi,Ot):null,Xt=s.layout.get("text-rotation-alignment")==="map";Se(ye,ge.posMatrix,u,l,St,gr,z,v,Xt,Ft)}const fs=u.translatePosMatrix(ge.posMatrix,fe,h,m),$s=G||l&&se||Yr?Pn:St,di=u.translatePosMatrix(gr,fe,h,m,!0),li=Te&&s.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let vi;vi=Te?ye.iconsInText?os(je.kind,Qe,te,z,u,fs,$s,di,tt,Ht):xn(je.kind,Qe,te,z,u,fs,$s,di,l,tt):yn(je.kind,Qe,te,z,u,fs,$s,di,l,tt);const ms={program:ft,buffers:De,uniformValues:vi,atlasTexture:Bt,atlasTextureIcon:Ut,atlasInterpolation:vt,atlasInterpolationIcon:oi,isSDF:Te,hasHalo:li};if(U&&ye.canOverlap){W=!0;const Ft=De.segments.get();for(const Xt of Ft)he.push({segments:new c.S([Xt]),sortKey:Xt.sortKey,state:ms,terrainData:Xe})}else he.push({segments:De.segments,sortKey:0,state:ms,terrainData:Xe})}W&&he.sort((ge,fe)=>ge.sortKey-fe.sortKey);for(const ge of he){const fe=ge.state;if(M.activeTexture.set(R.TEXTURE0),fe.atlasTexture.bind(fe.atlasInterpolation,R.CLAMP_TO_EDGE),fe.atlasTextureIcon&&(M.activeTexture.set(R.TEXTURE1),fe.atlasTextureIcon&&fe.atlasTextureIcon.bind(fe.atlasInterpolationIcon,R.CLAMP_TO_EDGE)),fe.isSDF){const ye=fe.uniformValues;fe.hasHalo&&(ye.u_is_halo=1,zn(fe.buffers,ge.segments,s,u,fe.program,re,w,S,ye,ge.terrainData)),ye.u_is_halo=0}zn(fe.buffers,ge.segments,s,u,fe.program,re,w,S,fe.uniformValues,ge.terrainData)}}function zn(u,t,s,n,l,h,m,g,y,v){const w=n.context;l.draw(w,w.gl.TRIANGLES,h,m,g,It.disabled,y,v,s.id,u.layoutVertexBuffer,u.indexBuffer,t,s.paint,n.transform.zoom,u.programConfigurations.get(s.id),u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer)}function ra(u,t,s,n,l){if(!s||!n||!n.imageAtlas)return;const h=n.imageAtlas.patternPositions;let m=h[s.to.toString()],g=h[s.from.toString()];if(!m&&g&&(m=g),!g&&m&&(g=m),!m||!g){const y=l.getPaintProperty(t);m=h[y],g=h[y]}m&&g&&u.setConstantPatternPositions(m,g)}function sa(u,t,s,n,l,h,m){const g=u.context.gl,y="fill-pattern",v=s.paint.get(y),w=v&&v.constantOr(1),S=s.getCrossfadeParameters();let M,R,L,F,z;m?(R=w&&!s.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",M=g.LINES):(R=w?"fillPattern":"fill",M=g.TRIANGLES);const G=v.constantOr(null);for(const te of n){const U=t.getTile(te);if(w&&!U.patternsLoaded())continue;const W=U.getBucket(s);if(!W)continue;const re=W.programConfigurations.get(s.id),se=u.useProgram(R,re),he=u.style.map.terrain&&u.style.map.terrain.getTerrainData(te);w&&(u.context.activeTexture.set(g.TEXTURE0),U.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),re.updatePaintBuffers(S)),ra(re,y,G,U,s);const ge=he?te:null,fe=u.translatePosMatrix(ge?ge.posMatrix:te.posMatrix,U,s.paint.get("fill-translate"),s.paint.get("fill-translate-anchor"));if(m){F=W.indexBuffer2,z=W.segments2;const ye=[g.drawingBufferWidth,g.drawingBufferHeight];L=R==="fillOutlinePattern"&&w?Ca(fe,u,S,U,ye):Ma(fe,ye)}else F=W.indexBuffer,z=W.segments,L=w?fn(fe,u,S,U):bo(fe);se.draw(u.context,M,l,u.stencilModeForClipping(te),h,It.disabled,L,he,s.id,W.layoutVertexBuffer,F,z,s.paint,u.transform.zoom,re)}}function aa(u,t,s,n,l,h,m){const g=u.context,y=g.gl,v="fill-extrusion-pattern",w=s.paint.get(v),S=w.
vendor: 8,909 bytes, line 577
577constantOr(1),M=s.getCrossfadeParameters(),R=s.paint.get("fill-extrusion-opacity"),L=w.constantOr(null);for(const F of n){const z=t.getTile(F),G=z.getBucket(s);if(!G)continue;const te=u.style.map.terrain&&u.style.map.terrain.getTerrainData(F),U=G.programConfigurations.get(s.id),W=u.useProgram(S?"fillExtrusionPattern":"fillExtrusion",U);S&&(u.context.activeTexture.set(y.TEXTURE0),z.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),U.updatePaintBuffers(M)),ra(U,v,L,z,s);const re=u.translatePosMatrix(F.posMatrix,z,s.paint.get("fill-extrusion-translate"),s.paint.get("fill-extrusion-translate-anchor")),se=s.paint.get("fill-extrusion-vertical-gradient"),he=S?qr(re,u,se,R,F,M,z):pn(re,u,se,R);W.draw(g,g.gl.TRIANGLES,l,h,m,It.backCCW,he,te,s.id,G.layoutVertexBuffer,G.indexBuffer,G.segments,s.paint,u.transform.zoom,U,u.style.map.terrain&&G.centroidVertexBuffer)}}function Vl(u,t,s,n,l,h,m){const g=u.context,y=g.gl,v=s.fbo;if(!v)return;const w=u.useProgram("hillshade"),S=u.style.map.terrain&&u.style.map.terrain.getTerrainData(t);g.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,v.colorAttachment.get()),w.draw(g,y.TRIANGLES,l,h,m,It.disabled,((M,R,L,F)=>{const z=L.paint.get("hillshade-shadow-color"),G=L.paint.get("hillshade-highlight-color"),te=L.paint.get("hillshade-accent-color");let U=L.paint.get("hillshade-illumination-direction")*(Math.PI/180);L.paint.get("hillshade-illumination-anchor")==="viewport"&&(U-=M.transform.angle);const W=!M.options.moving;return{u_matrix:F?F.posMatrix:M.transform.calculatePosMatrix(R.tileID.toUnwrapped(),W),u_image:0,u_latrange:gn(0,R.tileID),u_light:[L.paint.get("hillshade-exaggeration"),U],u_shadow:z,u_highlight:G,u_accent:te}})(u,s,n,S?t:null),S,n.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}function Dn(u,t,s,n,l,h){const m=u.context,g=m.gl,y=t.dem;if(y&&y.data){const v=y.dim,w=y.stride,S=y.getPixels();if(m.activeTexture.set(g.TEXTURE1),m.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||u.getTileTexture(w),t.demTexture){const R=t.demTexture;R.update(S,{premultiply:!1}),R.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else t.demTexture=new Et(m,S,g.RGBA,{premultiply:!1}),t.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);m.activeTexture.set(g.TEXTURE0);let M=t.fbo;if(!M){const R=new Et(m,{width:v,height:v,data:null},g.RGBA);R.bind(g.LINEAR,g.CLAMP_TO_EDGE),M=t.fbo=m.createFramebuffer(v,v,!0,!1),M.colorAttachment.set(R.texture)}m.bindFramebuffer.set(M.framebuffer),m.viewport.set([0,0,v,v]),u.useProgram("hillshadePrepare").draw(m,g.TRIANGLES,n,l,h,It.disabled,((R,L)=>{const F=L.stride,z=c.Z();return c.aS(z,0,c.N,-c.N,0,0,1),c.$(z,z,[0,-c.N,0]),{u_matrix:z,u_image:1,u_dimension:[F,F],u_zoom:R.overscaledZ,u_unpack:L.getUnpackVector()}})(t.tileID,y),null,s.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Nl(u,t,s,n,l,h){const m=n.paint.get("raster-fade-duration");if(!h&&m>0){const g=c.h.now(),y=(g-u.timeAdded)/m,v=t?(g-t.timeAdded)/m:-1,w=s.getSource(),S=l.coveringZoomLevel({tileSize:w.tileSize,roundZoom:w.roundZoom}),M=!t||Math.abs(t.tileID.overscaledZ-S)>Math.abs(u.tileID.overscaledZ-S),R=M&&u.refreshedUponExpiration?1:c.ad(M?y:1-v,0,1);return u.refreshedUponExpiration&&y>=1&&(u.refreshedUponExpiration=!1),t?{opacity:1,mix:1-R}:{opacity:R,mix:0}}return{opacity:1,mix:0}}const Ro=new c.aT(1,0,0,1),qa=new c.aT(0,1,0,1),Ln=new c.aT(0,0,1,1),Bo=new c.aT(1,0,1,1),Fo=new c.aT(0,1,1,1);function na(u,t,s,n){Ga(u,0,t+s/2,u.transform.width,s,n)}function Za(u,t,s,n){Ga(u,t-s/2,0,s,u.transform.height,n)}function Ga(u,t,s,n,l,h){const m=u.context,g=m.gl;g.enable(g.SCISSOR_TEST),g.scissor(t*u.pixelRatio,s*u.pixelRatio,n*u.pixelRatio,l*u.pixelRatio),m.clear({color:h}),g.disable(g.SCISSOR_TEST)}function Oo(u,t,s){const n=u.context,l=n.gl,h=s.posMatrix,m=u.useProgram("debug"),g=st.disabled,y=Pt.disabled,v=u.colorModeForRenderPass(),w="$debug",S=u.style.map.terrain&&u.style.map.terrain.getTerrainData(s);n.activeTexture.set(l.TEXTURE0);const M=t.getTileByID(s.key).latestRawTileData,R=Math.floor((M&&M.byteLength||0)/1024),L=t.getTile(s).tileSize,F=512/Math.min(L,512)*(s.overscaledZ/u.transform.zoom)*.5;let z=s.canonical.toString();s.overscaledZ!==s.canonical.z&&(z+=` => ${s.overscaledZ}`),function(G,te){G.initDebugOverlayCanvas();const U=G.debugOverlayCanvas,W=G.context.gl,re=G.debugOverlayCanvas.getContext("2d");re.clearRect(0,0,U.width,U.height),re.shadowColor="white",re.shadowBlur=2,re.lineWidth=1.5,re.strokeStyle="white",re.textBaseline="top",re.font="bold 36px Open Sans, sans-serif",re.fillText(te,5,5),re.strokeText(te,5,5),G.debugOverlayTexture.update(U),G.debugOverlayTexture.bind(W.LINEAR,W.CLAMP_TO_EDGE)}(u,`${z} ${R}kB`),m.draw(n,l.TRIANGLES,g,y,Ct.alphaBlended,It.disabled,ea(h,c.aT.transparent,F),null,w,u.debugBuffer,u.quadTriangleIndexBuffer,u.debugSegments),m.draw(n,l.LINE_STRIP,g,y,v,It.disabled,ea(h,c.aT.red),S,w,u.debugBuffer,u.tileBorderIndexBuffer,u.debugSegments)}function Lt(u,t,s){const n=u.context,l=n.gl,h=u.colorModeForRenderPass(),m=new st(l.LEQUAL,st.ReadWrite,u.depthRangeFor3D),g=u.useProgram("terrain"),y=t.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,u.width,u.height]);for(const v of s){const w=u.renderToTexture.getTexture(v),S=t.getTerrainData(v.tileID);n.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,w.texture);const M={u_matrix:u.transform.calculatePosMatrix(v.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(u.transform.zoom)};g.draw(n,l.TRIANGLES,m,Pt.disabled,h,It.backCCW,M,S,"terrain",y.vertexBuffer,y.indexBuffer,y.segments)}}class us{constructor(t,s){this.context=new Ol(t),this.transform=s,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.Z(),renderTime:0},this.setup(),this.numSublayers=Ei.maxUnderzooming+Ei.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ia}resize(t,s,n){if(this.width=Math.floor(t*n),this.height=Math.floor(s*n),this.pixelRatio=n,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const t=this.context,s=new c.a_;s.emplaceBack(0,0),s.emplaceBack(c.N,0),s.emplaceBack(0,c.N),s.emplaceBack(c.N,c.N),this.tileExtentBuffer=t.createVertexBuffer(s,Aa.members),this.tileExtentSegments=c.S.simpleSegment(0,0,4,2);const n=new c.a_;n.emplaceBack(0,0),n.emplaceBack(c.N,0),n.emplaceBack(0,c.N),n.emplaceBack(c.N,c.N),this.debugBuffer=t.createVertexBuffer(n,Aa.members),this.debugSegments=c.S.simpleSegment(0,0,4,5);const l=new c.V;l.emplaceBack(0,0,0,0),l.emplaceBack(c.N,0,c.N,0),l.emplaceBack(0,c.N,0,c.N),l.emplaceBack(c.N,c.N,c.N,c.N),this.rasterBoundsBuffer=t.createVertexBuffer(l,ar.members),this.rasterBoundsSegments=c.S.simpleSegment(0,0,4,2);const h=new c.a_;h.emplaceBack(0,0),h.emplaceBack(1,0),h.emplaceBack(0,1),h.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(h,Aa.members),this.viewportSegments=c.S.simpleSegment(0,0,4,2);const m=new c.a$;m.emplaceBack(0),m.emplaceBack(1),m.emplaceBack(3),m.emplaceBack(2),m.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(m);const g=new c.b0;g.emplaceBack(0,1,2),g.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(g);const y=this.context.gl;this.stencilClearMode=new Pt({func:y.ALWAYS,mask:0},0,255,y.ZERO,y.ZERO,y.ZERO)}clearStencil(){const t=this.context,s=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=c.Z();c.aS(n,0,this.width,this.height,0,0,1),c.a0(n,n,[s.drawingBufferWidth,s.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,s.TRIANGLES,st.disabled,this.stencilClearMode,Ct.disabled,It.disabled,wo(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,s){if(this.currentStencilSource===t.source||!t.isTileClipped()||!s||!s.length)return;this.currentStencilSource=t.source;const n=this.context,l=n.gl;this.nextStencilID+s.length>256&&this.clearStencil(),n.setColorMode(Ct.disabled),n.setDepthMode(st.disabled);const h=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const m of s){const g=this._tileClippingMaskIDs[m.key]=this.nextStencilID++,y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(m);h.draw(n,l.TRIANGLES,st.disabled,new Pt({func:l.ALWAYS,mask:0},g,255,l.KEEP,l.KEEP,l.REPLACE),Ct.disabled,It.disabled,wo(m.posMatrix),y,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,s=this.context.gl;return new Pt({func:s.NOTEQUAL,mask:255},t,255,s.KEEP,s.KEEP,s.REPLACE)}stencilModeForClipping(t){const s=this.context.gl;return new Pt({func:s.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,s.KEEP,s.KEEP,s.REPLACE)}stencilConfigForOverlap(t){const s=this.context.gl,n=t.sort((m,g)=>
577g.overscaledZ-m.overscaledZ),l=n[n.length-1].overscaledZ,h=n[0].overscaledZ-l+1;if(h>1){this.currentStencilSource=void 0,this.nextStencilID+h>256&&this.clearStencil();const m={};for(let g=0;g<h;g++)m[g+l]=new Pt({func:s.GEQUAL,mask:255},g+this.nextStencilID,255,s.KEEP,s.KEEP,s.REPLACE);return this.nextStencilID+=h,[m,n]}return[{[l]:Pt.disabled},n]}colorModeForRenderPass(){const t=this.context.gl;return this._showOverdrawInspector?new Ct([t.CONSTANT_COLOR,t.ONE],new c.aT(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ct.unblended:Ct.alphaBlended}depthModeForSublayer(t,s,n){if(!this.opaquePassEnabledForLayer())return st.disabled;const l=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new st(n||this.context.gl.LEQUAL,s,[l,l])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,s){this.style=t,this.options=s,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(c.h.now()),this.imageManager.beginFrame();const n=this.style._order,l=this.style.sourceCaches,h={},m={},g={};for(const y in l){const v=l[y];v.used&&v.prepare(this.context),h[y]=v.getVisibleCoordinates(),m[y]=h[y].slice().reverse(),g[y]=v.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let y=0;y<n.length;y++)if(this.style._layers[n[y]].is3D()){this.opaquePassCutoff=y;break}if(this.renderToTexture){this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0;const y=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!c.b1(this.terrainFacilitator.matrix,this.transform.projMatrix)||y.length)&&(c.b2(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(v,w){const S=v.context,M=S.gl,R=Ct.unblended,L=new st(M.LEQUAL,st.ReadWrite,[0,1]),F=w.getTerrainMesh(),z=w.sourceCache.getRenderableTiles(),G=v.useProgram("terrainDepth");S.bindFramebuffer.set(w.getFramebuffer("depth").framebuffer),S.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),S.clear({color:c.aT.transparent,depth:1});for(const te of z){const U=w.getTerrainData(te.tileID),W={u_matrix:v.transform.calculatePosMatrix(te.tileID.toUnwrapped()),u_ele_delta:w.getMeshFrameDelta(v.transform.zoom)};G.draw(S,M.TRIANGLES,L,Pt.disabled,R,It.backCCW,W,U,"terrain",F.vertexBuffer,F.indexBuffer,F.segments)}S.bindFramebuffer.set(null),S.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain),function(v,w){const S=v.context,M=S.gl,R=Ct.unblended,L=new st(M.LEQUAL,st.ReadWrite,[0,1]),F=w.getTerrainMesh(),z=w.getCoordsTexture(),G=w.sourceCache.getRenderableTiles(),te=v.useProgram("terrainCoords");S.bindFramebuffer.set(w.getFramebuffer("coords").framebuffer),S.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),S.clear({color:c.aT.transparent,depth:1}),w.coordsIndex=[];for(const U of G){const W=w.getTerrainData(U.tileID);S.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,z.texture);const re={u_matrix:v.transform.calculatePosMatrix(U.tileID.toUnwrapped()),u_terrain_coords_id:(255-w.coordsIndex.length)/255,u_texture:0,u_ele_delta:w.getMeshFrameDelta(v.transform.zoom)};te.draw(S,M.TRIANGLES,L,Pt.disabled,R,It.backCCW,re,W,"terrain",F.vertexBuffer,F.indexBuffer,F.segments),w.coordsIndex.push(U.tileID.key)}S.bindFramebuffer.set(null),S.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain))}this.renderPass="offscreen";for(const y of n){const v=this.style._layers[y];if(!v.hasOffscreenPass()||v.isHidden(this.transform.zoom))continue;const w=m[v.source];(v.type==="custom"||w.length)&&this.renderLayer(this,l[v.source],v,w)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:s.showOverdrawInspector?c.aT.black:c.aT.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=s.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){const y=this.style._layers[n[this.currentLayer]],v=l[y.source],w=h[y.source];this._renderTileClippingMasks(y,w),this.renderLayer(this,v,y,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){const y=this.style._layers[n[this.currentLayer]],v=l[y.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(y))continue;const w=(y.type==="symbol"?g:m)[y.source];this._renderTileClippingMasks(y,h[y.source]),this.renderLayer(this,v,y,w)}if(this.options.showTileBoundaries){const y=function(v,w){let S=null;const M=Object.values(v._layers).flatMap(z=>z.source&&!z.isHidden(w)?[v.sourceCaches[z.source]]:[]),R=M.filter(z=>z.getSource().type==="vector"),L=M.filter(z=>z.getSource().type!=="vector"),F=z=>{(!S||S.getSource().maxzoom<z.getSource().maxzoom)&&(S=z)};return R.forEach(z=>
577F(z)),S||L.forEach(z=>F(z)),S}(this.style,this.transform.zoom);y&&function(v,w,S){for(let M=0;M<S.length;M++)Oo(v,w,S[M])}(this,y,y.getVisibleCoordinates())}this.options.showPadding&&function(y){const v=y.transform.padding;na(y,y.transform.height-(v.top||0),3,Ro),na(y,v.bottom||0,3,qa),Za(y,v.left||0,3,Ln),Za(y,y.transform.width-(v.right||0),3,Bo);const w=y.transform.centerPoint;(function(S,M,R,L){Ga(S,M-1,R-10,2,20,L),Ga(S,M-10,R-1,20,2,L)})(y,w.x,y.transform.height-w.y,Fo)}(this),this.context.setDefault()}renderLayer(t,s,n,l){if(!n.isHidden(this.transform.zoom)&&(n.type==="background"||n.type==="custom"||(l||[]).length))switch(this.id=n.id,n.type){case"symbol":(function(h,m,g,y,v){if(h.renderPass!=="translucent")return;const w=Pt.disabled,S=h.colorModeForRenderPass();(g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(M,R,L,F,z,G,te){const U=R.transform,W=z==="map",re=G==="map";for(const se of M){const he=F.getTile(se),ge=he.getBucket(L);if(!ge||!ge.text||!ge.text.segments.get().length)continue;const fe=c.ah(ge.textSizeData,U.zoom),ye=Z(he,1,R.transform.zoom),De=be(se.posMatrix,re,W,R.transform,ye),et=L.layout.get("icon-text-fit")!=="none"&&ge.hasIconData();if(fe){const Te=Math.pow(2,U.zoom-he.tileID.overscaledZ);$a(ge,W,re,te,U,De,se.posMatrix,Te,fe,et,R.style.map.terrain?(je,Re)=>R.style.map.terrain.getElevation(se,je,Re):null)}}}(y,h,g,m,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),v),g.paint.get("icon-opacity").constantOr(1)!==0&&ja(h,m,g,y,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),w,S),g.paint.get("text-opacity").constantOr(1)!==0&&ja(h,m,g,y,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),w,S),m.map.showCollisionBoxes&&(Lo(h,m,g,y,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),!0),Lo(h,m,g,y,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),!1))})(t,s,n,l,this.style.placement.variableOffsets);break;case"circle":(function(h,m,g,y){if(h.renderPass!=="translucent")return;const v=g.paint.get("circle-opacity"),w=g.paint.get("circle-stroke-width"),S=g.paint.get("circle-stroke-opacity"),M=!g.layout.get("circle-sort-key").isConstant();if(v.constantOr(1)===0&&(w.constantOr(1)===0||S.constantOr(1)===0))return;const R=h.context,L=R.gl,F=h.depthModeForSublayer(0,st.ReadOnly),z=Pt.disabled,G=h.colorModeForRenderPass(),te=[];for(let U=0;U<y.length;U++){const W=y[U],re=m.getTile(W),se=re.getBucket(g);if(!se)continue;const he=se.programConfigurations.get(g.id),ge=h.useProgram("circle",he),fe=se.layoutVertexBuffer,ye=se.indexBuffer,De=h.style.map.terrain&&h.style.map.terrain.getTerrainData(W),et={programConfiguration:he,program:ge,layoutVertexBuffer:fe,indexBuffer:ye,uniformValues:Zr(h,W,re,g),terrainData:De};if(M){const Te=se.segments.get();for(const je of Te)te.push({segments:new c.S([je]),sortKey:je.sortKey,state:et})}else te.push({segments:se.segments,sortKey:0,state:et})}M&&te.sort((U,W)=>U.sortKey-W.sortKey);for(const U of te){const{programConfiguration:W,program:re,layoutVertexBuffer:se,indexBuffer:he,uniformValues:ge,terrainData:fe}=U.state;re.draw(R,L.TRIANGLES,F,z,G,It.disabled,ge,fe,g.id,se,he,U.segments,g.paint,h.transform.zoom,W)}})(t,s,n,l);break;case"heatmap":(function(h,m,g,y){if(g.paint.get("heatmap-opacity")!==0)if(h.renderPass==="offscreen"){const v=h.context,w=v.gl,S=Pt.disabled,M=new Ct([w.ONE,w.ONE],c.aT.transparent,[!0,!0,!0,!0]);(function(R,L,F){const z=R.gl;R.activeTexture.set(z.TEXTURE1),R.viewport.set([0,0,L.width/4,L.height/4]);let G=F.heatmapFbo;if(G)z.bindTexture(z.TEXTURE_2D,G.colorAttachment.get()),R.bindFramebuffer.set(G.framebuffer);else{const te=z.createTexture();z.bindTexture(z.TEXTURE_2D,te),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_WRAP_S,z.CLAMP_TO_EDGE),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_WRAP_T,z.CLAMP_TO_EDGE),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_MIN_FILTER,z.LINEAR),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_MAG_FILTER,z.LINEAR),G=F.heatmapFbo=R.createFramebuffer(L.width/4,L.height/4,!1,!1),function(U,W,re,se){var he,ge;const fe=U.gl,ye=(he=U.HALF_FLOAT)!==null&&he!==void 0?he:fe.UNSIGNED_BYTE,De=(ge=U.RGBA16F)!==null&&ge!==void 0?ge:fe.RGBA;fe.texImage2D(fe.TEXTURE_2D,0,De,W.width/4,W.height/4,0,fe.RGBA,ye,null),se.colorAttachment.set(re)}(R,L,te,G)}})(v,h,g),v.clear({color:c.aT.transparent});for(let R=0;R<y.length;R++){const L=y[R];if(m.hasRenderableParent(L))continue;const F=m.getTile(L),z=F.getBucket(g);if(!z)continue;const G=z.programConfigurations.get(g.id),te=h.useProgram("heatmap",G),{zoom:U}=h.transform;te.draw(v,w.TRIANGLES,st.disabled,S,M,It.disabled,Pl(L.posMatrix,F,U,g.paint.get("heatmap-intensity")),null,g.id,z.layoutVertexBuffer,z.indexBuffer,z.segments,g.paint,h.transform.zoom,G)}v.viewport.set([0,0,h.width,h.height])}else h.renderPass==="translucent"&&(h.context.setColorMode(h.colorModeForRenderPass()),function(v,w){const S=v.context,M=S.gl,R=w.heatmapFbo;if(!R)return;S.activeTexture.set(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,R.colorAttachment.get()),S.activeTexture.set(M.TEXTURE1);let L=w.colorRampTexture;L||(L=w.colorRampTexture=new Et(S,w.colorRamp,M.RGBA)),L.bind(M.LINEAR,M.CLAMP_TO_EDGE),v.useProgram("heatmapTexture").draw(S,M.TRIANGLES,st.disabled,Pt.disabled,v.colorModeForRenderPass(),It.disabled,((F,z,G,te)=>{const U=c.Z();c.aS(U,0,F.width,F.height,0,0,1);const W=F.context.gl;return{u_matrix:U,u_world:[W.drawingBufferWidth,W.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:z.paint.get("heatmap-opacity")}})(v,w),null,w.id,v.viewportBuffer,v.quadTriangleIndexBuffer,v.viewportSegments,w.paint,v.transform.zoom)}(h,g))})(t,s,n,l);break;case"line":(function(h,m,g,y){if(h.renderPass!=="translucent")return;const v=g.paint.get("line-opacity"),w=g.paint.get("line-width");if(v.constantOr(1)===0||w.constantOr(1)===0)return;const S=h.depthModeForSublayer(0,st.ReadOnly),M=h.colorModeForRenderPass(),R=g.paint.get("line-dasharray"),L=g.paint.get("line-pattern"),F=L.constantOr(1),z=g.paint.get("line-gradient"),G=g.getCrossfadeParameters(),te=F?"linePattern":R?"lineSDF":z?"lineGradient":"line",U=h.context,W=U.gl;let re=!0;for(const se of y){const he=m.getTile(se);if(F&&!he.patternsLoaded())continue;const ge=he.getBucket(g);if(!ge)continue;const fe=ge.programConfigurations.get(g.id),ye=h.context.program.get(),De=h.useProgram(te,fe),et=re||De.program!==ye,Te=h.style.map.terrain&&h.style.map.terrain.getTerrainData(se),je=L.constantOr(null);if(je&&he.imageAtlas){const Qe=he.imageAtlas,Xe=Qe.patternPositions[je.to.toString()],tt=Qe.patternPositions[je.from.toString()];Xe&&tt&&fe.setConstantPatternPositions(Xe,tt)}const Re=Te?se:null,ft=F?kl(h,he,g,G,Re):R?To(h,he,g,R,G,Re):z?So(h,he,g,ge.lineClipsArray.length,Re):_n(h,he,g,Re);if(F)U.activeTexture.set(W.TEXTURE0),he.imageAtlasTexture.bind(W.LINEAR,W.CLAMP_TO_EDGE),fe.updatePaintBuffers(G);else if(R&&(et||h.lineAtlas.dirty))U.activeTexture.set(W.TEXTURE0),h.lineAtlas.bind(U);else if(z){const Qe=ge.gradients[g.id];let Xe=Qe.texture;if(g.gradientVersion!==Qe.version){let tt=256;if(g.stepInterpolant){const Bt=m.getSource().maxzoom,vt=se.canonical.z===Bt?Math.ceil(1<<h.transform.maxZoom-se.canonical.z):1;tt=c.ad(c.aY(ge.maxLineLength/c.N*1024*vt),256,U.maxTextureSize)}Qe.gradient=c.aZ({expression:g.gradientExpression(),evaluationKey:"lineProgress",resolution:tt,image:Qe.gradient||void 0,clips:ge.lineClipsArray}),Qe.texture?Qe.texture.update(Qe.gradient):Qe.texture=new Et(U,Qe.gradient,W.RGBA),Qe.version=g.gradientVersion,Xe=Qe.texture}
577U.activeTexture.set(W.TEXTURE0),Xe.bind(g.stepInterpolant?W.NEAREST:W.LINEAR,W.CLAMP_TO_EDGE)}De.draw(U,W.TRIANGLES,S,h.stencilModeForClipping(se),M,It.disabled,ft,Te,g.id,ge.layoutVertexBuffer,ge.indexBuffer,ge.segments,g.paint,h.transform.zoom,fe,ge.layoutVertexBuffer2),re=!1}})(t,s,n,l);break;case"fill":(function(h,m,g,y){const v=g.paint.get("fill-color"),w=g.paint.get("fill-opacity");if(w.constantOr(1)===0)return;const S=h.colorModeForRenderPass(),M=g.paint.get("fill-pattern"),R=h.opaquePassEnabledForLayer()&&!M.constantOr(1)&&v.constantOr(c.aT.transparent).a===1&&w.constantOr(0)===1?"opaque":"translucent";if(h.renderPass===R){const L=h.depthModeForSublayer(1,h.renderPass==="opaque"?st.ReadWrite:st.ReadOnly);sa(h,m,g,y,L,S,!1)}if(h.renderPass==="translucent"&&g.paint.get("fill-antialias")){const L=h.depthModeForSublayer(g.getPaintProperty("fill-outline-color")?2:0,st.ReadOnly);sa(h,m,g,y,L,S,!0)}})(t,s,n,l);break;case"fill-extrusion":(function(h,m,g,y){const v=g.paint.get("fill-extrusion-opacity");if(v!==0&&h.renderPass==="translucent"){const w=new st(h.context.gl.LEQUAL,st.ReadWrite,h.depthRangeFor3D);if(v!==1||g.paint.get("fill-extrusion-pattern").constantOr(1))aa(h,m,g,y,w,Pt.disabled,Ct.disabled),aa(h,m,g,y,w,h.stencilModeFor3D(),h.colorModeForRenderPass());else{const S=h.colorModeForRenderPass();aa(h,m,g,y,w,Pt.disabled,S)}}})(t,s,n,l);break;case"hillshade":(function(h,m,g,y){if(h.renderPass!=="offscreen"&&h.renderPass!=="translucent")return;const v=h.context,w=h.depthModeForSublayer(0,st.ReadOnly),S=h.colorModeForRenderPass(),[M,R]=h.renderPass==="translucent"?h.stencilConfigForOverlap(y):[{},y];for(const L of R){const F=m.getTile(L);F.needsHillshadePrepare!==void 0&&F.needsHillshadePrepare&&h.renderPass==="offscreen"?Dn(h,F,g,w,Pt.disabled,S):h.renderPass==="translucent"&&Vl(h,L,F,g,w,M[L.overscaledZ],S)}v.viewport.set([0,0,h.width,h.height])})(t,s,n,l);break;case"raster":(function(h,m,g,y){if(h.renderPass!=="translucent"||g.paint.get("raster-opacity")===0||!y.length)return;const v=h.context,w=v.gl,S=m.getSource(),M=h.useProgram("raster"),R=h.colorModeForRenderPass(),[L,F]=S instanceof Hi?[{},y]:h.stencilConfigForOverlap(y),z=F[F.length-1].overscaledZ,G=!h.options.moving;for(const te of F){const U=h.depthModeForSublayer(te.overscaledZ-z,g.paint.get("raster-opacity")===1?st.ReadWrite:st.ReadOnly,w.LESS),W=m.getTile(te);W.registerFadeDuration(g.paint.get("raster-fade-duration"));const re=m.findLoadedParent(te,0),se=Nl(W,re,m,g,h.transform,h.style.map.terrain);let he,ge;const fe=g.paint.get("raster-resampling")==="nearest"?w.NEAREST:w.LINEAR;v.activeTexture.set(w.TEXTURE0),W.texture.bind(fe,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST),v.activeTexture.set(w.TEXTURE1),re?(re.texture.bind(fe,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST),he=Math.pow(2,re.tileID.overscaledZ-W.tileID.overscaledZ),ge=[W.tileID.canonical.x*he%1,W.tileID.canonical.y*he%1]):W.texture.bind(fe,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST);const ye=h.style.map.terrain&&h.style.map.terrain.getTerrainData(te),De=ye?te:null,et=De?De.posMatrix:h.transform.calculatePosMatrix(te.toUnwrapped(),G),Te=Ao(et,ge||[0,0],he||1,se,g);S instanceof Hi?M.draw(v,w.TRIANGLES,U,Pt.disabled,R,It.disabled,Te,ye,g.id,S.boundsBuffer,h.quadTriangleIndexBuffer,S.boundsSegments):M.draw(v,w.TRIANGLES,U,L[te.overscaledZ],R,It.disabled,Te,ye,g.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}})(t,s,n,l);break;case"background":(function(h,m,g,y){const v=g.paint.get("background-color"),w=g.paint.get("background-opacity");if(w===0)return;const S=h.context,M=S.gl,R=h.transform,L=R.tileSize,F=g.paint.get("background-pattern");if(h.isPatternMissing(F))return;const z=!F&&v.a===1&&w===1&&h.opaquePassEnabledForLayer()?"opaque":"translucent";if(h.renderPass!==z)return;const G=Pt.disabled,te=h.depthModeForSublayer(0,z==="opaque"?st.ReadWrite:st.ReadOnly),U=h.colorModeForRenderPass(),W=h.useProgram(F?"backgroundPattern":"background"),re=y||R.coveringTiles({tileSize:L,terrain:h.style.map.terrain});F&&(S.activeTexture.set(M.TEXTURE0),h.imageManager.bind(h.context));const se=g.getCrossfadeParameters();for(const he of re){const ge=y?he.posMatrix:h.transform.calculatePosMatrix(he.toUnwrapped()),fe=F?Qi(ge,w,h,F,{tileID:he,tileSize:L},se):ka(ge,w,v),ye=h.style.map.terrain&&h.style.map.terrain.getTerrainData(he);W.draw(S,M.TRIANGLES,te,G,U,It.disabled,fe,ye,g.id,h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}})(t,0,n,l);break;
577case"custom":(function(h,m,g){const y=h.context,v=g.implementation;if(h.renderPass==="offscreen"){const w=v.prerender;w&&(h.setCustomLayerDefaults(),y.setColorMode(h.colorModeForRenderPass()),w.call(v,y.gl,h.transform.customLayerMatrix()),y.setDirty(),h.setBaseState())}else if(h.renderPass==="translucent"){h.setCustomLayerDefaults(),y.setColorMode(h.colorModeForRenderPass()),y.setStencilMode(Pt.disabled);const w=v.renderingMode==="3d"?new st(h.context.gl.LEQUAL,st.ReadWrite,h.depthRangeFor3D):h.depthModeForSublayer(0,st.ReadOnly);y.setDepthMode(w),v.render(y.gl,h.transform.customLayerMatrix()),y.setDirty(),h.setBaseState(),y.bindFramebuffer.set(null)}})(t,0,n)}}translatePosMatrix(t,s,n,l,h){if(!n[0]&&!n[1])return t;const m=h?l==="map"?this.transform.angle:0:l==="viewport"?-this.transform.angle:0;if(m){const v=Math.sin(m),w=Math.cos(m);n=[n[0]*w-n[1]*v,n[0]*v+n[1]*w]}const g=[h?n[0]:Z(s,n[0],this.transform.zoom),h?n[1]:Z(s,n[1],this.transform.zoom),0],y=new Float32Array(16);return c.$(y,t,g),y}saveTileTexture(t){const s=this._tileTextures[t.size[0]];s?s.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const s=this._tileTextures[t];return s&&s.length>0?s.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const s=this.imageManager.getPattern(t.from.toString()),n=this.imageManager.getPattern(t.to.toString());return!s||!n}useProgram(t,s){this.cache=this.cache||{};const n=t+(s?s.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[n]||(this.cache[n]=new Ea(this.context,Mt[t],s,za[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[n]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Et(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:s}=this.context.gl;return this.width!==t||this.height!==s}}class Mi{constructor(t,s){this.points=t,this.planes=s}static fromInvProjectionMatrix(t,s,n){const l=Math.pow(2,n),h=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(g=>{const y=1/(g=c.ag([],g,t))[3]/s*l;return c.b3(g,g,[y,y,1/g[3],y])}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(g=>{const y=function(M,R){var L=R[0],F=R[1],z=R[2],G=L*L+F*F+z*z;return G>0&&(G=1/Math.sqrt(G)),M[0]=R[0]*G,M[1]=R[1]*G,M[2]=R[2]*G,M}([],function(M,R,L){var F=R[0],z=R[1],G=R[2],te=L[0],U=L[1],W=L[2];return M[0]=z*W-G*U,M[1]=G*te-F*W,M[2]=F*U-z*te,M}([],ur([],h[g[0]],h[g[1]]),ur([],h[g[2]],h[g[1]]))),v=-((w=y)[0]*(S=h[g[1]])[0]+w[1]*S[1]+w[2]*S[2]);var w,S;return y.concat(v)});return new Mi(h,m)}}class Bs{constructor(t,s){this.min=t,this.max=s,this.center=function(n,l,h){return n[0]=.5*l[0],n[1]=.5*l[1],n[2]=.5*l[2],n}([],function(n,l,h){return n[0]=l[0]+h[0],n[1]=l[1]+h[1],n[2]=l[2]+h[2],n}([],this.min,this.max))}quadrant(t){const s=[t%2==0,t<2],n=Vt(this.min),l=Vt(this.max);for(let h=0;h<s.length;h++)n[h]=s[h]?this.min[h]:this.center[h],l[h]=s[h]?this.center[h]:this.max[h];return l[2]=this.max[2],new Bs(n,l)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){const s=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],
vendor: 6,940 bytes, line 577
5771],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let n=!0;for(let l=0;l<t.planes.length;l++){const h=t.planes[l];let m=0;for(let g=0;g<s.length;g++)c.b4(h,s[g])>=0&&m++;if(m===0)return 0;m!==s.length&&(n=!1)}if(n)return 2;for(let l=0;l<3;l++){let h=Number.MAX_VALUE,m=-Number.MAX_VALUE;for(let g=0;g<t.points.length;g++){const y=t.points[g][l]-this.min[l];h=Math.min(h,y),m=Math.max(m,y)}if(m<0||h>this.max[l]-this.min[l])return 0}return 1}}class oa{constructor(t=0,s=0,n=0,l=0){if(isNaN(t)||t<0||isNaN(s)||s<0||isNaN(n)||n<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=s,this.left=n,this.right=l}interpolate(t,s,n){return s.top!=null&&t.top!=null&&(this.top=c.B.number(t.top,s.top,n)),s.bottom!=null&&t.bottom!=null&&(this.bottom=c.B.number(t.bottom,s.bottom,n)),s.left!=null&&t.left!=null&&(this.left=c.B.number(t.left,s.left,n)),s.right!=null&&t.right!=null&&(this.right=c.B.number(t.right,s.right,n)),this}getCenter(t,s){const n=c.ad((this.left+t-this.right)/2,0,t),l=c.ad((this.top+s-this.bottom)/2,0,s);return new c.P(n,l)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new oa(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Wa{constructor(t,s,n,l,h){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=h===void 0||!!h,this._minZoom=t||0,this._maxZoom=s||22,this._minPitch=n??0,this._maxPitch=l??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new oa,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const t=new Wa(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this._minEleveationForCurrentTile=t._minEleveationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const s=-c.b5(t,-180,180)*Math.PI/180;this.angle!==s&&(this._unmodified=!1,this.angle=s,this._calcMatrices(),this.rotationMatrix=function(){var n=new c.A(4);return c.A!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n}(),function(n,l,h){var m=l[0],g=l[1],y=l[2],v=l[3],w=Math.sin(h),S=Math.cos(h);n[0]=m*S+y*w,n[1]=g*S+v*w,n[2]=m*-w+y*S,n[3]=g*-w+v*S}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const s=c.ad(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==s&&(this._unmodified=!1,this._pitch=s,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const s=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==s&&(this._unmodified=!1,this._zoom=s,this.tileZoom=Math.max(0,Math.floor(s)),this.scale=this.zoomScale(s),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,s,n){this._unmodified=!1,this._edgeInsets.interpolate(t,s,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const s=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,s)}getVisibleUnwrappedCoordinates(t){const s=[new c.b6(0,t)];if(this._renderWorldCopies){const n=this.pointCoordinate(new c.P(0,0)),l=this.pointCoordinate(new c.P(this.width,0)),h=this.pointCoordinate(new c.P(this.width,this.height)),m=this.pointCoordinate(new c.P(0,this.height)),g=Math.floor(Math.min(n.x,l.x,h.x,m.x)),y=Math.floor(Math.max(n.x,l.x,h.x,m.x)),v=1;for(let w=g-v;w<=y+v;w++)w!==0&&s.push(new c.b6(w,t))}return s}coveringTiles(t){var s,n;let l=this.coveringZoomLevel(t);const h=l;if(t.minzoom!==void 0&&l<t.minzoom)return[];t.maxzoom!==void 0&&l>t.maxzoom&&(l=t.maxzoom);const m=this.pointCoordinate(this.getCameraPoint()),g=c.U.fromLngLat(this.center),y=Math.pow(2,l),v=[y*m.x,y*m.y,0],w=[y*g.x,y*g.y,0],S=Mi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,l);let M=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(M=l);const R=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,L=U=>({aabb:new Bs([U*y,0,0],[(U+1)*y,y,0]),zoom:0,x:0,y:0,wrap:U,fullyVisible:!1}),F=[],z=[],G=l,te=t.reparseOverscaled?h:l;if(this._renderWorldCopies)for(let U=1;U<=3;U++)F.push(L(-U)),F.push(L(U));for(F.push(L(0));F.length>0;){const U=F.pop(),W=U.x,re=U.y;let se=U.fullyVisible;if(!se){const De=U.aabb.intersects(S);if(De===0)continue;se=De===2}const he=t.terrain?v:w,ge=U.aabb.distanceX(he),fe=U.aabb.distanceY(he),ye=Math.max(Math.abs(ge),Math.abs(fe));if(U.zoom===G||ye>R+(1<<G-U.zoom)-2&&U.zoom>=M){const De=G-U.zoom,et=v[0]-.5-(W<<De),Te=v[1]-.5-(re<<De);z.push({tileID:new c.O(U.zoom===G?te:U.zoom,U.wrap,U.zoom,W,re),distanceSq:Xs([w[0]-.5-W,w[1]-.5-re]),tileDistanceToCamera:Math.sqrt(et*et+Te*Te)})}else for(let De=0;De<4;De++){const et=(W<<1)+De%2,Te=(re<<1)+(De>>1),je=U.zoom+1;let Re=U.aabb.quadrant(De);
577if(t.terrain){const ft=new c.O(je,U.wrap,je,et,Te),Qe=t.terrain.getMinMaxElevation(ft),Xe=(s=Qe.minElevation)!==null&&s!==void 0?s:this.elevation,tt=(n=Qe.maxElevation)!==null&&n!==void 0?n:this.elevation;Re=new Bs([Re.min[0],Re.min[1],Xe],[Re.max[0],Re.max[1],tt])}F.push({aabb:Re,zoom:je,x:et,y:Te,wrap:U.wrap,fullyVisible:se})}}return z.sort((U,W)=>U.distanceSq-W.distanceSq).map(U=>U.tileID)}resize(t,s){this.width=t,this.height=s,this.pixelsToGLUnits=[2/t,-2/s],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const s=c.ad(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new c.P(c.G(t.lng)*this.worldSize,c.H(s)*this.worldSize)}unproject(t){return new c.U(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const s=this.pointLocation(this.centerPoint,t),n=t.getElevationForLngLatZoom(s,this.tileZoom);if(!(this.elevation-n))return;const l=this.getCameraPosition(),h=c.U.fromLngLat(l.lngLat,l.altitude),m=c.U.fromLngLat(s,n),g=h.x-m.x,y=h.y-m.y,v=h.z-m.z,w=Math.sqrt(g*g+y*y+v*v),S=this.scaleZoom(this.cameraToCenterDistance/w/this.tileSize);this._elevation=n,this._center=s,this.zoom=S}setLocationAtPoint(t,s){const n=this.pointCoordinate(s),l=this.pointCoordinate(this.centerPoint),h=this.locationCoordinate(t),m=new c.U(h.x-(n.x-l.x),h.y-(n.y-l.y));this.center=this.coordinateLocation(m),this._renderWorldCopies&&
577(this.center=this.center.wrap())}locationPoint(t,s){return s?this.coordinatePoint(this.locationCoordinate(t),s.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,s){return this.coordinateLocation(this.pointCoordinate(t,s))}locationCoordinate(t){return c.U.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,s){if(s){const M=s.pointCoordinate(t);if(M!=null)return M}const n=[t.x,t.y,0,1],l=[t.x,t.y,1,1];c.ag(n,n,this.pixelMatrixInverse),c.ag(l,l,this.pixelMatrixInverse);const h=n[3],m=l[3],g=n[1]/h,y=l[1]/m,v=n[2]/h,w=l[2]/m,S=v===w?0:(0-v)/(w-v);return new c.U(c.B.number(n[0]/h,l[0]/m,S)/this.worldSize,c.B.number(g,y,S)/this.worldSize)}coordinatePoint(t,s=0,n=this.pixelMatrix){const l=[t.x*this.worldSize,t.y*this.worldSize,s,1];return c.ag(l,l,n),new c.P(l[0]/l[3],l[1]/l[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new bt().extend(this.pointLocation(new c.P(0,t))).extend(this.pointLocation(new c.P(this.width,t))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new bt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,s=!1){const n=t.key,l=s?this._alignedPosMatrixCache:this._posMatrixCache;if(l[n])return l[n];const h=t.canonical,m=this.worldSize/this.zoomScale(h.z),g=h.x+Math.pow(2,h.z)*t.wrap,y=c.ao(new Float64Array(16));return c.$(y,y,[g*m,h.y*m,0]),c.a0(y,y,[m/c.N,m/c.N,1]),c.a1(y,s?this.alignedProjMatrix:this.projMatrix,y),l[n]=new Float32Array(y),l[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,s,n,l,h=-90,m=90,g=-180,y=180;const v=this.size,w=this._unmodified;if(this.latRange){const R=this.latRange;h=c.H(R[1])*this.worldSize,m=c.H(R[0])*this.worldSize,t=m-h<v.y?v.y/(m-h):0}if(this.lngRange){const R=this.lngRange;g=c.b5(c.G(R[0])*this.worldSize,0,this.worldSize),y=c.b5(c.G(R[1])*this.worldSize,0,this.worldSize),y<g&&(y+=this.worldSize),s=y-g<v.x?v.x/(y-g):0}const S=this.point,M=Math.max(s||0,t||0);if(M)return this.center=this.unproject(new c.P(s?(y+g)/2:S.x,t?(m+h)/2:S.y)),this.zoom+=this.scaleZoom(M),this._unmodified=w,void(this._constraining=!1);if(this.latRange){const R=S.y,L=v.y/2;R-L<h&&(l=h+L),R+L>m&&(l=m-L)}if(this.lngRange){const R=(g+y)/2,L=c.b5(S.x,R-this.worldSize/2,R+this.worldSize/2),F=v.x/2;L-F<g&&(n=g+F),L+F>y&&(n=y-F)}n===void 0&&l===void 0||(this.center=this.unproject(new c.P(n!==void 0?n:S.x,l!==void 0?l:S.y)).wrap()),this._unmodified=w,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,s=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b7(1,this.center.lat)*this.worldSize;let l=c.ao(new Float64Array(16));c.a0(l,l,[this.width/2,-this.height/2,1]),c.$(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=c.ao(new Float64Array(16)),c.a0(l,l,[1,-1,1]),c.$(l,l,[-1,-1,0]),c.a0(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l;const h=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),m=Math.min(this.elevation,this._minEleveationForCurrentTile),g=h-m*this._pixelPerMeter/Math.cos(this._pitch),y=m<0?g:h,v=Math.PI/2+this._pitch,w=this._fov*(.5+t.y/this.height),S=Math.sin(w)*y/Math.sin(c.ad(Math.PI-v-w,.01,Math.PI-.01)),M=this.getHorizon(),R=2*Math.atan(M/this.cameraToCenterDistance)*(.5+t.y/(2*M)),L=Math.sin(R)*y/Math.sin(c.ad(Math.PI-v-R,.01,Math.PI-.01)),F=Math.min(S,L),z=1.01*(Math.cos(Math.PI/2-this._pitch)*F+y),G=this.height/50;l=new Float64Array(16),c.b8(l,this._fov,this.width/this.height,G,z),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,c.a0(l,l,[1,-1,1]),c.$(l,l,[0,0,-this.cameraToCenterDistance]),c.b9(l,l,this._pitch),c.ae(l,l,this.angle),c.$(l,l,[-s,-n,0]),this.mercatorMatrix=c.a0([],l,[this.worldSize,this.worldSize,this.worldSize]),c.a0(l,l,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.a1(new Float64Array(16),this.labelPlaneMatr
577ix,l),c.$(l,l,[0,0,-this.elevation]),this.projMatrix=l,this.invProjMatrix=c.as([],l),this.pixelMatrix3D=c.a1(new Float64Array(16),this.labelPlaneMatrix,l);const te=this.width%2/2,U=this.height%2/2,W=Math.cos(this.angle),re=Math.sin(this.angle),se=s-Math.round(s)+W*te+re*U,he=n-Math.round(n)+W*U+re*te,ge=new Float64Array(l);if(c.$(ge,ge,[se>.5?se-1:se,he>.5?he-1:he,0]),this.alignedProjMatrix=ge,l=c.as(new Float64Array(16),this.pixelMatrix),!l)throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new c.P(0,0)),s=[t.x*this.worldSize,t.y*this.worldSize,0,1];return c.ag(s,s,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,t))}getCameraQueryGeometry(t){const s=this.getCameraPoint();if(t.length===1)return[t[0],s];{let n=s.x,l=s.y,h=s.x,m=s.y;for(const g of t)n=Math.min(n,g.x),l=Math.min(l,g.y),h=Math.max(h,g.x),m=Math.max(m,g.y);return[new c.P(n,l),new c.P(h,l),new c.P(h,m),new c.P(n,m),new c.P(n,l)]}}}function hs(u,t){let s,n=!1,l=null,h=null;const m=()=>{l=null,n&&(u.apply(h,s),l=setTimeout(m,t),n=!1)};return(...g)=>(n=!0,h=this,s=g,l||m(),l)}class la{constructor(t){this._getCurrentHash=()=>{const s=window.location.hash.replace("#","");if(this._hashName){let n;return s.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(n=l)}),(n&&n[1]||"").split("/")}return s.split("/")},this._onHashChange=()=>{const s=this._getCurrentHash();if(s.length>=3&&!s.some(n=>isNaN(n))){const n=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:n,pitch:+(s[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const s=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,s)}catch{}},this._updateHash=hs(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){const s=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,l=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),h=Math.pow(10,l),m=Math.round(s.lng*h)/h,g=Math.round(s.lat*h)/h,y=this._map.getBearing(),v=this._map.getPitch();let w="";if(w+=t?`/${m}/${g}/${n}`:`${n}/${g}/${m}`,(y||v)&&(w+="/"+Math.round(10*y)/10),v&&(w+=`/${Math.round(v)}`),this._hashName){const S=this._hashName;let M=!1;const R=window.location.hash.slice(1).split("&").map(L=>{const F=L.split("=")[0];return F===S?(M=!0,`${F}=${w}`):L}).filter(L=>L);return M||R.push(`${S}=${w}`),`#${R.join("&")}`}return`#${w}`}}const Fs={linearity:.3,easing:c.ba(0,0,.3,1)},Vo=c.e({deceleration:2500,maxSpeed:1400},Fs),No=c.e({deceleration:20,maxSpeed:1400},Fs),Uo=c.e({deceleration:1e3,maxSpeed:360},Fs),$o=c.e({deceleration:1e3,maxSpeed:90},Fs);class jo{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c.h.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,s=c.h.now();for(;t.length>0&&s-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const s={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:h}of this._inertiaBuffer)s.zoom+=h.zoomDelta||0,s.bearing+=h.bearingDelta||0,s.pitch+=h.pitchDelta||0,h.panDelta&&s.pan._add(h.panDelta),h.around&&(s.around=h.around),h.pinchAround&&(s.pinchAround=h.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(s.pan.mag()){const h=ca(s.pan.mag(),n,c.e({},Vo,t||{}));l.offset=s.pan.mult(h.amount/s.pan.mag()),l.center=this._map.transform.center,mr(l,h)}if(s.zoom){const h=ca(s.zoom,n,No);l.zoom=this._map.transform.zoom+h.amount,mr(l,h)}if(s.bearing){const h=ca(s.bearing,n,Uo);
vendor: 7,126 bytes, line 577
577l.bearing=this._map.transform.bearing+c.ad(h.amount,-179,179),mr(l,h)}if(s.pitch){const h=ca(s.pitch,n,$o);l.pitch=this._map.transform.pitch+h.amount,mr(l,h)}if(l.zoom||l.bearing){const h=s.pinchAround===void 0?s.around:s.pinchAround;l.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),c.e(l,{noMoveStart:!0})}}function mr(u,t){(!u.duration||u.duration<t.duration)&&(u.duration=t.duration,u.easing=t.easing)}function ca(u,t,s){const{maxSpeed:n,linearity:l,deceleration:h}=s,m=c.ad(u*l/(t/1e3),-n,n),g=Math.abs(m)/(h*l);return{easing:s.easing,duration:1e3*g,amount:m*(g/2)}}class Ni extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,s,n,l={}){const h=K.mousePos(s.getCanvasContainer(),n),m=s.unproject(h);super(t,c.e({point:h,lngLat:m,originalEvent:n},l)),this._defaultPrevented=!1,this.target=s}}class ua extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,s,n){const l=t==="touchend"?n.changedTouches:n.touches,h=K.touchPos(s.getCanvasContainer(),l),m=h.map(y=>s.unproject(y)),g=h.reduce((y,v,w,S)=>y.add(v.div(S.length)),new c.P(0,0));super(t,{points:h,point:g,lngLats:m,lngLat:s.unproject(g),originalEvent:n}),this._defaultPrevented=!1}}class qo extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,s,n){super(t,{originalEvent:n}),this._defaultPrevented=!1}}class Zo{constructor(t,s){this._map=t,this._clickTolerance=s.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new qo(t.type,this._map,t))}mousedown(t,s){return this._mousedownPos=s,this._firePreventable(new Ni(t.type,this._map,t))}mouseup(t){this._map.fire(new Ni(t.type,this._map,t))}click(t,s){this._mousedownPos&&this._mousedownPos.dist(s)>=this._clickTolerance||this._map.fire(new Ni(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Ni(t.type,this._map,t))}mouseover(t){this._map.fire(new Ni(t.type,this._map,t))}mouseout(t){this._map.fire(new Ni(t.type,this._map,t))}touchstart(t){return this._firePreventable(new ua(t.type,this._map,t))}touchmove(t){this._map.fire(new ua(t.type,this._map,t))}touchend(t){this._map.fire(new ua(t.type,this._map,t))}touchcancel(t){this._map.fire(new ua(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Go{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Ni(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ni("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Ni(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Hr{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(c.P.convert(t),this._map.terrain)}}class Wo{constructor(t,s){this._map=t,this._tr=new Hr(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=s.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,s){this.isEnabled()&&t.shiftKey&&t.button===0&&(K.disableDrag(),this._startPos=this._lastPos=s,this._active=!0)}mousemoveWindow(t,s){if(!this._active)return;const n=s;if(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=n,this._box||(this._box=K.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const h=Math.min(l.x,n.x),m=Math.max(l.x,n.x),g=Math.min(l.y,n.y),y=Math.max(l.y,n.y);K.setTransform(this._box,`translate(${h}px,${g}px)`),this._box.style.width=m-h+"px",this._box.style.height=y-g+"px"}mouseupWindow(t,s){if(!this._active||t.button!==0)return;const n=this._startPos,l=s;if(this.reset(),K.suppressClick(),n.x!==l.x||n.y!==l.y)return this._map.fire(new c.k("boxzoomend",{originalEvent:t})),{cameraAnimation:h=>h.fitScreenCoordinates(n,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(K.remove(this._box),this._box=null),K.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,s){return this._map.fire(new c.k(t,{originalEvent:s}))}}function er(u,t){if(u.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${u.length}, points ${t.length}`);const s={};for(let n=0;n<u.length;n++)s[u[n].identifier]=t[n];return s}class Cr{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,s,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(l){const h=new c.P(0,0);for(const m of l)h._add(m);return h.div(l.length)}(s),this.touches=er(n,s)))}touchmove(t,s,n){if(this.aborted||!this.centroid)return;const l=er(n,s);for(const h in this.touches){const m=l[h];(!m||m.dist(this.touches[h])>30)&&(this.aborted=!0)}}touchend(t,s,n){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class Ha{constructor(t){this.singleTap=new Cr(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,s,n){this.singleTap.touchstart(t,s,n)}touchmove(t,s,n){this.singleTap.touchmove(t,s,n)}touchend(t,s,n){const l=this.singleTap.touchend(t,s,n);if(l){const h=t.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(l)<30;if(h&&m||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class Pr{constructor(t){this._tr=new Hr(t),this._zoomIn=new Ha({numTouches:1,numTaps:2}),this._zoomOut=new Ha({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,s,n){this._zoomIn.touchstart(t,s,n),this._zoomOut.touchstart(t,s,n)}touchmove(t,s,n){this._zoomIn.touchmove(t,s,n),this._zoomOut.touchmove(t,s,n)}
577touchend(t,s,n){const l=this._zoomIn.touchend(t,s,n),h=this._zoomOut.touchend(t,s,n),m=this._tr;return l?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom+1,around:m.unproject(l)},{originalEvent:t})}):h?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:g=>g.easeTo({duration:300,zoom:m.zoom-1,around:m.unproject(h)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class kr{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const s=this._moveFunction(...t);if(s.bearingDelta||s.pitchDelta||s.around||s.panDelta)return this._active=!0,s}dragStart(t,s){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=s.length?s[0]:s,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,s){if(!this.isEnabled())return;const n=this._lastPoint;if(!n)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const l=s.length?s[0]:s;return!this._moved&&l.dist(n)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(n,l))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&K.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Ul={0:1,2:2};class Rn{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const s=K.mouseButton(t);this._eventButton=s}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(s,n){const l=Ul[n];return s.buttons===void 0||(s.buttons&l)!==l}(t,this._eventButton)}isValidEndEvent(t){return K.mouseButton(t)===this._eventButton}}class Ho{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return t.targetTouches.length===1}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}const Xa=u=>{u.mousedown=u.dragStart,u.mousemoveWindow=u.dragMove,u.mouseup=u.dragEnd,u.contextmenu=function(t){t.preventDefault()}},Os=({enable:u,clickTolerance:t,bearingDegreesPerPixelMoved:s=.8})=>{const n=new Rn({checkCorrectEvent:l=>K.mouseButton(l)===0&&l.ctrlKey||K.mouseButton(l)===2});return new kr({clickTolerance:t,move:(l,h)=>({bearingDelta:(h.x-l.x)*s}),moveStateManager:n,enable:u,assignEvents:Xa})},zr=({enable:u,clickTolerance:t,pitchDegreesPerPixelMoved:s=-.5})=>{const n=new Rn({checkCorrectEvent:l=>K.mouseButton(l)===0&&l.ctrlKey||K.mouseButton(l)===2});return new kr({clickTolerance:t,move:(l,h)=>({pitchDelta:(h.y-l.y)*s}),moveStateManager:n,enable:u,assignEvents:Xa})};class Ce{constructor(t,s){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=s,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,s,n){return this._calculateTransform(t,s,n)}touchmove(t,s,n){if(this._map._cooperativeGestures&&(this._minTouches===2&&n.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,n.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(n.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,s,n)}
577touchend(t,s,n){this._calculateTransform(t,s,n),this._active&&n.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,s,n){n.length>0&&(this._active=!0);const l=er(n,s),h=new c.P(0,0),m=new c.P(0,0);let g=0;for(const v in l){const w=l[v],S=this._touches[v];S&&(h._add(w),m._add(w.sub(S)),g++,l[v]=w)}if(this._touches=l,g<this._minTouches||!m.mag())return;const y=m.div(g);return this._sum._add(y),this._sum.mag()<this._clickTolerance?void 0:{around:h.div(g),panDelta:y}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ka{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,s,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([s[0],s[1]]))}touchmove(t,s,n){if(!this._firstTwoTouches)return;t.preventDefault();const[l,h]=this._firstTwoTouches,m=Xr(n,s,l),g=Xr(n,s,h);if(!m||!g)return;const y=this._aroundCenter?null:m.add(g).div(2);return this._move([m,g],y,t)}
vendor: 4,449 bytes, line 577
577touchend(t,s,n){if(!this._firstTwoTouches)return;const[l,h]=this._firstTwoTouches,m=Xr(n,s,l),g=Xr(n,s,h);m&&g||(this._active&&K.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Xr(u,t,s){for(let n=0;n<u.length;n++)if(u[n].identifier===s)return t[n]}function Vs(u,t){return Math.log(u/t)/Math.LN2}class Xo extends Ka{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,s){const n=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Vs(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Vs(this._distance,n),pinchAround:s}}}function Ee(u,t){return 180*u.angleWith(t)/Math.PI}class Bn extends Ka{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,s){const n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ee(this._vector,n),pinchAround:s}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const s=25/(Math.PI*this._minDiameter)*360,n=Ee(t,this._startVector);return Math.abs(n)<s}}function Fn(u){return Math.abs(u.y)>Math.abs(u.x)}class $l extends Ka{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,s,n){super.touchstart(t,s,n),this._currentTouchCount=n.length}_start(t){this._lastPoints=t,Fn(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,s,n){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const l=t[0].sub(this._lastPoints[0]),h=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,h,n.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(l.y+h.y)/2*-.5}):void 0}gestureBeginsVertically(t,s,n){if(this._valid!==void 0)return this._valid;const l=t.mag()>=2,h=s.mag()>=2;if(!l&&!h)return;if(!l||!h)return this._firstMove===void 0&&(this._firstMove=n),n-this._firstMove<100&&void 0;const m=t.y>0==s.y>0;return Fn(t)&&Fn(s)&&m}}const On={panStep:100,bearingStep:15,pitchStep:10};class Ko{constructor(t){this._tr=new Hr(t);const s=On;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let s=0,n=0,l=0,h=0,m=0;switch(t.keyCode){case 61:case 107:case 171:case 187:s=1;break;case 189:case 109:case 173:s=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),h=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),h=1);break;case 38:t.shiftKey?l=1:(t.preventDefault(),m=-1);break;case 40:t.shiftKey?l=-1:(t.preventDefault(),m=1);break;default:return}return this._rotationDisabled&&(n=0,l=0),{cameraAnimation:g=>{const y=this._tr;g.easeTo({duration:300,easeId:"keyboardHandler",easing:Yo,zoom:s?Math.round(y.zoom)+s*(t.shiftKey?2:1):y.zoom,bearing:y.bearing+n*this._bearingStep,pitch:y.pitch+l*this._pitchStep,offset:[-h*this._panStep,-m*this._panStep],center:y.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Yo(u){return u*(2-u)}const Jo=4.000244140625;class jl{constructor(t,s){this._onTimeout=n=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(n)},this._map=t,this._tr=new Hr(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=s,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let s=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;
577const n=c.h.now(),l=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,s!==0&&s%Jo==0?this._type="wheel":s!==0&&Math.abs(s)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=s,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(l*s)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,s+=this._lastValue)),t.shiftKey&&s&&(s/=4),this._type&&(this._lastWheelEvent=t,this._delta-=s,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const s=K.mousePos(this._el,t),n=this._tr;this._around=c.L.convert(this._aroundCenter?n.center:n.unproject(s)),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const g=this._type==="wheel"&&Math.abs(this._delta)>Jo?this._wheelZoomRate:this._defaultZoomRate;let y=2/(1+Math.exp(-Math.abs(this._delta*g)));this._delta<0&&y!==0&&(y=1/y);const v=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(v*y))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const s=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,n=this._startZoom,l=this._easing;let h,m=!1;if(this._type==="wheel"&&n&&l){const g=Math.min((c.h.now()-this._lastWheelEventTime)/200,1),y=l(g);h=c.B.number(n,s,y),g<1?this._frameId||(this._frameId=!0):m=!0}else h=s,m=!0;return this._active=!0,m&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!m,zoomDelta:h-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let s=c.bb;if(this._prevEase){const n=this._prevEase,l=(c.h.now()-n.start)/n.duration,h=n.easing(l+.01)-n.easing(l),m=.27/Math.sqrt(h*h+1e-4)*.01,g=Math.sqrt(.0729-m*m);s=c.ba(m,g,.25,1)}return this._prevEase={start:c.h.now(),duration:t,easing:s},s}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Vn{constructor(t,s){this._clickZoom=t,this._tapZoom=s}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Nn{constructor(t){this._tr=new Hr(t),this.reset()}reset(){this._active=!1}dblclick(t,s){return t.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(s)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Un{constructor(){this._tap=new Ha({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,s,n){if(!this._swipePoint)if(this._tapTime){const l=s[0],h=t.timeStamp-this._tapTime<500,m=this._tapPoint.dist(l)<30;h&&m?n.length>0&&(this._swipePoint=l,this._swipeTouch=n[0].identifier):this.reset()}else this._tap.touchstart(t,s,n)}touchmove(t,s,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;const l=s[0],h=l.y-this._swipePoint.y;return this._swipePoint=l,t.preventDefault(),this._active=!0,{zoomDelta:h/128}}}else this._tap.touchmove(t,s,n)}
vendor: 4,666 bytes, line 577
577touchend(t,s,n){if(this._tapTime)this._swipePoint&&n.length===0&&this.reset();else{const l=this._tap.touchend(t,s,n);l&&(this._tapTime=t.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class $n{constructor(t,s,n){this._el=t,this._mousePan=s,this._touchPan=n}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ci{constructor(t,s,n){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=s,this._mousePitch=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Kr{constructor(t,s,n,l){this._el=t,this._touchZoom=s,this._touchRotate=n,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const ha=u=>u.zoom||u.drag||u.pitch||u.rotate;class jn extends c.k{}function da(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta}class qn{constructor(t,s){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,h)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const m=l.type==="renderFrame"?void 0:l,g={needsRenderFrame:!1},y={},v={},w=l.touches,S=w?this._getMapTouches(w):void 0,M=S?K.touchPos(this._el,S):K.mousePos(this._el,l);for(const{handlerName:F,handler:z,allowed:G}of this._handlers){if(!z.isEnabled())continue;let te;this._blockedByActive(v,G,F)?z.reset():z[h||l.type]&&(te=z[h||l.type](l,M,S),this.mergeHandlerResult(g,y,te,F,m),te&&te.needsRenderFrame&&this._triggerRenderFrame()),(te||z.isActive())&&(v[F]=z)}const R={};for(const F in this._previousActiveHandlers)v[F]||(R[F]=m);this._previousActiveHandlers=v,(Object.keys(R).length||da(g))&&(this._changes.push([g,y,R]),this._triggerRenderFrame()),(Object.keys(v).length||da(g))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:L}=g;L&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],L(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new jo(t),this._bearingSnap=s.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(s);const n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,h,m]of this._listeners)K.addEventListener(l,h,l===document?this.handleWindowEvent:this.handleEvent,m)}destroy(){for(const[t,s,n]of this._listeners)K.removeEventListener(t,s,t===document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(t){const s=this._map,n=s.getCanvasContainer();this._add("mapEvent",new Zo(s,t));const l=s.boxZoom=new Wo(s,t);this._add("boxZoom",l),t.interactive&&t.boxZoom&&l.enable();const h=new Pr(s),m=new Nn(s);s.doubleClickZoom=new Vn(m,h),this._add("tapZoom",h),this._add("clickZoom",m),t.interactive&&t.doubleClickZoom&&s.doubleClickZoom.enable();const g=new Un;this._add("tapDragZoom",g);
577const y=s.touchPitch=new $l(s);this._add("touchPitch",y),t.interactive&&t.touchPitch&&s.touchPitch.enable(t.touchPitch);const v=Os(t),w=zr(t);s.dragRotate=new Ci(t,v,w),this._add("mouseRotate",v,["mousePitch"]),this._add("mousePitch",w,["mouseRotate"]),t.interactive&&t.dragRotate&&s.dragRotate.enable();const S=(({enable:G,clickTolerance:te})=>{const U=new Rn({checkCorrectEvent:W=>K.mouseButton(W)===0&&!W.ctrlKey});return new kr({clickTolerance:te,move:(W,re)=>({around:re,panDelta:re.sub(W)}),activateOnStart:!0,moveStateManager:U,enable:G,assignEvents:Xa})})(t),M=new Ce(t,s);s.dragPan=new $n(n,S,M),this._add("mousePan",S),this._add("touchPan",M,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&s.dragPan.enable(t.dragPan);const R=new Bn,L=new Xo;s.touchZoomRotate=new Kr(n,L,R,g),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",L,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&s.touchZoomRotate.enable(t.touchZoomRotate);const F=s.scrollZoom=new jl(s,()=>this._triggerRenderFrame());this._add("scrollZoom",F,["mousePan"]),t.interactive&&t.scrollZoom&&s.scrollZoom.enable(t.scrollZoom);const z=s.keyboard=new Ko(s);this._add("keyboard",z),t.interactive&&t.keyboard&&s.keyboard.enable(),this._add("blockableMapEvent",new Go(s))}_add(t,s,n){this._handlers.push({handlerName:t,handler:s,allowed:n}),this._handlersById[t]=s}stop(t){if(!this._updatingCamera){for(const{handler:s}of this._handlers)s.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ha(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,s,n){for(const l in t)if(l!==n&&(!s||s.indexOf(l)<0))return!0;return!1}_getMapTouches(t){const s=[];for(const n of t)this._el.contains(n.target)&&s.push(n);return s}mergeHandlerResult(t,s,n,l,h){if(!n)return;c.e(t,n);const m={handlerName:l,originalEvent:n.originalEvent||h};n.zoomDelta!==void 0&&(s.zoom=m),n.panDelta!==void 0&&(s.drag=m),n.pitchDelta!==void 0&&(s.pitch=m),n.bearingDelta!==void 0&&(s.rotate=m)}_applyChanges(){const t={},s={},n={};for(const[l,h,m]of this._changes)l.panDelta&&(t.panDelta=(t.panDelta||new c.P(0,0))._add(l.panDelta)),l.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+l.pitchDelta),l.around!==void 0&&(t.around=l.around),l.pinchAround!==void 0&&(t.pinchAround=l.pinchAround),l.noInertia&&(t.noInertia=l.noInertia),c.e(s,h),c.e(n,m);this._updateMapTransform(t,s,n),this._changes=[]}_updateMapTransform(t,s,n){const l=this._map,h=l._getTransformForUpdate(),m=l.terrain;if(!(da(t)||m&&this._terrainMovement))return this._fireEvents(s,n,!0);let{panDelta:g,zoomDelta:y,bearingDelta:v,pitchDelta:w,around:S,pinchAround:M}=t;M!==void 0&&(S=M),l._stop(!0),S=S||l.transform.centerPoint;const R=h.pointLocation(g?S.sub(g):S);v&&(h.bearing+=v),w&&(h.pitch+=w),y&&(h.zoom+=y),m?this._terrainMovement||!s.drag&&!s.zoom?s.drag&&this._terrainMovement?h.center=h.pointLocation(h.centerPoint.sub(g)):h.setLocationAtPoint(R,S):(this._terrainMovement=!0,this._map._elevationFreeze=!0,h.setLocationAtPoint(R,S),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,h.recalculateZoom(l.terrain)})):h.setLocationAtPoint(R,S),l._applyUpdatedTransform(h),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(s,n,!0)}_fireEvents(t,s,n){const l=ha(this._eventsInProgress),h=ha(t),m={};for(const w in t){const{originalEvent:S}=t[w];this._eventsInProgress[w]||(m[`${w}start`]=S),this._eventsInProgress[w]=t[w]}!l&&h&&this._fireEvent("movestart",h.originalEvent);for(const w in m)this._fireEvent(w,m[w]);h&&this._fireEvent("move",h.originalEvent);for(const w in t){const{originalEvent:S}=t[w];this._fireEvent(w,S)}const g={};let y;for(const w in this._eventsInProgress){const{handlerName:S,originalEvent:M}=this._eventsInProgress[w];this._handlersById[S].isActive()||(delete this._eventsInProgress[w],y=s[S]||M,g[`${w}end`]=y)}for(const w in g)this._fireEvent(w,g[w]);const v=ha(this._eventsInProgress);if(n&&(l||h)&&!v){this._updatingCamera=!0;const w=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),S=M=>M!==0&&-this._bearingSnap<M&&M<this._bearingSnap;!w||!w.essential&&c.h.prefersReducedMotion?(this._map.fire(new c.k("moveend",{originalEvent:y})),S(this._map.getBearing())&&this._map.resetNorth()):(S(w.bearing||this._map.getBearing())&&
577(w.bearing=0),w.freezeElevation=!0,this._map.easeTo(w,{originalEvent:y})),this._updatingCamera=!1}}_fireEvent(t,s){this._map.fire(new c.k(t,s?{originalEvent:s}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new jn("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Qo extends c.E{constructor(t,s){super(),this._renderFrameCallback=()=>{const n=Math.min((c.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=s.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.L(this.transform.center.lng,this.transform.center.lat)}setCenter(t,s){return this.jumpTo({center:t},s)}panBy(t,s,n){return t=c.P.convert(t).mult(-1),this.panTo(this.transform.center,c.e({offset:t},s),n)}panTo(t,s,n){return this.easeTo(c.e({center:t},s),n)}getZoom(){return this.transform.zoom}setZoom(t,s){return this.jumpTo({zoom:t},s),this}zoomTo(t,s,n){return this.easeTo(c.e({zoom:t},s),n)}zoomIn(t,s){return this.zoomTo(this.getZoom()+1,t,s),this}zoomOut(t,s){return this.zoomTo(this.getZoom()-1,t,s),this}getBearing(){return this.transform.bearing}setBearing(t,s){return this.jumpTo({bearing:t},s),this}getPadding(){return this.transform.padding}setPadding(t,s){return this.jumpTo({padding:t},s),this}rotateTo(t,s,n){return this.easeTo(c.e({bearing:t},s),n)}resetNorth(t,s){return this.rotateTo(0,c.e({duration:1e3},t),s),this}resetNorthPitch(t,s){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},t),s),this}snapToNorth(t,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,s):this}getPitch(){return this.transform.pitch}setPitch(t,s){return this.jumpTo({pitch:t},s),this}cameraForBounds(t,s){t=bt.convert(t);const n=s&&s.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),n,s)}_cameraForBoxAndBearing(t,s,n,l){const h={top:0,bottom:0,right:0,left:0};if(typeof(l=c.e({padding:h,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const re=l.padding;l.padding={top:re,bottom:re,right:re,left:re}}l.padding=c.e(h,l.padding);const m=this.transform,g=m.padding,y=m.project(c.L.convert(t)),v=m.project(c.L.convert(s)),w=y.rotate(-n*Math.PI/180),S=v.rotate(-n*Math.PI/180),M=new c.P(Math.max(w.x,S.x),Math.max(w.y,S.y)),R=new c.P(Math.min(w.x,S.x),Math.min(w.y,S.y)),L=M.sub(R),F=(m.width-(g.left+g.right+l.padding.left+l.padding.right))/L.x,z=(m.height-(g.top+g.bottom+l.padding.top+l.padding.bottom))/L.y;if(z<0||F<0)return void c.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const G=Math.min(m.scaleZoom(m.scale*Math.min(F,z)),l.maxZoom),te=c.P.convert(l.offset),U=new c.P((l.padding.left-l.padding.right)/2,(l.padding.top-l.padding.bottom)/2).rotate(n*Math.PI/180),W=te.add(U).mult(m.scale/m.zoomScale(G));return{center:m.unproject(y.add(v).div(2).sub(W)),zoom:G,bearing:n}}fitBounds(t,s,n){return this._fitInternal(this.cameraForBounds(t,s),s,n)}fitScreenCoordinates(t,s,n,l,h){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(c.P.convert(t)),this.transform.pointLocation(c.P.convert(s)),n,l),l,h)}_fitInternal(t,s,n){return t?(delete(s=c.e(t,s)).padding,s.linear?this.easeTo(s,n):this.flyTo(s,n)):this}jumpTo(t,s){this.stop();const n=this._getTransformForUpdate();let l=!1,h=!1,m=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(l=!0,n.zoom=+t.zoom),t.center!==void 0&&(n.center=c.L.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(h=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(m=!0,n.pitch=+t.pitch),t.padding==null||n.isPaddingEqual(t.padding)||(n.padding=t.padding),this._applyUpdatedTransform(n),this.fire(new c.k("movestart",s)).fire(new c.k("move",s)),l&&this.fire(new c.k("zoomstart",s)).fire(new c.k("zoom",s)).fire(new c.k("zoomend",s)),h&&this.fire(new c.k("rotatestart",s)).fire(new c.k("rotate",s)).fire(new c.k("rotateend",s)),m&&this.fire(new c.k("pitchstart",s)).fire(new c.k("pitch",s)).fire(new c.k("pitchend",s)),this.fire(new c.k("moveend",s))}calculateCameraOptionsFromTo(t,s,n,l=0){const h=c.U.fromLngLat(t,s),m=c.U.fromLngLat(n,l),g=m.x-h.x,y=m.y-h.y,v=m.z-h.z,w=Math.hypot(g,y,v);if(w===0)throw new Error("Can't calculate camera options with same From and To");const S=Math.hypot(g,y),M=this.transform.scaleZoom(this.transform.cameraToCenterDistance/w/this.transform.tileSize),R=180*Math.atan2(g,-y)/Math.PI;let L=180*Math.acos(S/w)/Math.PI;return L=v<0?90-L:90+L,{center:m.toLngLat(),zoom:M,pitch:L,bearing:R}}easeTo(t,s){this._stop(!1,t.easeId),((t=c.e({offset:[0,0],duration:500,easing:c.bb},t)).animate===!1||!t.essential&&c.h.prefersReducedMotion)&&(t.duration=0);const n=this._getTransformForUpdate(),l=this.getZoom(),h=this.getBearing(),m=this.getPitch(),g=this.getPadding(),y="zoom"in t?+t.zoom:l,v="bearing"in t?this._normalizeBearing(t.bearing,h):h,w="pitch"in t?+t.pitch:m,S="padding"in t?t.padding:n.padding,M=c.P.convert(t.offset);let R=n.centerPoint.add(M);const L=n.pointLocation(R),F=c.L.convert(t.center||L);this._normalizeCenter(F);const z=n.project(L),G=n.project(F).sub(z),te=n.zoomScale(y-l);let U,W;t.around&&(U=c.L.convert(t.around),W=n.locationPoint(U));const re={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==l,this._rotating=this._rotating||h!==v,this._pitching=this._pitching||w!==m,this._padding=!n.isPaddingEqual(S),this._easeId=t.easeId,this._prepareEase(s,t.noMoveStart,re),this.terrain&&this._prepareElevation(F),this._ease(se=>{if(this._zooming&&(n.zoom=c.B.number(l,y,se)),this._rotating&&(n.bearing=c.B.number(h,v,se)),this._pitching&&(n.pitch=c.B.number(m,w,se)),this._padding&&(n.interpolatePadding(g,S,se),R=n.centerPoint.add(M)),this.terrain&&!t.freezeElevation&&this._updateElevation(se),U)n.setLocationAtPoint(U,W);else{const he=n.zoomScale(n.zoom-l),ge=y>l?Math.min(2,te):Math.max(.5,te),fe=Math.pow(ge,1-se),ye=n.unproject(z.add(G.mult(se*fe)).mult(he));
577n.setLocationAtPoint(n.renderWorldCopies?ye.wrap():ye,R)}this._applyUpdatedTransform(n),this._fireMoveEvents(s)},se=>{this.terrain&&this._finalizeElevation(),this._afterEase(s,se)},t),this}_prepareEase(t,s,n={}){this._moving=!0,s||n.moving||this.fire(new c.k("movestart",t)),this._zooming&&!n.zooming&&this.fire(new c.k("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new c.k("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new c.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const s=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&s!==this._elevationTarget){const n=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(n-(s-(n*t+this._elevationStart))/(1-t)),this._elevationTarget=s}this.transform.elevation=c.B.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const s=t.clone(),{center:n,zoom:l,pitch:h,bearing:m,elevation:g}=this.transformCameraUpdate(s);n&&(s.center=n),l!==void 0&&(s.zoom=l),h!==void 0&&(s.pitch=h),m!==void 0&&(s.bearing=m),g!==void 0&&(s.elevation=g),this.transform.apply(s)}_fireMoveEvents(t){this.fire(new c.k("move",t)),this._zooming&&this.fire(new c.k("zoom",t)),this._rotating&&this.fire(new c.k("rotate",t)),this._pitching&&this.fire(new c.k("pitch",t))}_afterEase(t,s){if(this._easeId&&s&&this._easeId===s)return;delete this._easeId;const n=this._zooming,l=this._rotating,h=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new c.k("zoomend",t)),l&&this.fire(new c.k("rotateend",t)),h&&this.fire(new c.k("pitchend",t)),this.fire(new c.k("moveend",t))}flyTo(t,s){if(!t.essential&&c.h.prefersReducedMotion){const Re=c.F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Re,s)}this.stop(),t=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.bb},t);const n=this._getTransformForUpdate(),l=this.getZoom(),h=this.getBearing(),m=this.getPitch(),g=this.getPadding(),y="zoom"in t?c.ad(+t.zoom,n.minZoom,n.maxZoom):l,v="bearing"in t?this._normalizeBearing(t.bearing,h):h,w="pitch"in t?+t.pitch:m,S="padding"in t?t.padding:n.padding,M=n.zoomScale(y-l),R=c.P.convert(t.offset);let L=n.centerPoint.add(R);const F=n.pointLocation(L),z=c.L.convert(t.center||F);this._normalizeCenter(z);const G=n.project(F),te=n.project(z).sub(G);let U=t.curve;const W=Math.max(n.width,n.height),re=W/M,se=te.mag();if("minZoom"in t){const Re=c.ad(Math.min(t.minZoom,l,y),n.minZoom,n.maxZoom),ft=W/n.zoomScale(Re-l);U=Math.sqrt(ft/se*2)}const he=U*U;function ge(Re){const ft=(re*re-W*W+(Re?-1:1)*he*he*se*se)/(2*(Re?re:W)*he*se);return Math.log(Math.sqrt(ft*ft+1)-ft)}function fe(Re){return(Math.exp(Re)-Math.exp(-Re))/2}function ye(Re){return(Math.exp(Re)+Math.exp(-Re))/2}const De=ge(!1);let et=function(Re){return ye(De)/ye(De+U*Re)},Te=function(Re){return W*((ye(De)*(fe(ft=De+U*Re)/ye(ft))-fe(De))/he)/se;var ft},je=(ge(!0)-De)/U;if(Math.abs(se)<1e-6||!isFinite(je)){if(Math.abs(W-re)<1e-6)return this.easeTo(t,s);const Re=re<W?-1:1;je=Math.abs(Math.log(re/W))/U,Te=function(){return 0},et=function(ft){return Math.exp(Re*U*ft)}}return t.duration="duration"in t?+t.duration:1e3*je/("screenSpeed"in t?+t.screenSpeed/U:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=h!==v,this._pitching=w!==m,this._padding=!n.isPaddingEqual(S),this._prepareEase(s,!1),this.terrain&&this._prepareElevation(z),this._ease(Re=>
577{const ft=Re*je,Qe=1/et(ft);n.zoom=Re===1?y:l+n.scaleZoom(Qe),this._rotating&&(n.bearing=c.B.number(h,v,Re)),this._pitching&&(n.pitch=c.B.number(m,w,Re)),this._padding&&(n.interpolatePadding(g,S,Re),L=n.centerPoint.add(R)),this.terrain&&!t.freezeElevation&&this._updateElevation(Re);const Xe=Re===1?z:n.unproject(G.add(te.mult(Te(ft))).mult(Qe));n.setLocationAtPoint(n.renderWorldCopies?Xe.wrap():Xe,L),this._applyUpdatedTransform(n),this._fireMoveEvents(s)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(s)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,s)}if(!t){const n=this.handlers;n&&n.stop(!1)}return this}_ease(t,s,n){n.animate===!1||n.duration===0?(t(1),s()):(this._easeStart=c.h.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,s){t=c.b5(t,-180,180);const n=Math.abs(t-s);return Math.abs(t-360-s)<n&&(t-=360),Math.abs(t+360-s)<n&&(t+=360),t}_normalizeCenter(t){const s=this.transform;if(!s.renderWorldCopies||s.lngRange)return;const n=t.lng-s.center.lng;t.lng+=n>180?-360:n<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(c.L.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class Ui{constructor(t={}){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=s=>{!s||s.sourceDataType!=="metadata"&&s.sourceDataType!=="visibility"&&s.dataType!=="style"&&s.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=K.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=K.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=K.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){K.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,s){const n=this._map._getUIString(`AttributionControl.${s}`);t.title=n,t.setAttribute("aria-label",n)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="str
577ing"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const s=this._map.style.sourceCaches;for(const l in s){const h=s[l];if(h.used||h.usedForTerrain){const m=h.getSource();m.attribution&&t.indexOf(m.attribution)<0&&t.push(m.attribution)}}t=t.filter(l=>String(l).trim()),t.sort((l,h)=>l.length-h.length),t=t.filter((l,h)=>{for(let m=h+1;m<t.length;m++)if(t[m].indexOf(l)>=0)return!1;return!0});const n=t.join(" | ");n!==this._attribHTML&&(this._attribHTML=n,t.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class wt{constructor(t={}){this._updateCompact=()=>{const s=this._container.children;if(s.length){const n=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=K.create("div","maplibregl-ctrl");const s=K.create("a","maplibregl-ctrl-logo");return s.target="_blank",s.rel="noopener nofollow",s.href="https://maplibre.org/",s.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),s.setAttribute("rel","noopener nofollow"),this._container.appendChild(s),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){K.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ya{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const s=++this._id;return this._queue.push({callback:t,id:s,cancelled:!1}),s}remove(t){const s=this._currentlyRunning,n=s?this._queue.concat(s):this._queue;for(const l of n)if(l.id===t)return void(l.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const s=this._currentlyRunning=this._queue;this._queue=[];for(const n of s)if(!n.cancelled&&(n.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Zn={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var el=c.Q([{name:"a_pos3d",type:"Int16",components:3}]);class tl extends c.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,s){this.sourceCache.update(t,s),this._renderableTilesKeys=[];const n={};for(const l of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:s}))n[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.posMatrix=new Float64Array(16),c.aS(l.posMatrix,0,c.N,0,c.N,0,1),this._tiles[l.key]=new $r(l,this.tileSize));for(const l in this._tiles)n[l]||delete this._tiles[l]}freeRtt(t){for(const s in this._tiles){const n=this._tiles[s];(!t||n.tileID.equals(t)||n.tileID.isChildOf(t)||t.isChildOf(n.tileID))&&(n.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const s={};for(const n of this._renderableTilesKeys){const l=this._tiles[n].tileID;if(l.canonical.equals(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16),c.aS(h.posMatrix,0,c.N,0,c.N,0,1),s[n]=h}else if(l.canonical.isChildOf(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const m=l.canonical.z-t.canonical.z,g=l.canonical.x-(l.canonical.x>>m<<m),y=l.canonical.y-(l.canonical.y>>m<<m),v=c.N>>m;c.aS(h.posMatrix,0,v,0,v,0,1),c.$(h.posMatrix,h.posMatrix,[-g*v,-y*v,0]),s[n]=h}else if(t.canonical.isChildOf(l.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const m=t.canonical.z-l.canonical.z,g=t.canonical.x-(t.canonical.x>>m<<m),y=t.canonical.y-(t.canonical.y>>m<<m),v=c.N>>m;c.aS(h.posMatrix,0,c.N,0,c.N,0,1),c.$(h.posMatrix,h.posMatrix,[g*v,y*v,0]),c.a0(h.posMatrix,h.posMatrix,[1/2**m,1/2**m,0]),s[n]=h}}return s}getSourceTile(t,s){const n=this.sourceCache._source;let l=t.overscaledZ-this.deltaZoom;if(l>n.maxzoom&&(l=n.maxzoom),l<n.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(l).key);let h=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!h||!h.dem)&&s)for(;l>=n.minzoom&&(!h||!h.dem);)h=this.sourceCache.getTileByID(t.scaledTo(l--).key);return h}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(s=>s.timeAdded>=t)}}class il{constructor(t,s,n){this.painter=t,this.sourceCache=new tl(s),this.options=n,this.exaggeration=typeof n.exaggeration=="number"?n.exaggeration:1,this.qual
vendor: 15,338 bytes, line 577
577ityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,s,n,l=c.N){var h;if(!(s>=0&&s<l&&n>=0&&n<l))return 0;const m=this.getTerrainData(t),g=(h=m.tile)===null||h===void 0?void 0:h.dem;if(!g)return 0;const y=function(L,F,z){var G=F[0],te=F[1];return L[0]=z[0]*G+z[4]*te+z[12],L[1]=z[1]*G+z[5]*te+z[13],L}([],[s/l*c.N,n/l*c.N],m.u_terrain_matrix),v=[y[0]*g.dim,y[1]*g.dim],w=Math.floor(v[0]),S=Math.floor(v[1]),M=v[0]-w,R=v[1]-S;return g.get(w,S)*(1-M)*(1-R)+g.get(w+1,S)*M*(1-R)+g.get(w,S+1)*(1-M)*R+g.get(w+1,S+1)*M*R}getElevationForLngLatZoom(t,s){const{tileID:n,mercatorX:l,mercatorY:h}=this._getOverscaledTileIDFromLngLatZoom(t,s);return this.getElevation(n,l%c.N,h%c.N,c.N)}getElevation(t,s,n,l=c.N){return this.getDEMElevation(t,s,n,l)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const l=this.painter.context,h=new c.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Et(l,h,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Et(l,new c.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=c.ao([])}const s=this.sourceCache.getSourceTile(t,!0);if(s&&s.dem&&(!s.demTexture||s.needsTerrainPrepare)){const l=this.painter.context;s.demTexture=this.painter.getTileTexture(s.dem.stride),s.demTexture?s.demTexture.update(s.dem.getPixels(),{premultiply:!1}):s.demTexture=new Et(l,s.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),s.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),s.needsTerrainPrepare=!1}const n=s&&s+s.tileID.key+t.key;if(n&&!this._demMatrixCache[n]){const l=this.sourceCache.sourceCache._source.maxzoom;let h=t.canonical.z-s.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=l?h=t.canonical.z-l:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const m=t.canonical.x-(t.canonical.x>>h<<h),g=t.canonical.y-(t.canonical.y>>h<<h),y=c.bc(new Float64Array(16),[1/(c.N<<h),1/(c.N<<h),0]);c.$(y,y,[m*c.N,g*c.N,0]),this._demMatrixCache[t.key]={matrix:y,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:s&&s.dem&&s.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:s&&s.dem&&s.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(s&&s.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:s}}getFramebuffer(t){const s=this.painter,n=s.width/devicePixelRatio,l=s.height/devicePixelRatio;return!this._fbo||this._fbo.width===n&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Et(s.context,{width:n,height:l,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Et(s.context,{width:n,height:l,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=s.context.createFramebuffer(n,l,!0,!1),this._fbo.depthAttachment.set(s.context.createRenderbuffer(s.context.gl.DEPTH_COMPONENT16,n,l))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const s=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let h=0,m=0;h<this._coordsTextureSize;h++)for(let g=0;g<this._coordsTextureSize;g++,m+=4)s[m+0]=255&g,s[m+1]=255&h,s[m+2]=g>>8<<4|h>>8,s[m+3]=0;const n=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(s.buffer)),l=new Et(t,n,t.gl.RGBA,{premultiply:!1});return l.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(t){const s=new Uint8Array(4),n=this.painter.context,l=n.gl;n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,s),n.bindFramebuffer.set(null);const h=s[0]+(s[2]>>4<<8),m=s[1]+((15&s[2])<<8),g=this.coordsIndex[255-s[3]],y=g&&this.sourceCache.getTileByID(g);if(!y)return null;const v=this._coordsTextureSize,w=(1<<y.tileID.canonical.z)*v;return new c.U(this._allowMercatorOverflow(t,(y.tileID.canonical.x*v+h)/w),(y.tileID.canonical.y*v+m)/w,this.getElevation(y.tileID,h,m,v))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,s=new c.bd,n=new c.b0,l=this.meshSize,h=c.N/l,m=l*l;for(let S=0;S<=l;S++)for(let M=0;M<=l;M++)s.emplaceBack(M*h,S*h,0);for(let S=0;S<m;S+=l+1)for(let M=0;M<l;M++)n.emplaceBack(M+S,l+M+S+1,l+M+S+2),n.emplaceBack(M+S,l+M+S+2,M+S+1);const g=s.length,y=g+2*(l+1);for(const S of[0,1])for(let M=0;M<=l;M++)for(const R of[0,1])s.emplaceBack(M*h,S*c.N,R);for(let S=0;S<2*l;S+=2)n.emplaceBack(y+S,y+S+1,y+S+3),n.emplaceBack(y+S,y+S+3,y+S+2),n.emplaceBack(g+S,g+S+3,g+S+1),n.emplaceBack(g+S,g+S+2,g+S+3);const v=s.length,w=v+2*(l+1);for(const S of[0,1])for(let M=0;M<=l;M++)for(const R of[0,1])s.emplaceBack(S*c.N,M*h,R);for(let S=0;S<2*l;S+=2)n.emplaceBack(v+S,v+S+1,v+S+3),n.emplaceBack(v+S,v+S+3,v+S+2),n.emplaceBack(w+S,w+S+3,w+S+1),n.emplaceBack(w+S,w+S+2,w+S+3);return this._mesh={indexBuffer:t.createIndexBuffer(n),vertexBuffer:t.createVertexBuffer(s,el.members),segments:c.S.simpleSegment(0,0,s.length,n.length)},this._mesh}getMeshFrameDelta(t){return 2*Math.PI*c.be/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,s){var n;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(t,s);return(n=this.getMinMaxElevation(l).minElevation)!==null&&n!==void 0?n:0}getMinMaxElevation(t){const s=this.getTerrainData(t).tile,n={minElevation:null,maxElevation:null};return s&&s.dem&&(n.minElevation=s.dem.min*this.exaggeration,n.maxElevation=s.dem.max*this.exaggeration),n}_getOverscaledTileIDFromLngLatZoom(t,s){const n=c.U.fromLngLat(t.wrap()),l=(1<<s)*c.N,h=n.x*l,m=n.y*l,g=Math.floor(h/c.N),y=Math.floor(m/c.N);return{tileID:new c.O(s,0,s,g,y),mercatorX:h,mercatorY:m}}_allowMercatorOverflow(t,s){const n=t.x<this.painter.width/2;let l=c.bf(s);const h=this.painter.transform.center.lng;return n&&Math.sign(l)>0&&Math.sign(h)<0||!n&&Math.sign(l)<0&&Math.sign(h)>0?(l=360*Math.sign(h)+l,c.G(l)):s}}class ql{constructor(t,s,n){this._context=t,this._size=s,this._tileSize=n,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const s=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),n=new Et(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return n.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),s.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),s.colorAttachment.set(n.texture),{id:t,fbo:s,texture:n,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(s=>t.id!==s),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const s of this._recentlyUsed)if(!this._objects[s].inUse)return this._objects[s];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(t=>!t.inUse)===!1}}const xi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ja{constructor(t,s){this.painter=t,this.terrain=s,this.pool=new ql(t.context,30,s.sourceCache.tileSize*s.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,s){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(n=>!t._layers[n].isHidden(s)),this._coordsDescendingInv={};for(const n in t.sourceCaches){this._coordsDescendingInv[n]={};const l=t.sourceCaches[n].getVisibleCoordinates();for(const h of l){const m=this.terrain.sourceCache.getTerrainCoords(h);for(const g in m)this._coordsDescendingInv[n][g]||(this._coordsDescendingInv[n][g]=[]),this._coordsDescendingInv[n][g].push(m[g])}}this._coordsDescendingInvStr={};for(const n of t._order){const l=t._layers[n],h=l.source;if(xi[l.type]&&!this._coordsDescendingInvStr[h]){this._coordsDescendingInvStr[h]={};for(const m in this._coordsDescendingInv[h])this._coordsDescendingInvStr[h][m]=this._coordsDescendingInv[h][m].map(g=>g.key).sort().join()}}for(const n of this._renderableTiles)for(const l in this._coordsDescendingInvStr){const h=this._coordsDescendingInvStr[l][n.tileID.key];h&&h!==n.rttCoords[l]&&(n.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const s=t.type,n=this.painter,l=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(xi[s]&&(this._prevType&&xi[this._prevType]||this._stacks.push([]),this._prevType=s,this._stacks[this._stacks.length-1].push(t.id),!l))return!0;if(xi[this._prevType]||xi[s]&&l){this._prevType=s;const h=this._stacks.length-1,m=this._stacks[h]||[];for(const g of this._renderableTiles){if(this.pool.isFull()&&(Lt(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(g),g.rtt[h]){const v=this.pool.getObjectForId(g.rtt[h].id);if(v.stamp===g.rtt[h].stamp){this.pool.useObject(v);continue}}const y=this.pool.getOrCreateFreeObject();this.pool.useObject(y),this.pool.stampObject(y),g.rtt[h]={id:y.id,stamp:y.stamp},n.context.bindFramebuffer.set(y.fbo.framebuffer),n.context.clear({color:c.aT.transparent,stencil:0}),n.currentStencilSource=void 0;for(let v=0;v<m.length;v++){const w=n.style._layers[m[v]],S=w.source?this._coordsDescendingInv[w.source][g.tileID.key]:[g.tileID];n.context.viewport.set([0,0,y.fbo.width,y.fbo.height]),n._renderTileClippingMasks(w,S),n.renderLayer(n,n.style.sourceCaches[w.source],w,S),w.source&&(g.rttCoords[w.source]=this._coordsDescendingInvStr[w.source][g.tileID.key])}}return Lt(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),xi[s]}return!1}}const Oe=Fe,$e={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:c.c.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},pa=u=>{u.touchstart=u.dragStart,u.touchmoveWindow=u.dragMove,u.touchend=u.dragEnd},Gn={showCompass:!0,showZoom:!0,visualizePitch:!1};class Wn{constructor(t,s,n=!1){this.mousedown=m=>{this.startMouse(c.e({},m,{ctrlKey:!0,preventDefault:()=>m.preventDefault()}),K.mousePos(this.element,m)),K.addEventListener(window,"mousemove",this.mousemove),K.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=m=>{this.moveMouse(m,K.mousePos(this.element,m))},this.mouseup=m=>{this.mouseRotate.dragEnd(m),this.mousePitch&&this.mousePitch.dragEnd(m),this.offTemp()},this.touchstart=m=>{m.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=K.touchPos(this.element,m.targetTouches)[0],this.startTouch(m,this._startPos),K.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),K.addEventListener(window,"touchend",this.touchend))},this.touchmove=m=>{m.targetTouches.length!==1?this.reset():(this._lastPos=K.touchPos(this.element,m.targetTouches)[0],this.moveTouch(m,this._lastPos))},this.touchend=m=>{m.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const l=t.dragRotate._mouseRotate.getClickTolerance(),h=t.dragRotate._mousePitch.getClickTolerance();this.element=s,this.mouseRotate=Os({clickTolerance:l,enable:!0}),this.touchRotate=(({enable:m,clickTolerance:g,bearingDegreesPerPixelMoved:y=.8})=>{const v=new Ho;return new kr({clickTolerance:g,move:(w,S)=>({bearingDelta:(S.x-w.x)*y}),moveStateManager:v,enable:m,assignEvents:pa})})({clickTolerance:l,enable:!0}),this.map=t,n&&(this.mousePitch=zr({clickTolerance:h,enable:!0}),this.touchPitch=(({enable:m,clickTolerance:g,pitchDegreesPerPixelMoved:y=-.5})=>{const v=new Ho;return new kr({clickTolerance:g,move:(w,S)=>({pitchDelta:(S.y-w.y)*y}),moveStateManager:v,enable:m,assignEvents:pa})})({clickTolerance:h,enable:!0})),K.addEventListener(s,"mousedown",this.mousedown),K.addEventListener(s,"touchstart",this.touchstart,{passive:!1}),K.addEventListener(s,"touchcancel",this.reset)}startMouse(t,s){this.mouseRotate.dragStart(t,s),this.mousePitch&&this.mousePitch.dragStart(t,s),K.disableDrag()}startTouch(t,s){this.touchRotate.dragStart(t,s),this.touchPitch&&this.touchPitch.dragStart(t,s),K.disableDrag()}moveMouse(t,s){const n=this.map,{bearingDelta:l}=this.mouseRotate.dragMove(t,s)||{};if(l&&n.setBearing(n.getBearing()+l),this.mousePitch){const{pitchDelta:h}=this.mousePitch.dragMove(t,s)||{};h&&n.setPitch(n.getPitch()+h)}}moveTouch(t,s){const n=this.map,{bearingDelta:l}=this.touchRotate.dragMove(t,s)||{};if(l&&n.setBearing(n.getBearing()+l),this.touchPitch){const{pitchDelta:h}=this.touchPitch.dragMove(t,s)||{};h&&n.setPitch(n.getPitch()+h)}}off(){const t=this.element;K.removeEventListener(t,"mousedown",this.mousedown),K.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),K.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),K.removeEventListener(window,"touchend",this.touchend),K.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){K.enableDrag(),K.removeEventListener(window,"mousemove",this.mousemove),K.removeEventListener(window,"mouseup",this.mouseup),K.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),K.removeEventListener(window,"touchend",this.touchend)}}let Nt;function Hn(u,t,s){if(u=new c.L(u.lng,u.lat),t){const n=new c.L(u.lng-360,u.lat),l=new c.L(u.lng+360,u.lat),h=s.locationPoint(u).distSqr(t);s.locationPoint(n).distSqr(t)<h?u=n:s.locationPoint(l).distSqr(t)<h&&(u=l)}for(;Math.abs(u.lng-s.center.lng)>180;){const n=s.locationPoint(u);if(n.x>=0&&n.y>=0&&n.x<=s.width&&n.y<=s.height)break;u.lng>s.center.lng?u.lng-=360:u.lng+=360}return u}
577const tr={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function rl(u,t,s){const n=u.classList;for(const l in tr)n.remove(`maplibregl-${s}-anchor-${l}`);n.add(`maplibregl-${s}-anchor-${t}`)}class ds extends c.E{constructor(t){if(super(),this._onKeyPress=s=>{const n=s.code,l=s.charCode||s.keyCode;n!=="Space"&&n!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=s=>{const n=s.originalEvent.target,l=this._element;this._popup&&(n===l||l.contains(n))&&this.togglePopup()},this._update=s=>{if(!this._map)return;const n=this._map.loaded()&&!this._map.isMoving();(s?.type==="terrain"||s?.type==="render"&&!n)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Hn(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let h="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?h="rotateX(0deg)":this._pitchAlignment==="map"&&(h=`rotateX(${this._map.getPitch()}deg)`),s&&s.type!=="moveend"||(this._pos=this._pos.round()),K.setTransform(this._element,`${tr[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${h} ${l}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const m=this._map.unproject(this._pos),g=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=m.distanceTo(this._lngLat)>20*g?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=s=>{if(!this._isDragging){const n=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=s.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=s=>{this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=c.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=K.create("div"),this._element.setAttribute("aria-label","Map marker");const s=K.createNS("http://www.w3.org/2000/svg","svg"),n=41,l=27;s.setAttributeNS(null,"display","block"),s.setAttributeNS(null,"height",`${n}px`),s.setAttributeNS(null,"width",`${l}px`),s.setAttributeNS(null,"viewBox",`0 0 ${l} ${n}`);const h=K.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"stroke","none"),h.setAttributeNS(null,"stroke-width","1"),h.setAttributeNS(null,"fill","none"),h.setAttributeNS(null,"fill-rule","evenodd");const m=K.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"fill-rule","nonzero");const g=K.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");const y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const G of y){const te=K.createNS("http://www.w3.org/2000/svg","ellipse");te.setAttributeNS(null,"opacity","0.04"),te.setAttributeNS(null,"cx","10.5"),te.setAttributeNS(null,"cy","5.80029008"),te.setAttributeNS(null,"rx",G.rx),te.setAttributeNS(null,"ry",G.ry),g.appendChild(te)}const v=K.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"fill",this._color);const w=K.createNS("http://www.w3.org/2000/svg","path");w.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),v.a
577ppendChild(w);const S=K.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"opacity","0.25"),S.setAttributeNS(null,"fill","#000000");const M=K.createNS("http://www.w3.org/2000/svg","path");M.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),S.appendChild(M);const R=K.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"transform","translate(6.0, 7.0)"),R.setAttributeNS(null,"fill","#FFFFFF");const L=K.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"transform","translate(8.0, 8.0)");const F=K.createNS("http://www.w3.org/2000/svg","circle");F.setAttributeNS(null,"fill","#000000"),F.setAttributeNS(null,"opacity","0.25"),F.setAttributeNS(null,"cx","5.5"),F.setAttributeNS(null,"cy","5.5"),F.setAttributeNS(null,"r","5.4999962");const z=K.createNS("http://www.w3.org/2000/svg","circle");z.setAttributeNS(null,"fill","#FFFFFF"),z.setAttributeNS(null,"cx","5.5"),z.setAttributeNS(null,"cy","5.5"),z.setAttributeNS(null,"r","5.4999962"),L.appendChild(F),L.appendChild(z),m.appendChild(g),m.appendChild(v),m.appendChild(S),m.appendChild(R),m.appendChild(L),s.appendChild(m),s.setAttributeNS(null,"height",n*this._scale+"px"),s.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(s),this._offset=c.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",s=>{s.preventDefault()}),this._element.addEventListener("mousedown",s=>{s.preventDefault()}),rl(this._element,this._anchor,"marker"),t&&t.className)for(const s of t.className.split(" "))this._element.classList.add(s);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),K.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=c.L.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const l=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(t){return this._offset=c.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const Rt={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0}
577;let kt=0,Ns=!1;const fa={maxWidth:100,unit:"metric"};function ma(u,t,s){const n=s&&s.maxWidth||100,l=u._container.clientHeight/2,h=u.unproject([0,l]),m=u.unproject([n,l]),g=h.distanceTo(m);if(s&&s.unit==="imperial"){const y=3.2808*g;y>5280?ps(t,n,y/5280,u._getUIString("ScaleControl.Miles")):ps(t,n,y,u._getUIString("ScaleControl.Feet"))}else s&&s.unit==="nautical"?ps(t,n,g/1852,u._getUIString("ScaleControl.NauticalMiles")):g>=1e3?ps(t,n,g/1e3,u._getUIString("ScaleControl.Kilometers")):ps(t,n,g,u._getUIString("ScaleControl.Meters"))}function ps(u,t,s,n){const l=function(h){const m=Math.pow(10,`${Math.floor(h)}`.length-1);let g=h/m;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:g>=1?1:function(y){const v=Math.pow(10,Math.ceil(-Math.log(y)/Math.LN10));return Math.round(y*v)/v}(g),m*g}(s);u.style.width=t*(l/s)+"px",u.innerHTML=`${l}&nbsp;${n}`}const Xn={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Kn=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Us(u){if(u){if(typeof u=="number"){const t=Math.round(Math.abs(u)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,u),"top-left":new c.P(t,t),"top-right":new c.P(-t,t),bottom:new c.P(0,-u),"bottom-left":new c.P(t,-t),"bottom-right":new c.P(-t,-t),left:new c.P(u,0),right:new c.P(-u,0)}}if(u instanceof c.P||Array.isArray(u)){const t=c.P.convert(u);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:c.P.convert(u.center||[0,0]),top:c.P.convert(u.top||[0,0]),"top-left":c.P.convert(u["top-left"]||[0,0]),"top-right":c.P.convert(u["top-right"]||[0,0]),bottom:c.P.convert(u.bottom||[0,0]),"bottom-left":c.P.convert(u["bottom-left"]||[0,0]),"bottom-right":c.P.convert(u["bottom-right"]||[0,0]),left:c.P.convert(u.left||[0,0]),right:c.P.convert(u.right||[0,0])}}return Us(new c.P(0,0))}const Yn={extend:(u,...t)=>c.e(u,...t),run(u){u()},logToElement(u,t=!1,s="log"){const n=window.document.getElementById(s);n&&(t&&(n.innerHTML=""),n.innerHTML+=`<br>${u}`)}},Jn=Fe;class ht{static get version(){return Jn}static get workerCount(){return dr.workerCount}static set workerCount(t){dr.workerCount=t}static get maxParallelImageRequests(){return c.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){c.c.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return c.c.WORKER_URL}static set workerUrl(t){c.c.WORKER_URL=t}static addProtocol(t,s){c.c.REGISTERED_PROTOCOLS[t]=s}static removeProtocol(t){delete c.c.REGISTERED_PROTOCOLS[t]}}return ht.Map=class extends Qo{constructor(u){if(c.bg.mark(c.bh.create),(u=c.e({},$e,u)).minZoom!=null&&u.maxZoom!=null&&u.minZoom>u.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(u.minPitch!=null&&u.maxPitch!=null&&u.minPitch>u.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(u.minPitch!=null&&u.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(u.maxPitch!=null&&u.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Wa(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies),{bearingSnap:u.bearingSnap}),this._cooperativeGesturesOnWheel=t=>{this._onCooperativeGesture(t,t[this._metaKey],1)},this._contextLost=t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new c.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=u.interactive,this._cooperativeGestures=u.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=u.maxTileCacheSize,this._maxTileCacheZoomLevels=u.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=u.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=u.preserveDrawingBuffer,this._antialias=u.antialias,this._trackResize=u.trackResize,this._bearingSnap=u.bearingSnap,this._refreshExpiredTiles=u.refreshExpiredTiles,this._fadeDuration=u.fadeDuration,this._crossSourceCollisions=u.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=u.collectResourceTiming,this._renderTaskQueue=new Ya,this._controls=[],this._mapId=c.a2(),this._locale=c.e({},Zn,u.locale),this._clickTolerance=u.clickTolerance,this._overridePixelRatio=u.pixelRatio,this._maxCanvasSize=u.maxCanvasSize,this.transformCameraUpdate=u.transformCameraUpdate,this._imageQueueHandle=ri.addThrottleControl(()=>this.isMoving()),this._requestManager=new Ii(u.transformRequest),typeof u.container=="string"){if(this._container=document.getElementById(u.container),!this._container)throw new Error(`Container '${u.container}' not found.`)}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(u.maxBounds&&this.setMaxBounds(u.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1;const s=hs(n=>{this._trackResize&&!this._removed&&this.resize(n)._update()},50);this._resizeObserver=new ResizeObserver(n=>{t?s(n):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new qn(this,u),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=u.hash&&new la(typeof u.hash=="string"&&u.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch}),u.bounds&&(this.resize(),this.fitBounds(u.bounds,c.e({},u.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=u.localIdeographFontFamily,this._val
577idateStyle=u.validateStyle,u.style&&this.setStyle(u.style,{localIdeographFontFamily:u.localIdeographFontFamily}),u.attributionControl&&this.addControl(new Ui({customAttribution:u.customAttribution})),u.maplibreLogo&&this.addControl(new wt,u.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new c.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new c.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new c.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(u,t){if(t===void 0&&(t=u.getDefaultPosition?u.getDefaultPosition():"top-right"),!u||!u.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const s=u.onAdd(this);this._controls.push(u);const n=this._controlPositions[t];return t.indexOf("bottom")!==-1?n.insertBefore(s,n.firstChild):n.appendChild(s),this}removeControl(u){if(!u||!u.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(u);return t>-1&&this._controls.splice(t,1),u.onRemove(this),this}hasControl(u){return this._controls.indexOf(u)>-1}calculateCameraOptionsFromTo(u,t,s,n){return n==null&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(u,t,s,n)}resize(u){var t;const s=this._containerDimensions(),n=s[0],l=s[1],h=this._getClampedPixelRatio(n,l);if(this._resizeCanvas(n,l,h),this.painter.resize(n,l,h),this.painter.overLimit()){const g=this.painter.context.gl;this._maxCanvasSize=[g.drawingBufferWidth,g.drawingBufferHeight];const y=this._getClampedPixelRatio(n,l);this._resizeCanvas(n,l,y),this.painter.resize(n,l,y)}this.transform.resize(n,l),(t=this._requestedCameraState)===null||t===void 0||t.resize(n,l);const m=!this._moving;return m&&(this.stop(),this.fire(new c.k("movestart",u)).fire(new c.k("move",u))),this.fire(new c.k("resize",u)),m&&this.fire(new c.k("moveend",u)),this}_getClampedPixelRatio(u,t){const{0:s,1:n}=this._maxCanvasSize,l=this.getPixelRatio(),h=u*l,m=t*l;return Math.min(h>s?s/h:1,m>n?n/m:1)*l}getPixelRatio(){var u;return(u=this._overridePixelRatio)!==null&&u!==void 0?u:devicePixelRatio}setPixelRatio(u){this._overridePixelRatio=u,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(u){return this.transform.setMaxBounds(bt.convert(u)),this._update()}setMinZoom(u){if((u=u??-2)>=-2&&u<=this.transform.maxZoom)return this.transform.minZoom=u,this._update(),this.getZoom()<u&&this.setZoom(u),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(u){if((u=u??22)>=this.transform.minZoom)return this.transform.maxZoom=u,this._update(),this.getZoom()>u&&this.setZoom(u),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(u){if((u=u??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(u>=0&&u<=this.transform.maxPitch)return this.transform.minPitch=u,this._update(),this.getPitch()<u&&this.setPitch(u),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(u){if((u=u??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(u>=this.transform.minPitch)return this.transform.maxPitch=u,this._update(),this.getPitch()>u&&this.setPitch(u),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.renderWorldCopies=u,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(u){return this._cooperativeGestures=u,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(u){return this.transform.locationPoint(c.L.convert(u),this.style&&this.terrain)}unproject(u){return this.transform.pointLocation(c.P.convert(u),this.terrain)}isMoving(){var u;return this._moving||((u=this.handlers)===null||u===void 0?void 0:u.isMoving())}isZooming(){var u;return this._zooming||((u=this.handlers)===null||u===void 0?void 0:u.isZooming())}isRotating(){var u;return this._rotating||((u=this.handlers)===null||u===void 0?void 0:u.isRotating())}
577_createDelegatedListener(u,t,s){if(u==="mouseenter"||u==="mouseover"){let n=!1;return{layer:t,listener:s,delegates:{mousemove:h=>{const m=this.getLayer(t)?this.queryRenderedFeatures(h.point,{layers:[t]}):[];m.length?n||(n=!0,s.call(this,new Ni(u,this,h.originalEvent,{features:m}))):n=!1},mouseout:()=>{n=!1}}}}if(u==="mouseleave"||u==="mouseout"){let n=!1;return{layer:t,listener:s,delegates:{mousemove:m=>{(this.getLayer(t)?this.queryRenderedFeatures(m.point,{layers:[t]}):[]).length?n=!0:n&&(n=!1,s.call(this,new Ni(u,this,m.originalEvent)))},mouseout:m=>{n&&(n=!1,s.call(this,new Ni(u,this,m.originalEvent)))}}}}{const n=l=>{const h=this.getLayer(t)?this.queryRenderedFeatures(l.point,{layers:[t]}):[];h.length&&(l.features=h,s.call(this,l),delete l.features)};return{layer:t,listener:s,delegates:{[u]:n}}}}on(u,t,s){if(s===void 0)return super.on(u,t);const n=this._createDelegatedListener(u,t,s);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(n);for(const l in n.delegates)this.on(l,n.delegates[l]);return this}once(u,t,s){if(s===void 0)return super.once(u,t);const n=this._createDelegatedListener(u,t,s);for(const l in n.delegates)this.once(l,n.delegates[l]);return this}off(u,t,s){return s===void 0?super.off(u,t):(this._delegatedListeners&&this._delegatedListeners[u]&&(n=>{const l=this._delegatedListeners[u];for(let h=0;h<l.length;h++){const m=l[h];if(m.layer===t&&m.listener===s){for(const g in m.delegates)this.off(g,m.delegates[g]);return l.splice(h,1),this}}})(),this)}queryRenderedFeatures(u,t){if(!this.style)return[];let s;const n=u instanceof c.P||Array.isArray(u),l=n?u:[[0,0],[this.transform.width,this.transform.height]];if(t=t||(n?{}:u)||{},l instanceof c.P||typeof l[0]=="number")s=[c.P.convert(l)];else{const h=c.P.convert(l[0]),m=c.P.convert(l[1]);s=[h,new c.P(m.x,h.y),m,new c.P(h.x,m.y),h]}return this.style.queryRenderedFeatures(s,t,this.transform)}querySourceFeatures(u,t){return this.style.querySourceFeatures(u,t)}setStyle(u,t){return(t=c.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._val
vendor: 8,485 bytes, line 577
577idateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&u?(this._diffStyle(u,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(u,t))}setTransformRequest(u){return this._requestManager.setTransformRequest(u),this}_getUIString(u){const t=this._locale[u];if(t==null)throw new Error(`Missing UI string '${u}'`);return t}_updateStyle(u,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(u,t));const s=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!u)),u?(this.style=new ni(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof u=="string"?this.style.loadURL(u,t,s):this.style.loadJSON(u,t,s),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ni(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(u,t){if(typeof u=="string"){const s=this._requestManager.transformRequest(u,_t.Style);c.f(s,(n,l)=>{n?this.fire(new c.j(n)):l&&this._updateDiff(l,t)})}else typeof u=="object"&&this._updateDiff(u,t)}_updateDiff(u,t){try{this.style.setState(u,t)&&this._update(!0)}catch(s){c.w(`Unable to perform style diff: ${s.message||s.error||s}.  Rebuilding the style from scratch.`),this._updateStyle(u,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(u,t){return this._lazyInitEmptyStyle(),this.style.addSource(u,t),this._update(!0)}isSourceLoaded(u){const t=this.style&&this.style.sourceCaches[u];if(t!==void 0)return t.loaded();this.fire(new c.j(new Error(`There is no source with ID '${u}'`)))}setTerrain(u){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),u){const t=this.style.sourceCaches[u.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);for(const s in this.style._layers){const n=this.style._layers[s];n.type==="hillshade"&&n.source===u.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new il(this.painter,t,u),this.painter.renderToTexture=new Ja(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=s=>{s.dataType==="style"?this.terrain.sourceCache.freeRtt():s.dataType==="source"&&s.tile&&(s.sourceId!==u.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(s.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:u})),this}getTerrain(){var u,t;return(t=(u=this.terrain)===null||u===void 0?void 0:u.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const u=this.style&&this.style.sourceCaches;for(const t in u){const s=u[t]._tiles;for(const n in s){const l=s[n];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}addSourceType(u,t,s){return this._lazyInitEmptyStyle(),this.style.addSourceType(u,t,s)}removeSource(u){return this.style.removeSource(u),this._update(!0)}getSource(u){return this.style.getSource(u)}addImage(u,t,s={}){const{pixelRatio:n=1,sdf:l=!1,stretchX:h,stretchY:m,content:g}=s;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||c.a(t))){if(t.width===void 0||t.height===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:y,height:v,data:w}=t,S=t;return this.style.addImage(u,{data:new c.R({width:y,height:v},new Uint8Array(w)),pixelRatio:n,stretchX:h,stretchY:m,content:g,sdf:l,version:0,userImage:S}),S.onAdd&&S.onAdd(this,u),this}}{const{width:y,height:v,data:w}=c.h.getImageData(t);this.style.addImage(u,{data:new c.R({width:y,height:v},w),pixelRatio:n,stretchX:h,stretchY:m,content:g,sdf:l,version:0})}}updateImage(u,t){const s=this.style.getImage(u);if(!s)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const n=t instanceof HTMLImageElement||c.a(t)?c.h.getImageData(t):t,{width:l,height:h,data:m}=n;if(l===void 0||h===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==s.data.width||h!==s.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const g=!(t instanceof HTMLImageElement||c.a(t));return s.data.replace(m,g),this.style.updateImage(u,s),this}getImage(u){return this.style.getImage(u)}hasImage(u){return u?!!this.style.getImage(u):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(u)}loadImage(u,t){ri.getImage(this._requestManager.transformRequest(u,_t.Image),t)}listImages(){return this.style.listImages()}addLayer(u,t){return this._lazyInitEmptyStyle(),this.style.addLayer(u,t),this._update(!0)}moveLayer(u,t){return this.style.moveLayer(u,t),this._update(!0)}removeLayer(u){return this.style.removeLayer(u),this._update(!0)}getLayer(u){return this.style.getLayer(u)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(u,t,s){return this.style.setLayerZoomRange(u,t,s),this._update(!0)}setFilter(u,t,s={}){return this.style.setFilter(u,t,s),this._update(!0)}getFilter(u){return this.style.getFilter(u)}setPaintProperty(u,t,s,n={}){return this.style.setPaintProperty(u,t,s,n),this._update(!0)}getPaintProperty(u,t){return this.style.getPaintProperty(u,t)}setLayoutProperty(u,t,s,n={}){return this.style.setLayoutProperty(u,t,s,n),this._update(!0)}getLayoutProperty(u,t){return this.style.getLayoutProperty(u,t)}setGlyphs(u,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(u,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(u,t,s={}){return this._lazyInitEmptyStyle(),this.style.addSprite(u,t,s,n=>{n||this._update(!0)}),this}removeSprite(u){return this._lazyInitEmptyStyle(),this.style.removeSprite(u),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(u,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(u,t,s=>{s||this._update(!0)}),this}setLight(u,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(u,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(u,t){return this.style.setFeatureState(u,t),this._update()}removeFeatureState(u,t){return this.style.removeFeatureState(u,t),this._update()}getFeatureState(u){return this.style.getFeatureState(u)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let u=0,t=0;return this._container&&(u=this._container.clientWidth||400,t=this._container.clientHeight||300),[u,t]}_setupContainer(){const u=this._container;u.classList.add("maplibregl-map");const t=this._canvasContainer=K.create("div","maplibregl-canvas-container",u);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=K.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","regi
577on");const s=this._containerDimensions(),n=this._getClampedPixelRatio(s[0],s[1]);this._resizeCanvas(s[0],s[1],n);const l=this._controlContainer=K.create("div","maplibregl-control-container",u),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(m=>{h[m]=K.create("div",`maplibregl-ctrl-${m} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=K.create("div","maplibregl-cooperative-gesture-screen",this._container);let u=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(u=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=`
578            <div class="maplibregl-desktop-message">${u}</div>
579            <div class="maplibregl-mobile-message">${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>
580        `,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){K.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(u,t,s){this._canvas.width=Math.floor(s*u),this._canvas.height=Math.floor(s*t),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const u={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",n=>{t={requestedAttributes:u},n&&(t.statusMessage=n.statusMessage,t.type=n.type)},{once:!0});const s=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!s){const n="Failed to initialize WebGL";throw t?(t.message=n,new Error(JSON.stringify(t))):new Error(n)}this.painter=new us(s,this.transform),Ke.testSupport(s)}_onCooperativeGesture(u,t,s){return!t&&s<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let s=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const l=this.transform.zoom,h=c.h.now();this.style.zoomHistory.update(l,h);const m=new c.a8(l,{now:h,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),g=m.crossFadingFactor();g===1&&g===this._crossFadingFactor||(s=!0,this._crossFadingFactor=g),this.style.update(m)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.bg.mark(c.bh.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||s)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const n=this._sourcesDirty||this._styleDirty||this._placementDirty;return n||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||n||(this._fullyLoaded=!0,c.bg.mark(c.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const s of this._controls)s.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),ri.removeThrottleControl(this._imageQueueHandle),(u=this._resizeObserver)===null||u===void 0||u.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),K.remove(this._canvasContainer),K.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),c.bg.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=c.h.frame(u=>{c.bg.frame(u),this._frame=null,this._render(u)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get version(){return Oe}getCameraTargetElevation(){return this.transform.elevation}}
580,ht.NavigationControl=class{constructor(u){this._updateZoomButtons=()=>{const t=this._map.getZoom(),s=t===this._map.getMaxZoom(),n=t===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,s)=>{const n=this._map._getUIString(`NavigationControl.${s}`);t.title=n,t.setAttribute("aria-label",n)},this.options=c.e({},Gn,u),this._container=K.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),K.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),K.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=K.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(u){return this._map=u,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Wn(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){K.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(u,t){const s=K.create("button",u,this._container);return s.type="button",s.addEventListener("click",t),s}},ht.GeolocateControl=class extends c.E{constructor(u){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const s=new c.L(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,l=this._map.getBearing(),h=c.e({bearing:l},this.options.fitBoundsOptions),m=bt.fromLngLat(s,n);this._map.fitBounds(m,h,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const s=new c.L(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&Ns)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",s=>s.preventDefault()),this._geolocateButton=K.create("button","maplibregl-ctrl-geolocate",this._container),K.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
580se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=K.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ds({element:this._dotElement}),this._circleElement=K.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ds({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",s=>{s.geolocateSource||this._watchState!=="ACTIVE_LOCK"||s.originalEvent&&s.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")))})}},this.options=c.e({},Rt,u)}onAdd(u){return this._map=u,this._container=K.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,s=!1){Nt===void 0||s?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(n=>{Nt=n.state!=="denied",t(Nt)}).catch(()=>{Nt=!!window.navigator.geolocation,t(Nt)}):(Nt=!!window.navigator.geolocation,t(Nt)):t(Nt)}(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),K.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,kt=0,Ns=!1}_isOutOfMapMaxBounds(u){const t=this._map.getMaxBounds(),s=u.coords;return t&&(s.longitude<t.getWest()||s.longitude>t.getEast()||s.latitude<t.getSouth()||s.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const u=this._map.getBounds(),t=u.getSouthEast(),s=u.getNorthEast(),n=t.distanceTo(s),l=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return c.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":kt--,Ns=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),kt++,kt>1?(u={maximumAge:6e5,timeout:0},Ns=!0):(u=this.options.positionOptions,Ns=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
580se"),this.options.showUserLocation&&this._updateMarker(null)}},ht.AttributionControl=Ui,ht.LogoControl=wt,ht.ScaleControl=class{constructor(u){this._onMove=()=>{ma(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,ma(this._map,this._container,this.options)},this.options=c.e({},fa,u)}getDefaultPosition(){return"bottom-left"}onAdd(u){return this._map=u,this._container=K.create("div","maplibregl-ctrl maplibregl-ctrl-scale",u.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){K.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},ht.FullscreenControl=class extends c.E{constructor(u={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=K.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){K.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=K.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);K.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},ht.TerrainControl=class{constructor(u){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=u}onAdd(u){return this._map=u,this._container=K.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=K.create("button","maplibregl-ctrl-terrain",this._container),K.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
580ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){K.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},ht.Popup=class extends c.E{constructor(u){super(),this.remove=()=>(this._content&&K.remove(this._content),this._container&&(K.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new c.k("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=K.create("div","maplibregl-popup",this._map.getContainer()),this._tip=K.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const m of this.options.className.split(" "))this._container.classList.add(m);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Hn(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const s=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let n=this.options.anchor;const l=Us(this.options.offset);if(!n){const m=this._container.offsetWidth,g=this._container.offsetHeight;let y;y=s.y+l.bottom.y<g?["top"]:s.y>this._map.transform.height-g?["bottom"]:[],s.x<m/2?y.push("left"):s.x>this._map.transform.width-m/2&&y.push("right"),n=y.length===0?"bottom":y.join("-")}const h=s.add(l[n]).round();K.setTransform(this._container,`${tr[n]} translate(${h.x}px,${h.y}px)`),rl(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(Xn),u)}addTo(u){return this._map&&this.remove(),this._map=u,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=c.L.convert(u),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const t=document.createDocumentFragment(),s=document.createElement("body");let n;for(s.innerHTML=u;n=s.firstChild,n;)t.appendChild(n);return this.setDOMContent(t)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=K.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){this._container&&this._container.classList.add(u)}removeClassName(u){this._container&&this._container.classList.remove(u)}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}_createCloseButton(){this.options.closeButton&&(this._closeButton=K.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(Kn);u&&u.focus()}},ht.Marker=ds,ht.Style=ni,ht.LngLat=c.L,ht.LngLatBounds=bt,ht.Point=c.P,ht.MercatorCoordinate=c.U,ht.Evented=c.E,ht.AJAXError=c.bi,ht.config=c.c,ht.CanvasSource=Nr,ht.GeoJSONSource=Vr,ht.ImageSource=Hi,ht.RasterDEMTileSource=Is,ht.RasterTileSource=Ts,ht.VectorTileSource=ts,ht.VideoSource=Js,ht.setRTLTextPlugin=c.bj,ht.getRTLTextPluginStatus=c.bk,ht.prewarm=function(){Ta().acquire(ot)},ht.clearPrewarmedResources=function(){const u=Ar;u&&(u.isPreloaded()&&u.numActive()===1?(u.release(ot),Ar=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},Yn.extend(ht,{isSafari:c.ac,getPerformanceMetrics:c.bg.getPerformanceMetrics}),ht});var xe=ne;return xe})})(Eh);var Ch=Eh.exports;const Kp=Tp(Ch),ef=Ap({__proto__:null,default:Kp},[Ch]);export{Qp as M,Jp as _,ef as m};
581//# sourceMappingURL=maplibre-BOGZE8_b.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.